From patchwork Tue Jul 14 07:13:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 11661827 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BAC3513B6 for ; Tue, 14 Jul 2020 07:13:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 98E4D2223C for ; Tue, 14 Jul 2020 07:13:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="PmNE01Mn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98E4D2223C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2689F6E8FF; Tue, 14 Jul 2020 07:13:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 189926E8FF for ; Tue, 14 Jul 2020 07:13:19 +0000 (UTC) Received: from wens.tw (mirror2.csie.ntu.edu.tw [140.112.194.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C97342220F; Tue, 14 Jul 2020 07:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594710798; bh=rDhbGvCqBc5qk7qu3M/g+nT1J2rIXk8oam06CO8RgGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PmNE01MnT5VBTE01AE6Q8G5DNRXf0MO1AirTJDxdPVe6c2tx7RjNv1cBhsDqYnB6I y3RjjOdpaIeCu/tSL735RmrgpgggPhx72lysBMK8gG0qciY8P9XLTlgiEDVyYhp5gV RNoBxHB024ZUdJELanZ212tIlW4oVmo115ncM4XE= Received: by wens.tw (Postfix, from userid 1000) id E239A5FA8D; Tue, 14 Jul 2020 15:13:13 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , Rob Herring , Sam Ravnborg , Thierry Reding , David Airlie , Daniel Vetter Subject: [PATCH 1/5] dt-bindings: display: panel-dpi: Add bits-per-color property Date: Tue, 14 Jul 2020 15:13:01 +0800 Message-Id: <20200714071305.18492-2-wens@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714071305.18492-1-wens@kernel.org> References: <20200714071305.18492-1-wens@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Siarhei Siamashka Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Chen-Yu Tsai Some LCD panels do not support 24-bit true color, or 8bits per channel RGB. Many low end ones only support up to 6 bits per channel natively. Add a device tree property to describe the native bit depth of the panel. This is separate from the bus width or format of the connection to the display output. Signed-off-by: Chen-Yu Tsai --- .../devicetree/bindings/display/panel/panel-dpi.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml b/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml index 0cd74c8dab42..8eb013fb1969 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml @@ -26,6 +26,9 @@ properties: height-mm: true label: true panel-timing: true + bits-per-color: + description: + Shall contain an integer describing the number of bits per color. port: true power-supply: true reset-gpios: true @@ -42,6 +45,7 @@ examples: panel { compatible = "osddisplays,osd057T0559-34ts", "panel-dpi"; label = "osddisplay"; + bits-per-color = <8>; power-supply = <&vcc_supply>; backlight = <&backlight>; From patchwork Tue Jul 14 07:13:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 11661837 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 802D4138C for ; Tue, 14 Jul 2020 07:13:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 58F272076D for ; Tue, 14 Jul 2020 07:13:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="pPUI4kqR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58F272076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 564AA6E8FD; Tue, 14 Jul 2020 07:13:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B0366E918 for ; Tue, 14 Jul 2020 07:13:20 +0000 (UTC) Received: from wens.tw (mirror2.csie.ntu.edu.tw [140.112.194.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A236422227; Tue, 14 Jul 2020 07:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594710799; bh=YiVWckYXZobeNaSRkUj8azBJxqyMKc8YEr8QUsXFDdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pPUI4kqRSARdAvLmGOuFhpE0+TwvUrgdGV5zoluw7dB4jMnbpdwOyWHl6ni2MDtIU zibtyLk+sEY8qdNgniqRgz0jDnhq1F8gEZ5FU8cZ/255xX8zfgMyAeAwl2Mpfp/py3 mIgoeOwFEXDJijHL+pJwF8QkP8OK82SFgkfFbUMc= Received: by wens.tw (Postfix, from userid 1000) id F23B05FCE5; Tue, 14 Jul 2020 15:13:13 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , Rob Herring , Sam Ravnborg , Thierry Reding , David Airlie , Daniel Vetter Subject: [PATCH 2/5] drm/panel: simple: Set bpc from bits-per-color DT property for panel-dpi Date: Tue, 14 Jul 2020 15:13:02 +0800 Message-Id: <20200714071305.18492-3-wens@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714071305.18492-1-wens@kernel.org> References: <20200714071305.18492-1-wens@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Siarhei Siamashka Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Chen-Yu Tsai Now that the device tree binding for panel-dpi has the "bits-per-color" property, parse its value and set bpc in the panel description to the given value. This would allow encoders to detect less-than-8-bits color depth and employ color dithering if possible. Signed-off-by: Chen-Yu Tsai --- drivers/gpu/drm/panel/panel-simple.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 13a9df44f781..0765bfa54b7a 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -433,6 +433,7 @@ static int panel_dpi_probe(struct device *dev, of_property_read_u32(np, "width-mm", &desc->size.width); of_property_read_u32(np, "height-mm", &desc->size.height); + of_property_read_u32(np, "bits-per-color", &desc->bpc); /* Extract bus_flags from display_timing */ bus_flags = 0; From patchwork Tue Jul 14 07:13:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 11661835 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7658138C for ; Tue, 14 Jul 2020 07:13:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 85C3B22225 for ; Tue, 14 Jul 2020 07:13:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="iSETV3Xu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85C3B22225 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 816326E918; Tue, 14 Jul 2020 07:13:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 024786E914 for ; Tue, 14 Jul 2020 07:13:20 +0000 (UTC) Received: from wens.tw (mirror2.csie.ntu.edu.tw [140.112.194.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A0C8B22225; Tue, 14 Jul 2020 07:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594710799; bh=w1blA/cFj1h024XvBru10C7tkW/sc1XSHCZ9GuDw07w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iSETV3Xu9AbC5Rv/zleZ6t6T/ZJB5lio1LdK3NqyRNPGrWukZ6IlWZY7dLrCIdobT +l6kjTNJepn5XErgyt8R14TdZjf6eDPUxZCfBhJkw6p/wJ+89ZyhSXtpbjJPVp2qOc CwSiGdGjLhKEOr2TakSgIa8VrUkEKinRxFkyJVpc= Received: by wens.tw (Postfix, from userid 1000) id 055375FCF0; Tue, 14 Jul 2020 15:13:14 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , Rob Herring , Sam Ravnborg , Thierry Reding , David Airlie , Daniel Vetter Subject: [PATCH 3/5] dt-bindings: arm: sunxi: Add compatible for MSI Primo73 tablet Date: Tue, 14 Jul 2020 15:13:03 +0800 Message-Id: <20200714071305.18492-4-wens@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714071305.18492-1-wens@kernel.org> References: <20200714071305.18492-1-wens@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Siarhei Siamashka Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Chen-Yu Tsai Document board compatible name for MSI Primo73 tablet. Signed-off-by: Chen-Yu Tsai Acked-by: Rob Herring --- Documentation/devicetree/bindings/arm/sunxi.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml index efc9118233b4..35d78448ec46 100644 --- a/Documentation/devicetree/bindings/arm/sunxi.yaml +++ b/Documentation/devicetree/bindings/arm/sunxi.yaml @@ -475,6 +475,11 @@ properties: - const: allwinner,mk808c - const: allwinner,sun7i-a20 + - description: MSI Primo73 Tablet + items: + - const: msi,primo73 + - const: allwinner,sun7i-a20 + - description: MSI Primo81 Tablet items: - const: msi,primo81 From patchwork Tue Jul 14 07:13:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 11661833 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 778291392 for ; Tue, 14 Jul 2020 07:13:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55EF52076D for ; Tue, 14 Jul 2020 07:13:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ma1kr062" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55EF52076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE6C06E91C; Tue, 14 Jul 2020 07:13:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id EBE1E6E8FF for ; Tue, 14 Jul 2020 07:13:19 +0000 (UTC) Received: from wens.tw (mirror2.csie.ntu.edu.tw [140.112.194.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9A99C22210; Tue, 14 Jul 2020 07:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594710799; bh=wtiSdBLfP/oEAjuWCJVaVyY3I3kTknkon20LM58lCn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ma1kr062avGaCtPZxmJRmXknz8+TQaEl9Q3AbmoS0hy2TQGZfBkAApQnSYGoEriwP EpHqDHxs8uAL5L9xI+ViOnQBAnf83qBRaDgcbKQTGjbWlXuyA4sRwK//gurtz7wz1P KsjULFwPDE680eeYxP0PBREMEHmiZJKc1c2RN9gM= Received: by wens.tw (Postfix, from userid 1000) id 114FF5FCF6; Tue, 14 Jul 2020 15:13:14 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , Rob Herring , Sam Ravnborg , Thierry Reding , David Airlie , Daniel Vetter Subject: [PATCH 4/5] ARM: dts: sun7i: Add LCD0 RGB888 pins Date: Tue, 14 Jul 2020 15:13:04 +0800 Message-Id: <20200714071305.18492-5-wens@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714071305.18492-1-wens@kernel.org> References: <20200714071305.18492-1-wens@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Siarhei Siamashka Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Chen-Yu Tsai In some designs, the full 24 bits of RGB plus the control / sync signals for the LCD panel are used. Add a pinmux option for this. Signed-off-by: Chen-Yu Tsai --- arch/arm/boot/dts/sun7i-a20.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi index 6d6a37940db2..eec6b4473cbd 100644 --- a/arch/arm/boot/dts/sun7i-a20.dtsi +++ b/arch/arm/boot/dts/sun7i-a20.dtsi @@ -934,6 +934,18 @@ ir1_tx_pin: ir1-tx-pin { function = "ir1"; }; + /omit-if-no-ref/ + lcd0_rgb888_pins: lcd0-rgb888-pins { + pins = "PD0", "PD1", "PD2", "PD3", + "PD4", "PD5", "PD6", "PD7", + "PD8", "PD9", "PD10", "PD11", + "PD12", "PD13", "PD14", "PD15", + "PD16", "PD17", "PD18", "PD19", + "PD20", "PD21", "PD22", "PD23", + "PD24", "PD25", "PD26", "PD27"; + function = "lcd0"; + }; + /omit-if-no-ref/ lcd_lvds0_pins: lcd-lvds0-pins { pins = "PD0", "PD1", "PD2", "PD3", "PD4", From patchwork Tue Jul 14 07:13:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 11661839 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2CBF61392 for ; Tue, 14 Jul 2020 07:13:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A8C82076D for ; Tue, 14 Jul 2020 07:13:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="p5M5EJ3N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A8C82076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 910546E925; Tue, 14 Jul 2020 07:13:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 14FD56E925 for ; Tue, 14 Jul 2020 07:13:22 +0000 (UTC) Received: from wens.tw (mirror2.csie.ntu.edu.tw [140.112.194.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B48F722224; Tue, 14 Jul 2020 07:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594710801; bh=LPMXYSBHUc5/3XxljcDu6A64UBHu6QfCt9odX/hhY2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p5M5EJ3Nwu5Eq7uDgnT3rD5zedmq+5BhhvtpjGKsK7qL15GzdaukZXkIHdxI7l2XD LoCGLKNYPNvdSECPxg+A/mptGjd5Gi2JSQtwAV+oX12AqlS/Kfn2/qnQYIqamvOxiX w5C43kj9hiO97LMz5GorUMjNqOH100oezmZXZOyY= Received: by wens.tw (Postfix, from userid 1000) id 1C7AA5FD4B; Tue, 14 Jul 2020 15:13:14 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , Rob Herring , Sam Ravnborg , Thierry Reding , David Airlie , Daniel Vetter Subject: [PATCH 5/5] ARM: dts: sun7i: Add MSI Primo73 tablet Date: Tue, 14 Jul 2020 15:13:05 +0800 Message-Id: <20200714071305.18492-6-wens@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714071305.18492-1-wens@kernel.org> References: <20200714071305.18492-1-wens@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Siarhei Siamashka Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Chen-Yu Tsai The Primo73 is an MSI branded Allwinner A20-based 7-inch tablet. It has a metal back case with a plastic insert around where the WiFi antenna is. The tablet is (as of July of 2020) no longer available from retailers. Kernel sources (as required by GPL) are no longer available from the vendor, MSI. The device support page still lists the link, but it is dead. The tablet features a non-identifiable 1024x600 7" MIPI DPI TFT panel, Goodix GT911-based capacitive touchscreen, 1GB DRAM, 8GB MLC NAND, RTL8188ETV-based WiFi, an NXP MMA8452 accelerometer for orientation, a GC2035 2 megapixel rear camera, a GC0308 0.3 megapixel front camera, a mini-HDMI output, a micro-USB port, a headphone jack and single speaker. The board design is believe to follow Allwinner's reference design. This judgement is based on the fact that the I/O pins and GPIO lines used match up with the reference design. Assumptions about the regulator tree are based on this. The LCD panel only has some serial number markings, and what appears to be a part number: "OS1N71J003", which is also a prefix for one of the serial number markings. Searching for this part number yielded no results. As such, the color depth display timings are directly listed in the device tree. The timing are from the FEX file recovered from the device. The color depth was derived from the dithering setting from the FEX file, as well as independent testing with a color gradient image. The internal board, as well as the ribbon cable for the panel, route the full 24 bits of color. So the 2 extra bits are dropped either by the panel itself or somewhere within the LCD panel module casing. Add a device tree for this tablet. Almost the whole device is supported. The only things missing are the two cameras, which don't have device tree bindings or driver support. The vendor for the LCD panel is left out, since there is nothing to go with. Signed-off-by: Chen-Yu Tsai --- The panel-dpi binding requires a more-specific compatible string. However given the vendor of the panel is unknown, I'm not sure what the best course of action is here. I opted to put the part number in without a vendor prefix. --- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/sun7i-a20-primo73.dts | 279 ++++++++++++++++++++++++ 2 files changed, 280 insertions(+) create mode 100644 arch/arm/boot/dts/sun7i-a20-primo73.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index e6a1cac0bfc7..c09cda958db5 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -1133,6 +1133,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \ sun7i-a20-orangepi-mini.dtb \ sun7i-a20-pcduino3.dtb \ sun7i-a20-pcduino3-nano.dtb \ + sun7i-a20-primo73.dtb \ sun7i-a20-wexler-tab7200.dtb \ sun7i-a20-wits-pro-a20-dkt.dtb dtb-$(CONFIG_MACH_SUN8I) += \ diff --git a/arch/arm/boot/dts/sun7i-a20-primo73.dts b/arch/arm/boot/dts/sun7i-a20-primo73.dts new file mode 100644 index 000000000000..f3b1002ceb50 --- /dev/null +++ b/arch/arm/boot/dts/sun7i-a20-primo73.dts @@ -0,0 +1,279 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (C) 2020 Chen-Yu Tsai + */ + +/dts-v1/; +#include "sun7i-a20.dtsi" +#include "sunxi-common-regulators.dtsi" + +#include +#include +#include +#include + +/{ + model = "MSI Primo73 Tablet"; + compatible = "msi,primo73", "allwinner,sun7i-a20"; + + aliases { + serial0 = &uart0; + }; + + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; + enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + hdmi-connector { + compatible = "hdmi-connector"; + type = "b"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + panel: panel { + compatible = "os1n71j003", "panel-dpi"; + backlight = <&backlight>; + power-supply = <®_vcc5v0>; /* Actually driven from IPSOUT */ + enable-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */ + height-mm = <86>; + width-mm = <155>; + bits-per-color = <6>; + + panel-timing { + clock-frequency = <60000000>; + hactive = <1024>; + vactive = <600>; + hfront-porch = <160>; + hback-porch = <60>; + hsync-len = <100>; + vback-porch = <13>; + vfront-porch = <10>; + vsync-len = <10>; + de-active = <1>; + pixelclk-active = <0>; + }; + + port { + panel_input: endpoint { + remote-endpoint = <&tcon0_out_lcd>; + }; + }; + }; +}; + +&ccu { + pinctrl-0 = <&csi0_clk_pin>; + pinctrl-names = "default"; +}; + +&codec { + allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ + status = "okay"; +}; + +&cpu0 { + cpu-supply = <®_dcdc2>; +}; + +&de { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&hdmi { + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&i2c0 { + status = "okay"; + + axp209: pmic@34 { + reg = <0x34>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; +}; + +#include "axp209.dtsi" + +&battery_power_supply { + status = "okay"; +}; + +&i2c1 { + clock-frequency = <400000>; + status = "okay"; + + accelerometer@1c { + compatible = "fsl,mma8452"; + reg = <0x1c>; + vdd-supply = <®_vcc3v0>; + vddio-supply = <®_vcc3v0>; + #io-channel-cells = <1>; + }; +}; + +&i2c2 { + clock-frequency = <400000>; + status = "okay"; + + touchscreen@5d { + compatible = "goodix,gt911"; + reg = <0x5d>; + interrupt-parent = <&pio>; + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */ + irq-gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* INT (PH21) */ + reset-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* RST (PB13) */ + touchscreen-swapped-x-y; /* Match LCD panel orientation */ + }; +}; + +&lradc { + vref-supply = <®_vcc3v0>; + status = "okay"; + + button-200 { + label = "Volume Up"; + linux,code = ; + channel = <0>; + voltage = <200000>; + }; + + button-400 { + label = "Volume Down"; + linux,code = ; + channel = <0>; + voltage = <400000>; + }; +}; + +&mmc0 { + vmmc-supply = <®_vcc3v0>; + bus-width = <4>; + cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */ + status = "okay"; +}; + +&otg_sram { + status = "okay"; +}; + +&pio { + vcc-pa-supply = <®_vcc3v0>; + vcc-pc-supply = <®_vcc3v0>; + vcc-pe-supply = <®_ldo3>; + vcc-pf-supply = <®_vcc3v0>; + vcc-pg-supply = <®_ldo3>; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pin>; + status = "okay"; +}; + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1400000>; + regulator-name = "vdd-cpu"; +}; + +®_dcdc3 { + regulator-always-on; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1400000>; + regulator-name = "vdd-int-dll"; +}; + +®_ldo1 { + regulator-name = "vdd-rtc"; +}; + +®_ldo2 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "avcc"; +}; + +®_ldo3 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-name = "csi-iovdd"; +}; + +®_ldo4 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-name = "csi-avdd"; +}; + +®_usb0_vbus { + gpio = <&pio 1 9 GPIO_ACTIVE_HIGH>; /* PB09 */ + status = "okay"; +}; + +®_usb2_vbus { + gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */ + status = "okay"; +}; + +®_vcc3v3 { + status = "disabled"; +}; + +&tcon0 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd0_rgb888_pins>; +}; + +&tcon0_out { + tcon0_out_lcd: endpoint@0 { + reg = <0>; + remote-endpoint = <&panel_input>; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pb_pins>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "otg"; + status = "okay"; +}; + +&usb_power_supply { + status = "okay"; +}; + +&usbphy { + usb0_id_det-gpios = <&pio 7 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH4 */ + usb0_vbus_power-supply = <&usb_power_supply>; + usb0_vbus-supply = <®_usb0_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +};