From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A60EEC433EF for ; Mon, 14 Mar 2022 19:19:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243991AbiCNTU0 (ORCPT ); Mon, 14 Mar 2022 15:20:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232224AbiCNTUZ (ORCPT ); Mon, 14 Mar 2022 15:20:25 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 460F0E01C for ; Mon, 14 Mar 2022 12:19:15 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id s25so23419243lji.5 for ; Mon, 14 Mar 2022 12:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=TjvDabmipcoDVAowxyOIFgn1uuT4hi0ow4KrPPUg6D4=; b=S/rZzB/TDKyf3X2mQGLC8ujbKUEER7DEPaN0ikq6Pk1hyxxZEmgym3bC7rAz2KUHiZ 49fx9kVfTB9XFd8rFcJ4T6W/FpxJlDSQHiXJfat+uxXkwNLIPmJ5BHN9rcni9iJ7RqQA uoHf7uQnNmQhozpb3GRZDxBHakYHt5ycw7loLCdXJzVHjqJya/TkpiwhVbu8OaU5skwD FohPPTUsXCLEgZgFrE2ed4wKkWumJDPk9BUXDbgnLdsSdRWIsZHORYI1gFaa03bBKN2J DpQJfRZLLoxFaPgUw6a1eSmYRQKWQAapsBdamFdhw8bwM6cLGa1cyWPjfx7tdoSGStKT N26A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=TjvDabmipcoDVAowxyOIFgn1uuT4hi0ow4KrPPUg6D4=; b=te94Lt9PIpTMavY9oSuTUORaigYs/iglbMIwhOKgTlL/IZUcpGh9dbRlG4BT8z6H+T p7etUEA0J4Xp53AYSIMqpR/Gjk9BlhKYdI8qbKxaLxeNoK5WfIk9OkR8MmhPAKbYewQS fdY73+DF8EDIdulOCzxtpaZMxKDlZp+RbzsIrwmYY9XMzF0uWpWFYfRkdBnqh5mmiaWx c2JIcc41WJFpYTEc+zEcVZUB7BPqil+zHaIDo0YilO0Z8u1cZJVEruAdYxrUH6I7hAGD oCv+IPMme7Z43J1KSt4V+0Q2uANbh1cNZkjXDwdZDEJxcqUbo/cWoFoVasBhqyEEdTho nSWA== X-Gm-Message-State: AOAM532Z6pBrZIf/MOvke/WMyOACC/jhWtC3i3/PkyfowEeTzcvR5pWr 2i23Ms67kP78Fkr0vBPaX+Fspw== X-Google-Smtp-Source: ABdhPJxhuKx8oc4rbiN4ALuz3yTIjPTRav3swyG7A2AzuUxZce2+DV9c0nr98TQgOH4sA8dq1b+RYA== X-Received: by 2002:a2e:9617:0:b0:247:d94b:c73b with SMTP id v23-20020a2e9617000000b00247d94bc73bmr14939709ljh.78.1647285549670; Mon, 14 Mar 2022 12:19:09 -0700 (PDT) Received: from [192.168.1.211] ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id g19-20020a2e3913000000b00247dea5b468sm4115825lja.115.2022.03.14.12.19.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Mar 2022 12:19:08 -0700 (PDT) Message-ID: Date: Mon, 14 Mar 2022 22:19:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v11 3/9] mfd: qcom-spmi-pmic: read fab id on supported PMICs Content-Language: en-GB To: Caleb Connolly , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Andy Gross , Bjorn Andersson , Lee Jones , Stephen Boyd , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: sumit.semwal@linaro.org, amit.pundir@linaro.org, john.stultz@linaro.org References: <20220309210014.352267-1-caleb.connolly@linaro.org> <20220309210014.352267-4-caleb.connolly@linaro.org> From: Dmitry Baryshkov In-Reply-To: <20220309210014.352267-4-caleb.connolly@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 10/03/2022 00:00, Caleb Connolly wrote: > The PMI8998 and PM660 expose the fab_id, this is needed by drivers like > the RRADC to calibrate ADC values. > > Signed-off-by: Caleb Connolly Reviewed-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov > --- > drivers/mfd/qcom-spmi-pmic.c | 7 +++++++ > include/soc/qcom/qcom-spmi-pmic.h | 1 + > 2 files changed, 8 insertions(+) > > diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c > index bfe1304aee1b..b12a07da6183 100644 > --- a/drivers/mfd/qcom-spmi-pmic.c > +++ b/drivers/mfd/qcom-spmi-pmic.c > @@ -19,6 +19,7 @@ > #define PMIC_REV4 0x103 > #define PMIC_TYPE 0x104 > #define PMIC_SUBTYPE 0x105 > +#define PMIC_FAB_ID 0x1f2 > > #define PMIC_TYPE_VALUE 0x51 > > @@ -175,6 +176,12 @@ static int pmic_spmi_load_revid(struct regmap *map, struct device *dev, > if (ret < 0) > return ret; > > + if (pmic->subtype == PMI8998_SUBTYPE || pmic->subtype == PM660_SUBTYPE) { > + ret = regmap_read(map, PMIC_FAB_ID, &pmic->fab_id); > + if (ret < 0) > + return ret; > + } > + > /* > * In early versions of PM8941 and PM8226, the major revision number > * started incrementing from 0 (eg 0 = v1.0, 1 = v2.0). > diff --git a/include/soc/qcom/qcom-spmi-pmic.h b/include/soc/qcom/qcom-spmi-pmic.h > index 5400e6509fe8..ff839b230e62 100644 > --- a/include/soc/qcom/qcom-spmi-pmic.h > +++ b/include/soc/qcom/qcom-spmi-pmic.h > @@ -50,6 +50,7 @@ struct qcom_spmi_pmic { > unsigned int major; > unsigned int minor; > unsigned int rev2; > + unsigned int fab_id; > const char *name; > }; > -- With best wishes Dmitry