mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javierm@redhat.com>
To: Thomas Zimmermann <tzimmermann@suse.de>, linux-kernel@vger.kernel.org
Cc: ipedrosa@redhat.com, David Airlie <airlied@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Marcus Folkesson <marcus.folkesson@gmail.com>,
	Maxime Ripard <mripard@kernel.org>,
	Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/sitronix/st7571-i2c: Make the reset GPIO to be optional
Date: Mon, 14 Jul 2025 11:47:35 +0200	[thread overview]
Message-ID: <87tt3fksso.fsf@minerva.mail-host-address-is-not-set> (raw)
In-Reply-To: <a5cb70b2-f724-4d5e-910c-0b92dd759ebf@suse.de>

Thomas Zimmermann <tzimmermann@suse.de> writes:

> Hi
>
> Am 10.07.25 um 12:24 schrieb Javier Martinez Canillas:
>> Some Sitronix LCD controllers (such as the ST7567) don't have a reset pin,
>> so lets relax this in the driver and make the reset GPIO to be optional.
>>
>> The devm_gpiod_get_optional() helper is similar to devm_gpiod_get(), but
>> returns NULL when there isn't a reset-gpios property defined in a DT node.
>>
>> The DT binding schema for "sitronix,st7571" that require a reset GPIO will
>> enforce the "reset-gpios" to be present, due being a required DT property.
>> But in the driver itself the property can be made optional if not defined.
>>
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>> ---
>>
>>   drivers/gpu/drm/sitronix/st7571-i2c.c | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/sitronix/st7571-i2c.c b/drivers/gpu/drm/sitronix/st7571-i2c.c
>> index eec846892962..73e8db25f895 100644
>> --- a/drivers/gpu/drm/sitronix/st7571-i2c.c
>> +++ b/drivers/gpu/drm/sitronix/st7571-i2c.c
>> @@ -802,15 +802,19 @@ static int st7571_parse_dt(struct st7571_device *st7571)
>>   	st7571->nlines = dt.vactive.typ;
>>   	st7571->ncols = dt.hactive.typ;
>>   
>> -	st7571->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
>> +	st7571->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
>>   	if (IS_ERR(st7571->reset))
>> -		return PTR_ERR(st7571->reset);
>> +		return dev_err_probe(dev, PTR_ERR(st7571->reset),
>> +				     "Failed to get reset gpio\n");
>
> There's struct st7571_panel_data. It could store a flag signalling the 
> expected behavior.
>

Indeed.

> With more effort the panel_data could store a dedicated parse_dt pointer 
> for each panel type. ASAICT the st7567 features a subset of the other 
> type. So there might not be much code duplication.
>

This is a good idea too. I think that will do that for v2.

Thanks a lot for your feedback!

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


  reply	other threads:[~2025-07-14  9:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-10 10:24 [PATCH 0/3] drm/sitronix/st7571-i2c: Add support for the ST7567 Controller Javier Martinez Canillas
2025-07-10 10:24 ` [PATCH 1/3] dt-bindings: display: Add Sitronix ST7567 LCD Controller Javier Martinez Canillas
2025-07-10 22:51   ` Rob Herring (Arm)
2025-07-10 10:24 ` [PATCH 2/3] drm/sitronix/st7571-i2c: Make the reset GPIO to be optional Javier Martinez Canillas
2025-07-10 10:47   ` Marcus Folkesson
2025-07-10 11:00     ` Javier Martinez Canillas
2025-07-10 11:10       ` Marcus Folkesson
2025-07-11 19:25         ` Javier Martinez Canillas
2025-07-14  8:45   ` Thomas Zimmermann
2025-07-14  9:42     ` Javier Martinez Canillas
2025-07-14  8:55   ` Thomas Zimmermann
2025-07-14  9:47     ` Javier Martinez Canillas [this message]
2025-07-10 10:24 ` [PATCH 3/3] drm/sitronix/st7571-i2c: Add support for the ST7567 Controller Javier Martinez Canillas
2025-07-11 20:23 ` [PATCH 0/3] " Marcus Folkesson
2025-07-11 20:51   ` Javier Martinez Canillas

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=87tt3fksso.fsf@minerva.mail-host-address-is-not-set \
    --to=javierm@redhat.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ipedrosa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marcus.folkesson@gmail.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

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

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

all inboxes | Powered by JetHome®