linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Stuebner <heiko@sntech.de>
To: linux-rockchip@lists.infradead.org, hjc@rock-chips.com
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	dri-devel@lists.freedesktop.org, robh+dt@kernel.org,
	mark.rutland@arm.com, architt@codeaurora.org,
	a.hajda@samsung.com, Laurent.pinchart@ideasonboard.com,
	linux-clk@vger.kernel.org, Heiko Stuebner <heiko@sntech.de>
Subject: [PATCH 07/15] drm/rockchip: dw-mipi-dsi: add support for rk3368-variant
Date: Mon, 17 Dec 2018 13:36:42 +0100	[thread overview]
Message-ID: <20181217123650.6773-8-heiko@sntech.de> (raw)
In-Reply-To: <20181217123650.6773-1-heiko@sntech.de>

Add the compatible and grf values and allow the driver to also
not select a specific crtc input on systems with only one vop.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 .../display/rockchip/dw_mipi_dsi_rockchip.txt |  1 +
 .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   | 25 +++++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
index 6bb59ab39f2f..869fbc256d51 100644
--- a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
+++ b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
@@ -5,6 +5,7 @@ Required properties:
 - #address-cells: Should be <1>.
 - #size-cells: Should be <0>.
 - compatible: "rockchip,rk3288-mipi-dsi", "snps,dw-mipi-dsi".
+	      "rockchip,rk3368-mipi-dsi", "snps,dw-mipi-dsi".
 	      "rockchip,rk3399-mipi-dsi", "snps,dw-mipi-dsi".
 - reg: Represent the physical address range of the controller.
 - interrupts: Represent the controller's interrupt to the CPU(s).
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 7ee359bcee62..041647bfce71 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -142,6 +142,11 @@
 #define RK3288_DSI0_LCDC_SEL		BIT(6)
 #define RK3288_DSI1_LCDC_SEL		BIT(9)
 
+#define RK3368_GRF_SOC_CON7		0x41c
+#define RK3368_DSI_TURNDISABLE		BIT(5)
+#define RK3368_DSI_FORCERXMODE		BIT(6)
+#define RK3368_DSI_FORCETXSTOPMODE	(0xf << 7)
+
 #define RK3399_GRF_SOC_CON20		0x6250
 #define RK3399_DSI0_LCDC_SEL		BIT(0)
 #define RK3399_DSI1_LCDC_SEL		BIT(4)
@@ -192,7 +197,7 @@ enum {
 struct rockchip_dw_dsi_chip_data {
 	u32 reg;
 
-	u32 lcdsel_grf_reg;
+	int lcdsel_grf_reg;
 	u32 lcdsel_big;
 	u32 lcdsel_lit;
 
@@ -566,7 +571,7 @@ static const struct dw_mipi_dsi_phy_ops dw_mipi_dsi_rockchip_phy_ops = {
 static void dw_mipi_dsi_rockchip_config(struct dw_mipi_dsi_rockchip *dsi,
 					int mux)
 {
-	if (dsi->cdata->lcdsel_grf_reg)
+	if (dsi->cdata->lcdsel_grf_reg >= 0)
 		regmap_write(dsi->grf_regmap, dsi->cdata->lcdsel_grf_reg,
 			mux ? dsi->cdata->lcdsel_lit : dsi->cdata->lcdsel_big);
 
@@ -1008,6 +1013,19 @@ static const struct rockchip_dw_dsi_chip_data rk3288_chip_data[] = {
 	{ /* sentinel */ }
 };
 
+static const struct rockchip_dw_dsi_chip_data rk3368_chip_data[] = {
+	{
+		.reg = 0xff960000,
+		.lcdsel_grf_reg = -1,
+		.lanecfg1_grf_reg = RK3368_GRF_SOC_CON7,
+		.lanecfg1 = HIWORD_UPDATE(0, RK3368_DSI_TURNDISABLE |
+					     RK3368_DSI_FORCERXMODE |
+					     RK3368_DSI_FORCETXSTOPMODE),
+		.max_data_lanes = 4,
+	},
+	{ /* sentinel */ }
+};
+
 static const struct rockchip_dw_dsi_chip_data rk3399_chip_data[] = {
 	{
 		.reg = 0xff960000,
@@ -1058,6 +1076,9 @@ static const struct of_device_id dw_mipi_dsi_rockchip_dt_ids[] = {
 	{
 	 .compatible = "rockchip,rk3288-mipi-dsi",
 	 .data = &rk3288_chip_data,
+	}, {
+	 .compatible = "rockchip,rk3368-mipi-dsi",
+	 .data = &rk3368_chip_data,
 	}, {
 	 .compatible = "rockchip,rk3399-mipi-dsi",
 	 .data = &rk3399_chip_data,
-- 
2.19.2


  parent reply	other threads:[~2018-12-17 12:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
2018-12-17 12:36 ` [PATCH 01/15] clk: rockchip: add clock ids for dphy rx and tx channels on rk3368 Heiko Stuebner
2018-12-20 21:37   ` Rob Herring
2018-12-17 12:36 ` [PATCH 02/15] clk: rockchip: add clock id 24m dsi clock " Heiko Stuebner
2018-12-20 21:37   ` Rob Herring
2018-12-17 12:36 ` [PATCH 03/15] clk: rockchip: use clock ids for dphy rx and tx " Heiko Stuebner
2018-12-17 12:36 ` [PATCH 04/15] clk: rockchip: use clock id for 24m dsi " Heiko Stuebner
2018-12-17 12:36 ` [PATCH 05/15] drm/rockchip: dw_hdmi: add support for rk3368 Heiko Stuebner
2018-12-20 21:39   ` Rob Herring
2018-12-17 12:36 ` [PATCH 06/15] drm/rockchip: analogix_dp: add support for the rk3368 variant Heiko Stuebner
2018-12-20 21:40   ` Rob Herring
2018-12-17 12:36 ` Heiko Stuebner [this message]
2018-12-20 21:42   ` [PATCH 07/15] drm/rockchip: dw-mipi-dsi: add support for rk3368-variant Rob Herring
2018-12-17 12:36 ` [PATCH 08/15] arm64: dts: rockchip: default values for core clocks on rk3368 Heiko Stuebner
2018-12-17 12:36 ` [PATCH 09/15] arm64: dts: rockchip: add power-domain nodes " Heiko Stuebner
2018-12-17 12:36 ` [PATCH 10/15] arm64: dts: rockchip: add dw-hdmi controller " Heiko Stuebner
2018-12-17 12:36 ` [PATCH 11/15] arm64: dts: rockchip: add analogix-dp " Heiko Stuebner
2018-12-17 12:36 ` [PATCH 12/15] arm64: dts: rockchip: add dw-mipi-dsi " Heiko Stuebner
2018-12-17 12:36 ` [PATCH 13/15] arm64: dts: rockchip: add core display support for rk3368 Heiko Stuebner
2018-12-17 12:36 ` [PATCH 14/15] arm64: dts: rockchip: enable display on rk3368-r88 Heiko Stuebner
2018-12-17 12:36 ` [PATCH 15/15] arm64: defconfig: enable hym8563 rtc driver Heiko Stuebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181217123650.6773-8-heiko@sntech.de \
    --to=heiko@sntech.de \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=architt@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hjc@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).