From patchwork Wed Oct 20 15:34:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Keeping X-Patchwork-Id: 12572611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6A3CC433F5 for ; Wed, 20 Oct 2021 15:50:21 +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 7056261212 for ; Wed, 20 Oct 2021 15:50:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7056261212 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=metanate.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F35B6E084; Wed, 20 Oct 2021 15:50:20 +0000 (UTC) X-Greylist: delayed 935 seconds by postgrey-1.36 at gabe; Wed, 20 Oct 2021 15:50:19 UTC Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9FBCF6E084 for ; Wed, 20 Oct 2021 15:50:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Reply-To: Content-ID:Content-Description; bh=cIUI/bXHveWZMR9h3CdEbhAxpYfGQQQHM8NqLPkSilg=; b=NQZEQoYyrcI8/h8BjsnLOmTZkp Pl2qfCJah9DM58+XAsUHNx4D+7zA087HBqJatVCUXqm/LwiPA1ChBe/na7VooPqA01dDgRI9TnpsQ QhjuyphbNDhYpdk9AY414QOjQlzbDNnnKwM1XEUR+5vdl59Kjc8RukekiaJSoo6GvEua9RuVLRQTa yjxlkOO9/iC6EHNHkga5Qba2wpoAucEylHEAcGAtx/bJe7j4BAfOF9EC5n1YUJL2soZwoC6p143mr bXYgmOqU+TIrFsZWy0Or2fY8eQL7BgMnZJXfKckkltRw/Gv/a8sC1JF6YrpC1Mipke0jV5klAH606 /QWTJH4A==; Received: from [81.174.171.191] (helo=donbot.metanate.com) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mdDc1-00043j-3n; Wed, 20 Oct 2021 16:34:41 +0100 From: John Keeping To: dri-devel@lists.freedesktop.org Cc: John Keeping , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Maxime Ripard , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] dt-bindings: ili9881c: add missing panel-common inheritance Date: Wed, 20 Oct 2021 16:34:28 +0100 Message-Id: <20211020153432.383845-2-john@metanate.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211020153432.383845-1-john@metanate.com> References: <20211020153432.383845-1-john@metanate.com> MIME-Version: 1.0 X-Authenticated: YES 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The properties below refer to items in panel-common.yaml, which means that needs to be referenced in the schema. Signed-off-by: John Keeping --- .../devicetree/bindings/display/panel/ilitek,ili9881c.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml index 07789d554889..032bae7891ad 100644 --- a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml +++ b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml @@ -9,6 +9,9 @@ title: Ilitek ILI9881c based MIPI-DSI panels maintainers: - Maxime Ripard +allOf: + - $ref: panel-common.yaml# + properties: compatible: items: From patchwork Wed Oct 20 15:34:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Keeping X-Patchwork-Id: 12572617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDDB1C433F5 for ; Wed, 20 Oct 2021 15:50:35 +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 89EF861391 for ; Wed, 20 Oct 2021 15:50:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 89EF861391 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=metanate.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 80FCB6E9EA; Wed, 20 Oct 2021 15:50:29 +0000 (UTC) Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8A5916E9EE for ; Wed, 20 Oct 2021 15:50:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Reply-To: Content-ID:Content-Description; bh=9wQxL1mQCD9KGWokSJt4JLAUUu9p5wZhKYOiCzkRPr8=; b=Sqc32ZaSmRhE4g6JHhpl9FhuZX 6m1+KBe285RfgiuN0/zH4Sx6THM9mdlS9aGD5WICZIAnSyFEQCTksXV+MUQxQo1xRjRYG4l1tOfB3 zXGUOxeSGfGDko1T9Ngifrc8LILHmdKu+ZGQmUPwh2MgDrZNTXqJ9t9yHQ4bFE6qRaEZSmeV77oSV C4H+eNoktjxvCUB8VcG/yfz2OTRr/Q0taNyA9E/McaJyZiCpG4n8D4a4/aENocqymNFr5Y2Y02qWi 2CO5hmz1p5jiCXHSBHRzMlzrMmgaLfhNnF6W3f1SycM1dkaQEeDpDoI/PY0d/yLZ6D9XOkCK5jiic sx/eBjHw==; Received: from [81.174.171.191] (helo=donbot.metanate.com) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mdDc1-00043j-Qh; Wed, 20 Oct 2021 16:34:41 +0100 From: John Keeping To: dri-devel@lists.freedesktop.org Cc: John Keeping , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Maxime Ripard , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] dt-bindings: ili9881c: add rotation property Date: Wed, 20 Oct 2021 16:34:29 +0100 Message-Id: <20211020153432.383845-3-john@metanate.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211020153432.383845-1-john@metanate.com> References: <20211020153432.383845-1-john@metanate.com> MIME-Version: 1.0 X-Authenticated: YES 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Allow the standard rotation property from panel-common for ILI9881C based panels. Signed-off-by: John Keeping --- .../devicetree/bindings/display/panel/ilitek,ili9881c.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml index 032bae7891ad..c5d1df680858 100644 --- a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml +++ b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml @@ -25,6 +25,7 @@ properties: power-supply: true reg: true reset-gpios: true + rotation: true required: - compatible From patchwork Wed Oct 20 15:34:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Keeping X-Patchwork-Id: 12572613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37F4BC433EF for ; Wed, 20 Oct 2021 15:50:28 +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 F265B6135E for ; Wed, 20 Oct 2021 15:50:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F265B6135E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=metanate.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B7E86E9ED; Wed, 20 Oct 2021 15:50:24 +0000 (UTC) Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) by gabe.freedesktop.org (Postfix) with ESMTPS id E847C6E4B7 for ; Wed, 20 Oct 2021 15:50:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Reply-To: Content-ID:Content-Description; bh=B8trVW6cPaFG3skNIZzv8boeVt5L92SBMXw4m+queSU=; b=gOivhW8nOzjf76TzAFgQwf4eAH 4mlkN61zm5m9znZ0owWlJNdUUKx49OiCpgOa9/5qSgLFe6sEuK0R1nR9QfLhnuD74EopOIO37qIGQ YGHmRk8LWsmXE0Xq3yacJjE6qllWkXerMLwRfhqXAc6jrYafWW4NT6psO8yOHq76K3Ro7AUjuSkHn woR+vZqqV5hNKu3vLrCafg6ALnLIdIOAOhlZQ4LEJzwKisKISnyCyZa90GOWWzWpYNZGsbdHipjnL 3WgXXeyHDLqxHQLBCiVWS4A94d1+t62UzsYAd5c/MRZ+iwLnJubz/i7cXPr4YJ6yzvKVjjmf5JbrC AZXLItCQ==; Received: from [81.174.171.191] (helo=donbot.metanate.com) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mdDc2-00043j-JD; Wed, 20 Oct 2021 16:34:42 +0100 From: John Keeping To: dri-devel@lists.freedesktop.org Cc: John Keeping , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] drm/panel: ilitek-ili9881c: Read panel orientation Date: Wed, 20 Oct 2021 16:34:30 +0100 Message-Id: <20211020153432.383845-4-john@metanate.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211020153432.383845-1-john@metanate.com> References: <20211020153432.383845-1-john@metanate.com> MIME-Version: 1.0 X-Authenticated: YES 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The panel orientation needs to parsed from a device-tree and assigned to the panel's connector in order to make orientation property available to userspace. That's what this patch does for ILI9881C based panels. Signed-off-by: John Keeping --- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index d68c52bd53c2..ba30d11547ad 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -52,6 +52,8 @@ struct ili9881c { struct regulator *power; struct gpio_desc *reset; + + enum drm_panel_orientation orientation; }; #define ILI9881C_SWITCH_PAGE_INSTR(_page) \ @@ -851,6 +853,8 @@ static int ili9881c_get_modes(struct drm_panel *panel, connector->display_info.width_mm = mode->width_mm; connector->display_info.height_mm = mode->height_mm; + drm_connector_set_panel_orientation(connector, ctx->orientation); + return 1; } @@ -887,6 +891,13 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) return dev_err_probe(&dsi->dev, PTR_ERR(ctx->reset), "Couldn't get our reset GPIO\n"); + ret = of_drm_get_panel_orientation(dsi->dev.of_node, &ctx->orientation); + if (ret) { + dev_err(&dsi->dev, "%pOF: failed to get orientation: %d\n", + dsi->dev.of_node, ret); + return ret; + } + ret = drm_panel_of_backlight(&ctx->panel); if (ret) return ret;