All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org
Subject: Re: [PATCH 01/11] ASoC: ak5386: switch to using gpiod API
Date: Wed, 16 Nov 2022 11:07:48 -0800	[thread overview]
Message-ID: <Y3U1BJAPOJTLw/Zb@google.com> (raw)
In-Reply-To: <Y3S9KzTE1/UQDmJl@sirena.org.uk>

On Wed, Nov 16, 2022 at 10:36:27AM +0000, Mark Brown wrote:
> On Tue, Nov 15, 2022 at 09:38:07PM -0800, Dmitry Torokhov wrote:
> 
> > Switch the driver from legacy gpio API that is deprecated to the newer
> > gpiod API that respects line polarities described in ACPI/DT.
> 
> > -	if (gpio_is_valid(priv->reset_gpio))
> > -		gpio_set_value(priv->reset_gpio, 1);
> > +	if (priv->reset_gpio)
> > +		gpiod_set_value(priv->reset_gpio, 0);
> 
> How are we ensuring that people have described signals as active
> low/high in existing DTs, and are we positive that the signal is
> described as active low for all devices?  In particular if the
> signal is described as a reset signal then it's active high even
> if we want it low while the device is actually in use.

I have been going through in-kernel DTSes and adjusting ones that are
incorrect. For external ones I think we should take a pragmatic approach
and say that if driver has last non-mechanical update in 2014 and there
are no users submitted to mainline since then (as this one), then it is
highly unlikely that devices currently using this component/codec will
be updated to the 6.2+ kernel even if they are still in service. And if
this does happen the breakage will be immediately obvious as we'll keep
the codec in reset state.

But if you really want to I can add quirk(s) to gpiolib forcing this
line to be treated as active-low regardless of what specified in DTS.
This kind of negates benefit of going to gpiod though.

Please let me know.

-- 
Dmitry

WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/11] ASoC: ak5386: switch to using gpiod API
Date: Wed, 16 Nov 2022 11:07:48 -0800	[thread overview]
Message-ID: <Y3U1BJAPOJTLw/Zb@google.com> (raw)
In-Reply-To: <Y3S9KzTE1/UQDmJl@sirena.org.uk>

On Wed, Nov 16, 2022 at 10:36:27AM +0000, Mark Brown wrote:
> On Tue, Nov 15, 2022 at 09:38:07PM -0800, Dmitry Torokhov wrote:
> 
> > Switch the driver from legacy gpio API that is deprecated to the newer
> > gpiod API that respects line polarities described in ACPI/DT.
> 
> > -	if (gpio_is_valid(priv->reset_gpio))
> > -		gpio_set_value(priv->reset_gpio, 1);
> > +	if (priv->reset_gpio)
> > +		gpiod_set_value(priv->reset_gpio, 0);
> 
> How are we ensuring that people have described signals as active
> low/high in existing DTs, and are we positive that the signal is
> described as active low for all devices?  In particular if the
> signal is described as a reset signal then it's active high even
> if we want it low while the device is actually in use.

I have been going through in-kernel DTSes and adjusting ones that are
incorrect. For external ones I think we should take a pragmatic approach
and say that if driver has last non-mechanical update in 2014 and there
are no users submitted to mainline since then (as this one), then it is
highly unlikely that devices currently using this component/codec will
be updated to the 6.2+ kernel even if they are still in service. And if
this does happen the breakage will be immediately obvious as we'll keep
the codec in reset state.

But if you really want to I can add quirk(s) to gpiolib forcing this
line to be treated as active-low regardless of what specified in DTS.
This kind of negates benefit of going to gpiod though.

Please let me know.

-- 
Dmitry

  reply	other threads:[~2022-11-16 19:07 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  5:38 [PATCH 01/11] ASoC: ak5386: switch to using gpiod API Dmitry Torokhov
2022-11-16  5:38 ` Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 02/11] ASoC: max98373: " Dmitry Torokhov
2022-11-16  5:38   ` Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 03/11] ASoC: tas5086: " Dmitry Torokhov
2022-11-16  5:38   ` Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 04/11] ASoC: tpa6130a2: remove support for platform data Dmitry Torokhov
2022-11-16  5:38   ` Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 05/11] ASoC: tpa6130a2: switch to using gpiod API Dmitry Torokhov
2022-11-16  5:38   ` Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 06/11] ASoC: tlv320aic32x4: remove support for platform data Dmitry Torokhov
2022-11-16  5:38   ` Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 07/11] ASoC: tlv320aic32x4: switch to using gpiod API Dmitry Torokhov
2022-11-16  5:38   ` Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 08/11] ASoC: dt-bindings: wcd9335: fix reset line polarity in example Dmitry Torokhov
2022-11-16  5:38   ` Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 09/11] ASoC: wcd9335: switch to using gpiod API Dmitry Torokhov
2022-11-16  5:38   ` Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 10/11] ASoC: dt-bindings: wcd938x: fix codec reset line polarity in example Dmitry Torokhov
2022-11-16  5:38   ` Dmitry Torokhov
2022-11-16  5:38 ` [PATCH 11/11] ASoC: wcd938x: switch to using gpiod API Dmitry Torokhov
2022-11-16  5:38   ` Dmitry Torokhov
2023-03-08 18:11   ` Krzysztof Kozlowski
2022-11-16 10:36 ` [PATCH 01/11] ASoC: ak5386: " Mark Brown
2022-11-16 10:36   ` Mark Brown
2022-11-16 19:07   ` Dmitry Torokhov [this message]
2022-11-16 19:07     ` Dmitry Torokhov
2022-11-17 11:34     ` Mark Brown
2022-11-17 11:34       ` Mark Brown
2022-11-18  6:31       ` Dmitry Torokhov
2022-11-18  6:31         ` Dmitry Torokhov
2022-11-18 13:12         ` Mark Brown
2022-11-18 13:12           ` Mark Brown

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=Y3U1BJAPOJTLw/Zb@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is 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.