mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Viorel Suman <viorel.suman@nxp.com>,
	"Viorel Suman (OSS)" <viorel.suman@oss.nxp.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	"S.j. Wang" <shengjiu.wang@nxp.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] ASoC: ak4458: use reset control instead of reset gpio
Date: Fri, 20 Nov 2020 15:40:24 +0200	[thread overview]
Message-ID: <c6e7ff22-f421-d05e-621f-738740b30482@ti.com> (raw)
In-Reply-To: <VI1PR0401MB22729D51912D66FDB2973A7792E00@VI1PR0401MB2272.eurprd04.prod.outlook.com>


Hi Viorel,

On 19/11/2020 18.24, Viorel Suman wrote:
> Hi Peter,
> 
>> DTS is supposed to look as follows:
>>>
>>> / {
>>>     ak4458_reset: gpio-reset {
>>>        compatible = "gpio-reset";
>>>        reset-gpios = <&pca6416 4 GPIO_ACTIVE_LOW>;
>>>        #reset-cells = <0>;
>>>        initially-in-reset;
>>
>> I can not find anything resembling to this in next-20201119.
>> Where is the implementation and documentation for this gpio-reset?
> 
> The board schematics is not publicly available; some info may be seen in DTS files below:
> https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mm-evk.dts?h=imx_5.4.24_2.1.0
> https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mm-ab2.dts?h=imx_5.4.24_2.1.0
> https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mp-ab2.dts?h=imx_5.4.24_2.1.0
> 
> In examples above the GPIO is handled by machine driver - wrong approach given that
> it requires machine driver being probed before codec driver.

Right, so this gpio-reset driver is not in mainline. You are adding
support for something which does not exists ;)

> 
>>> -	ak4458->reset_gpiod = devm_gpiod_get_optional(ak4458->dev,
>> "reset",
>>> -						      GPIOD_OUT_LOW);
>>> -	if (IS_ERR(ak4458->reset_gpiod))
>>> -		return PTR_ERR(ak4458->reset_gpiod);
>>> +	ak4458->reset = devm_reset_control_get_optional_shared(ak4458-
>>> dev, NULL);
>>> +	if (IS_ERR(ak4458->reset))
>>> +		return PTR_ERR(ak4458->reset);
>>
>> The binding documentation must be updated and you must support the gpio
>> way as well.
> 
> Sure, make sense.
> 
>> When I had this discussion around using the reset framework for shared
>> enable and/or reset pins it was suggested that _if_ such a driver makes
>> sense then it should internally handle (by using magic strings) the fallback
>> and work with pre-reset binding.
> 
> Thanks, would appreciate if you point me to the discussion you had.

There were few iterations of it when I finally given up, I can quickly
find rfc v2:
https://lkml.org/lkml/2019/10/30/311

Probably in earlier or later series the reset framework was also discussed.

I ended up using GPIOD_FLAGS_BIT_NONEXCLUSIVE in the pcm3168a driver.
https://lkml.org/lkml/2019/11/13/411
- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

      reply	other threads:[~2020-11-20 13:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 22:20 Viorel Suman (OSS)
2020-11-17 17:39 ` Mark Brown
2020-11-17 18:17   ` Viorel Suman
2020-11-18 11:55     ` Mark Brown
2020-11-19 16:22       ` Viorel Suman
2020-11-19 16:27         ` Mark Brown
2020-11-19 12:48 ` Peter Ujfalusi
2020-11-19 16:24   ` Viorel Suman
2020-11-20 13:40     ` Peter Ujfalusi [this message]

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=c6e7ff22-f421-d05e-621f-738740b30482@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=shengjiu.wang@nxp.com \
    --cc=tiwai@suse.com \
    --cc=viorel.suman@nxp.com \
    --cc=viorel.suman@oss.nxp.com \
    /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®