From patchwork Fri Feb 14 12:24:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 11382177 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 11E2892A for ; Fri, 14 Feb 2020 12:25:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E3A022067D for ; Fri, 14 Feb 2020 12:25:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BbHzM4a8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="Rj3Vaeua"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="xct+q5D+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3A022067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tigashXfJKTfnnmIZM0e6HVuWMwg/DTFU3Xgx+MNCEQ=; b=BbHzM4a8EzzStT dGtWavOQgiRuQdhGq0M86dry1bmwFlZ4f4QoCVVbgdv/pW35B33Xonzv+VhhwOYdiek684qO/9jF6 0mkMyu2boDOUyvEfha9uLWoZwCVWUK0pUYTbIyY5MT/cvGWtc/hRCw5k1HZYwO+wUJP2fTD3S9Ycg zXJwM2I3Qm4LwHnGer+v50Lj9wEWQ+uE/s52T6a0SggyrxjQVE67PBkpTLsabMdnu8zVamIcSvyLV cjAySKDEZ2HrBqHCHHMX+QrbqhotTBd+k3RaA71P50PWJQE2JdwUF/HXLSKVRi6SgV2/XGARzuvcV X6x4EUspE5Wxswz7my4w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j2a1z-0004MC-B8; Fri, 14 Feb 2020 12:25:15 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j2a1W-0002pt-Ip for linux-arm-kernel@lists.infradead.org; Fri, 14 Feb 2020 12:24:48 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id D95287177; Fri, 14 Feb 2020 07:24:45 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 14 Feb 2020 07:24:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=dnk7pJKP+HgrN 4lk8DCUSISIcaYg2wPtGi46T6k0vVo=; b=Rj3VaeuanI9A6ew5xyhcXLuCAkzMo FOy5E4ddX5rzZlhz0YWun3R0J+lOC37ZCT3S/+xMT1wHhHy/LOzkImg+zj/o/gam 7fPo3Es5jEb8MG9Bg062foRqpnyADxRuiSsXXnnyoP0aDbzUqyRoCheR9KziYZgd YZoNXJWBu1wElllTXhzPoqKHyIvfUSoag7Q/wKszDT6A/oUf3XyyABiWIIb7dYxI fIhoQQaPtfguX6oExT5Gxek0OXx9hRSXg7bsX0XYtL0heuwDN83e45JVAqaibZxh zGh0uzAdVnZLBXw+IgGdbs+9QhKtorFSITMP4paF3sTrkANpXzrLWbZtA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=dnk7pJKP+HgrN4lk8DCUSISIcaYg2wPtGi46T6k0vVo=; b=xct+q5D+ b/EK9Seh9XoyEIz37AF7H+iIcE706DypIxNIdMMsHHHAfkZxngw3N9KewiXEt8jq z24XBahyMUPsUN6xnu/mOtrfL3EoJ+Yh6vCZfrQ2C6zAZg0c9uM3tr3gL3fC9SUh g023XieIOJXAzvHB92YtEOdiY3Vw2L8osfk9tdM29ZRjuIaXnfSjHCDBEQL7TsqH MuJkMpGRwS9W8KGAiAK5L9WqsEb1o+3CEzs1QOw9lqC89WUeJS7nHPoLxJ6CmVwF eBsXLC6qTo5gYgsyYN7UxNbs8dgyxjt3yxTMsiuLSE1QSMJoUp1XmsLGBro0kYOB GFz5O6hTLS6DGQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjedtgdegtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucfkphepledtrd ekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 70B13328005A; Fri, 14 Feb 2020 07:24:45 -0500 (EST) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , dri-devel@lists.freedesktop.org Subject: [PATCH 1/4] drm/connector: Add data polarity flags Date: Fri, 14 Feb 2020 13:24:38 +0100 Message-Id: X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200214_042446_769960_70EC4528 X-CRM114-Status: UNSURE ( 8.61 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [66.111.4.230 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, David Airlie , Sam Ravnborg , Maarten Lankhorst , Rob Herring , Sean Paul , Maxime Ripard , Thierry Reding , Daniel Vetter , Frank Rowand , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Some LVDS encoders can change the polarity of the data signals being sent. Add a DRM bus flag to reflect this. Signed-off-by: Maxime Ripard --- include/drm/drm_connector.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 221910948b37..9a08fe6ab7c2 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -330,6 +330,8 @@ enum drm_panel_orientation { * edge of the pixel clock * @DRM_BUS_FLAG_SHARP_SIGNALS: Set if the Sharp-specific signals * (SPL, CLS, PS, REV) must be used + * @DRM_BUS_FLAG_DATA_LOW: The Data signals are active low + * @DRM_BUS_FLAG_DATA_HIGH: The Data signals are active high */ enum drm_bus_flags { DRM_BUS_FLAG_DE_LOW = BIT(0), @@ -349,6 +351,8 @@ enum drm_bus_flags { DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE = DRM_BUS_FLAG_SYNC_NEGEDGE, DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE = DRM_BUS_FLAG_SYNC_POSEDGE, DRM_BUS_FLAG_SHARP_SIGNALS = BIT(8), + DRM_BUS_FLAG_DATA_LOW = BIT(9), + DRM_BUS_FLAG_DATA_HIGH = BIT(10), }; /** From patchwork Fri Feb 14 12:24:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 11382179 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 483CE92A for ; Fri, 14 Feb 2020 12:25:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 25D8E2067D for ; Fri, 14 Feb 2020 12:25:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cAfOQrnG"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="Dk5KDX75"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="VR/gyYZN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 25D8E2067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UDzQoxMQ2jMd4jrYfiLFVNySlhkluhVHpBj/cdL4Xx0=; b=cAfOQrnGmEnx2E XB1T4VogUjWiXrjOEAYQtfUcEOO/rPIp7TcQ4CYKN8lL9pMyP7TTJWsXLYCZ1QX78JZIFPIHbeC8g W0GZkBHZm6cnKGwAkmIOzNiDHSpb7/0remLRi82qjGr12I9vC62CLBna12YbGjqoHYuTszZtSAY17 JfKJGMf0O7KjKckujyECM7JdpmteM+IgbAHn0WOf2XC8badCHGWuwjLpu9LF/Vo2DA3m8XQI/6qhG ph1LWQDIenmFyXBlvTIWRan99Pe5X7EdnkfD3eGs5XHdOHb5mNFNDJszzFPlwqHIScZsZgTCz4yqa NWjRrXiurajec1lEuEgQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j2a2B-0004X4-68; Fri, 14 Feb 2020 12:25:27 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j2a1X-0002rZ-U6 for linux-arm-kernel@lists.infradead.org; Fri, 14 Feb 2020 12:24:49 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 5411F3AF4; Fri, 14 Feb 2020 07:24:47 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 14 Feb 2020 07:24:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=rwNWZVmBtWdIw bVzvsN+k7pWGqA8/J3u/JzQZKfK/0g=; b=Dk5KDX75Rdys5uWQNp1Z7IZv73T1L NXyS/ORyZKSr0hJ5cmcH2Gdm+qzA3x0PIroSHAaq/rb9V+g2EjDLP/3UPYr1Q0/M 1uxoaHODNBKQyVVPh2beBYgtoPYvWfBZTSJKttff6UDUn4rSNQRHQmiY7Z7r6yCl MNtiG/QcwhaA7BBze3F1Nr0QGAVYIcSSQzw8b2qe/HGuhxWRAz0mV5TmSECFLpdT p00I/ZYYaHTsfjUL9u2GwrqYC56S9IJwYm9E/Prevf1k1fEkBjzIqMgqjnqPaVu8 0Jbyx13l+G9Jsx8yERKKrASwqu1tbl4chm4FeOaK6MIj7PFBdee5XAMZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=rwNWZVmBtWdIwbVzvsN+k7pWGqA8/J3u/JzQZKfK/0g=; b=VR/gyYZN MYWlElM8PX+S9WhqzOFDtu+IgOWAnXf2ZajoqneO/wGvw72vIbGRGD1T9RcTSGge NjdzGM5bIZfnrDjePBk2bF5kjAvn8aJvphbnnV3gIKO3WtdYTinnRzuPDTO5Sp/D fejmX0YsyIL6B+A/+Z4N9X5s6k8sbAKwS0TWgZIGkwtbJGEmFEPNAg5rOLCu6iRu 0vTHDegH9GMxdnRGMi1zbvsA2YeunFz0iudtbfVXMbCS/Ss0iKuSPlp6IVRm0xcS MdRlm5Wb1TnYE4ZEdst84QXu9qIjiXLHCgqK5JIpCdRJzxAYYjuzhbXMKPj7fuNK LS1ZyJBh9HfDTg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjedtgdegtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucfkphepledtrd ekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id E69EA3060EF5; Fri, 14 Feb 2020 07:24:46 -0500 (EST) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , dri-devel@lists.freedesktop.org Subject: [PATCH 2/4] dt-bindings: panel: lvds: Add properties for clock and data polarities Date: Fri, 14 Feb 2020 13:24:39 +0100 Message-Id: <620a740cec4186177ce346b092d4ba451e1420dc.1581682983.git-series.maxime@cerno.tech> X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200214_042448_148785_27592005 X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [66.111.4.230 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, David Airlie , Sam Ravnborg , Maarten Lankhorst , Rob Herring , Sean Paul , Maxime Ripard , Thierry Reding , Daniel Vetter , Frank Rowand , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Some LVDS encoders can support multiple polarities on the data and clock lanes, and similarly some panels require a given polarity on their inputs. Add a property on the panel to configure the encoder properly. Signed-off-by: Maxime Ripard --- Documentation/devicetree/bindings/display/panel/lvds.yaml | 10 ++++++++- 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/lvds.yaml b/Documentation/devicetree/bindings/display/panel/lvds.yaml index d0083301acbe..4a1111a1ab38 100644 --- a/Documentation/devicetree/bindings/display/panel/lvds.yaml +++ b/Documentation/devicetree/bindings/display/panel/lvds.yaml @@ -90,6 +90,16 @@ properties: CTL2: Data Enable CTL3: 0 + clock-active-low: + type: boolean + description: > + If set, reverse the clock polarity on the clock lane. + + data-active-low: + type: boolean + description: > + If set, reverse the bit polarity on all data lanes. + data-mirror: type: boolean description: From patchwork Fri Feb 14 12:24:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 11382181 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 154B613A4 for ; Fri, 14 Feb 2020 12:25:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E749C2067D for ; Fri, 14 Feb 2020 12:25:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mcv2AYDf"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="tUVxtqrh"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="U6HoPEPH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E749C2067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=W0du43s3PuKqMqz9rmEVtlzDNBKgB0MOLhuNVT5svPk=; b=mcv2AYDfbttJe+ XiS7tSWNSNo/q/XKhMwa2W83dndxmagN9VtdHO0B3wkgFSd1Yds6Nlbg8dmn/jAFv4InO8vwvOF6K 8nxdblf2wtPzmWrZ2AWmfplCtEm698rCk/yTQbu7IMTWSqvHvpovGxmut+zNP6lzhIWNHOv7M7iiZ XUKuXLp6S4dhMHuM4g/m9C6fVVy2nsTKid3gNcMXbZTkffdVUPHZNHd4W8Y8M6JdtRWMSnLj91gbh m7Lco9xyPX/N/MCfWVJ7AyMrqvcM5fdC2b93RyxQqN+l3ugGZtRQSJ4a45n68fVycbUMVOP9tBW88 q5Aod3BRfaATbwctrYDA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j2a2Q-0004lc-Oo; Fri, 14 Feb 2020 12:25:42 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j2a1Z-0002t1-DO for linux-arm-kernel@lists.infradead.org; Fri, 14 Feb 2020 12:24:51 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id B3A9C7352; Fri, 14 Feb 2020 07:24:48 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 14 Feb 2020 07:24:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=aGIlfA2KuBAok WapNsxvxuUq+3OyrK2C0WS49FNUGu4=; b=tUVxtqrh+vW/O2BpQj+bR9+uhbZPd RjCe0jJLlss1RVaLKUAyd5JM9rv6a79cHUJatJfwAJZxJOA1gyTylKKtglYHNntl ikL+X2ThGq/5hvjDk9wwC/ZY2Gw5QjHMccH8zJAAqnrB/zLMiWqKwtuJpn5yl2Nc 3GFuiupwc3/Yw8Epp6dzR9QAF5oeuGbtdmTfS7s8pV0gI6w5/2na9VXkhq49hU6J TgspOkIPpZMdd3b61kOohpUUoxOopEQ1mzwwUByeLzMlBAgEH87osj19/PJcO3Q1 edlxfw1g32sCH0Al41pXOOBVkp/3Onhn69eLVh0s343SIX61pNdFtqcYA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=aGIlfA2KuBAokWapNsxvxuUq+3OyrK2C0WS49FNUGu4=; b=U6HoPEPH k5ZpvAkq40wNODLGmqWtZlTHImZwFZWPlu6GJoUTUkUzruh09ULKlzRAJkB4PhQg ddlewVly7VXFAC7CG3qrLr6RwIektH7Ln6xPco0Nh/DFUlaSepGhwbMxfE2+g+OI 9qPaKKsBI9lVbX+F+XyvbH3IM5gFY1/Jic19yH8ybzmSsX4U/iNH0fGHuc0gf1+D WmqS/RH4nqcjyxoXhboEaPz3VmhWNqhTXwflF5r7GXOBeoHpjkl6uD4q2Fd42jfD wkqIQyoKC6vtGKVwiYlvfq+QD7Vf+n+clpTh+5//NdvwfnfFjNJz/trYdIXR3cMk m+LFhvhCA5GtAA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjedtgdegtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucfkphepledtrd ekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 51D1E328005A; Fri, 14 Feb 2020 07:24:48 -0500 (EST) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , dri-devel@lists.freedesktop.org Subject: [PATCH 3/4] drm/panel: lvds: Support data and clock polarity flags Date: Fri, 14 Feb 2020 13:24:40 +0100 Message-Id: X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200214_042449_643401_B1BA217F X-CRM114-Status: GOOD ( 11.65 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [66.111.4.230 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, David Airlie , Sam Ravnborg , Maarten Lankhorst , Rob Herring , Sean Paul , Maxime Ripard , Thierry Reding , Daniel Vetter , Frank Rowand , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add device tree properties to the panel-lvds driver to set the bus flags properly. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/panel/panel-lvds.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c index 5ce3f4a2b7a1..c0d6dcd9e9fc 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -31,6 +31,8 @@ struct panel_lvds { unsigned int height; struct videomode video_mode; unsigned int bus_format; + bool clk_active_low; + bool data_active_low; bool data_mirror; struct regulator *supply; @@ -83,6 +85,7 @@ static int panel_lvds_get_modes(struct drm_panel *panel, { struct panel_lvds *lvds = to_panel_lvds(panel); struct drm_display_mode *mode; + unsigned int flags = 0; mode = drm_mode_create(connector->dev); if (!mode) @@ -96,9 +99,23 @@ static int panel_lvds_get_modes(struct drm_panel *panel, connector->display_info.height_mm = lvds->height; drm_display_info_set_bus_formats(&connector->display_info, &lvds->bus_format, 1); - connector->display_info.bus_flags = lvds->data_mirror - ? DRM_BUS_FLAG_DATA_LSB_TO_MSB - : DRM_BUS_FLAG_DATA_MSB_TO_LSB; + + if (lvds->data_mirror) + flags |= DRM_BUS_FLAG_DATA_LSB_TO_MSB; + else + flags |= DRM_BUS_FLAG_DATA_MSB_TO_LSB; + + if (lvds->clk_active_low) + flags |= DRM_BUS_FLAG_PIXDATA_NEGEDGE; + else + flags |= DRM_BUS_FLAG_PIXDATA_POSEDGE; + + if (lvds->data_active_low) + flags |= DRM_BUS_FLAG_DATA_LOW; + else + flags |= DRM_BUS_FLAG_DATA_HIGH; + + connector->display_info.bus_flags = flags; return 1; } @@ -159,6 +176,8 @@ static int panel_lvds_parse_dt(struct panel_lvds *lvds) return -EINVAL; } + lvds->clk_active_low = of_property_read_bool(np, "clock-active-low"); + lvds->data_active_low = of_property_read_bool(np, "data-active-low"); lvds->data_mirror = of_property_read_bool(np, "data-mirror"); return 0; From patchwork Fri Feb 14 12:24:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 11382183 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 3EC2513A4 for ; Fri, 14 Feb 2020 12:26:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 1CA9A2067D for ; Fri, 14 Feb 2020 12:26:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FFPHoRdk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="tjVpa68s"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="YRsFt0v4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CA9A2067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BkiTYQVfR1prsgqOhjRoxf4GXy5S6M6hybfzF4/6mHI=; b=FFPHoRdkn6CjfS gz5BpSrnyqvQeJU9Vz9IQp75RU0CBURCx8VD2Ec5Ic+iPacOE6YlYDCPpW/wco04+huzkIcy+SuGA ll580rCpC9ZFWqCNhUdWtzDUDiBhvSpnExrrd0zGAsU1F1M7b34RkKOEFzEWKZkmXcsmzfjATxEeL oEVpuAIhDMumkDWDwqTZWdMx8OytXTzdqeMvKZ4AgQ4J2t/8vk42WTYX/JquvdQCa2r/5IpSwJYr2 eu4HC73gYMPi1CYa8a80RlOKTPqyVz3cFyzd4ORXY5IxT6lF11VhsybrREO+oEaI2epuv5yn+tcSy 3YlGdBx9vDn45+xKpEjw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j2a2d-0004zD-VE; Fri, 14 Feb 2020 12:25:55 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j2a1a-0002uD-Rt for linux-arm-kernel@lists.infradead.org; Fri, 14 Feb 2020 12:24:52 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 333FC734E; Fri, 14 Feb 2020 07:24:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 14 Feb 2020 07:24:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=bC7S86a4jGL63 niIbDq1SRfkrzDp7RcwzpEdiRnR5HQ=; b=tjVpa68swhCHL7XkAD4r3YiwBDAk9 AsTaFK31nPwN+5FI/obez2qZjo4kgraENOyfJrx1UEvWiTSn0Ks9TfDkHZcjSHT3 Ya77mY44vvdhnYbP12yF3cPSLnrnYJ8QW912zlIGtIK3Bz23zYzhG9MlgoOF31Ow aSp5aetfk0ojcp6xIRi+E6bTze/DqLC30SFutGfTknxtnTNAwLJsCcS+LQwlDmjH I2GoeIQlTOWTu4GwZTg6aBQOmxQyz0jwMsgE17CfPt4r+LHlpDjJZdHRnoPDxsXN jb6kLZEek7M4Us3W18b+PUE0uN0wTx05QUIb5sH2pBa9GkhU+BH6CgXxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=bC7S86a4jGL63niIbDq1SRfkrzDp7RcwzpEdiRnR5HQ=; b=YRsFt0v4 1LH+T6thCxVx7vprAn5UedpAkslwwc//hZB102bNJgEhTPFAh+csany84R916EIp HSQE9KgBKRYvb3hVgvMGs8yz1Sw0YgqT8zVlCX5Zlx0RgxHtgknPzeCH4x7a2voU lOqjbJNjMjhX7VxDLII0vMNcfxCdsG+cHO/6A1q2JuhacAZRJ071L7VNh21jgnQK vkLbZGAtOh6OuqVJiaGHcxvO8SFdQHtvFhEm5j4v9MpeJWrg7Is/ox/ErAOMhSFo vPQe6cwrSdxSS8BSQ3kwD8BgxZuFduI0jx0zy+z9Ph0xzeS3QQ3H4i+Hku/ZyMFS q6VD5MbtD9pTyw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjedtgdegtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucfkphepledtrd ekledrieekrdejieenucevlhhushhtvghrufhiiigvpeefnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id C60113060EF2; Fri, 14 Feb 2020 07:24:49 -0500 (EST) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , dri-devel@lists.freedesktop.org Subject: [PATCH 4/4] drm/sun4i: lvds: Support data and clock polarity flags Date: Fri, 14 Feb 2020 13:24:41 +0100 Message-Id: <011bbc064e12acb5d8848721f8ff94e50754a9e4.1581682983.git-series.maxime@cerno.tech> X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200214_042451_080241_B70C82DE X-CRM114-Status: GOOD ( 10.76 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [66.111.4.230 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, David Airlie , Sam Ravnborg , Maarten Lankhorst , Rob Herring , Sean Paul , Maxime Ripard , Thierry Reding , Daniel Vetter , Frank Rowand , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Our LVDS encoder can change the polarity of data and clock signals on the LVDS link. Make sure we don't ignore the matching bus flags. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index c81cdce6ed55..fdf143042f83 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -404,6 +404,8 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon, const struct drm_encoder *encoder, const struct drm_display_mode *mode) { + struct drm_connector *connector = sun4i_tcon_get_connector(encoder); + const struct drm_display_info *info = &connector->display_info; unsigned int bp; u8 clk_delay; u32 reg, val = 0; @@ -449,9 +451,17 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon, SUN4I_TCON0_BASIC2_V_TOTAL(mode->crtc_vtotal * 2) | SUN4I_TCON0_BASIC2_V_BACKPORCH(bp)); - reg = SUN4I_TCON0_LVDS_IF_CLK_SEL_TCON0 | - SUN4I_TCON0_LVDS_IF_DATA_POL_NORMAL | - SUN4I_TCON0_LVDS_IF_CLK_POL_NORMAL; + reg = SUN4I_TCON0_LVDS_IF_CLK_SEL_TCON0; + if (info->bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE) + reg |= SUN4I_TCON0_LVDS_IF_CLK_POL_INV; + else + reg |= SUN4I_TCON0_LVDS_IF_CLK_POL_NORMAL; + + if (info->bus_flags & DRM_BUS_FLAG_DATA_LOW) + reg |= SUN4I_TCON0_LVDS_IF_DATA_POL_INV; + else + reg |= SUN4I_TCON0_LVDS_IF_DATA_POL_NORMAL; + if (sun4i_tcon_get_pixel_depth(encoder) == 24) reg |= SUN4I_TCON0_LVDS_IF_BITWIDTH_24BITS; else