All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/6] drm/rockchip: hdmi support for rk3328
@ 2018-09-12 12:47 ` Heiko Stuebner
  0 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: architt, hjc, a.hajda
  Cc: Jose.Abreu, algea.cao, jonas, dri-devel, linux-rockchip,
	Laurent.pinchart, linux-arm-kernel, zhengyang

The rk3228/rk3229 and rk3328 socs started using a new type of hdmi-phy
from Innosilicon that resides completely separate from the dw-hdmi block
and gets accessed via mmio.

Additionally the rk3328 dw-hdmi does not report the vendor-phy type
but a different one instead, so add the possibility to override the
phy type when the glue driver knows better than the ip block itself.

changes in v5:
- disable CEC_5V option to make CEC actually work (Jonas)

changes in v4:
- rebased onto 4.19-rc2 - no actual changes
- added Rob's Ack on the dw-hdmi compatible

changes in v3:
- split off phy driver into a separate series
- only allow forcing vendor phy type
- wording fixes and other nits

changes in v2:
- phy: prevent overflow in tmdsclk calculation
  as reported by Martin Cerveny
- phy: use unsigned long for all tmdsclk rate uses
- phy: simplify tmds rate calculation
- dropped patch exporting some dw-hdmi phy functions
  as a similar patch entered drm-misc already

Heiko Stuebner (6):
  drm/bridge: dw-hdmi: allow forcing vendor phy-type
  drm/rockchip: dw_hdmi: Allow outputs that don't need output switching
  dt-bindings: allow optional phys in Rockchip dw_hdmi binding
  drm/rockchip: dw_hdmi: allow including external phys
  drm/rockchip: dw_hdmi: store rockchip_hdmi reference in phy_data
    object
  drm/rockchip: dw_hdmi: add dw-hdmi support for the rk3328

 .../display/rockchip/dw_hdmi-rockchip.txt     |   3 +
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     |   4 +-
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c   | 126 +++++++++++++++++-
 include/drm/bridge/dw_hdmi.h                  |   1 +
 4 files changed, 130 insertions(+), 4 deletions(-)

-- 
2.17.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 0/6] drm/rockchip: hdmi support for rk3328
@ 2018-09-12 12:47 ` Heiko Stuebner
  0 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

The rk3228/rk3229 and rk3328 socs started using a new type of hdmi-phy
from Innosilicon that resides completely separate from the dw-hdmi block
and gets accessed via mmio.

Additionally the rk3328 dw-hdmi does not report the vendor-phy type
but a different one instead, so add the possibility to override the
phy type when the glue driver knows better than the ip block itself.

changes in v5:
- disable CEC_5V option to make CEC actually work (Jonas)

changes in v4:
- rebased onto 4.19-rc2 - no actual changes
- added Rob's Ack on the dw-hdmi compatible

changes in v3:
- split off phy driver into a separate series
- only allow forcing vendor phy type
- wording fixes and other nits

changes in v2:
- phy: prevent overflow in tmdsclk calculation
  as reported by Martin Cerveny
- phy: use unsigned long for all tmdsclk rate uses
- phy: simplify tmds rate calculation
- dropped patch exporting some dw-hdmi phy functions
  as a similar patch entered drm-misc already

Heiko Stuebner (6):
  drm/bridge: dw-hdmi: allow forcing vendor phy-type
  drm/rockchip: dw_hdmi: Allow outputs that don't need output switching
  dt-bindings: allow optional phys in Rockchip dw_hdmi binding
  drm/rockchip: dw_hdmi: allow including external phys
  drm/rockchip: dw_hdmi: store rockchip_hdmi reference in phy_data
    object
  drm/rockchip: dw_hdmi: add dw-hdmi support for the rk3328

 .../display/rockchip/dw_hdmi-rockchip.txt     |   3 +
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     |   4 +-
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c   | 126 +++++++++++++++++-
 include/drm/bridge/dw_hdmi.h                  |   1 +
 4 files changed, 130 insertions(+), 4 deletions(-)

-- 
2.17.0

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 1/6] drm/bridge: dw-hdmi: allow forcing vendor phy-type
  2018-09-12 12:47 ` Heiko Stuebner
@ 2018-09-12 12:47   ` Heiko Stuebner
  -1 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: architt, hjc, a.hajda
  Cc: Jose.Abreu, algea.cao, jonas, dri-devel, linux-rockchip,
	Laurent.pinchart, linux-arm-kernel, zhengyang

In some IP implementations the reading of the phy-type may be broken.
One example are the Rockchip rk3228 and rk3328 socs that use a separate
vendor-type phy from Innosilicon but still report the HDMI20_TX type.

So allow the glue driver to force the vendor-phy for these cases.
In the future it may be necessary to allow forcing other types, but
for now we'll keep it simply to the case actually seen in the wild.

changes in v3:
- only allow forcing vendor type, as suggested by Laurent

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 +++-
 include/drm/bridge/dw_hdmi.h              | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 5971976284bf..ac37c50d6c4b 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2205,7 +2205,9 @@ static int dw_hdmi_detect_phy(struct dw_hdmi *hdmi)
 	unsigned int i;
 	u8 phy_type;
 
-	phy_type = hdmi_readb(hdmi, HDMI_CONFIG2_ID);
+	phy_type = hdmi->plat_data->phy_force_vendor ?
+				DW_HDMI_PHY_VENDOR_PHY :
+				hdmi_readb(hdmi, HDMI_CONFIG2_ID);
 
 	if (phy_type == DW_HDMI_PHY_VENDOR_PHY) {
 		/* Vendor PHYs require support from the glue layer. */
diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
index ccb5aa8468e0..6ef3236bb6dd 100644
--- a/include/drm/bridge/dw_hdmi.h
+++ b/include/drm/bridge/dw_hdmi.h
@@ -133,6 +133,7 @@ struct dw_hdmi_plat_data {
 	const struct dw_hdmi_phy_ops *phy_ops;
 	const char *phy_name;
 	void *phy_data;
+	bool phy_force_vendor;
 
 	/* Synopsys PHY support */
 	const struct dw_hdmi_mpll_config *mpll_cfg;
-- 
2.17.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 1/6] drm/bridge: dw-hdmi: allow forcing vendor phy-type
@ 2018-09-12 12:47   ` Heiko Stuebner
  0 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

In some IP implementations the reading of the phy-type may be broken.
One example are the Rockchip rk3228 and rk3328 socs that use a separate
vendor-type phy from Innosilicon but still report the HDMI20_TX type.

So allow the glue driver to force the vendor-phy for these cases.
In the future it may be necessary to allow forcing other types, but
for now we'll keep it simply to the case actually seen in the wild.

changes in v3:
- only allow forcing vendor type, as suggested by Laurent

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 +++-
 include/drm/bridge/dw_hdmi.h              | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 5971976284bf..ac37c50d6c4b 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2205,7 +2205,9 @@ static int dw_hdmi_detect_phy(struct dw_hdmi *hdmi)
 	unsigned int i;
 	u8 phy_type;
 
-	phy_type = hdmi_readb(hdmi, HDMI_CONFIG2_ID);
+	phy_type = hdmi->plat_data->phy_force_vendor ?
+				DW_HDMI_PHY_VENDOR_PHY :
+				hdmi_readb(hdmi, HDMI_CONFIG2_ID);
 
 	if (phy_type == DW_HDMI_PHY_VENDOR_PHY) {
 		/* Vendor PHYs require support from the glue layer. */
diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
index ccb5aa8468e0..6ef3236bb6dd 100644
--- a/include/drm/bridge/dw_hdmi.h
+++ b/include/drm/bridge/dw_hdmi.h
@@ -133,6 +133,7 @@ struct dw_hdmi_plat_data {
 	const struct dw_hdmi_phy_ops *phy_ops;
 	const char *phy_name;
 	void *phy_data;
+	bool phy_force_vendor;
 
 	/* Synopsys PHY support */
 	const struct dw_hdmi_mpll_config *mpll_cfg;
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 2/6] drm/rockchip: dw_hdmi: Allow outputs that don't need output switching
  2018-09-12 12:47 ` Heiko Stuebner
@ 2018-09-12 12:47   ` Heiko Stuebner
  -1 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: architt, hjc, a.hajda
  Cc: Jose.Abreu, algea.cao, jonas, dri-devel, linux-rockchip,
	Laurent.pinchart, linux-arm-kernel, zhengyang

So far we always encountered socs with 2 output crtcs needing the driver
to tell the hdmi block which output to connect to. But there also exist
socs with only one crtc like the rk3228, rk3328 and rk3368.

So adapt the register field to simply carry a negative value to signal
that no output-switching is necessary.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Robin Murphy <robin.murphy@arm.com>

changes in v3:
- fixed wording issue found by Robin Murphy
---
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index 11309a2a4e43..b09c3531305b 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -36,7 +36,7 @@
  * @lcdsel_lit: reg value of selecting vop little for HDMI
  */
 struct rockchip_hdmi_chip_data {
-	u32	lcdsel_grf_reg;
+	int	lcdsel_grf_reg;
 	u32	lcdsel_big;
 	u32	lcdsel_lit;
 };
@@ -245,6 +245,9 @@ static void dw_hdmi_rockchip_encoder_enable(struct drm_encoder *encoder)
 	u32 val;
 	int ret;
 
+	if (hdmi->chip_data->lcdsel_grf_reg < 0)
+		return;
+
 	ret = drm_of_encoder_active_endpoint_id(hdmi->dev->of_node, encoder);
 	if (ret)
 		val = hdmi->chip_data->lcdsel_lit;
-- 
2.17.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 2/6] drm/rockchip: dw_hdmi: Allow outputs that don't need output switching
@ 2018-09-12 12:47   ` Heiko Stuebner
  0 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

So far we always encountered socs with 2 output crtcs needing the driver
to tell the hdmi block which output to connect to. But there also exist
socs with only one crtc like the rk3228, rk3328 and rk3368.

So adapt the register field to simply carry a negative value to signal
that no output-switching is necessary.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Robin Murphy <robin.murphy@arm.com>

changes in v3:
- fixed wording issue found by Robin Murphy
---
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index 11309a2a4e43..b09c3531305b 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -36,7 +36,7 @@
  * @lcdsel_lit: reg value of selecting vop little for HDMI
  */
 struct rockchip_hdmi_chip_data {
-	u32	lcdsel_grf_reg;
+	int	lcdsel_grf_reg;
 	u32	lcdsel_big;
 	u32	lcdsel_lit;
 };
@@ -245,6 +245,9 @@ static void dw_hdmi_rockchip_encoder_enable(struct drm_encoder *encoder)
 	u32 val;
 	int ret;
 
+	if (hdmi->chip_data->lcdsel_grf_reg < 0)
+		return;
+
 	ret = drm_of_encoder_active_endpoint_id(hdmi->dev->of_node, encoder);
 	if (ret)
 		val = hdmi->chip_data->lcdsel_lit;
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 3/6] dt-bindings: allow optional phys in Rockchip dw_hdmi binding
  2018-09-12 12:47 ` Heiko Stuebner
@ 2018-09-12 12:47   ` Heiko Stuebner
  -1 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: architt, hjc, a.hajda
  Cc: Jose.Abreu, algea.cao, jonas, dri-devel, linux-rockchip,
	Laurent.pinchart, linux-arm-kernel, zhengyang

Some newer Rockchip SoCs use an Innosilicon hdmiphy accessed via general
mmio, so allow these to be referenced via the regular phy interfaces
and therefore add optional phy-related properties to the binding.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
index adc94fc3c9f8..937bfb472e1d 100644
--- a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
+++ b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
@@ -34,6 +34,8 @@ Optional properties
 - clock-names: May contain "cec" as defined in dw_hdmi.txt.
 - clock-names: May contain "grf", power for grf io.
 - clock-names: May contain "vpll", external clock for some hdmi phy.
+- phys: from general PHY binding: the phandle for the PHY device.
+- phy-names: Should be "hdmi" if phys references an external phy.
 
 Example:
 
-- 
2.17.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 3/6] dt-bindings: allow optional phys in Rockchip dw_hdmi binding
@ 2018-09-12 12:47   ` Heiko Stuebner
  0 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

Some newer Rockchip SoCs use an Innosilicon hdmiphy accessed via general
mmio, so allow these to be referenced via the regular phy interfaces
and therefore add optional phy-related properties to the binding.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
index adc94fc3c9f8..937bfb472e1d 100644
--- a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
+++ b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
@@ -34,6 +34,8 @@ Optional properties
 - clock-names: May contain "cec" as defined in dw_hdmi.txt.
 - clock-names: May contain "grf", power for grf io.
 - clock-names: May contain "vpll", external clock for some hdmi phy.
+- phys: from general PHY binding: the phandle for the PHY device.
+- phy-names: Should be "hdmi" if phys references an external phy.
 
 Example:
 
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 4/6] drm/rockchip: dw_hdmi: allow including external phys
  2018-09-12 12:47 ` Heiko Stuebner
@ 2018-09-12 12:47   ` Heiko Stuebner
  -1 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: architt, hjc, a.hajda
  Cc: Jose.Abreu, algea.cao, jonas, dri-devel, linux-rockchip,
	Laurent.pinchart, linux-arm-kernel, zhengyang

Some variants of the dw-hdmi on Rockchip socs use a separate phy block
accessed via the generic phy framework, so allow them to be included
if such a phy reference is found.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index b09c3531305b..57e76dfd5f6d 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -11,6 +11,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/phy/phy.h>
 #include <linux/regmap.h>
 
 #include <drm/drm_of.h>
@@ -49,6 +50,7 @@ struct rockchip_hdmi {
 	struct clk *vpll_clk;
 	struct clk *grf_clk;
 	struct dw_hdmi *hdmi;
+	struct phy *phy;
 };
 
 #define to_rockchip_hdmi(x)	container_of(x, struct rockchip_hdmi, x)
@@ -376,6 +378,14 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
 		return ret;
 	}
 
+	hdmi->phy = devm_phy_optional_get(dev, "hdmi");
+	if (IS_ERR(hdmi->phy)) {
+		ret = PTR_ERR(hdmi->phy);
+		if (ret != -EPROBE_DEFER)
+			DRM_DEV_ERROR(hdmi->dev, "failed to get phy\n");
+		return ret;
+	}
+
 	drm_encoder_helper_add(encoder, &dw_hdmi_rockchip_encoder_helper_funcs);
 	drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs,
 			 DRM_MODE_ENCODER_TMDS, NULL);
-- 
2.17.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 4/6] drm/rockchip: dw_hdmi: allow including external phys
@ 2018-09-12 12:47   ` Heiko Stuebner
  0 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

Some variants of the dw-hdmi on Rockchip socs use a separate phy block
accessed via the generic phy framework, so allow them to be included
if such a phy reference is found.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index b09c3531305b..57e76dfd5f6d 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -11,6 +11,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/phy/phy.h>
 #include <linux/regmap.h>
 
 #include <drm/drm_of.h>
@@ -49,6 +50,7 @@ struct rockchip_hdmi {
 	struct clk *vpll_clk;
 	struct clk *grf_clk;
 	struct dw_hdmi *hdmi;
+	struct phy *phy;
 };
 
 #define to_rockchip_hdmi(x)	container_of(x, struct rockchip_hdmi, x)
@@ -376,6 +378,14 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
 		return ret;
 	}
 
+	hdmi->phy = devm_phy_optional_get(dev, "hdmi");
+	if (IS_ERR(hdmi->phy)) {
+		ret = PTR_ERR(hdmi->phy);
+		if (ret != -EPROBE_DEFER)
+			DRM_DEV_ERROR(hdmi->dev, "failed to get phy\n");
+		return ret;
+	}
+
 	drm_encoder_helper_add(encoder, &dw_hdmi_rockchip_encoder_helper_funcs);
 	drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs,
 			 DRM_MODE_ENCODER_TMDS, NULL);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 5/6] drm/rockchip: dw_hdmi: store rockchip_hdmi reference in phy_data object
  2018-09-12 12:47 ` Heiko Stuebner
@ 2018-09-12 12:47   ` Heiko Stuebner
  -1 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: architt, hjc, a.hajda
  Cc: Jose.Abreu, algea.cao, jonas, dri-devel, linux-rockchip,
	Laurent.pinchart, linux-arm-kernel, zhengyang

When using special phy handling operations we'll often need access to
the rockchip_hdmi struct.

As the chip-data that occupies the phy_data pointer initially gets
assigned to the rockchip_hdmi struct, we can now re-use this phy_data
pointer to hold the reference to the rockchip_hdmi struct and use this
reference later on.

Inspiration for this comes from meson and sunxi dw-hdmi, which are using
the same method.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Robin Murphy <robin.murphy@arm.com>

changes in v3:
- reword commit message
---
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index 57e76dfd5f6d..19f002fa0a09 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -335,7 +335,7 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
 				 void *data)
 {
 	struct platform_device *pdev = to_platform_device(dev);
-	const struct dw_hdmi_plat_data *plat_data;
+	struct dw_hdmi_plat_data *plat_data;
 	const struct of_device_id *match;
 	struct drm_device *drm = data;
 	struct drm_encoder *encoder;
@@ -350,9 +350,14 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
 		return -ENOMEM;
 
 	match = of_match_node(dw_hdmi_rockchip_dt_ids, pdev->dev.of_node);
-	plat_data = match->data;
+	plat_data = devm_kmemdup(&pdev->dev, match->data,
+					     sizeof(*plat_data), GFP_KERNEL);
+	if (!plat_data)
+		return -ENOMEM;
+
 	hdmi->dev = &pdev->dev;
 	hdmi->chip_data = plat_data->phy_data;
+	plat_data->phy_data = hdmi;
 	encoder = &hdmi->encoder;
 
 	encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node);
-- 
2.17.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 5/6] drm/rockchip: dw_hdmi: store rockchip_hdmi reference in phy_data object
@ 2018-09-12 12:47   ` Heiko Stuebner
  0 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

When using special phy handling operations we'll often need access to
the rockchip_hdmi struct.

As the chip-data that occupies the phy_data pointer initially gets
assigned to the rockchip_hdmi struct, we can now re-use this phy_data
pointer to hold the reference to the rockchip_hdmi struct and use this
reference later on.

Inspiration for this comes from meson and sunxi dw-hdmi, which are using
the same method.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Robin Murphy <robin.murphy@arm.com>

changes in v3:
- reword commit message
---
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index 57e76dfd5f6d..19f002fa0a09 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -335,7 +335,7 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
 				 void *data)
 {
 	struct platform_device *pdev = to_platform_device(dev);
-	const struct dw_hdmi_plat_data *plat_data;
+	struct dw_hdmi_plat_data *plat_data;
 	const struct of_device_id *match;
 	struct drm_device *drm = data;
 	struct drm_encoder *encoder;
@@ -350,9 +350,14 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
 		return -ENOMEM;
 
 	match = of_match_node(dw_hdmi_rockchip_dt_ids, pdev->dev.of_node);
-	plat_data = match->data;
+	plat_data = devm_kmemdup(&pdev->dev, match->data,
+					     sizeof(*plat_data), GFP_KERNEL);
+	if (!plat_data)
+		return -ENOMEM;
+
 	hdmi->dev = &pdev->dev;
 	hdmi->chip_data = plat_data->phy_data;
+	plat_data->phy_data = hdmi;
 	encoder = &hdmi->encoder;
 
 	encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 6/6] drm/rockchip: dw_hdmi: add dw-hdmi support for the rk3328
  2018-09-12 12:47 ` Heiko Stuebner
@ 2018-09-12 12:47   ` Heiko Stuebner
  -1 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: architt, hjc, a.hajda
  Cc: Jose.Abreu, algea.cao, jonas, dri-devel, linux-rockchip,
	Laurent.pinchart, linux-arm-kernel, zhengyang

The rk3328 uses a dw-hdmi controller with an external hdmi phy from
Innosilicon which uses the generic phy framework for access.
Add the necessary data and the compatible for the rk3328 to the
rockchip dw-hdmi driver.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Rob Herring <robh@kernel.org>

changes in v5:
- disable CEC_5V option to make CEC actually work (Jonas)
changes in v3:
- reword as suggested by Rob to show that it's a dw-hdmi + Inno phy
---
 .../display/rockchip/dw_hdmi-rockchip.txt     |   1 +
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c   | 102 ++++++++++++++++++
 2 files changed, 103 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
index 937bfb472e1d..39143424a474 100644
--- a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
+++ b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
@@ -13,6 +13,7 @@ Required properties:
 
 - compatible: should be one of the following:
 		"rockchip,rk3288-dw-hdmi"
+		"rockchip,rk3328-dw-hdmi"
 		"rockchip,rk3399-dw-hdmi"
 - reg: See dw_hdmi.txt.
 - reg-io-width: See dw_hdmi.txt. Shall be 4.
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index 19f002fa0a09..0566def18d2d 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -25,6 +25,24 @@
 
 #define RK3288_GRF_SOC_CON6		0x025C
 #define RK3288_HDMI_LCDC_SEL		BIT(4)
+#define RK3328_GRF_SOC_CON2		0x0408
+
+#define RK3328_HDMI_SDAIN_MSK		BIT(11)
+#define RK3328_HDMI_SCLIN_MSK		BIT(10)
+#define RK3328_HDMI_HPD_IOE		BIT(2)
+#define RK3328_GRF_SOC_CON3		0x040c
+/* need to be unset if hdmi or i2c should control voltage */
+#define RK3328_HDMI_SDA5V_GRF		BIT(15)
+#define RK3328_HDMI_SCL5V_GRF		BIT(14)
+#define RK3328_HDMI_HPD5V_GRF		BIT(13)
+#define RK3328_HDMI_CEC5V_GRF		BIT(12)
+#define RK3328_GRF_SOC_CON4		0x0410
+#define RK3328_HDMI_HPD_SARADC		BIT(13)
+#define RK3328_HDMI_CEC_5V		BIT(11)
+#define RK3328_HDMI_SDA_5V		BIT(10)
+#define RK3328_HDMI_SCL_5V		BIT(9)
+#define RK3328_HDMI_HPD_5V		BIT(8)
+
 #define RK3399_GRF_SOC_CON20		0x6250
 #define RK3399_HDMI_LCDC_SEL		BIT(6)
 
@@ -292,6 +310,64 @@ static const struct drm_encoder_helper_funcs dw_hdmi_rockchip_encoder_helper_fun
 	.atomic_check = dw_hdmi_rockchip_encoder_atomic_check,
 };
 
+static int dw_hdmi_rockchip_genphy_init(struct dw_hdmi *dw_hdmi, void *data,
+			     struct drm_display_mode *mode)
+{
+	struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
+
+	return phy_power_on(hdmi->phy);
+}
+
+static void dw_hdmi_rockchip_genphy_disable(struct dw_hdmi *dw_hdmi, void *data)
+{
+	struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
+
+	phy_power_off(hdmi->phy);
+}
+
+static enum drm_connector_status
+dw_hdmi_rk3328_read_hpd(struct dw_hdmi *dw_hdmi, void *data)
+{
+	struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
+	enum drm_connector_status status;
+
+	status = dw_hdmi_phy_read_hpd(dw_hdmi, data);
+
+	if (status == connector_status_connected)
+		regmap_write(hdmi->regmap,
+			RK3328_GRF_SOC_CON4,
+			HIWORD_UPDATE(RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V,
+				      RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V));
+	else
+		regmap_write(hdmi->regmap,
+			RK3328_GRF_SOC_CON4,
+			HIWORD_UPDATE(0, RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V));
+	return status;
+}
+
+static void dw_hdmi_rk3328_setup_hpd(struct dw_hdmi *dw_hdmi, void *data)
+{
+	struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
+
+	dw_hdmi_phy_setup_hpd(dw_hdmi, data);
+
+	/* Enable and map pins to 3V grf-controlled io-voltage */
+	regmap_write(hdmi->regmap,
+		RK3328_GRF_SOC_CON4,
+		HIWORD_UPDATE(0, RK3328_HDMI_HPD_SARADC | RK3328_HDMI_CEC_5V |
+				 RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V |
+				 RK3328_HDMI_HPD_5V));
+	regmap_write(hdmi->regmap,
+		RK3328_GRF_SOC_CON3,
+		HIWORD_UPDATE(0, RK3328_HDMI_SDA5V_GRF | RK3328_HDMI_SCL5V_GRF |
+				 RK3328_HDMI_HPD5V_GRF | RK3328_HDMI_CEC5V_GRF));
+	regmap_write(hdmi->regmap,
+		RK3328_GRF_SOC_CON2,
+		HIWORD_UPDATE(RK3328_HDMI_SDAIN_MSK | RK3328_HDMI_SCLIN_MSK,
+			      RK3328_HDMI_SDAIN_MSK | RK3328_HDMI_SCLIN_MSK |
+			      RK3328_HDMI_HPD_IOE));
+}
+
 static struct rockchip_hdmi_chip_data rk3288_chip_data = {
 	.lcdsel_grf_reg = RK3288_GRF_SOC_CON6,
 	.lcdsel_big = HIWORD_UPDATE(0, RK3288_HDMI_LCDC_SEL),
@@ -306,6 +382,29 @@ static const struct dw_hdmi_plat_data rk3288_hdmi_drv_data = {
 	.phy_data = &rk3288_chip_data,
 };
 
+static const struct dw_hdmi_phy_ops rk3328_hdmi_phy_ops = {
+	.init		= dw_hdmi_rockchip_genphy_init,
+	.disable	= dw_hdmi_rockchip_genphy_disable,
+	.read_hpd	= dw_hdmi_rk3328_read_hpd,
+	.update_hpd	= dw_hdmi_phy_update_hpd,
+	.setup_hpd	= dw_hdmi_rk3328_setup_hpd,
+};
+
+static struct rockchip_hdmi_chip_data rk3328_chip_data = {
+	.lcdsel_grf_reg = -1,
+};
+
+static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = {
+	.mode_valid = dw_hdmi_rockchip_mode_valid,
+	.mpll_cfg = rockchip_mpll_cfg,
+	.cur_ctr = rockchip_cur_ctr,
+	.phy_config = rockchip_phy_config,
+	.phy_data = &rk3328_chip_data,
+	.phy_ops = &rk3328_hdmi_phy_ops,
+	.phy_name = "inno_dw_hdmi_phy2",
+	.phy_force_vendor = true,
+};
+
 static struct rockchip_hdmi_chip_data rk3399_chip_data = {
 	.lcdsel_grf_reg = RK3399_GRF_SOC_CON20,
 	.lcdsel_big = HIWORD_UPDATE(0, RK3399_HDMI_LCDC_SEL),
@@ -324,6 +423,9 @@ static const struct of_device_id dw_hdmi_rockchip_dt_ids[] = {
 	{ .compatible = "rockchip,rk3288-dw-hdmi",
 	  .data = &rk3288_hdmi_drv_data
 	},
+	{ .compatible = "rockchip,rk3328-dw-hdmi",
+	  .data = &rk3328_hdmi_drv_data
+	},
 	{ .compatible = "rockchip,rk3399-dw-hdmi",
 	  .data = &rk3399_hdmi_drv_data
 	},
-- 
2.17.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 6/6] drm/rockchip: dw_hdmi: add dw-hdmi support for the rk3328
@ 2018-09-12 12:47   ` Heiko Stuebner
  0 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-12 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

The rk3328 uses a dw-hdmi controller with an external hdmi phy from
Innosilicon which uses the generic phy framework for access.
Add the necessary data and the compatible for the rk3328 to the
rockchip dw-hdmi driver.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Rob Herring <robh@kernel.org>

changes in v5:
- disable CEC_5V option to make CEC actually work (Jonas)
changes in v3:
- reword as suggested by Rob to show that it's a dw-hdmi + Inno phy
---
 .../display/rockchip/dw_hdmi-rockchip.txt     |   1 +
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c   | 102 ++++++++++++++++++
 2 files changed, 103 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
index 937bfb472e1d..39143424a474 100644
--- a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
+++ b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
@@ -13,6 +13,7 @@ Required properties:
 
 - compatible: should be one of the following:
 		"rockchip,rk3288-dw-hdmi"
+		"rockchip,rk3328-dw-hdmi"
 		"rockchip,rk3399-dw-hdmi"
 - reg: See dw_hdmi.txt.
 - reg-io-width: See dw_hdmi.txt. Shall be 4.
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index 19f002fa0a09..0566def18d2d 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -25,6 +25,24 @@
 
 #define RK3288_GRF_SOC_CON6		0x025C
 #define RK3288_HDMI_LCDC_SEL		BIT(4)
+#define RK3328_GRF_SOC_CON2		0x0408
+
+#define RK3328_HDMI_SDAIN_MSK		BIT(11)
+#define RK3328_HDMI_SCLIN_MSK		BIT(10)
+#define RK3328_HDMI_HPD_IOE		BIT(2)
+#define RK3328_GRF_SOC_CON3		0x040c
+/* need to be unset if hdmi or i2c should control voltage */
+#define RK3328_HDMI_SDA5V_GRF		BIT(15)
+#define RK3328_HDMI_SCL5V_GRF		BIT(14)
+#define RK3328_HDMI_HPD5V_GRF		BIT(13)
+#define RK3328_HDMI_CEC5V_GRF		BIT(12)
+#define RK3328_GRF_SOC_CON4		0x0410
+#define RK3328_HDMI_HPD_SARADC		BIT(13)
+#define RK3328_HDMI_CEC_5V		BIT(11)
+#define RK3328_HDMI_SDA_5V		BIT(10)
+#define RK3328_HDMI_SCL_5V		BIT(9)
+#define RK3328_HDMI_HPD_5V		BIT(8)
+
 #define RK3399_GRF_SOC_CON20		0x6250
 #define RK3399_HDMI_LCDC_SEL		BIT(6)
 
@@ -292,6 +310,64 @@ static const struct drm_encoder_helper_funcs dw_hdmi_rockchip_encoder_helper_fun
 	.atomic_check = dw_hdmi_rockchip_encoder_atomic_check,
 };
 
+static int dw_hdmi_rockchip_genphy_init(struct dw_hdmi *dw_hdmi, void *data,
+			     struct drm_display_mode *mode)
+{
+	struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
+
+	return phy_power_on(hdmi->phy);
+}
+
+static void dw_hdmi_rockchip_genphy_disable(struct dw_hdmi *dw_hdmi, void *data)
+{
+	struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
+
+	phy_power_off(hdmi->phy);
+}
+
+static enum drm_connector_status
+dw_hdmi_rk3328_read_hpd(struct dw_hdmi *dw_hdmi, void *data)
+{
+	struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
+	enum drm_connector_status status;
+
+	status = dw_hdmi_phy_read_hpd(dw_hdmi, data);
+
+	if (status == connector_status_connected)
+		regmap_write(hdmi->regmap,
+			RK3328_GRF_SOC_CON4,
+			HIWORD_UPDATE(RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V,
+				      RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V));
+	else
+		regmap_write(hdmi->regmap,
+			RK3328_GRF_SOC_CON4,
+			HIWORD_UPDATE(0, RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V));
+	return status;
+}
+
+static void dw_hdmi_rk3328_setup_hpd(struct dw_hdmi *dw_hdmi, void *data)
+{
+	struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
+
+	dw_hdmi_phy_setup_hpd(dw_hdmi, data);
+
+	/* Enable and map pins to 3V grf-controlled io-voltage */
+	regmap_write(hdmi->regmap,
+		RK3328_GRF_SOC_CON4,
+		HIWORD_UPDATE(0, RK3328_HDMI_HPD_SARADC | RK3328_HDMI_CEC_5V |
+				 RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V |
+				 RK3328_HDMI_HPD_5V));
+	regmap_write(hdmi->regmap,
+		RK3328_GRF_SOC_CON3,
+		HIWORD_UPDATE(0, RK3328_HDMI_SDA5V_GRF | RK3328_HDMI_SCL5V_GRF |
+				 RK3328_HDMI_HPD5V_GRF | RK3328_HDMI_CEC5V_GRF));
+	regmap_write(hdmi->regmap,
+		RK3328_GRF_SOC_CON2,
+		HIWORD_UPDATE(RK3328_HDMI_SDAIN_MSK | RK3328_HDMI_SCLIN_MSK,
+			      RK3328_HDMI_SDAIN_MSK | RK3328_HDMI_SCLIN_MSK |
+			      RK3328_HDMI_HPD_IOE));
+}
+
 static struct rockchip_hdmi_chip_data rk3288_chip_data = {
 	.lcdsel_grf_reg = RK3288_GRF_SOC_CON6,
 	.lcdsel_big = HIWORD_UPDATE(0, RK3288_HDMI_LCDC_SEL),
@@ -306,6 +382,29 @@ static const struct dw_hdmi_plat_data rk3288_hdmi_drv_data = {
 	.phy_data = &rk3288_chip_data,
 };
 
+static const struct dw_hdmi_phy_ops rk3328_hdmi_phy_ops = {
+	.init		= dw_hdmi_rockchip_genphy_init,
+	.disable	= dw_hdmi_rockchip_genphy_disable,
+	.read_hpd	= dw_hdmi_rk3328_read_hpd,
+	.update_hpd	= dw_hdmi_phy_update_hpd,
+	.setup_hpd	= dw_hdmi_rk3328_setup_hpd,
+};
+
+static struct rockchip_hdmi_chip_data rk3328_chip_data = {
+	.lcdsel_grf_reg = -1,
+};
+
+static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = {
+	.mode_valid = dw_hdmi_rockchip_mode_valid,
+	.mpll_cfg = rockchip_mpll_cfg,
+	.cur_ctr = rockchip_cur_ctr,
+	.phy_config = rockchip_phy_config,
+	.phy_data = &rk3328_chip_data,
+	.phy_ops = &rk3328_hdmi_phy_ops,
+	.phy_name = "inno_dw_hdmi_phy2",
+	.phy_force_vendor = true,
+};
+
 static struct rockchip_hdmi_chip_data rk3399_chip_data = {
 	.lcdsel_grf_reg = RK3399_GRF_SOC_CON20,
 	.lcdsel_big = HIWORD_UPDATE(0, RK3399_HDMI_LCDC_SEL),
@@ -324,6 +423,9 @@ static const struct of_device_id dw_hdmi_rockchip_dt_ids[] = {
 	{ .compatible = "rockchip,rk3288-dw-hdmi",
 	  .data = &rk3288_hdmi_drv_data
 	},
+	{ .compatible = "rockchip,rk3328-dw-hdmi",
+	  .data = &rk3328_hdmi_drv_data
+	},
 	{ .compatible = "rockchip,rk3399-dw-hdmi",
 	  .data = &rk3399_hdmi_drv_data
 	},
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PATCH v5 1/6] drm/bridge: dw-hdmi: allow forcing vendor phy-type
       [not found]   ` <1851d56f-b628-2d10-0da7-72c1075b2b9a@rock-chips.com>
@ 2018-09-28  7:51       ` Zheng Yang
  0 siblings, 0 replies; 28+ messages in thread
From: Zheng Yang @ 2018-09-28  7:51 UTC (permalink / raw)
  To: Sandy Huang, architt, a.hajda
  Cc: Jose Abreu, algea.cao, Heiko Stuebner, jonas, dri-devel,
	linux-rockchip, Laurent Pinchart, linux-arm-kernel

Hi, Heiko:

Reviewed-by: zhengyang <zhengyang@rock-chips.com>

>
> In some IP implementations the reading of the phy-type may be broken.
> One example are the Rockchip rk3228 and rk3328 socs that use a separate
> vendor-type phy from Innosilicon but still report the HDMI20_TX type.
>
> So allow the glue driver to force the vendor-phy for these cases.
> In the future it may be necessary to allow forcing other types, but
> for now we'll keep it simply to the case actually seen in the wild.
>
> changes in v3:
> - only allow forcing vendor type, as suggested by Laurent
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> Tested-by: Robin Murphy <robin.murphy@arm.com>
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 +++-
>  include/drm/bridge/dw_hdmi.h              | 1 +
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c 
> b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 5971976284bf..ac37c50d6c4b 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2205,7 +2205,9 @@ static int dw_hdmi_detect_phy(struct dw_hdmi *hdmi)
>      unsigned int i;
>      u8 phy_type;
>  -    phy_type = hdmi_readb(hdmi, HDMI_CONFIG2_ID);
> +    phy_type = hdmi->plat_data->phy_force_vendor ?
> +                DW_HDMI_PHY_VENDOR_PHY :
> +                hdmi_readb(hdmi, HDMI_CONFIG2_ID);
>       if (phy_type == DW_HDMI_PHY_VENDOR_PHY) {
>          /* Vendor PHYs require support from the glue layer. */
> diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
> index ccb5aa8468e0..6ef3236bb6dd 100644
> --- a/include/drm/bridge/dw_hdmi.h
> +++ b/include/drm/bridge/dw_hdmi.h
> @@ -133,6 +133,7 @@ struct dw_hdmi_plat_data {
>      const struct dw_hdmi_phy_ops *phy_ops;
>      const char *phy_name;
>      void *phy_data;
> +    bool phy_force_vendor;
>       /* Synopsys PHY support */
>      const struct dw_hdmi_mpll_config *mpll_cfg;



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 1/6] drm/bridge: dw-hdmi: allow forcing vendor phy-type
@ 2018-09-28  7:51       ` Zheng Yang
  0 siblings, 0 replies; 28+ messages in thread
From: Zheng Yang @ 2018-09-28  7:51 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, Heiko:

Reviewed-by: zhengyang <zhengyang@rock-chips.com>

>
> In some IP implementations the reading of the phy-type may be broken.
> One example are the Rockchip rk3228 and rk3328 socs that use a separate
> vendor-type phy from Innosilicon but still report the HDMI20_TX type.
>
> So allow the glue driver to force the vendor-phy for these cases.
> In the future it may be necessary to allow forcing other types, but
> for now we'll keep it simply to the case actually seen in the wild.
>
> changes in v3:
> - only allow forcing vendor type, as suggested by Laurent
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> Tested-by: Robin Murphy <robin.murphy@arm.com>
> ---
> ?drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 +++-
> ?include/drm/bridge/dw_hdmi.h????????????? | 1 +
> ?2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c 
> b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 5971976284bf..ac37c50d6c4b 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2205,7 +2205,9 @@ static int dw_hdmi_detect_phy(struct dw_hdmi *hdmi)
> ???? unsigned int i;
> ???? u8 phy_type;
> ?-??? phy_type = hdmi_readb(hdmi, HDMI_CONFIG2_ID);
> +??? phy_type = hdmi->plat_data->phy_force_vendor ?
> +??????????????? DW_HDMI_PHY_VENDOR_PHY :
> +??????????????? hdmi_readb(hdmi, HDMI_CONFIG2_ID);
> ????? if (phy_type == DW_HDMI_PHY_VENDOR_PHY) {
> ???????? /* Vendor PHYs require support from the glue layer. */
> diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
> index ccb5aa8468e0..6ef3236bb6dd 100644
> --- a/include/drm/bridge/dw_hdmi.h
> +++ b/include/drm/bridge/dw_hdmi.h
> @@ -133,6 +133,7 @@ struct dw_hdmi_plat_data {
> ???? const struct dw_hdmi_phy_ops *phy_ops;
> ???? const char *phy_name;
> ???? void *phy_data;
> +??? bool phy_force_vendor;
> ????? /* Synopsys PHY support */
> ???? const struct dw_hdmi_mpll_config *mpll_cfg;

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Fwd: [PATCH v5 2/6] drm/rockchip: dw_hdmi: Allow outputs that don't need output switching
       [not found]   ` <6d4ee8b5-a1fa-23b7-88db-32b2c02833cb@rock-chips.com>
@ 2018-09-28  7:52       ` Zheng Yang
  0 siblings, 0 replies; 28+ messages in thread
From: Zheng Yang @ 2018-09-28  7:52 UTC (permalink / raw)
  To: Sandy Huang, architt, a.hajda
  Cc: Jose Abreu, algea.cao, Heiko Stuebner, jonas, dri-devel,
	linux-rockchip, Laurent Pinchart, linux-arm-kernel

Hi, Heiko:

Hi, Heiko:

Hi, Heiko:

Reviewed-by: zhengyang <zhengyang@rock-chips.com>

>
> So far we always encountered socs with 2 output crtcs needing the driver
> to tell the hdmi block which output to connect to. But there also exist
> socs with only one crtc like the rk3228, rk3328 and rk3368.
>
> So adapt the register field to simply carry a negative value to signal
> that no output-switching is necessary.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> Tested-by: Robin Murphy <robin.murphy@arm.com>
>
> changes in v3:
> - fixed wording issue found by Robin Murphy
> ---
>  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c 
> b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> index 11309a2a4e43..b09c3531305b 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> @@ -36,7 +36,7 @@
>   * @lcdsel_lit: reg value of selecting vop little for HDMI
>   */
>  struct rockchip_hdmi_chip_data {
> -    u32    lcdsel_grf_reg;
> +    int    lcdsel_grf_reg;
>      u32    lcdsel_big;
>      u32    lcdsel_lit;
>  };
> @@ -245,6 +245,9 @@ static void dw_hdmi_rockchip_encoder_enable(struct 
> drm_encoder *encoder)
>      u32 val;
>      int ret;
>  +    if (hdmi->chip_data->lcdsel_grf_reg < 0)
> +        return;
> +
>      ret = drm_of_encoder_active_endpoint_id(hdmi->dev->of_node, 
> encoder);
>      if (ret)
>          val = hdmi->chip_data->lcdsel_lit;



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Fwd: [PATCH v5 2/6] drm/rockchip: dw_hdmi: Allow outputs that don't need output switching
@ 2018-09-28  7:52       ` Zheng Yang
  0 siblings, 0 replies; 28+ messages in thread
From: Zheng Yang @ 2018-09-28  7:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, Heiko:

Hi, Heiko:

Hi, Heiko:

Reviewed-by: zhengyang <zhengyang@rock-chips.com>

>
> So far we always encountered socs with 2 output crtcs needing the driver
> to tell the hdmi block which output to connect to. But there also exist
> socs with only one crtc like the rk3228, rk3328 and rk3368.
>
> So adapt the register field to simply carry a negative value to signal
> that no output-switching is necessary.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> Tested-by: Robin Murphy <robin.murphy@arm.com>
>
> changes in v3:
> - fixed wording issue found by Robin Murphy
> ---
> ?drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 5 ++++-
> ?1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c 
> b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> index 11309a2a4e43..b09c3531305b 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> @@ -36,7 +36,7 @@
> ? * @lcdsel_lit: reg value of selecting vop little for HDMI
> ? */
> ?struct rockchip_hdmi_chip_data {
> -??? u32??? lcdsel_grf_reg;
> +??? int??? lcdsel_grf_reg;
> ???? u32??? lcdsel_big;
> ???? u32??? lcdsel_lit;
> ?};
> @@ -245,6 +245,9 @@ static void dw_hdmi_rockchip_encoder_enable(struct 
> drm_encoder *encoder)
> ???? u32 val;
> ???? int ret;
> ?+??? if (hdmi->chip_data->lcdsel_grf_reg < 0)
> +??????? return;
> +
> ???? ret = drm_of_encoder_active_endpoint_id(hdmi->dev->of_node, 
> encoder);
> ???? if (ret)
> ???????? val = hdmi->chip_data->lcdsel_lit;

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Fwd: [PATCH v5 4/6] drm/rockchip: dw_hdmi: allow including external phys
       [not found]   ` <4187b1f6-9682-6c3e-741e-0374e3e9165b@rock-chips.com>
@ 2018-09-28  7:52       ` Zheng Yang
  0 siblings, 0 replies; 28+ messages in thread
From: Zheng Yang @ 2018-09-28  7:52 UTC (permalink / raw)
  To: Sandy Huang, architt, a.hajda
  Cc: Jose Abreu, algea.cao, Heiko Stuebner, jonas, dri-devel,
	linux-rockchip, Laurent Pinchart, linux-arm-kernel

Hi, Heiko:

Reviewed-by: zhengyang <zhengyang@rock-chips.com>

> Some variants of the dw-hdmi on Rockchip socs use a separate phy block
> accessed via the generic phy framework, so allow them to be included
> if such a phy reference is found.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> Tested-by: Robin Murphy <robin.murphy@arm.com>
> ---
>  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c 
> b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> index b09c3531305b..57e76dfd5f6d 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> @@ -11,6 +11,7 @@
>  #include <linux/mfd/syscon.h>
>  #include <linux/module.h>
>  #include <linux/platform_device.h>
> +#include <linux/phy/phy.h>
>  #include <linux/regmap.h>
>   #include <drm/drm_of.h>
> @@ -49,6 +50,7 @@ struct rockchip_hdmi {
>      struct clk *vpll_clk;
>      struct clk *grf_clk;
>      struct dw_hdmi *hdmi;
> +    struct phy *phy;
>  };
>   #define to_rockchip_hdmi(x)    container_of(x, struct rockchip_hdmi, x)
> @@ -376,6 +378,14 @@ static int dw_hdmi_rockchip_bind(struct device 
> *dev, struct device *master,
>          return ret;
>      }
>  +    hdmi->phy = devm_phy_optional_get(dev, "hdmi");
> +    if (IS_ERR(hdmi->phy)) {
> +        ret = PTR_ERR(hdmi->phy);
> +        if (ret != -EPROBE_DEFER)
> +            DRM_DEV_ERROR(hdmi->dev, "failed to get phy\n");
> +        return ret;
> +    }
> +
>      drm_encoder_helper_add(encoder, 
> &dw_hdmi_rockchip_encoder_helper_funcs);
>      drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs,
>               DRM_MODE_ENCODER_TMDS, NULL);



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Fwd: [PATCH v5 4/6] drm/rockchip: dw_hdmi: allow including external phys
@ 2018-09-28  7:52       ` Zheng Yang
  0 siblings, 0 replies; 28+ messages in thread
From: Zheng Yang @ 2018-09-28  7:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, Heiko:

Reviewed-by: zhengyang <zhengyang@rock-chips.com>

> Some variants of the dw-hdmi on Rockchip socs use a separate phy block
> accessed via the generic phy framework, so allow them to be included
> if such a phy reference is found.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> Tested-by: Robin Murphy <robin.murphy@arm.com>
> ---
> ?drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 10 ++++++++++
> ?1 file changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c 
> b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> index b09c3531305b..57e76dfd5f6d 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> @@ -11,6 +11,7 @@
> ?#include <linux/mfd/syscon.h>
> ?#include <linux/module.h>
> ?#include <linux/platform_device.h>
> +#include <linux/phy/phy.h>
> ?#include <linux/regmap.h>
> ? #include <drm/drm_of.h>
> @@ -49,6 +50,7 @@ struct rockchip_hdmi {
> ???? struct clk *vpll_clk;
> ???? struct clk *grf_clk;
> ???? struct dw_hdmi *hdmi;
> +??? struct phy *phy;
> ?};
> ? #define to_rockchip_hdmi(x)??? container_of(x, struct rockchip_hdmi, x)
> @@ -376,6 +378,14 @@ static int dw_hdmi_rockchip_bind(struct device 
> *dev, struct device *master,
> ???????? return ret;
> ???? }
> ?+??? hdmi->phy = devm_phy_optional_get(dev, "hdmi");
> +??? if (IS_ERR(hdmi->phy)) {
> +??????? ret = PTR_ERR(hdmi->phy);
> +??????? if (ret != -EPROBE_DEFER)
> +??????????? DRM_DEV_ERROR(hdmi->dev, "failed to get phy\n");
> +??????? return ret;
> +??? }
> +
> ???? drm_encoder_helper_add(encoder, 
> &dw_hdmi_rockchip_encoder_helper_funcs);
> ???? drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs,
> ????????????? DRM_MODE_ENCODER_TMDS, NULL);

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Fwd: [PATCH v5 5/6] drm/rockchip: dw_hdmi: store rockchip_hdmi reference in phy_data object
       [not found]   ` <3a8b88a3-ec0c-cf39-0a97-a941068318c2@rock-chips.com>
@ 2018-09-28  7:52       ` Zheng Yang
  0 siblings, 0 replies; 28+ messages in thread
From: Zheng Yang @ 2018-09-28  7:52 UTC (permalink / raw)
  To: Sandy Huang, Heiko Stuebner, architt, a.hajda, Jose.Abreu, algea.cao

Hi, Heiko:

Reviewed-by: zhengyang <zhengyang@rock-chips.com>

>
> When using special phy handling operations we'll often need access to
> the rockchip_hdmi struct.
>
> As the chip-data that occupies the phy_data pointer initially gets
> assigned to the rockchip_hdmi struct, we can now re-use this phy_data
> pointer to hold the reference to the rockchip_hdmi struct and use this
> reference later on.
>
> Inspiration for this comes from meson and sunxi dw-hdmi, which are using
> the same method.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> Tested-by: Robin Murphy <robin.murphy@arm.com>
>
> changes in v3:
> - reword commit message
> ---
>  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c 
> b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> index 57e76dfd5f6d..19f002fa0a09 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> @@ -335,7 +335,7 @@ static int dw_hdmi_rockchip_bind(struct device 
> *dev, struct device *master,
>                   void *data)
>  {
>      struct platform_device *pdev = to_platform_device(dev);
> -    const struct dw_hdmi_plat_data *plat_data;
> +    struct dw_hdmi_plat_data *plat_data;
>      const struct of_device_id *match;
>      struct drm_device *drm = data;
>      struct drm_encoder *encoder;
> @@ -350,9 +350,14 @@ static int dw_hdmi_rockchip_bind(struct device 
> *dev, struct device *master,
>          return -ENOMEM;
>       match = of_match_node(dw_hdmi_rockchip_dt_ids, pdev->dev.of_node);
> -    plat_data = match->data;
> +    plat_data = devm_kmemdup(&pdev->dev, match->data,
> +                         sizeof(*plat_data), GFP_KERNEL);
> +    if (!plat_data)
> +        return -ENOMEM;
> +
>      hdmi->dev = &pdev->dev;
>      hdmi->chip_data = plat_data->phy_data;
> +    plat_data->phy_data = hdmi;
>      encoder = &hdmi->encoder;
>       encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, 
> dev->of_node);



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Fwd: [PATCH v5 5/6] drm/rockchip: dw_hdmi: store rockchip_hdmi reference in phy_data object
@ 2018-09-28  7:52       ` Zheng Yang
  0 siblings, 0 replies; 28+ messages in thread
From: Zheng Yang @ 2018-09-28  7:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, Heiko:

Reviewed-by: zhengyang <zhengyang@rock-chips.com>

>
> When using special phy handling operations we'll often need access to
> the rockchip_hdmi struct.
>
> As the chip-data that occupies the phy_data pointer initially gets
> assigned to the rockchip_hdmi struct, we can now re-use this phy_data
> pointer to hold the reference to the rockchip_hdmi struct and use this
> reference later on.
>
> Inspiration for this comes from meson and sunxi dw-hdmi, which are using
> the same method.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> Tested-by: Robin Murphy <robin.murphy@arm.com>
>
> changes in v3:
> - reword commit message
> ---
> ?drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 9 +++++++--
> ?1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c 
> b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> index 57e76dfd5f6d..19f002fa0a09 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> @@ -335,7 +335,7 @@ static int dw_hdmi_rockchip_bind(struct device 
> *dev, struct device *master,
> ????????????????? void *data)
> ?{
> ???? struct platform_device *pdev = to_platform_device(dev);
> -??? const struct dw_hdmi_plat_data *plat_data;
> +??? struct dw_hdmi_plat_data *plat_data;
> ???? const struct of_device_id *match;
> ???? struct drm_device *drm = data;
> ???? struct drm_encoder *encoder;
> @@ -350,9 +350,14 @@ static int dw_hdmi_rockchip_bind(struct device 
> *dev, struct device *master,
> ???????? return -ENOMEM;
> ????? match = of_match_node(dw_hdmi_rockchip_dt_ids, pdev->dev.of_node);
> -??? plat_data = match->data;
> +??? plat_data = devm_kmemdup(&pdev->dev, match->data,
> +???????????????????????? sizeof(*plat_data), GFP_KERNEL);
> +??? if (!plat_data)
> +??????? return -ENOMEM;
> +
> ???? hdmi->dev = &pdev->dev;
> ???? hdmi->chip_data = plat_data->phy_data;
> +??? plat_data->phy_data = hdmi;
> ???? encoder = &hdmi->encoder;
> ????? encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, 
> dev->of_node);

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Fwd: [PATCH v5 6/6] drm/rockchip: dw_hdmi: add dw-hdmi support for the rk3328
       [not found]   ` <8ec9f7d2-069a-81e4-acf5-050d6b2094f7@rock-chips.com>
@ 2018-09-28  7:52       ` Zheng Yang
  0 siblings, 0 replies; 28+ messages in thread
From: Zheng Yang @ 2018-09-28  7:52 UTC (permalink / raw)
  To: Sandy Huang, architt, a.hajda
  Cc: Jose Abreu, algea.cao, Heiko Stuebner, jonas, dri-devel,
	linux-rockchip, Laurent.pinchart, linux-arm-kernel

Hi, Heiko:

Reviewed-by: zhengyang <zhengyang@rock-chips.com>

>
> The rk3328 uses a dw-hdmi controller with an external hdmi phy from
> Innosilicon which uses the generic phy framework for access.
> Add the necessary data and the compatible for the rk3328 to the
> rockchip dw-hdmi driver.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> Tested-by: Robin Murphy <robin.murphy@arm.com>
> Acked-by: Rob Herring <robh@kernel.org>
>
> changes in v5:
> - disable CEC_5V option to make CEC actually work (Jonas)
> changes in v3:
> - reword as suggested by Rob to show that it's a dw-hdmi + Inno phy
> ---
>  .../display/rockchip/dw_hdmi-rockchip.txt     |   1 +
>  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c   | 102 ++++++++++++++++++
>  2 files changed, 103 insertions(+)
>
> diff --git 
> a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt 
> b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
> index 937bfb472e1d..39143424a474 100644
> --- 
> a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
> +++ 
> b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
> @@ -13,6 +13,7 @@ Required properties:
>   - compatible: should be one of the following:
>          "rockchip,rk3288-dw-hdmi"
> +        "rockchip,rk3328-dw-hdmi"
>          "rockchip,rk3399-dw-hdmi"
>  - reg: See dw_hdmi.txt.
>  - reg-io-width: See dw_hdmi.txt. Shall be 4.
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c 
> b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> index 19f002fa0a09..0566def18d2d 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> @@ -25,6 +25,24 @@
>   #define RK3288_GRF_SOC_CON6        0x025C
>  #define RK3288_HDMI_LCDC_SEL        BIT(4)
> +#define RK3328_GRF_SOC_CON2        0x0408
> +
> +#define RK3328_HDMI_SDAIN_MSK        BIT(11)
> +#define RK3328_HDMI_SCLIN_MSK        BIT(10)
> +#define RK3328_HDMI_HPD_IOE        BIT(2)
> +#define RK3328_GRF_SOC_CON3        0x040c
> +/* need to be unset if hdmi or i2c should control voltage */
> +#define RK3328_HDMI_SDA5V_GRF        BIT(15)
> +#define RK3328_HDMI_SCL5V_GRF        BIT(14)
> +#define RK3328_HDMI_HPD5V_GRF        BIT(13)
> +#define RK3328_HDMI_CEC5V_GRF        BIT(12)
> +#define RK3328_GRF_SOC_CON4        0x0410
> +#define RK3328_HDMI_HPD_SARADC        BIT(13)
> +#define RK3328_HDMI_CEC_5V        BIT(11)
> +#define RK3328_HDMI_SDA_5V        BIT(10)
> +#define RK3328_HDMI_SCL_5V        BIT(9)
> +#define RK3328_HDMI_HPD_5V        BIT(8)
> +
>  #define RK3399_GRF_SOC_CON20        0x6250
>  #define RK3399_HDMI_LCDC_SEL        BIT(6)
>  @@ -292,6 +310,64 @@ static const struct drm_encoder_helper_funcs 
> dw_hdmi_rockchip_encoder_helper_fun
>      .atomic_check = dw_hdmi_rockchip_encoder_atomic_check,
>  };
>  +static int dw_hdmi_rockchip_genphy_init(struct dw_hdmi *dw_hdmi, 
> void *data,
> +                 struct drm_display_mode *mode)
> +{
> +    struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
> +
> +    return phy_power_on(hdmi->phy);
> +}
> +
> +static void dw_hdmi_rockchip_genphy_disable(struct dw_hdmi *dw_hdmi, 
> void *data)
> +{
> +    struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
> +
> +    phy_power_off(hdmi->phy);
> +}
> +
> +static enum drm_connector_status
> +dw_hdmi_rk3328_read_hpd(struct dw_hdmi *dw_hdmi, void *data)
> +{
> +    struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
> +    enum drm_connector_status status;
> +
> +    status = dw_hdmi_phy_read_hpd(dw_hdmi, data);
> +
> +    if (status == connector_status_connected)
> +        regmap_write(hdmi->regmap,
> +            RK3328_GRF_SOC_CON4,
> +            HIWORD_UPDATE(RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V,
> +                      RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V));
> +    else
> +        regmap_write(hdmi->regmap,
> +            RK3328_GRF_SOC_CON4,
> +            HIWORD_UPDATE(0, RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V));
> +    return status;
> +}
> +
> +static void dw_hdmi_rk3328_setup_hpd(struct dw_hdmi *dw_hdmi, void 
> *data)
> +{
> +    struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
> +
> +    dw_hdmi_phy_setup_hpd(dw_hdmi, data);
> +
> +    /* Enable and map pins to 3V grf-controlled io-voltage */
> +    regmap_write(hdmi->regmap,
> +        RK3328_GRF_SOC_CON4,
> +        HIWORD_UPDATE(0, RK3328_HDMI_HPD_SARADC | RK3328_HDMI_CEC_5V |
> +                 RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V |
> +                 RK3328_HDMI_HPD_5V));
> +    regmap_write(hdmi->regmap,
> +        RK3328_GRF_SOC_CON3,
> +        HIWORD_UPDATE(0, RK3328_HDMI_SDA5V_GRF | RK3328_HDMI_SCL5V_GRF |
> +                 RK3328_HDMI_HPD5V_GRF | RK3328_HDMI_CEC5V_GRF));
> +    regmap_write(hdmi->regmap,
> +        RK3328_GRF_SOC_CON2,
> +        HIWORD_UPDATE(RK3328_HDMI_SDAIN_MSK | RK3328_HDMI_SCLIN_MSK,
> +                  RK3328_HDMI_SDAIN_MSK | RK3328_HDMI_SCLIN_MSK |
> +                  RK3328_HDMI_HPD_IOE));
> +}
> +
>  static struct rockchip_hdmi_chip_data rk3288_chip_data = {
>      .lcdsel_grf_reg = RK3288_GRF_SOC_CON6,
>      .lcdsel_big = HIWORD_UPDATE(0, RK3288_HDMI_LCDC_SEL),
> @@ -306,6 +382,29 @@ static const struct dw_hdmi_plat_data 
> rk3288_hdmi_drv_data = {
>      .phy_data = &rk3288_chip_data,
>  };
>  +static const struct dw_hdmi_phy_ops rk3328_hdmi_phy_ops = {
> +    .init        = dw_hdmi_rockchip_genphy_init,
> +    .disable    = dw_hdmi_rockchip_genphy_disable,
> +    .read_hpd    = dw_hdmi_rk3328_read_hpd,
> +    .update_hpd    = dw_hdmi_phy_update_hpd,
> +    .setup_hpd    = dw_hdmi_rk3328_setup_hpd,
> +};
> +
> +static struct rockchip_hdmi_chip_data rk3328_chip_data = {
> +    .lcdsel_grf_reg = -1,
> +};
> +
> +static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = {
> +    .mode_valid = dw_hdmi_rockchip_mode_valid,
> +    .mpll_cfg = rockchip_mpll_cfg,
> +    .cur_ctr = rockchip_cur_ctr,
> +    .phy_config = rockchip_phy_config,
> +    .phy_data = &rk3328_chip_data,
> +    .phy_ops = &rk3328_hdmi_phy_ops,
> +    .phy_name = "inno_dw_hdmi_phy2",
> +    .phy_force_vendor = true,
> +};
> +
>  static struct rockchip_hdmi_chip_data rk3399_chip_data = {
>      .lcdsel_grf_reg = RK3399_GRF_SOC_CON20,
>      .lcdsel_big = HIWORD_UPDATE(0, RK3399_HDMI_LCDC_SEL),
> @@ -324,6 +423,9 @@ static const struct of_device_id 
> dw_hdmi_rockchip_dt_ids[] = {
>      { .compatible = "rockchip,rk3288-dw-hdmi",
>        .data = &rk3288_hdmi_drv_data
>      },
> +    { .compatible = "rockchip,rk3328-dw-hdmi",
> +      .data = &rk3328_hdmi_drv_data
> +    },
>      { .compatible = "rockchip,rk3399-dw-hdmi",
>        .data = &rk3399_hdmi_drv_data
>      },




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Fwd: [PATCH v5 6/6] drm/rockchip: dw_hdmi: add dw-hdmi support for the rk3328
@ 2018-09-28  7:52       ` Zheng Yang
  0 siblings, 0 replies; 28+ messages in thread
From: Zheng Yang @ 2018-09-28  7:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, Heiko:

Reviewed-by: zhengyang <zhengyang@rock-chips.com>

>
> The rk3328 uses a dw-hdmi controller with an external hdmi phy from
> Innosilicon which uses the generic phy framework for access.
> Add the necessary data and the compatible for the rk3328 to the
> rockchip dw-hdmi driver.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> Tested-by: Robin Murphy <robin.murphy@arm.com>
> Acked-by: Rob Herring <robh@kernel.org>
>
> changes in v5:
> - disable CEC_5V option to make CEC actually work (Jonas)
> changes in v3:
> - reword as suggested by Rob to show that it's a dw-hdmi + Inno phy
> ---
> ?.../display/rockchip/dw_hdmi-rockchip.txt???? |?? 1 +
> ?drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c?? | 102 ++++++++++++++++++
> ?2 files changed, 103 insertions(+)
>
> diff --git 
> a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt 
> b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
> index 937bfb472e1d..39143424a474 100644
> --- 
> a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
> +++ 
> b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
> @@ -13,6 +13,7 @@ Required properties:
> ? - compatible: should be one of the following:
> ???????? "rockchip,rk3288-dw-hdmi"
> +??????? "rockchip,rk3328-dw-hdmi"
> ???????? "rockchip,rk3399-dw-hdmi"
> ?- reg: See dw_hdmi.txt.
> ?- reg-io-width: See dw_hdmi.txt. Shall be 4.
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c 
> b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> index 19f002fa0a09..0566def18d2d 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> @@ -25,6 +25,24 @@
> ? #define RK3288_GRF_SOC_CON6??????? 0x025C
> ?#define RK3288_HDMI_LCDC_SEL??????? BIT(4)
> +#define RK3328_GRF_SOC_CON2??????? 0x0408
> +
> +#define RK3328_HDMI_SDAIN_MSK??????? BIT(11)
> +#define RK3328_HDMI_SCLIN_MSK??????? BIT(10)
> +#define RK3328_HDMI_HPD_IOE??????? BIT(2)
> +#define RK3328_GRF_SOC_CON3??????? 0x040c
> +/* need to be unset if hdmi or i2c should control voltage */
> +#define RK3328_HDMI_SDA5V_GRF??????? BIT(15)
> +#define RK3328_HDMI_SCL5V_GRF??????? BIT(14)
> +#define RK3328_HDMI_HPD5V_GRF??????? BIT(13)
> +#define RK3328_HDMI_CEC5V_GRF??????? BIT(12)
> +#define RK3328_GRF_SOC_CON4??????? 0x0410
> +#define RK3328_HDMI_HPD_SARADC??????? BIT(13)
> +#define RK3328_HDMI_CEC_5V??????? BIT(11)
> +#define RK3328_HDMI_SDA_5V??????? BIT(10)
> +#define RK3328_HDMI_SCL_5V??????? BIT(9)
> +#define RK3328_HDMI_HPD_5V??????? BIT(8)
> +
> ?#define RK3399_GRF_SOC_CON20??????? 0x6250
> ?#define RK3399_HDMI_LCDC_SEL??????? BIT(6)
> ?@@ -292,6 +310,64 @@ static const struct drm_encoder_helper_funcs 
> dw_hdmi_rockchip_encoder_helper_fun
> ???? .atomic_check = dw_hdmi_rockchip_encoder_atomic_check,
> ?};
> ?+static int dw_hdmi_rockchip_genphy_init(struct dw_hdmi *dw_hdmi, 
> void *data,
> +???????????????? struct drm_display_mode *mode)
> +{
> +??? struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
> +
> +??? return phy_power_on(hdmi->phy);
> +}
> +
> +static void dw_hdmi_rockchip_genphy_disable(struct dw_hdmi *dw_hdmi, 
> void *data)
> +{
> +??? struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
> +
> +??? phy_power_off(hdmi->phy);
> +}
> +
> +static enum drm_connector_status
> +dw_hdmi_rk3328_read_hpd(struct dw_hdmi *dw_hdmi, void *data)
> +{
> +??? struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
> +??? enum drm_connector_status status;
> +
> +??? status = dw_hdmi_phy_read_hpd(dw_hdmi, data);
> +
> +??? if (status == connector_status_connected)
> +??????? regmap_write(hdmi->regmap,
> +??????????? RK3328_GRF_SOC_CON4,
> +??????????? HIWORD_UPDATE(RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V,
> +????????????????????? RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V));
> +??? else
> +??????? regmap_write(hdmi->regmap,
> +??????????? RK3328_GRF_SOC_CON4,
> +??????????? HIWORD_UPDATE(0, RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V));
> +??? return status;
> +}
> +
> +static void dw_hdmi_rk3328_setup_hpd(struct dw_hdmi *dw_hdmi, void 
> *data)
> +{
> +??? struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
> +
> +??? dw_hdmi_phy_setup_hpd(dw_hdmi, data);
> +
> +??? /* Enable and map pins to 3V grf-controlled io-voltage */
> +??? regmap_write(hdmi->regmap,
> +??????? RK3328_GRF_SOC_CON4,
> +??????? HIWORD_UPDATE(0, RK3328_HDMI_HPD_SARADC | RK3328_HDMI_CEC_5V |
> +???????????????? RK3328_HDMI_SDA_5V | RK3328_HDMI_SCL_5V |
> +???????????????? RK3328_HDMI_HPD_5V));
> +??? regmap_write(hdmi->regmap,
> +??????? RK3328_GRF_SOC_CON3,
> +??????? HIWORD_UPDATE(0, RK3328_HDMI_SDA5V_GRF | RK3328_HDMI_SCL5V_GRF |
> +???????????????? RK3328_HDMI_HPD5V_GRF | RK3328_HDMI_CEC5V_GRF));
> +??? regmap_write(hdmi->regmap,
> +??????? RK3328_GRF_SOC_CON2,
> +??????? HIWORD_UPDATE(RK3328_HDMI_SDAIN_MSK | RK3328_HDMI_SCLIN_MSK,
> +????????????????? RK3328_HDMI_SDAIN_MSK | RK3328_HDMI_SCLIN_MSK |
> +????????????????? RK3328_HDMI_HPD_IOE));
> +}
> +
> ?static struct rockchip_hdmi_chip_data rk3288_chip_data = {
> ???? .lcdsel_grf_reg = RK3288_GRF_SOC_CON6,
> ???? .lcdsel_big = HIWORD_UPDATE(0, RK3288_HDMI_LCDC_SEL),
> @@ -306,6 +382,29 @@ static const struct dw_hdmi_plat_data 
> rk3288_hdmi_drv_data = {
> ???? .phy_data = &rk3288_chip_data,
> ?};
> ?+static const struct dw_hdmi_phy_ops rk3328_hdmi_phy_ops = {
> +??? .init??????? = dw_hdmi_rockchip_genphy_init,
> +??? .disable??? = dw_hdmi_rockchip_genphy_disable,
> +??? .read_hpd??? = dw_hdmi_rk3328_read_hpd,
> +??? .update_hpd??? = dw_hdmi_phy_update_hpd,
> +??? .setup_hpd??? = dw_hdmi_rk3328_setup_hpd,
> +};
> +
> +static struct rockchip_hdmi_chip_data rk3328_chip_data = {
> +??? .lcdsel_grf_reg = -1,
> +};
> +
> +static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = {
> +??? .mode_valid = dw_hdmi_rockchip_mode_valid,
> +??? .mpll_cfg = rockchip_mpll_cfg,
> +??? .cur_ctr = rockchip_cur_ctr,
> +??? .phy_config = rockchip_phy_config,
> +??? .phy_data = &rk3328_chip_data,
> +??? .phy_ops = &rk3328_hdmi_phy_ops,
> +??? .phy_name = "inno_dw_hdmi_phy2",
> +??? .phy_force_vendor = true,
> +};
> +
> ?static struct rockchip_hdmi_chip_data rk3399_chip_data = {
> ???? .lcdsel_grf_reg = RK3399_GRF_SOC_CON20,
> ???? .lcdsel_big = HIWORD_UPDATE(0, RK3399_HDMI_LCDC_SEL),
> @@ -324,6 +423,9 @@ static const struct of_device_id 
> dw_hdmi_rockchip_dt_ids[] = {
> ???? { .compatible = "rockchip,rk3288-dw-hdmi",
> ?????? .data = &rk3288_hdmi_drv_data
> ???? },
> +??? { .compatible = "rockchip,rk3328-dw-hdmi",
> +????? .data = &rk3328_hdmi_drv_data
> +??? },
> ???? { .compatible = "rockchip,rk3399-dw-hdmi",
> ?????? .data = &rk3399_hdmi_drv_data
> ???? },

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v5 1/6] drm/bridge: dw-hdmi: allow forcing vendor phy-type
  2018-09-12 12:47   ` Heiko Stuebner
@ 2018-09-28  8:09     ` Andrzej Hajda
  -1 siblings, 0 replies; 28+ messages in thread
From: Andrzej Hajda @ 2018-09-28  8:09 UTC (permalink / raw)
  To: Heiko Stuebner, architt, hjc
  Cc: Jose.Abreu, algea.cao, jonas, dri-devel, linux-rockchip,
	Laurent.pinchart, linux-arm-kernel, zhengyang

On 12.09.2018 14:47, Heiko Stuebner wrote:
> In some IP implementations the reading of the phy-type may be broken.
> One example are the Rockchip rk3228 and rk3328 socs that use a separate
> vendor-type phy from Innosilicon but still report the HDMI20_TX type.
>
> So allow the glue driver to force the vendor-phy for these cases.
> In the future it may be necessary to allow forcing other types, but
> for now we'll keep it simply to the case actually seen in the wild.
>
> changes in v3:
> - only allow forcing vendor type, as suggested by Laurent
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> Tested-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

 --
Regards
Andrzej

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 1/6] drm/bridge: dw-hdmi: allow forcing vendor phy-type
@ 2018-09-28  8:09     ` Andrzej Hajda
  0 siblings, 0 replies; 28+ messages in thread
From: Andrzej Hajda @ 2018-09-28  8:09 UTC (permalink / raw)
  To: linux-arm-kernel

On 12.09.2018 14:47, Heiko Stuebner wrote:
> In some IP implementations the reading of the phy-type may be broken.
> One example are the Rockchip rk3228 and rk3328 socs that use a separate
> vendor-type phy from Innosilicon but still report the HDMI20_TX type.
>
> So allow the glue driver to force the vendor-phy for these cases.
> In the future it may be necessary to allow forcing other types, but
> for now we'll keep it simply to the case actually seen in the wild.
>
> changes in v3:
> - only allow forcing vendor type, as suggested by Laurent
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> Tested-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

?--
Regards
Andrzej

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v5 0/6] drm/rockchip: hdmi support for rk3328
  2018-09-12 12:47 ` Heiko Stuebner
@ 2018-09-28 11:14   ` Heiko Stuebner
  -1 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-28 11:14 UTC (permalink / raw)
  To: architt
  Cc: Jose.Abreu, algea.cao, linux-rockchip, jonas, dri-devel,
	Laurent.pinchart, linux-arm-kernel, zhengyang

Am Mittwoch, 12. September 2018, 14:47:34 CEST schrieb Heiko Stuebner:
> The rk3228/rk3229 and rk3328 socs started using a new type of hdmi-phy
> from Innosilicon that resides completely separate from the dw-hdmi block
> and gets accessed via mmio.
> 
> Additionally the rk3328 dw-hdmi does not report the vendor-phy type
> but a different one instead, so add the possibility to override the
> phy type when the glue driver knows better than the ip block itself.
> 
> changes in v5:
> - disable CEC_5V option to make CEC actually work (Jonas)
> 
> changes in v4:
> - rebased onto 4.19-rc2 - no actual changes
> - added Rob's Ack on the dw-hdmi compatible
> 
> changes in v3:
> - split off phy driver into a separate series
> - only allow forcing vendor phy type
> - wording fixes and other nits
> 
> changes in v2:
> - phy: prevent overflow in tmdsclk calculation
>   as reported by Martin Cerveny
> - phy: use unsigned long for all tmdsclk rate uses
> - phy: simplify tmds rate calculation
> - dropped patch exporting some dw-hdmi phy functions
>   as a similar patch entered drm-misc already
> 
> Heiko Stuebner (6):
>   drm/bridge: dw-hdmi: allow forcing vendor phy-type
>   drm/rockchip: dw_hdmi: Allow outputs that don't need output switching
>   dt-bindings: allow optional phys in Rockchip dw_hdmi binding
>   drm/rockchip: dw_hdmi: allow including external phys
>   drm/rockchip: dw_hdmi: store rockchip_hdmi reference in phy_data
>     object
>   drm/rockchip: dw_hdmi: add dw-hdmi support for the rk3328

applied to drm-misc-next with the received Reviews


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 0/6] drm/rockchip: hdmi support for rk3328
@ 2018-09-28 11:14   ` Heiko Stuebner
  0 siblings, 0 replies; 28+ messages in thread
From: Heiko Stuebner @ 2018-09-28 11:14 UTC (permalink / raw)
  To: linux-arm-kernel

Am Mittwoch, 12. September 2018, 14:47:34 CEST schrieb Heiko Stuebner:
> The rk3228/rk3229 and rk3328 socs started using a new type of hdmi-phy
> from Innosilicon that resides completely separate from the dw-hdmi block
> and gets accessed via mmio.
> 
> Additionally the rk3328 dw-hdmi does not report the vendor-phy type
> but a different one instead, so add the possibility to override the
> phy type when the glue driver knows better than the ip block itself.
> 
> changes in v5:
> - disable CEC_5V option to make CEC actually work (Jonas)
> 
> changes in v4:
> - rebased onto 4.19-rc2 - no actual changes
> - added Rob's Ack on the dw-hdmi compatible
> 
> changes in v3:
> - split off phy driver into a separate series
> - only allow forcing vendor phy type
> - wording fixes and other nits
> 
> changes in v2:
> - phy: prevent overflow in tmdsclk calculation
>   as reported by Martin Cerveny
> - phy: use unsigned long for all tmdsclk rate uses
> - phy: simplify tmds rate calculation
> - dropped patch exporting some dw-hdmi phy functions
>   as a similar patch entered drm-misc already
> 
> Heiko Stuebner (6):
>   drm/bridge: dw-hdmi: allow forcing vendor phy-type
>   drm/rockchip: dw_hdmi: Allow outputs that don't need output switching
>   dt-bindings: allow optional phys in Rockchip dw_hdmi binding
>   drm/rockchip: dw_hdmi: allow including external phys
>   drm/rockchip: dw_hdmi: store rockchip_hdmi reference in phy_data
>     object
>   drm/rockchip: dw_hdmi: add dw-hdmi support for the rk3328

applied to drm-misc-next with the received Reviews

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2018-09-28 11:14 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-12 12:47 [PATCH v5 0/6] drm/rockchip: hdmi support for rk3328 Heiko Stuebner
2018-09-12 12:47 ` Heiko Stuebner
2018-09-12 12:47 ` [PATCH v5 1/6] drm/bridge: dw-hdmi: allow forcing vendor phy-type Heiko Stuebner
2018-09-12 12:47   ` Heiko Stuebner
     [not found]   ` <1851d56f-b628-2d10-0da7-72c1075b2b9a@rock-chips.com>
2018-09-28  7:51     ` Zheng Yang
2018-09-28  7:51       ` Zheng Yang
2018-09-28  8:09   ` Andrzej Hajda
2018-09-28  8:09     ` Andrzej Hajda
2018-09-12 12:47 ` [PATCH v5 2/6] drm/rockchip: dw_hdmi: Allow outputs that don't need output switching Heiko Stuebner
2018-09-12 12:47   ` Heiko Stuebner
     [not found]   ` <6d4ee8b5-a1fa-23b7-88db-32b2c02833cb@rock-chips.com>
2018-09-28  7:52     ` Fwd: " Zheng Yang
2018-09-28  7:52       ` Zheng Yang
2018-09-12 12:47 ` [PATCH v5 3/6] dt-bindings: allow optional phys in Rockchip dw_hdmi binding Heiko Stuebner
2018-09-12 12:47   ` Heiko Stuebner
2018-09-12 12:47 ` [PATCH v5 4/6] drm/rockchip: dw_hdmi: allow including external phys Heiko Stuebner
2018-09-12 12:47   ` Heiko Stuebner
     [not found]   ` <4187b1f6-9682-6c3e-741e-0374e3e9165b@rock-chips.com>
2018-09-28  7:52     ` Fwd: " Zheng Yang
2018-09-28  7:52       ` Zheng Yang
2018-09-12 12:47 ` [PATCH v5 5/6] drm/rockchip: dw_hdmi: store rockchip_hdmi reference in phy_data object Heiko Stuebner
2018-09-12 12:47   ` Heiko Stuebner
     [not found]   ` <3a8b88a3-ec0c-cf39-0a97-a941068318c2@rock-chips.com>
2018-09-28  7:52     ` Fwd: " Zheng Yang
2018-09-28  7:52       ` Zheng Yang
2018-09-12 12:47 ` [PATCH v5 6/6] drm/rockchip: dw_hdmi: add dw-hdmi support for the rk3328 Heiko Stuebner
2018-09-12 12:47   ` Heiko Stuebner
     [not found]   ` <8ec9f7d2-069a-81e4-acf5-050d6b2094f7@rock-chips.com>
2018-09-28  7:52     ` Fwd: " Zheng Yang
2018-09-28  7:52       ` Zheng Yang
2018-09-28 11:14 ` [PATCH v5 0/6] drm/rockchip: hdmi support for rk3328 Heiko Stuebner
2018-09-28 11:14   ` Heiko Stuebner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.