Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1311553iog; Tue, 14 Jun 2022 03:40:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwT0AxpG+lw1iKrRr1HD2f37twgGIOlBSfLoRsxvsF9Sp3+TJVPO+trPDnn6eKH3aGcVAOH X-Received: by 2002:a17:906:b208:b0:70e:c7f1:f8bf with SMTP id p8-20020a170906b20800b0070ec7f1f8bfmr3592670ejz.143.1655203208608; Tue, 14 Jun 2022 03:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655203208; cv=none; d=google.com; s=arc-20160816; b=pukpbAUoG6gl72EAmr1trtxY3BlUHsm8HlIWcPzWh8bHwpsSIrVzhnwzm43lPZrtJM CmBml1ZVJO5icr+cCV/V4RxFjF5W9aXH2KQILHeBDjSnWC1sCYYy7XWt76d1yq07SKII eTZo4zTI3gdAv0W0qFZR9CPLznmrefW9kR0xTBCEeh/qPax1/Jn4oAb4gx3neEbVXUGo 0GLuSY33XQ2yRV36gvR82XaXTsYDs6zlPzi79YEnErQzvFz9jRhdeW9TQKrMlrGli2xs ahN1ux5N2KzN38+xsW6MzcGc0SKY5wH2FonkHO+xCPG5CPvvtoStR4rnIvTTLBl3VeVD MgRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=6R6LPpxliPlARArMVAh20tTGramzZw8RH2aKK1dA8RI=; b=WOkqm+8gVRwN7TLu5UgcXY6j3S9CWCeb1aaH3rQMSDWbavMrem2WTiAEoM9wvP2ymH oj/FNDMqIgn6jWnX+i96FuDHOjTRFkAOubhHuxiJkRsRZ7193hbp9UnNrIKjepWy98Zy o3PlNxwoH1HfxfIhdQx45TyL7dwRKEtxqDDX9dUkYbiqOQAxD5ny3/IalP2O2FiSx88a DxMEPoNeDhdiioiwLPZlTzK7xQ+J2VRGFMQLwF5T36w5N3rlxQy8ionD5AUDqoTnAP0d irm15mdbadgb+v+xPWqFF5efDJhW0t2v5MaK7VUuz7G9yC9XOP3b3eMLfi1xBjKj+gsv natA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ulIOCLnX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020aa7d5cb000000b0042df048551csi9692119eds.351.2022.06.14.03.39.43; Tue, 14 Jun 2022 03:40:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ulIOCLnX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S240313AbiFNKf1 (ORCPT + 99 others); Tue, 14 Jun 2022 06:35:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355778AbiFNKd0 (ORCPT ); Tue, 14 Jun 2022 06:33:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B2E247ACC; Tue, 14 Jun 2022 03:33:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B938A60EAA; Tue, 14 Jun 2022 10:33:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC191C3411B; Tue, 14 Jun 2022 10:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655202805; bh=ACx3upsZaaL84t/hdNR790ZYbJczEEwd+6WWrOK0Up4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ulIOCLnXY/qzFR/iAkuSG8Rs/itqDHhek3LgPCMHtwEn57aMoZElelMjzqID8LBv7 t22yqFN4/yCDG/hzRWC28tu+c2sCdcVM21+BeliXO1dDOAhbV5OLOKP0Y/Vvz0nXxw H1T0TMGWOmLzFCspFfYNIRSy6A7lZ/Qv4rQR8O8vVqfsDQX3VZNn0/w0ACBLccR0bn HawitHBEW0vl4ileoXil8chNZIxn138HOAVFxMMqTiRp5hrWNSNEBWjmDAFf38HZOt dQFOY0eWcSPXLjxnLvRvtnzGJKX9dOshv2qOEjeL6RaSDoXVwVxNHz2jpCXOs3K32z hrkSJFUaumsPQ== Date: Tue, 14 Jun 2022 11:42:34 +0100 From: Jonathan Cameron To: Caleb Connolly Cc: Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Lee Jones , Stephen Boyd , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jami Kettunen , Sumit Semwal , Dmitry Baryshkov Subject: Re: [PATCH v14 02/10] mfd: qcom-spmi-pmic: expose the PMIC revid information to clients Message-ID: <20220614114234.7e9dd1ac@jic23-huawei> In-Reply-To: <20220501182829.1edc181f@jic23-huawei> References: <20220429220904.137297-1-caleb.connolly@linaro.org> <20220429220904.137297-3-caleb.connolly@linaro.org> <20220501182829.1edc181f@jic23-huawei> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 1 May 2022 18:28:29 +0100 Jonathan Cameron wrote: > On Fri, 29 Apr 2022 23:08:57 +0100 > Caleb Connolly wrote: > > > Some PMIC functions such as the RRADC need to be aware of the PMIC > > chip revision information to implement errata or otherwise adjust > > behaviour, export the PMIC information to enable this. > > > > This is specifically required to enable the RRADC to adjust > > coefficients based on which chip fab the PMIC was produced in, > > this can vary per unique device and therefore has to be read at > > runtime. > > > > Signed-off-by: Caleb Connolly > > Reviewed-by: Dmitry Baryshkov > > Tested-by: Dmitry Baryshkov > > ... > > > +/** > > + * qcom_pmic_get() - Get a pointer to the base PMIC device > > + * > > + * This function takes a struct device for a driver which is a child of a PMIC. > > + * And locates the PMIC revision information for it. > > + * > > + * @dev: the pmic function device > > + * @return: the struct qcom_spmi_pmic* pointer associated with the function device > > + */ > > +inline const struct qcom_spmi_pmic *qcom_pmic_get(struct device *dev) > > +{ > > + struct spmi_device *sdev; > > + struct qcom_spmi_dev *spmi; > > + > > + /* > > + * Make sure the device is actually a child of a PMIC > > + */ > > + if (!of_match_device(pmic_spmi_id_table, dev->parent)) > > + return ERR_PTR(-EINVAL); > > + > > + sdev = qcom_pmic_get_base_usid(dev->parent); > > > > - if (subtype == PM8110_SUBTYPE) > > - minor = rev2; > > + if (IS_ERR(sdev)) > > + return ERR_CAST(sdev); > > > > - dev_dbg(dev, "%x: %s v%d.%d\n", subtype, name, major, minor); > > + spmi = (struct qcom_spmi_dev *)dev_get_drvdata(&sdev->dev); > > Shouldn't need the cast as dev_get_drvdata() returns void * and you can > implicitly cast that to any other pointer type. > > If this is all that comes up in the series I can fixup whilst applying. > > Jonathan Hi Caleb, Now Stephen has acked the spmi changes, only remaining ack needed is Lee for mfd. Given it's been a while, perhaps best bet is if you do a v15 just wrapping up those minor tweaks and ping Lee to take a look at it when he has time. On off chance Lee just want's to pick it up and push out an immutable branch (rather than me doing the same, I'll give tags for the IIO effecting bits) Thanks, Jonathan > > > > + > > + return &spmi->pmic; > > } > > +EXPORT_SYMBOL(qcom_pmic_get); > > >