2017-03-03 01:51:43

by Brian Norris

[permalink] [raw]
Subject: Re: [PATCH v4 23/23] drm/rockchip: dw-mipi-dsi: add reset control

+ devicetree

Hi,

On Fri, Feb 24, 2017 at 12:55:06PM +0000, John Keeping wrote:
> In order to fully reset the state of the MIPI controller we must assert
> this reset.
>
> This is slightly more complicated than it could be in order to maintain
> compatibility with device trees that do not specify the reset property.
>
> Signed-off-by: John Keeping <[email protected]>
> Reviewed-by: Chris Zhong <[email protected]>
> ---
> v4:
> - Fix error check for devm_reset_control_get() to use ENOENT
> v3:
> - Add Chris' Reviewed-by
> Unchanged in v2
> ---
> drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
> index 0c4bae711e84..30da75667334 100644
> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
> @@ -13,6 +13,7 @@
> #include <linux/module.h>
> #include <linux/of_device.h>
> #include <linux/regmap.h>
> +#include <linux/reset.h>
> #include <linux/mfd/syscon.h>
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_crtc.h>
> @@ -1144,6 +1145,7 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master,
> of_match_device(dw_mipi_dsi_dt_ids, dev);
> const struct dw_mipi_dsi_plat_data *pdata = of_id->data;
> struct platform_device *pdev = to_platform_device(dev);
> + struct reset_control *apb_rst;
> struct drm_device *drm = data;
> struct dw_mipi_dsi *dsi;
> struct resource *res;
> @@ -1182,6 +1184,35 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master,
> return ret;
> }
>
> + /*
> + * Note that the reset was not defined in the initial device tree, so
> + * we have to be prepared for it not being found.
> + */
> + apb_rst = devm_reset_control_get(dev, "apb");

Did this reset ever get documented in the device tree bindings? I
couldn't find it. Perhaps a follow-up patch is in order?

[...]

Brian


2017-03-03 11:58:41

by John Keeping

[permalink] [raw]
Subject: [PATCH] dt-bindings: display: rk3288-mipi-dsi: add reset property

This reset is required in order to fully reset the internal state of the
MIPI controller.

Signed-off-by: John Keeping <[email protected]>
---
On Thu, 2 Mar 2017 13:56:46 -0800, Brian Norris wrote:
> On Fri, Feb 24, 2017 at 12:55:06PM +0000, John Keeping wrote:
> > + /*
> > + * Note that the reset was not defined in the initial device tree, so
> > + * we have to be prepared for it not being found.
> > + */
> > + apb_rst = devm_reset_control_get(dev, "apb");
>
> Did this reset ever get documented in the device tree bindings? I
> couldn't find it. Perhaps a follow-up patch is in order?

Here's a patch to do that.

.../devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt | 7 +++++++
1 file changed, 7 insertions(+)

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 1753f0cc6fad..28d0b437d3cd 100644
--- a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
+++ b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
@@ -13,8 +13,13 @@ Required properties:
- ports: contain a port node with endpoint definitions as defined in [2].
For vopb,set the reg = <0> and set the reg = <1> for vopl.

+Optional properties:
+- resets: list of phandle + reset specifier pairs, as described in [3].
+- reset-names: string reset name, must be "apb".
+
[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
[2] Documentation/devicetree/bindings/media/video-interfaces.txt
+[3] Documentation/devicetree/bindings/reset/reset.txt

Example:
mipi_dsi: mipi@ff960000 {
@@ -25,6 +30,8 @@ Example:
interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cru SCLK_MIPI_24M>, <&cru PCLK_MIPI_DSI0>;
clock-names = "ref", "pclk";
+ resets = <&cru SRST_MIPIDSI0>;
+ reset-names = "apb";
rockchip,grf = <&grf>;
status = "okay";

--
2.12.0.rc2.230.ga28edc07cd.dirty

2017-03-03 20:48:32

by Brian Norris

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: display: rk3288-mipi-dsi: add reset property

On Fri, Mar 03, 2017 at 11:39:45AM +0000, John Keeping wrote:
> This reset is required in order to fully reset the internal state of the
> MIPI controller.
>
> Signed-off-by: John Keeping <[email protected]>
> ---
> On Thu, 2 Mar 2017 13:56:46 -0800, Brian Norris wrote:
> > On Fri, Feb 24, 2017 at 12:55:06PM +0000, John Keeping wrote:
> > > + /*
> > > + * Note that the reset was not defined in the initial device tree, so
> > > + * we have to be prepared for it not being found.
> > > + */
> > > + apb_rst = devm_reset_control_get(dev, "apb");
> >
> > Did this reset ever get documented in the device tree bindings? I
> > couldn't find it. Perhaps a follow-up patch is in order?
>
> Here's a patch to do that.

FWIW:

Reviewed-by: Brian Norris <[email protected]>

Thanks.

2017-03-06 22:22:20

by Sean Paul

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: display: rk3288-mipi-dsi: add reset property

On Fri, Mar 03, 2017 at 11:39:45AM +0000, John Keeping wrote:
> This reset is required in order to fully reset the internal state of the
> MIPI controller.
>
> Signed-off-by: John Keeping <[email protected]>

I'm sorry I missed this in my review. Adding Rob Herring directly for his ack.

Also,

Reviewed-by: Sean Paul <[email protected]>

> ---
> On Thu, 2 Mar 2017 13:56:46 -0800, Brian Norris wrote:
> > On Fri, Feb 24, 2017 at 12:55:06PM +0000, John Keeping wrote:
> > > + /*
> > > + * Note that the reset was not defined in the initial device tree, so
> > > + * we have to be prepared for it not being found.
> > > + */
> > > + apb_rst = devm_reset_control_get(dev, "apb");
> >
> > Did this reset ever get documented in the device tree bindings? I
> > couldn't find it. Perhaps a follow-up patch is in order?
>
> Here's a patch to do that.
>
> .../devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> 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 1753f0cc6fad..28d0b437d3cd 100644
> --- a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
> +++ b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
> @@ -13,8 +13,13 @@ Required properties:
> - ports: contain a port node with endpoint definitions as defined in [2].
> For vopb,set the reg = <0> and set the reg = <1> for vopl.
>
> +Optional properties:
> +- resets: list of phandle + reset specifier pairs, as described in [3].
> +- reset-names: string reset name, must be "apb".
> +
> [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
> [2] Documentation/devicetree/bindings/media/video-interfaces.txt
> +[3] Documentation/devicetree/bindings/reset/reset.txt
>
> Example:
> mipi_dsi: mipi@ff960000 {
> @@ -25,6 +30,8 @@ Example:
> interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
> clocks = <&cru SCLK_MIPI_24M>, <&cru PCLK_MIPI_DSI0>;
> clock-names = "ref", "pclk";
> + resets = <&cru SRST_MIPIDSI0>;
> + reset-names = "apb";
> rockchip,grf = <&grf>;
> status = "okay";
>
> --
> 2.12.0.rc2.230.ga28edc07cd.dirty
>
> _______________________________________________
> dri-devel mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

2017-03-12 12:07:06

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: display: rk3288-mipi-dsi: add reset property

On Fri, Mar 03, 2017 at 11:39:45AM +0000, John Keeping wrote:
> This reset is required in order to fully reset the internal state of the
> MIPI controller.
>
> Signed-off-by: John Keeping <[email protected]>
> ---
> On Thu, 2 Mar 2017 13:56:46 -0800, Brian Norris wrote:
> > On Fri, Feb 24, 2017 at 12:55:06PM +0000, John Keeping wrote:
> > > + /*
> > > + * Note that the reset was not defined in the initial device tree, so
> > > + * we have to be prepared for it not being found.
> > > + */
> > > + apb_rst = devm_reset_control_get(dev, "apb");
> >
> > Did this reset ever get documented in the device tree bindings? I
> > couldn't find it. Perhaps a follow-up patch is in order?
>
> Here's a patch to do that.
>
> .../devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt | 7 +++++++
> 1 file changed, 7 insertions(+)

Acked-by: Rob Herring <[email protected]>

2017-04-04 13:15:39

by John Keeping

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: display: rk3288-mipi-dsi: add reset property

Hi Sean,

On Sun, 12 Mar 2017 07:06:59 -0500, Rob Herring wrote:

> On Fri, Mar 03, 2017 at 11:39:45AM +0000, John Keeping wrote:
> > This reset is required in order to fully reset the internal state of the
> > MIPI controller.
> >
> > Signed-off-by: John Keeping <[email protected]>
> > ---
> > On Thu, 2 Mar 2017 13:56:46 -0800, Brian Norris wrote:
> > > On Fri, Feb 24, 2017 at 12:55:06PM +0000, John Keeping wrote:
> > > > + /*
> > > > + * Note that the reset was not defined in the initial device tree, so
> > > > + * we have to be prepared for it not being found.
> > > > + */
> > > > + apb_rst = devm_reset_control_get(dev, "apb");
> > >
> > > Did this reset ever get documented in the device tree bindings? I
> > > couldn't find it. Perhaps a follow-up patch is in order?
> >
> > Here's a patch to do that.
> >
> > .../devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt | 7 +++++++
> > 1 file changed, 7 insertions(+)
>
> Acked-by: Rob Herring <[email protected]>

I don't see this patch in linux-next, so I guess it has fallen through
the cracks somewhere. Since we have Rob's ack, can you pick this via
drm-misc?


Regards,
John

2017-04-04 18:30:53

by Sean Paul

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: display: rk3288-mipi-dsi: add reset property

On Tue, Apr 04, 2017 at 02:15:13PM +0100, John Keeping wrote:
> Hi Sean,
>
> On Sun, 12 Mar 2017 07:06:59 -0500, Rob Herring wrote:
>
> > On Fri, Mar 03, 2017 at 11:39:45AM +0000, John Keeping wrote:
> > > This reset is required in order to fully reset the internal state of the
> > > MIPI controller.
> > >
> > > Signed-off-by: John Keeping <[email protected]>
> > > ---
> > > On Thu, 2 Mar 2017 13:56:46 -0800, Brian Norris wrote:
> > > > On Fri, Feb 24, 2017 at 12:55:06PM +0000, John Keeping wrote:
> > > > > + /*
> > > > > + * Note that the reset was not defined in the initial device tree, so
> > > > > + * we have to be prepared for it not being found.
> > > > > + */
> > > > > + apb_rst = devm_reset_control_get(dev, "apb");
> > > >
> > > > Did this reset ever get documented in the device tree bindings? I
> > > > couldn't find it. Perhaps a follow-up patch is in order?
> > >
> > > Here's a patch to do that.
> > >
> > > .../devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt | 7 +++++++
> > > 1 file changed, 7 insertions(+)
> >
> > Acked-by: Rob Herring <[email protected]>
>
> I don't see this patch in linux-next, so I guess it has fallen through
> the cracks somewhere. Since we have Rob's ack, can you pick this via
> drm-misc?
>

Yeah, sorry about that. Applied to misc-next

Sean

>
> Regards,
> John

--
Sean Paul, Software Engineer, Google / Chromium OS