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 2410EC43217 for ; Fri, 29 Apr 2022 10:06:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238977AbiD2KJ2 (ORCPT ); Fri, 29 Apr 2022 06:09:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238952AbiD2KJ2 (ORCPT ); Fri, 29 Apr 2022 06:09:28 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF33B8AE50 for ; Fri, 29 Apr 2022 03:06:09 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id j15so10134702wrb.2 for ; Fri, 29 Apr 2022 03:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=5CntfCmjV+jt6ob6/zxp3NJtpyFCYLSjmSO47xgDfgc=; b=oXA9dlu2adoUv261G7eAKYGi1UusCO0BveMUWtGi/h0x1gYMNR/5kar9EilfjqWqeH RbQQah1OR9W1Epej6xFXyO2DPjGjQFkkaMoGvEr4GF+mznfy281mAKd4maVjO7gYS2gh FD8fp7mOMZK+CvC9/hJbl7kU3k5kbgm9z9yYicwcQnnq1hQL8LyKyhlxeNqGwDfKKXvb 6ix2grTS4VjS3pXgcX+OIwhC6ah39pI7b5teZJFxBjc3PWFjTe1W5w0fMrKiOH1Nuqoz i23aqjE5MO7AaSiLMfI3UnMTr5UtsaJCO4LnSs0sGiFOPXLF+1ATN9KndhWsBw0r5WNS xWVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=5CntfCmjV+jt6ob6/zxp3NJtpyFCYLSjmSO47xgDfgc=; b=C5zhKKUUkn3n5L133I8lZBJNmu3GkW4ABulA11ciTK18DKXH+rD6srpBSgTyyYpOGZ 1ZW4VQes6PNGC5izr/dk7Zy7BRtqtp6GER6LAM+it0bHkaHgswWWQH6s1ISaraxbm03U SwuTmmwI40Z1wT3RDrUn1hpgQHPvCYCYC5gQn7JOR4DgWuaUmGnIvsrLW/cDEmG/oXVA 016oEd3g5ZyjF2M0ix6m3ld4lVAMVG8koR208Kmr8TsYD0Ct2GTj0hJb8IVGOSVZRh7C qa3o3a4OuCFNm9BujksZozacqjnrVoLJwNyKMXWOVTeAHkGjI3S8Q7jJ7aLNLojiu6S/ YHJw== X-Gm-Message-State: AOAM531CuQdlDsl15v4OQjiBmt1VS9PjHDs5eVAsg0hCyy5IeS3RBurY 8GsGf++uzJJ5MdJZGYTeptTQQg== X-Google-Smtp-Source: ABdhPJyyUkGGUul0ToFA0PjtK9Hd8cYiW92xkX4JQwO7eX/nHbXxL2pHim5RFuxPS/MurU+O7q0yrg== X-Received: by 2002:adf:ec05:0:b0:20a:e496:dab5 with SMTP id x5-20020adfec05000000b0020ae496dab5mr14839951wrn.221.1651226768263; Fri, 29 Apr 2022 03:06:08 -0700 (PDT) Received: from google.com (cpc155339-bagu17-2-0-cust87.1-3.cable.virginm.net. [86.27.177.88]) by smtp.gmail.com with ESMTPSA id x2-20020adfbb42000000b0020ae057045csm2094888wrg.28.2022.04.29.03.06.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 03:06:07 -0700 (PDT) Date: Fri, 29 Apr 2022 11:06:05 +0100 From: Lee Jones To: Caleb Connolly 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 Subject: Re: [PATCH v13 2/9] mfd: qcom-spmi-pmic: expose the PMIC revid information to clients Message-ID: References: <20220323162820.110806-1-caleb@connolly.tech> <20220323162820.110806-3-caleb@connolly.tech> <2763f103-6947-e431-cef5-e202c324d678@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Thu, 28 Apr 2022, Caleb Connolly wrote: > 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. Fair point, well presented. Thanks for this - I understand the problem now. -- Lee Jones [李琼斯] Principal Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog