Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp577278ybm; Thu, 28 May 2020 09:51:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh8MnObdpJfHJRDLdRA3x3hGmHPSMt78DBjuCqeDwGP436qCCKJVZUSxpIkTZ3J1djj2hv X-Received: by 2002:a50:a981:: with SMTP id n1mr3842050edc.377.1590684682167; Thu, 28 May 2020 09:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590684682; cv=none; d=google.com; s=arc-20160816; b=MrT0nKQDz4M4juIabZedj/BMJeqA0W6ZDpK2lL0Eo4cJlE1memBu2PRW5313AHoQRk asdRDSzZZCvhKI5x8S8ePpk9Bbb0B3gp/taNM5Zt4vnxzJazhMDr7JvdkdPdbQLXBViK KyfUlXmDmnfgjmHXJ2Z+Riap022ey1S1o+SNk4LA3NpiO+WwGJDOtYsZWQ2JGBMiS0fL 4VOmV638OQetdDOCZU+2zWZZl3wMyAQFj/+qupnynXa/RCn59g0u7kNMS3u6zivU9a/m ZPvitS3gQLvL9nPuFeMT2poB9jEyLT234GgApZ3+ob4mocTPQ/swCThcuwD65vT8U+30 Vfxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature; bh=V/FjvseqBj5P84s0e9IFl/BbQIRhxvHn2iqA2kw9C+0=; b=CiTYZBtHwM67Br4hjTiZxakI9LuxIflg2y0PcoTQVi37tDT1BczH5vMO4F+KiNumtY Hto6PZLeNOl1ulGzU/QuPxdlrx0jUiylz8KKL7c9HjyyiUGrQ/3lusgYhUZcV8Vjf3ei tGbK4+jL46YZ4yiJA1MfJp8LpJ4yIwQ2MkYkxsWgWrjiUoj9Qn+dSnkP6bvEpN+RH4Ms RFtySJu1/jAPXVEL34zlUuMTp3y+/Jl+72K3NE9s2GSI+soYl3tfZslq8Xyo9HcSn++X c7gTjuQa4ut5wFYMBxI6pbXjWRk7KE1rbV3NEXKk9gvPIIMOydZwb6FJg36VIMDXqvNX vpKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=r9ORWwlO; 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 c17si1784932eds.154.2020.05.28.09.50.58; Thu, 28 May 2020 09:51:22 -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=r9ORWwlO; 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 S2405196AbgE1Qs1 (ORCPT + 99 others); Thu, 28 May 2020 12:48:27 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:34282 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405191AbgE1QsZ (ORCPT ); Thu, 28 May 2020 12:48:25 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1590684504; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=V/FjvseqBj5P84s0e9IFl/BbQIRhxvHn2iqA2kw9C+0=; b=r9ORWwlOSESyTgV5nX0qgosbHpc3afeuqHUjT14f3WVjUrMCStka9yiuAQ7aV3LIqCiJaN41 kl0VLVTY5mrNHOsrbvKZwuJcBnINv3DgFhJfU8atIPBn/xTz+9MvJC1bXbMFLjverIQPQHSW wA4utvSCUhFycUy1V2elU5DG/ms= X-Mailgun-Sending-Ip: 104.130.122.27 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-n03.prod.us-west-2.postgun.com with SMTP id 5ecfeb49bf0e32d254267fea (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 28 May 2020 16:48:09 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 77984C433CA; Thu, 28 May 2020 16:48:09 +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 [192.168.1.102] (unknown [157.47.99.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jprakash) by smtp.codeaurora.org (Postfix) with ESMTPSA id 27BD1C433C9; Thu, 28 May 2020 16:48:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 27BD1C433C9 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 Subject: Re: [PATCH V5 3/5] iio: adc: Add support for PMIC7 ADC To: Jonathan Cameron 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 References: <1590157452-27179-1-git-send-email-jprakash@codeaurora.org> <1590157452-27179-4-git-send-email-jprakash@codeaurora.org> <20200524125925.41102b3b@archlinux> From: Jishnu Prakash Message-ID: <795197a7-a43f-a2b6-9096-8ceb3ea7946c@codeaurora.org> Date: Thu, 28 May 2020 22:17:58 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200524125925.41102b3b@archlinux> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jonathan, On 5/24/2020 5:29 PM, Jonathan Cameron wrote: > On Fri, 22 May 2020 19:54:10 +0530 > Jishnu Prakash wrote: > >> The ADC architecture on PMIC7 is changed as compared to PMIC5. The >> major change from PMIC5 is that all SW communication to ADC goes through >> PMK8350, which communicates with other PMICs through PBS when the ADC >> on PMK8350 works in master mode. The SID register is used to identify the >> PMICs with which the PBS needs to communicate. Add support for the same. >> >> Signed-off-by: Jishnu Prakash >> --- >> drivers/iio/adc/qcom-spmi-adc5.c | 231 ++++++++++++++++++++++++++++++-- >> drivers/iio/adc/qcom-vadc-common.c | 260 +++++++++++++++++++++++++++++++++++++ >> drivers/iio/adc/qcom-vadc-common.h | 14 ++ >> 3 files changed, 496 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c >> index 21fdcde..e1482fd 100644 >> --- a/drivers/iio/adc/qcom-spmi-adc5.c >> +++ b/drivers/iio/adc/qcom-spmi-adc5.c >> @@ -1,6 +1,6 @@ >> // SPDX-License-Identifier: GPL-2.0 >> /* >> - * Copyright (c) 2018, The Linux Foundation. All rights reserved. >> + * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. > ... >> @@ -110,6 +120,7 @@ struct adc5_channel_prop { >> enum adc5_cal_method cal_method; >> enum adc5_cal_val cal_val; >> unsigned int decimation; >> + unsigned int sid; >> unsigned int prescale; >> unsigned int hw_settle_time; >> unsigned int avg_samples; >> @@ -140,6 +151,7 @@ struct adc5_chip { >> bool poll_eoc; >> struct completion complete; >> struct mutex lock; >> + int irq_eoc; > This is introduced but doesn't seem to be used... I'll remove it in the next post. > >> const struct adc5_data *data; >> }; >> >> @@ -155,6 +167,8 @@ static const struct vadc_prescale_ratio adc5_prescale_ratios[] = { >> {.num = 1, .den = 16} >> }; >> > ... > >> static int adc5_prescaling_from_dt(u32 num, u32 den) >> { >> unsigned int pre; >> @@ -285,7 +304,7 @@ static int adc5_configure(struct adc5_chip *adc, >> >> /* Read registers 0x42 through 0x46 */ >> ret = adc5_read(adc, ADC5_USR_DIG_PARAM, buf, sizeof(buf)); >> - if (ret < 0) >> + if (ret) >> return ret; > As Andy mentioned, this is better in a separate patch. It's just adding > noise to this patch which is actually doing things... I'll split it out into a separate patch in the next post. > >> >> /* Digital param selection */ >> @@ -314,6 +333,47 @@ static int adc5_configure(struct adc5_chip *adc, >> return adc5_write(adc, ADC5_USR_DIG_PARAM, buf, sizeof(buf)); >> } >> > Thanks, > > Jonathan