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 EF990C4332F for ; Thu, 28 Apr 2022 16:30:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346309AbiD1QeJ (ORCPT ); Thu, 28 Apr 2022 12:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350067AbiD1QeB (ORCPT ); Thu, 28 Apr 2022 12:34:01 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 882E96C967 for ; Thu, 28 Apr 2022 09:30:45 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id q23so7506769wra.1 for ; Thu, 28 Apr 2022 09:30:45 -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=KMHd5fXULhcXyAiUwOACLIbDiIltwFbphMx0p6+Bqpc=; b=IlMhCUquK3302JRV+dnW8sisiWrBYKgke8Vcsjpan61x4HXqOUeMXJ1EvR38Yurf10 sH3zd7/SGwTh0oXmjtJex2nOM8ORWfbnqgOSuVpx+RfGFgl9ajfo7Zrnr/NS+iE85rdo AbZw0oGHEj2zHmOx7VKJx+LiLoDE7DFsRbYmqhdp+PT29syjqX0ZbzDuSsUv9VnWlArf yiLwTvcPA5Hrutqj/A4K+ZtU5FhV0nLSS2WWveJk6G/qWEyyMG5f0MI1fIjHglb+ABZW aQYKaBd4jpDBZdZo+V7TTkDfL3hvrfgyidtMIZwDA96hZwWamWbxuLfBUmhDzf6YDSF8 SIxw== 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=KMHd5fXULhcXyAiUwOACLIbDiIltwFbphMx0p6+Bqpc=; b=UE1czzYOpCqs+mxDrrj3936alu8JAh5jBpyuJF2WXbrLoKV8JPMxOEwrBgMiW8bNrP ljYVHpSYhC4LHILka+IGIn8mYvdTt7Qw9+CkGNUPCCxAqxGs8jP0Lq8r3pQsqqpBg0C5 877vvlcWSZUMCV4c/q0ZboqvtQasxanACN6s1eYzFwBNI4zOTMkHxLAii7N2OUgfAMTq jxCPXcQs6DfWwNGJEtXSPyuHVJ+5uWEjQMMC7UWohjAikM9mXHlbcrI4KcX7l6i4Kyor 3D8SUtmSXJnNhEVaxcxBti9STwb5hvwT7cW13U3pVhcJBkGAiUD7tZoWEyIuMM5jB/dZ Ih5w== X-Gm-Message-State: AOAM531I7oR7ahykUw+SmhOmPLkK4Vvfxkl4HyfMpav+T/s866IY0rzK fC9GsPMWNH93tnkZyFJZ4tCsvg== X-Google-Smtp-Source: ABdhPJyzdHvOPdycnfJ7BtT6tZsr29Nxggep8lbk5N3X/jFsaHxwjv7admh0kbjGdsP4qIdOkB5Ihg== X-Received: by 2002:a5d:6551:0:b0:20a:e23c:a7fa with SMTP id z17-20020a5d6551000000b0020ae23ca7famr12917464wrv.535.1651163444078; Thu, 28 Apr 2022 09:30:44 -0700 (PDT) Received: from [192.168.0.33] (cpc78119-cwma10-2-0-cust590.7-3.cable.virginm.net. [81.96.50.79]) by smtp.gmail.com with ESMTPSA id j12-20020a5d564c000000b0020af46b0ff4sm247406wrw.37.2022.04.28.09.30.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Apr 2022 09:30:43 -0700 (PDT) Message-ID: Date: Thu, 28 Apr 2022 17:30:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v13 2/9] mfd: qcom-spmi-pmic: expose the PMIC revid information to clients Content-Language: en-US To: Lee Jones Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Andy Gross , Bjorn Andersson , Stephen Boyd , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, sumit.semwal@linaro.org, amit.pundir@linaro.org, john.stultz@linaro.org, Krzysztof Kozlowski , Dmitry Baryshkov References: <20220323162820.110806-1-caleb@connolly.tech> <20220323162820.110806-3-caleb@connolly.tech> <2763f103-6947-e431-cef5-e202c324d678@linaro.org> From: Caleb Connolly In-Reply-To: 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 28/04/2022 17:14, Lee Jones wrote: > On Wed, 27 Apr 2022, Caleb Connolly wrote: >> On 25/04/2022 16:03, Lee Jones wrote: >>> >>> On Wed, 23 Mar 2022, Caleb Connolly wrote: >>>> From: Caleb Connolly >>>> >>>> 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 >>>> --- >>>> drivers/mfd/qcom-spmi-pmic.c | 261 +++++++++++++++++++----------- >>>> include/soc/qcom/qcom-spmi-pmic.h | 60 +++++++ >>>> 2 files changed, 231 insertions(+), 90 deletions(-) >>>> create mode 100644 include/soc/qcom/qcom-spmi-pmic.h > > [...] > >>>> + /* >>>> + * If the base USID for this PMIC hasn't probed yet >>>> + * but the secondary USID has, then we need to defer >>>> + * the function driver so that it will attempt to >>>> + * probe again when the base USID is ready. >>>> + */ >>>> + if (pmic_addr == function_parent_usid - (ctx->num_usids - 1)) >>> >>> Double " ". >> Ack >>> >>> Over-bracketing of statements with matching operands. >> I don't think x - (y - 1) is equal to x - y - 1? Or am I misunderstanding you here? > > Can you give me an example when this would be the case? According to the Python interpreter: >>> x=7 >>> y=4 >>> x - y - 1 2 >>> x - (y - 1) 4 C does also respect the first rule of BODMAS - parenthesis are always evaluated first. > -- Kind Regards, Caleb (they/he)