Message ID | 20231122074741.154228-1-gnstark@salutedevices.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp1158534vqb; Tue, 21 Nov 2023 23:48:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCqDZr/OoJOSmxeDohAe0EN9+4bA1d0nE+SifbEN+glKglNsQkwJRg+DmGwYj4o5Dq9EFh X-Received: by 2002:a05:6830:4807:b0:6d4:726f:6899 with SMTP id dg7-20020a056830480700b006d4726f6899mr1883705otb.1.1700639292456; Tue, 21 Nov 2023 23:48:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700639292; cv=none; d=google.com; s=arc-20160816; b=dt0RwEzD++6JBCZckwL5jGHczyNiU08Qen3ePUg25ev3U6XpgN3Z7WKFbEcGZ8wRu0 /pwIRFc5vW2jtaSL7lUmnW52URIXZBiMPvRacqHERt7diVobhRSlcAIU1InbptP6GYXo TAf6YwJ8atNxoHZp4/UQHZIdjllKhrLAncZA4HFJPcad3BCit5RmUIJ30WHg6g0iodsB 7FfyepvvaZaCIVeioXS2QSTb9TvorhAR4A4TtAdsYFColvcnyxCR643IWQFfBF4CvYUO a2r5CgoMjGYk485L7bLdJoYCTA+V+IwEQJUBcqVdONKuqZbJNvgDitftjA/IaQDTmES8 i2qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=oU30MMu9WmhU+2fpdPT9gtSHN94XrD8m14J9f5rDEG0=; fh=oy3NHOEhWYKVpFhV1NNuwn5V55AWpupNTNwRor5xLNc=; b=mVS5R7KojAApY3c9Xp9ymqvBM+X/lDLdjJuu80uMNOO5jiU25oYdWhEpHaamMGyx/+ f2mOXgwRMx2zQHsDLIut7JWfhvkJyn2u56zdgC9Y//jUoEuO7uicBtX9ctdGT0lTI+kJ 2bI1SpG+e0FGNiPTMtuVrQ9vm982vcPKW0FT2Mg10DG1Uf9I4iKrhckLj5vYECe7JIdK ElfZZUuA5fDIwyrWTH07LvlT9KCCcqSIJicwP5GumL1V0G+HM/BtohvpDzSz2eC3PQHp 9lq1dPqxk9/uuWW4pzlabo4Kid6v7o1BIAg3API7hqn73sxsmQoocFu09KOovsmtsUtD dUSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=fzb1ZwNv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id x189-20020a6386c6000000b00585999a38a6si11793863pgd.793.2023.11.21.23.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 23:48:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=fzb1ZwNv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 0BA4280314FB; Tue, 21 Nov 2023 23:48:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234834AbjKVHr7 (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Wed, 22 Nov 2023 02:47:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229931AbjKVHr6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Nov 2023 02:47:58 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7323D112; Tue, 21 Nov 2023 23:47:52 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 53E20120017; Wed, 22 Nov 2023 10:47:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 53E20120017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700639269; bh=oU30MMu9WmhU+2fpdPT9gtSHN94XrD8m14J9f5rDEG0=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=fzb1ZwNvSSqMGofOnI5AJBJqXEfseIC0KVAi3z7oH12Xt5C7EeKWzygZfdmQD5nye pW2BM+pKKAFdH0sxvqyDWxTYtjEwcU3ZAwRhPHFyMnNI6cKWMygjZQeRjHmSG6lZ7u /JKUl9I6wUhPuAUAWC36NbQqdaPQRwTFB4b6k8Kt/0nlsEEg7OFwbQAL/gILcUeO8V 14N7FY5DUAEHNTvJZQckpR2LYvc1jIwU1lft9INJC9bKvLPXpBsOdoh4QG14SbYD2C cyCIwf6FCor/B1K5Gls4x8jlWbNwVd4NL9WIl+1K6tzK4NgVJynuS1Jf/XEGcjqkJc 1ZGWMfu4/ax7A== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 22 Nov 2023 10:47:48 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 22 Nov 2023 10:47:48 +0300 From: George Stark <gnstark@salutedevices.com> To: <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>, <gnstark@salutedevices.com> CC: <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: [PATCH v2 1/1] iio: adc: meson: add separate config for axg SoC family Date: Wed, 22 Nov 2023 10:47:41 +0300 Message-ID: <20231122074741.154228-1-gnstark@salutedevices.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181523 [Nov 22 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: gnstark@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/22 05:48:00 #22499758 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 21 Nov 2023 23:48:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783249546164360873 X-GMAIL-MSGID: 1783249546164360873 |
Series |
[v2,1/1] iio: adc: meson: add separate config for axg SoC family
|
|
Commit Message
George Stark
Nov. 22, 2023, 7:47 a.m. UTC
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> --- drivers/iio/adc/meson_saradc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
Comments
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. Or is it aligning with the vendor kernels and we don't know if it's strictly necessary or not? > --- > 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", > }; >
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. > >> --- >> 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", >> }; >> >
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 :) 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", > >> }; > >> > > >
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", >>>> }; >>>> >>> >> >
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", };