All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/panel-notatek-nt35510: Fix MTP read init
@ 2020-08-08 22:43 Linus Walleij
  2020-08-10 13:04 ` Daniel Vetter
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2020-08-08 22:43 UTC (permalink / raw)
  To: Thierry Reding, Sam Ravnborg, dri-devel; +Cc: newbytee, Stephan Gerhold

In order to successfully read ID of the MTP panel the
panel MTP control page must be unlocked. Previously
this wasn't encountered because in the setup with this
panel the power wasn't ever really dropped. When power
gets dropped from the panel, MTP needs to be unlocked.

Cc: newbytee@protonmail.com
Cc: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpu/drm/panel/panel-novatek-nt35510.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
index 4a8fa908a2cf..d0cd2128df1d 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
@@ -376,6 +376,10 @@ struct nt35510 {
 };
 
 /* Manufacturer command has strictly this byte sequence */
+static const u8 nt35510_mauc_mtp_read_param[] = { 0xAA, 0x55, 0x25, 0x01 };
+static const u8 nt35510_mauc_mtp_read_setting[] = { 0x01, 0x02, 0x00, 0x20,
+						    0x33, 0x13, 0x00, 0x40,
+						    0x00, 0x00, 0x23, 0x02 };
 static const u8 nt35510_mauc_select_page_0[] = { 0x55, 0xAA, 0x52, 0x08, 0x00 };
 static const u8 nt35510_mauc_select_page_1[] = { 0x55, 0xAA, 0x52, 0x08, 0x01 };
 static const u8 nt35510_vgh_on[] = { 0x01 };
@@ -698,6 +702,18 @@ static int nt35510_power_on(struct nt35510 *nt)
 		usleep_range(120000, 140000);
 	}
 
+	ret = nt35510_send_long(nt, dsi, MCS_CMD_MTP_READ_PARAM,
+				ARRAY_SIZE(nt35510_mauc_mtp_read_param),
+				nt35510_mauc_mtp_read_param);
+	if (ret)
+		return ret;
+
+	ret = nt35510_send_long(nt, dsi, MCS_CMD_MTP_READ_SETTING,
+				ARRAY_SIZE(nt35510_mauc_mtp_read_setting),
+				nt35510_mauc_mtp_read_setting);
+	if (ret)
+		return ret;
+
 	ret = nt35510_read_id(nt);
 	if (ret)
 		return ret;
-- 
2.26.2

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

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

* Re: [PATCH] drm/panel-notatek-nt35510: Fix MTP read init
  2020-08-08 22:43 [PATCH] drm/panel-notatek-nt35510: Fix MTP read init Linus Walleij
@ 2020-08-10 13:04 ` Daniel Vetter
  2020-08-11 20:24   ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2020-08-10 13:04 UTC (permalink / raw)
  To: Linus Walleij
  Cc: newbytee, Thierry Reding, Sam Ravnborg, Stephan Gerhold, dri-devel

On Sun, Aug 09, 2020 at 12:43:22AM +0200, Linus Walleij wrote:
> In order to successfully read ID of the MTP panel the
> panel MTP control page must be unlocked. Previously
> this wasn't encountered because in the setup with this
> panel the power wasn't ever really dropped. When power
> gets dropped from the panel, MTP needs to be unlocked.
> 
> Cc: newbytee@protonmail.com
> Cc: Stephan Gerhold <stephan@gerhold.net>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

I guess this needs to be merged together with the mcde changes, or things
break?

Either way looks reasonable. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/panel/panel-novatek-nt35510.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
> index 4a8fa908a2cf..d0cd2128df1d 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
> @@ -376,6 +376,10 @@ struct nt35510 {
>  };
>  
>  /* Manufacturer command has strictly this byte sequence */
> +static const u8 nt35510_mauc_mtp_read_param[] = { 0xAA, 0x55, 0x25, 0x01 };
> +static const u8 nt35510_mauc_mtp_read_setting[] = { 0x01, 0x02, 0x00, 0x20,
> +						    0x33, 0x13, 0x00, 0x40,
> +						    0x00, 0x00, 0x23, 0x02 };
>  static const u8 nt35510_mauc_select_page_0[] = { 0x55, 0xAA, 0x52, 0x08, 0x00 };
>  static const u8 nt35510_mauc_select_page_1[] = { 0x55, 0xAA, 0x52, 0x08, 0x01 };
>  static const u8 nt35510_vgh_on[] = { 0x01 };
> @@ -698,6 +702,18 @@ static int nt35510_power_on(struct nt35510 *nt)
>  		usleep_range(120000, 140000);
>  	}
>  
> +	ret = nt35510_send_long(nt, dsi, MCS_CMD_MTP_READ_PARAM,
> +				ARRAY_SIZE(nt35510_mauc_mtp_read_param),
> +				nt35510_mauc_mtp_read_param);
> +	if (ret)
> +		return ret;
> +
> +	ret = nt35510_send_long(nt, dsi, MCS_CMD_MTP_READ_SETTING,
> +				ARRAY_SIZE(nt35510_mauc_mtp_read_setting),
> +				nt35510_mauc_mtp_read_setting);
> +	if (ret)
> +		return ret;
> +
>  	ret = nt35510_read_id(nt);
>  	if (ret)
>  		return ret;
> -- 
> 2.26.2
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/panel-notatek-nt35510: Fix MTP read init
  2020-08-10 13:04 ` Daniel Vetter
@ 2020-08-11 20:24   ` Linus Walleij
  2020-08-11 20:58     ` Daniel Vetter
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2020-08-11 20:24 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: newbytee, Thierry Reding, Sam Ravnborg, Stephan Gerhold,
	open list:DRM PANEL DRIVERS

On Mon, Aug 10, 2020 at 3:04 PM Daniel Vetter <daniel@ffwll.ch> wrote:
> On Sun, Aug 09, 2020 at 12:43:22AM +0200, Linus Walleij wrote:
> > In order to successfully read ID of the MTP panel the
> > panel MTP control page must be unlocked. Previously
> > this wasn't encountered because in the setup with this
> > panel the power wasn't ever really dropped. When power
> > gets dropped from the panel, MTP needs to be unlocked.
> >
> > Cc: newbytee@protonmail.com
> > Cc: Stephan Gerhold <stephan@gerhold.net>
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>
> I guess this needs to be merged together with the mcde changes, or things
> break?

Yes this should be merged first.

> Either way looks reasonable. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Thanks!

BTW I need to merge v5.8 (final) into drm-misc-next so as to get
a smallish fix from the late -rc:s back. It is currently at v5.8-rc2.
Is that something you'd say I can be bold and attempt myself
of should I stay off it?

I asked on dri-devel but didn't get any help there.

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

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

* Re: [PATCH] drm/panel-notatek-nt35510: Fix MTP read init
  2020-08-11 20:24   ` Linus Walleij
@ 2020-08-11 20:58     ` Daniel Vetter
  2020-08-12  9:12       ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2020-08-11 20:58 UTC (permalink / raw)
  To: Linus Walleij, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann
  Cc: newbytee, Thierry Reding, Sam Ravnborg, Stephan Gerhold,
	open list:DRM PANEL DRIVERS

On Tue, Aug 11, 2020 at 10:24 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Mon, Aug 10, 2020 at 3:04 PM Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Sun, Aug 09, 2020 at 12:43:22AM +0200, Linus Walleij wrote:
> > > In order to successfully read ID of the MTP panel the
> > > panel MTP control page must be unlocked. Previously
> > > this wasn't encountered because in the setup with this
> > > panel the power wasn't ever really dropped. When power
> > > gets dropped from the panel, MTP needs to be unlocked.
> > >
> > > Cc: newbytee@protonmail.com
> > > Cc: Stephan Gerhold <stephan@gerhold.net>
> > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> >
> > I guess this needs to be merged together with the mcde changes, or things
> > break?
>
> Yes this should be merged first.
>
> > Either way looks reasonable. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> Thanks!
>
> BTW I need to merge v5.8 (final) into drm-misc-next so as to get
> a smallish fix from the late -rc:s back. It is currently at v5.8-rc2.
> Is that something you'd say I can be bold and attempt myself
> of should I stay off it?
>
> I asked on dri-devel but didn't get any help there.

Hm I also asked Maxime already for a backmerge, I guess it didn't
happen yet. Maybe time for Maarten or Thomas to do it instead. Adding
them all.

Usually maintainers should do this, least to avoid surprises and stuff
when they do the next pull request. And yeah a quick ping on irc
should be enough to make it happen.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/panel-notatek-nt35510: Fix MTP read init
  2020-08-11 20:58     ` Daniel Vetter
@ 2020-08-12  9:12       ` Linus Walleij
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2020-08-12  9:12 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Stephan Gerhold, newbytee, open list:DRM PANEL DRIVERS,
	Thierry Reding, Thomas Zimmermann, Sam Ravnborg

On Tue, Aug 11, 2020 at 10:58 PM Daniel Vetter <daniel@ffwll.ch> wrote:

> > BTW I need to merge v5.8 (final) into drm-misc-next so as to get
> > a smallish fix from the late -rc:s back. It is currently at v5.8-rc2.
> > Is that something you'd say I can be bold and attempt myself
> > of should I stay off it?
> >
> > I asked on dri-devel but didn't get any help there.
>
> Hm I also asked Maxime already for a backmerge, I guess it didn't
> happen yet. Maybe time for Maarten or Thomas to do it instead. Adding
> them all.

OK thanks.

> Usually maintainers should do this, least to avoid surprises and stuff
> when they do the next pull request. And yeah a quick ping on irc
> should be enough to make it happen.

It's vacation time on the northern hemisphere so we can cut them
some slack.

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

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

end of thread, other threads:[~2020-08-12  9:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-08 22:43 [PATCH] drm/panel-notatek-nt35510: Fix MTP read init Linus Walleij
2020-08-10 13:04 ` Daniel Vetter
2020-08-11 20:24   ` Linus Walleij
2020-08-11 20:58     ` Daniel Vetter
2020-08-12  9:12       ` Linus Walleij

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.