Linux-Amlogic Archive mirror
 help / color / mirror / Atom feed
From: George Stark <gnstark@salutedevices.com>
To: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Cc: Jonathan Cameron <jic23@kernel.org>, <lars@metafoo.de>,
	<neil.armstrong@linaro.org>, <khilman@baylibre.com>,
	<jbrunet@baylibre.com>, <martin.blumenstingl@googlemail.com>,
	<andriy.shevchenko@linux.intel.com>, <nuno.sa@analog.com>,
	<u.kleine-koenig@pengutronix.de>, <linux-iio@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-amlogic@lists.infradead.org>, <kernel@salutedevices.com>
Subject: Re: [PATCH v2 1/1] iio: adc: meson: add separate config for axg SoC family
Date: Sat, 2 Dec 2023 03:05:13 +0300	[thread overview]
Message-ID: <2cd319fe-f1f8-4855-badb-cf7dd1f6160a@salutedevices.com> (raw)
In-Reply-To: <20231201180811.00002783@Huawei.com>

Hello Jonathan

On 12/1/23 21:08, Jonathan Cameron wrote:
> On Mon, 27 Nov 2023 22:17:33 +0300
> George Stark <gnstark@salutedevices.com> wrote:
> 
>> Hello Jonathan
>>
>> Thanks for the review.
>>
>> On 11/25/23 20:25, Jonathan Cameron wrote:
>>> On Wed, 22 Nov 2023 10:47:41 +0300
>>> George Stark <gnstark@salutedevices.com> wrote:
>>>    
>>>> According to Amlogic custom kernels ADC of axg SoC family has
>>>> vref_select and requires this setting to work nominally and thus
>>>> needs a separate config.
>>>>
>>>> Signed-off-by: George Stark <gnstark@salutedevices.com>
>>>> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
>>>
>>> Is this a fix?  If so, please provide a fixes tag.
>> Actually yes, these changes could be done in the patch that introduced
>> new configuration parameters.
>>
>>> Or is it aligning with the vendor kernels and we don't know if
>>> it's strictly necessary or not?
>> I do know it's necessary if we want kernel driver to be independent from
>> ADC initialization in vendor u-boot code. I have Amlogic a113x device
>> (axg family) and can provide test results w and w/o this patch.
> 
> Definitely best to not rely on firmware.
> 
> So send a Fixes tag for this and I'll apply it as a fix
> (you get to figure out which patch it fixed :)

The patch is ready :)

https://lore.kernel.org/lkml/20231127235558.71995-1-gnstark@salutedevices.com/


> 
> Jonathan
> 
>>
>>>    
>>>> ---
>>>>    drivers/iio/adc/meson_saradc.c | 16 +++++++++++++++-
>>>>    1 file changed, 15 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
>>>> index db280da9edbf..34555a85f131 100644
>>>> --- a/drivers/iio/adc/meson_saradc.c
>>>> +++ b/drivers/iio/adc/meson_saradc.c
>>>> @@ -1242,6 +1242,20 @@ static const struct meson_sar_adc_param meson_sar_adc_gxl_param = {
>>>>    	.cmv_select = 1,
>>>>    };
>>>>    
>>>> +static const struct meson_sar_adc_param meson_sar_adc_axg_param = {
>>>> +	.has_bl30_integration = true,
>>>> +	.clock_rate = 1200000,
>>>> +	.bandgap_reg = MESON_SAR_ADC_REG11,
>>>> +	.regmap_config = &meson_sar_adc_regmap_config_gxbb,
>>>> +	.resolution = 12,
>>>> +	.disable_ring_counter = 1,
>>>> +	.has_reg11 = true,
>>>> +	.vref_volatge = 1,
>>>> +	.has_vref_select = true,
>>>> +	.vref_select = VREF_VDDA,
>>>> +	.cmv_select = 1,
>>>> +};
>>>> +
>>>>    static const struct meson_sar_adc_param meson_sar_adc_g12a_param = {
>>>>    	.has_bl30_integration = false,
>>>>    	.clock_rate = 1200000,
>>>> @@ -1286,7 +1300,7 @@ static const struct meson_sar_adc_data meson_sar_adc_gxm_data = {
>>>>    };
>>>>    
>>>>    static const struct meson_sar_adc_data meson_sar_adc_axg_data = {
>>>> -	.param = &meson_sar_adc_gxl_param,
>>>> +	.param = &meson_sar_adc_axg_param,
>>>>    	.name = "meson-axg-saradc",
>>>>    };
>>>>      
>>>    
>>
> 

-- 
Best regards
George

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

      reply	other threads:[~2023-12-02  0:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22  7:47 [PATCH v2 1/1] iio: adc: meson: add separate config for axg SoC family George Stark
2023-11-25 17:25 ` Jonathan Cameron
2023-11-27 19:17   ` George Stark
2023-12-01 18:08     ` Jonathan Cameron
2023-12-02  0:05       ` George Stark [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=2cd319fe-f1f8-4855-badb-cf7dd1f6160a@salutedevices.com \
    --to=gnstark@salutedevices.com \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jbrunet@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=kernel@salutedevices.com \
    --cc=khilman@baylibre.com \
    --cc=lars@metafoo.de \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=nuno.sa@analog.com \
    --cc=u.kleine-koenig@pengutronix.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).