Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1405558rdb; Fri, 1 Dec 2023 16:06:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHR9pxEeBTOq44awXkL89B5eF05VzpPhvdLEEwKbYYW8JWrSyx44vUibH7xcyd1/dnpnlHQ X-Received: by 2002:a05:6870:71d5:b0:1fa:2b89:3663 with SMTP id p21-20020a05687071d500b001fa2b893663mr489789oag.2.1701475575771; Fri, 01 Dec 2023 16:06:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701475575; cv=none; d=google.com; s=arc-20160816; b=yx7ZaHSiDipQodyFWxv9QH6GOWeIgBli3teUPgLI4n6o1C46nIINJIyWnzr8XQYVas jttbj1QoxsrENmjtkifqzZx8sxnOprzDxc+/ofPzWjog6i8JnjTuHGPBxpYzXlfUBouT qpEiOua9fyPv1ZrXhFhE4+0bxTPdcVk4+8gG/R0GugttdsAoZnbyi2gxx2oCYCSBD1Es BoqFsaC3oYq4qvQhhbCZfS07V1nDP/0Pjjk5aZHzgssqpxro6iJKvSVHAXEn7IxzydV5 h0X4+wFrPFPdCi05bTE0IRMXAboEzYn3hZn2dpQ5RySsyiFGrI19usyP2QEvxImUqBbP uOaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-filter; bh=rswht4tp6bVZEwPQC/eJeMDlDm0anK7iby4EiMgmWvA=; fh=9GZVO/QLTF5EL3f2OkcFBMV1J9ZbzMlJmCvxtSS2DkM=; b=iL/2+qd4dpGLj3Bnowyz9aNE0TpmK6HoRXHEKeFDAFEaDeSdPq/FkrnLd2yUJDTPew w2aIBR9rOP14Ji63AZ6jA2lzfYNsIrvSIm1IgeRrpFNJc3a4YllBKoHTOBNetX5QZNfo 9FRchRVzJ+5ruzKWgMGJKUm2+pRiPLb41U0YmpGOg+Ho1cygBVovp+Xf2a9jgrQ36gwo Pyn5Gpvka0EL31tl+diGZ0kLySSiYqQ9PvMVeXmKfsiuDxh1qOMOuDRt59HNzck7jAkj uIOrSFJ6mrHrAlzw95nth/GV6ueIPx/K29Omqt3BvYMOb1SXMxnzylAXdLgvsOLUqSpf 34xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=YmzY+eyT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id p24-20020a17090ad31800b0028659a5d68esi1952549pju.115.2023.12.01.16.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 16:06:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=YmzY+eyT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 0BCA981E0FFC; Fri, 1 Dec 2023 16:06:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441961AbjLBAF4 (ORCPT + 99 others); Fri, 1 Dec 2023 19:05:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442007AbjLBAFM (ORCPT ); Fri, 1 Dec 2023 19:05:12 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B6941FE3; Fri, 1 Dec 2023 16:04:54 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 7660E120027; Sat, 2 Dec 2023 03:04:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 7660E120027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1701475490; bh=rswht4tp6bVZEwPQC/eJeMDlDm0anK7iby4EiMgmWvA=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:From; b=YmzY+eyTx9f4+oXHhAnywRc481Fu31AWnX+fspgxf9ZHVaRE03r+41QyeSZQVqar4 zdUmtIO4WJABaLL9dfFAN7/eFXZRs6Nxw4yKeWPo5+u8S3Ho2/GM7i0M0KZKHD6tmn KP2IKfyKhaGVNSeuGCMIHH0CNc9VpRgxypPFmlVzg2vsarW8cStpQzaqaY1V2Vgm4Y CZutHsoQRKSPBov3vFnth4Z3GPzdi6C5tHV55+JrUk+RAHwwsCIXusIhU10agxMZiq Spc9rNbD6J0MolcHIDmTvAhK0CO8GoXh94ZCWjNzxbD/Mp/1+TQ1iNYsT5JGXRoGMD lHg8kmL6l6y6A== 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; Sat, 2 Dec 2023 03:04:50 +0300 (MSK) Received: from [192.168.1.127] (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; Sat, 2 Dec 2023 03:04:49 +0300 Message-ID: <2cd319fe-f1f8-4855-badb-cf7dd1f6160a@salutedevices.com> Date: Sat, 2 Dec 2023 03:05:13 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/1] iio: adc: meson: add separate config for axg SoC family Content-Language: en-US To: Jonathan Cameron CC: Jonathan Cameron , , , , , , , , , , , , , References: <20231122074741.154228-1-gnstark@salutedevices.com> <20231125172508.2a2242bf@jic23-huawei> <20231201180811.00002783@Huawei.com> From: George Stark In-Reply-To: <20231201180811.00002783@Huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) 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: 181777 [Dec 01 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: 5 0.3.5 98d108ddd984cca1d7e65e595eac546a62b0144b, {Tracking_uf_ne_domains}, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;127.0.0.199:7.1.2;salutedevices.com:7.1.1;100.64.160.123:7.1.2;lore.kernel.org: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, bases: 2023/12/01 22:50:00 X-KSMG-LinksScanning: Clean, bases: 2023/12/01 23:54:00 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/12/01 22:03:00 #22603897 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 lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 01 Dec 2023 16:06:13 -0800 (PST) Hello Jonathan On 12/1/23 21:08, Jonathan Cameron wrote: > On Mon, 27 Nov 2023 22:17:33 +0300 > George Stark 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 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 >>>> Reviewed-by: Neil Armstrong >>> >>> 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