Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3399600ybt; Tue, 23 Jun 2020 01:03:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/gLZZxKi9F1paF4Rb5eSeeE120kHyMQbjVSa7YVqnCVE/rcKY54o/QuwfHpsxnPk7nQ/D X-Received: by 2002:a17:906:c44c:: with SMTP id ck12mr1461722ejb.145.1592899417568; Tue, 23 Jun 2020 01:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592899417; cv=none; d=google.com; s=arc-20160816; b=rHNKcdNPFSu4j1+Rs12U/0Uu70q7k55RJR5mNKIQLfmeqztVvarsmxnLgWFYERk+nu 08t2OJwLo0ElsNE02h6HVhR/GmPS7GRaWmeShnG8MRSWbFI4dJfJ/+LskdCYs6DGw5wP ewTUU5cLwJkBc39sWtxmxJmmtWtOQ3LPs9uIMy1TXpgo2p3bDsLW+EoNGNLCVPj4RNSO YSzGxvm1AP4Edz6tEo6j4CQTzLLlYPyZEEcKPFMhP6NKlwsjDepeMnyKI0tBGxTLgmkd r0UGbWan38D7RPwz2PzPAaYVdjtIzgkTHCHsKovYzppyzmzN5dKq2Hu7qbXbj8iZxxFA gFdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=TDH4ZfrBuoWx+BiIJhwwh/FBQ8J1kbRargPKwEZiV2U=; b=Yg4S5a6sCTYskviQDmfAEluhLPc0OAUIaW32K6Uw+/uzTzwHKSTrn3y4i2N6wEDbVG gps9PsaemnNohLBG83Y6rvDlUi8qwG/DXRRN1TZY1EHrvpgEdRJVG0dQJ/yxvSHLPOwT Bs1J5/3wFicEMs99fyi+oKVflxguHd3EykEbV0w0R3IeTMgYmo7PtUt+8RAYXmObqlw5 t9g6V2C+at02ajSzfbRwGl/ABXKiTZQCHtPV3q7Mw6Bm6qwrZb0wx6zqbW6+shi7zWxs e7mR5s4IoF2eKoCBF9tOG85e50v5QeKJECcJwoDlplp/+PI9kdk5Td2HdY6i1g5o+uzM Zevw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=d+uI922m; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si476193ejc.174.2020.06.23.01.03.14; Tue, 23 Jun 2020 01:03:37 -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=@gmail.com header.s=20161025 header.b=d+uI922m; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731579AbgFWIBN (ORCPT + 99 others); Tue, 23 Jun 2020 04:01:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731516AbgFWIBM (ORCPT ); Tue, 23 Jun 2020 04:01:12 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47F15C061573; Tue, 23 Jun 2020 01:01:12 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id j1so9731347pfe.4; Tue, 23 Jun 2020 01:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TDH4ZfrBuoWx+BiIJhwwh/FBQ8J1kbRargPKwEZiV2U=; b=d+uI922mr0oQu2pI3Bl9AxYVkOLmjht77lyasvbxW2g20pZChmks5C4hrEJKE1iUs3 fJGUETnz7ARQYllkMrVg4FCydRSOBdgfhY7BSnKOU1/DEB3/jh8sevqo47L3pJnUzB5q oZ7Xg60zRpul9N1h70nI4GJNX0/M4PkSLdIuMp/JW9+tziPf+33gPyfscDThy65e4ZIb CsZ5Cz7D/W8wmFOpoDxOsp1X4wrZAFv7g8lDgb8a5iM1ilY+Bb0/yy8Zfs8rPHHm1rpd S9xL96ogn6HCjcShGpt50WyqSdqGbAwyHIUSHjK7hglVnZrzMa/f+E3wTlWpRa96HZ1s Kg7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TDH4ZfrBuoWx+BiIJhwwh/FBQ8J1kbRargPKwEZiV2U=; b=oia6nhbDFa6tHF0XrSczUNFZSxjS4gREgISiebk9qcUF3AG7D0my7gIxaSkvIpqSgC aSxJabwMQq/fyJfx6Mw0RQ5FVswEznHv6FW8hG1b8NS2dktM6OmaGN8DEn+Yn1A7E4+2 h0JxUEKgctoT+LXo+C/3vkx5d+GV5HQT6B0lyzTmvqBXCnARMyzMaD9Z1hwrxIgFZgrG cW7FtmxSFR54PbzvkfHTA/aSgpjGI7as0j5TXDV9E21ieSGwEiDAF/PA88GMPjg9+d0t TDcODNdPtEux+f3aljWfO2f9l9zYIjliL4EjnLxj2xIyZ8SFUFLmqpfqGTnwSmyBvspM kntw== X-Gm-Message-State: AOAM531JGE1Tmh+98gWxn8Ym70vbwknFNFt8MguuIfYlbMKdfVlm/5iR 989r+lKXsapGr7C7AYGmm4bcTmaS6mlzAXyyITg= X-Received: by 2002:a63:f042:: with SMTP id s2mr15816496pgj.4.1592899271743; Tue, 23 Jun 2020 01:01:11 -0700 (PDT) MIME-Version: 1.0 References: <1592897399-24089-1-git-send-email-jprakash@codeaurora.org> <1592897399-24089-4-git-send-email-jprakash@codeaurora.org> In-Reply-To: <1592897399-24089-4-git-send-email-jprakash@codeaurora.org> From: Andy Shevchenko Date: Tue, 23 Jun 2020 11:00:58 +0300 Message-ID: Subject: Re: [PATCH V7 3/7] iio: adc: Add info property under adc_data To: Jishnu Prakash Cc: agross@kernel.org, Bjorn Andersson , devicetree , Linux Kernel Mailing List , Matthias Kaehlcke , Linus Walleij , Jonathan Cameron , Amit Kucheria , 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 , linux-arm-msm-owner@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 23, 2020 at 10:31 AM 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. > FWIW, Reviewed-by: Andy Shevchenko > 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 > -- With Best Regards, Andy Shevchenko