Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1231597rdb; Fri, 1 Dec 2023 10:09:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiB1k/0AsjwHpsNfxnqUgXATDZFtA65dVTtTHK4ieQhLcB6qj4s3afIsFtkc3FPJY0sdNI X-Received: by 2002:a05:6a20:4415:b0:187:b16f:e779 with SMTP id ce21-20020a056a20441500b00187b16fe779mr29664601pzb.5.1701454193234; Fri, 01 Dec 2023 10:09:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701454193; cv=none; d=google.com; s=arc-20160816; b=Eu7P0Wc20D2SQoFZPwF1SuaB4bYCjHVC0U6bPwSqZxmCWycnYgFl6yGwf7Xfa6ov7p wmA9KZAfInIJm/T4G+C7xRziAeqbreIyRKmpQgcMD7DxLZTRKbcVtPTE0l5PXi3theFd 551D0ODMbTiEop0HqOLDLW1bKOVfNHYu+mIKfz689LRws4XHiCHaGpxuDfvie00Y2nh9 p/yP5w5DAe3NB7tDfjCfAXGp/dDktQ9I1i36zgoikYjdTZBQNl3Dnk/biPy6OrjmWpDb qjkqY2UeAUKVs3bTe/jbtY8VfJh8BqtQLjrYrMXQUuVN4C7BaorOR6QqAylTgj6Bhbt+ aLbA== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=51QXPZhvux1jwq0PVNhmISorPOZThzSsgvF8/1aRcR0=; fh=ti5lIKWj/PzhhhdfP4M/HhYLjIkY+aE44wuiCOseWb0=; b=XO1GFSYMG8YZwokI4wKRA7pk5AEOVdtW53HJDJr0I35F3+bFi0z4ZpxPEotiH7NhXk iPc8nUpgGLmDE4GTK1vXvXlyPUXz4cMTX5+AsXGFq1FFI+O1KnS55uJOdFfIsGt3OJsd vUfbjGqmR5lNfprqAzbx0DG0kTGpc2+w9J9xIkFySqhiL0T5MWsWBIb2cYFE++tptzFg J/5NPR46d01Rk5YMzJIBliGcRtwxLeTFYO8s2+wRofhKMvNG4mKYzebgwgp0nYXfj1Uy jIa/pL7XJpHnXEg5IUnxAH3rN7sNQm2iio0e1y8mz7wR7nUJ2AH9GPpmYsUH7i3Jh6v4 ONdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id bg2-20020a056a02010200b005c6259da621si3885529pgb.555.2023.12.01.10.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 10:09:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 217E081C9AFE; Fri, 1 Dec 2023 10:09:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229905AbjLASIL (ORCPT + 99 others); Fri, 1 Dec 2023 13:08:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjLASIK (ORCPT ); Fri, 1 Dec 2023 13:08:10 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 805CBF9; Fri, 1 Dec 2023 10:08:15 -0800 (PST) Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4ShgyW1Yp3z6J9rV; Sat, 2 Dec 2023 02:07:47 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 168131401E0; Sat, 2 Dec 2023 02:08:13 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 1 Dec 2023 18:08:12 +0000 Date: Fri, 1 Dec 2023 18:08:11 +0000 From: Jonathan Cameron To: George Stark CC: Jonathan Cameron , , , , , , , , , , , , , Subject: Re: [PATCH v2 1/1] iio: adc: meson: add separate config for axg SoC family Message-ID: <20231201180811.00002783@Huawei.com> In-Reply-To: References: <20231122074741.154228-1-gnstark@salutedevices.com> <20231125172508.2a2242bf@jic23-huawei> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500005.china.huawei.com (7.191.163.240) X-Spam-Status: No, score=-0.8 required=5.0 tests=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 fry.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 (fry.vger.email [0.0.0.0]); Fri, 01 Dec 2023 10:09:29 -0800 (PST) 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 :) 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", > >> }; > >> > > >