Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp581613ybm; Thu, 28 May 2020 09:58:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyX2P2d3aKA7maP8/MV89RCQb45+fha6giu/sa5K0kTYlY+HmcAB11vFNSIyTyfqqr4AGTP X-Received: by 2002:a17:906:6b92:: with SMTP id l18mr3955908ejr.145.1590685091377; Thu, 28 May 2020 09:58:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590685091; cv=none; d=google.com; s=arc-20160816; b=zw07J+IwTlbF3YClQMUA5YgWLzBswW/1U0mnxGOeLSsMJbw/gJ7s4uKLvyG58DKUDD aLri939aNsW7OWirevEuRMFidJ/KUtwOhBLKu56vKdsokbdm43PMNEdJ9px/F9cLlINa fS69DenqGrn4mkqzzXBWTwYXiWsfucXQzWxR0s8GYcJbVsf+EncTAZ5HbzRuZiRJgBcV lPGJ48drR4HpenWHs3hiebp09/TkateFJmnzpvkz+7uirT5+eiliozNhhPvOai5NWdig wP/onCzaEFipkHduOQ9ENiHyaH4/hgC8zmye8dSjlQt7hivlwgCCsYPJa38m1qj38CaO 8vow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=ZXsN90wErB1JosUSuFzG2gI172jnlE+QOOZyjuivH10=; b=FqaB9WFuhCUQwqCGNZn1nsHAsYoXCsRybQzBwmIuPsxy4BJlc8LJxWpi2qzUfAr5yC aVScwf/QlgR3eJUWUfNot4LxoNZE5C4/hZlFqtAQ9WXQAz+NGydCGLLXL3X0WN7i6Zls 3qgiK8MVhInL0PUc5Scx0zJOkql7W8hEvMFa3ISaf6yViEPWXzZ3pP40m3iL75PJlRfA fAvm14kWdLl2PPfs+Ybxl3z55R0Rg8W7u3MZTv24K7FTY+y9Lmnfl9Mz2PU91T/1jemY Ccaju2+0OowzDB0ca+kT2yYmc4mneDekNcC5ZvP0OCBudEI98a1rgAwW94j4gqrdnDC4 x7gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=eF9+ME2g; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si4166479ejb.144.2020.05.28.09.57.47; Thu, 28 May 2020 09:58:11 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=eF9+ME2g; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405275AbgE1Qzq (ORCPT + 99 others); Thu, 28 May 2020 12:55:46 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:56434 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405237AbgE1Qzk (ORCPT ); Thu, 28 May 2020 12:55:40 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1590684939; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=ZXsN90wErB1JosUSuFzG2gI172jnlE+QOOZyjuivH10=; b=eF9+ME2gIUkkMDsngZVxm0jRQfsO5CAaSEtQ41e/qHn3+axs583oiLIfuQJQTEoXy3z049+i isJZOiCalYej2fbscbSz1f/fwcRPP67LDOghqHrkjZlLl1RCCWVvpEdPHL14+Iah/83DkSz0 r0XXw7qnVp+bcEJlzicoOwztJew= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 5ecfed0a3ac6f4f603eed308 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 28 May 2020 16:55:38 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id D51CAC433A1; Thu, 28 May 2020 16:55:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from jprakash-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jprakash) by smtp.codeaurora.org (Postfix) with ESMTPSA id 023DAC43387; Thu, 28 May 2020 16:55:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 023DAC43387 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=jprakash@codeaurora.org From: Jishnu Prakash To: 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, Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org Cc: linux-arm-msm-owner@vger.kernel.org, Jishnu Prakash Subject: [PATCH V6 3/7] iio: adc: Add info property under adc_data Date: Thu, 28 May 2020 22:24:25 +0530 Message-Id: <1590684869-15400-4-git-send-email-jprakash@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590684869-15400-1-git-send-email-jprakash@codeaurora.org> References: <1590684869-15400-1-git-send-email-jprakash@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project