Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1955399ybm; Sun, 31 May 2020 04:02:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpMJ7Jgh2cqxdjmUgpQXZdKFte1XYaU1mNznffzQnZAgTxJNMC2Qp62CgahcroJ4n61HVb X-Received: by 2002:a50:c014:: with SMTP id r20mr16137271edb.110.1590922969850; Sun, 31 May 2020 04:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590922969; cv=none; d=google.com; s=arc-20160816; b=x4EPATiVeIje5XKBl94jM1tw6HGyHB9/10gBMDr9mfYlrkcYQYgbeDWwacQfFcOhQp H4kujTwaIRhFiC2QW+OO1c5cW64dsaRsY+FDtpAD+NZ0Yr00gFviqijfD7Oy06jHCfAW YT1Z4FGOkZuk/wbl4Ip7qoy6SKDVzVXykrdpHpKHepgsz3M7iAs6IIekCPc2tKgaAao1 +AckyBbxmmfnDdgYQRfm+Mnv7yeb+chzJL1gMO/X3MUp8JrCSM/LSFL+TpVjJwHEqc5n H+9GuetcvIB6R4vM9m0fC/662jM1LwjecLhnQvWwqJjM4BugzDss6XZE4wUlwaHF6Wds XV6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=MNMpgNFDlCRBQN0clf/Kvjpuy+/5kHizZ3Acl7Wky7Y=; b=g+OL1G6MRVkQOKpvjk50jvIbbVU8JjHOCY0g5PHUh6QFY+T4ckHTN2iGkpxEcY2DuB NtWf0ysnT5uMoLlyR3hcqhpHE8f8EO2FHpxkPSgzHKWAqjvDyCd+9y+LyWA29kMEb/x8 W9KL1CJjWPq/nqwOsn7l/Phd4Xlv+xgeIvSrQ4vrCdeyKsWWBRk1cXfxjKKRt3rsg4tP VlopB+yGFvK1nLoLFKQOmvPuUbzqP1D0SefwWaZ4ENiyZl4t4XtYhhU1p99LXWAGd0aM Zvn7nSArMr/S9yPkIvd0OMHIngr6DNpQyXg87HjCVencPLBfWQmPXEDvEyOo2JxYfB3v 2IZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kJYMVbx0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si8738888eji.141.2020.05.31.04.02.27; Sun, 31 May 2020 04:02:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kJYMVbx0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728261AbgEaKsG (ORCPT + 99 others); Sun, 31 May 2020 06:48:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:54266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725813AbgEaKsG (ORCPT ); Sun, 31 May 2020 06:48:06 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A306C2074A; Sun, 31 May 2020 10:48:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590922085; bh=VKuSydnCA8GbAnW/vXcAF5F4KY9bvvxAF6aLZVGJkXM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kJYMVbx0SmXng/5nf6YHI7Q0zQOJ2gjlrxWGdSXENmp5n9U2t13PTRGYEDIi4wSoZ /O2mflibc5V3x1oJsfCHOuRkVywRwozEEiJrbMF1MR76m2beUvUFL8yCuG1XnK8iii GOHWT+FVHhgGXIYH6k2fPuNhaoFyczSYkEV3usuA= Date: Sun, 31 May 2020 11:48:00 +0100 From: Jonathan Cameron To: Jishnu Prakash Cc: agross@kernel.org, bjorn.andersson@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mka@chromium.org, linus.walleij@linaro.org, Jonathan.Cameron@huawei.com, andy.shevchenko@gmail.com, amit.kucheria@verdurent.com, smohanad@codeaurora.org, kgunda@codeaurora.org, aghayal@codeaurora.org, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org, linux-arm-msm-owner@vger.kernel.org Subject: Re: [PATCH V6 3/7] iio: adc: Add info property under adc_data Message-ID: <20200531114800.6527be21@archlinux> In-Reply-To: <1590684869-15400-4-git-send-email-jprakash@codeaurora.org> References: <1590684869-15400-1-git-send-email-jprakash@codeaurora.org> <1590684869-15400-4-git-send-email-jprakash@codeaurora.org> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 28 May 2020 22:24:25 +0530 Jishnu Prakash wrote: > Add info property under adc_data to support adding ADC variants > which may use different iio_info than the one defined for PMIC5. > > Signed-off-by: Jishnu Prakash Applied. Thanks, Jonathan > --- > drivers/iio/adc/qcom-spmi-adc5.c | 4 +++- > drivers/iio/adc/qcom-vadc-common.h | 1 + > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c > index 21fdcde..0fa1d37 100644 > --- a/drivers/iio/adc/qcom-spmi-adc5.c > +++ b/drivers/iio/adc/qcom-spmi-adc5.c > @@ -629,6 +629,7 @@ static const struct adc5_data adc5_data_pmic = { > .full_scale_code_volt = 0x70e4, > .full_scale_code_cur = 0x2710, > .adc_chans = adc5_chans_pmic, > + .info = &adc5_info, > .decimation = (unsigned int [ADC5_DECIMATION_SAMPLES_MAX]) > {250, 420, 840}, > .hw_settle_1 = (unsigned int [VADC_HW_SETTLE_SAMPLES_MAX]) > @@ -643,6 +644,7 @@ static const struct adc5_data adc5_data_pmic_rev2 = { > .full_scale_code_volt = 0x4000, > .full_scale_code_cur = 0x1800, > .adc_chans = adc5_chans_rev2, > + .info = &adc5_info, > .decimation = (unsigned int [ADC5_DECIMATION_SAMPLES_MAX]) > {256, 512, 1024}, > .hw_settle_1 = (unsigned int [VADC_HW_SETTLE_SAMPLES_MAX]) > @@ -777,7 +779,7 @@ static int adc5_probe(struct platform_device *pdev) > indio_dev->dev.of_node = node; > indio_dev->name = pdev->name; > indio_dev->modes = INDIO_DIRECT_MODE; > - indio_dev->info = &adc5_info; > + indio_dev->info = adc->data->info; > indio_dev->channels = adc->iio_chans; > indio_dev->num_channels = adc->nchannels; > > diff --git a/drivers/iio/adc/qcom-vadc-common.h b/drivers/iio/adc/qcom-vadc-common.h > index e074902a..6a7553f 100644 > --- a/drivers/iio/adc/qcom-vadc-common.h > +++ b/drivers/iio/adc/qcom-vadc-common.h > @@ -136,6 +136,7 @@ struct adc5_data { > const u32 full_scale_code_volt; > const u32 full_scale_code_cur; > const struct adc5_channels *adc_chans; > + const struct iio_info *info; > unsigned int *decimation; > unsigned int *hw_settle_1; > unsigned int *hw_settle_2;