Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1284621imm; Wed, 11 Jul 2018 22:13:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdeKRpvlGjTXSk0eBKsQ8nvDXn7ABYuGNCEDK9PlWgQyVk90+uviXwZBI5GkYOFXUtZ8eMH X-Received: by 2002:a63:35c3:: with SMTP id c186-v6mr717155pga.217.1531372392636; Wed, 11 Jul 2018 22:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531372392; cv=none; d=google.com; s=arc-20160816; b=JJdMn+kEeByvk3syFAlz3BrgwfSDutQk3Fa+3lUkiWpyY9/OO6BeduVOXIlLeplcGr fY01bMp3WDbf1I5+QdNt91D/keQe2aL23bMa6m20/7JrjsaVCcwCblldH+/kokDkt9OP hXl6lYbLoOKGSQDb6rzVLCY0GSvoiOxH3vAVT4GdH/UUKDc7L4oxf0hqMR2ZnfIwYvyk SjWMohQWRxRiyyMrD1rmwQpKCukC9em33p8aIvWndf2Eru1MbUdyHZG2gDYjhOwH9pZc lmBPAZ0yVHy5Q848DXGb7uE7x3NdpLR+myrgY1DDTeotOt42R5xpdo1G4hhqPYUZhUsf Lh9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=Hh/0cv/4n3fwTOMZZpnwgzx9YFl2tRlk4NjLuWaCiN8=; b=uhQh/V923RVnj6zoOSF3xhw7Dj1WieDj2n8uvwvsyojzKfuTbhrwg3T7kyXbS76YIW nCXRo1U1cBGA0p1QoCkEgHzlU7Ht1RHdfMNxGGDkNBsx/M87L+5y4/VC59GC3YqNGDv/ +ffvLD7Xieu0L0zFIIWP1Mmjfl2E+ZFnmQniUxWHKjvthfUTpyPJJqccEh4K+XIdGnxB LU9kOfqhuHG6FL8+EVd4ubFFOlmWWLGPT5o5H3gVo+wkKjZv5DDjhMfzGI7SetuOFZ/T BzgYoZRnixZJbAPhkaUbWkfX4RUTaP/eBBCmxqLTRN8GxvRQzKXhpfdWvIyu+YR9gjW/ YkNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gN7POpZ/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c32-v6si4261271pgc.129.2018.07.11.22.12.56; Wed, 11 Jul 2018 22:13:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gN7POpZ/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726015AbeGLFUN (ORCPT + 99 others); Thu, 12 Jul 2018 01:20:13 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:46254 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725786AbeGLFUN (ORCPT ); Thu, 12 Jul 2018 01:20:13 -0400 Received: by mail-qt0-f196.google.com with SMTP id d4-v6so7622167qtn.13 for ; Wed, 11 Jul 2018 22:12:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Hh/0cv/4n3fwTOMZZpnwgzx9YFl2tRlk4NjLuWaCiN8=; b=gN7POpZ/DaJlmY+y2w8JME8ULflQovuRkCyxExMevlo3FS61R/PE7cbAwMRCCzpLnu Jx+ShGvL1nhO5aJKS6lOEVUXU8qp/YiJ/v2cJfk8O+sFs5ngKTJxU5w8PWKJjfTlmAv4 3jLUI+WsqnB9E1Lw+oL9Cdda9urxnbr2SnSFg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Hh/0cv/4n3fwTOMZZpnwgzx9YFl2tRlk4NjLuWaCiN8=; b=RrOILXytN6NoayE6l0EpDZ5fgyry7+o9c6oNLubGV8vjBzNMd5CxdMyPPOcCUn1LcT qtjQdJuY9E/Y1ywyvjV/a38vg6i8bBPBxYfMDdJv4DUTUgkzBdoy9MKunR/1SHwh/gYw ylQX7E/OlyiSNyUwdV9Lx4hmnwvkOZbY2taRCwGCFFjaykXmA1wKtsXxZ4VSww4PdNJQ u2ylhTDXUz0WYHATS3ZuNCGQ9hAHDOHLTKg0M1rLafzwC89LYdQ1Dy4mDxPlAe/HKliq IlU+LAyinswhSRoFn/85D4KcdLiLnJop/hnRQ3IEB9CENiKLU7ts0J8jRT9X5lTSZS79 untA== X-Gm-Message-State: AOUpUlFRa7gvrHrVV8cWbZ2VES+mxFtOxDc4eo5ESUp6WYtnwBO82Rvy oUYSrNbFaWZXQfPznf0Xm6D3PAkg1dj2BQ0D/MeX8w== X-Received: by 2002:a0c:9281:: with SMTP id b1-v6mr745170qvb.115.1531372341841; Wed, 11 Jul 2018 22:12:21 -0700 (PDT) MIME-Version: 1.0 References: <278b59d6a25f874a087995368cecec2572b5be89.1531135999.git.amit.kucheria@linaro.org> In-Reply-To: From: Amit Kucheria Date: Thu, 12 Jul 2018 10:42:10 +0530 Message-ID: Subject: Re: [PATCH v6 5/7] thermal: tsens: Add generic support for TSENS v2 IP To: Doug Anderson Cc: Linux Kernel Mailing List , Rajendra Nayak , linux-arm-msm , Bjorn Andersson , Eduardo Valentin , smohanad@codeaurora.org, Vivek Gautam , Andy Gross , Zhang Rui , Kees Cook , Rob Herring , Linux PM list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 12, 2018 at 12:10 AM Doug Anderson wrote: > > Hi, > > On Mon, Jul 9, 2018 at 4:43 AM, Amit Kucheria wrote: > > SDM845 uses v2 of the TSENS IP block but the get_temp() function > > appears to be identical across v2.x.y in code seen so far. We use the > > generic get_temp() function defined as part of ops_generic_v2. > > > > Signed-off-by: Amit Kucheria > > --- > > drivers/thermal/qcom/tsens-v2.c | 6 +++++- > > drivers/thermal/qcom/tsens.c | 3 +++ > > drivers/thermal/qcom/tsens.h | 5 ++++- > > 3 files changed, 12 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c > > index 34ba6c7..f40150f 100644 > > --- a/drivers/thermal/qcom/tsens-v2.c > > +++ b/drivers/thermal/qcom/tsens-v2.c > > @@ -69,8 +69,12 @@ static const struct tsens_ops ops_generic_v2 = { > > .get_temp = get_temp_tsens_v2, > > }; > > > > +const struct tsens_data data_tsens_v2 = { > > + .ops = &ops_generic_v2, > > +}; > > + > > +/* Kept around for backward compatibility with old msm8996.dtsi */ > > const struct tsens_data data_8996 = { > > .num_sensors = 13, > > .ops = &ops_generic_v2, > > }; > > Something seems fishy here. You have a ".num_sensors" for sdm8996 > hardcoded to 13 but you don't have a ".num_sensors" for your new v2. > Where does num_sensors get set for everyone else? In patch #3 you > have a new "#qcom,sensors" but: > > 1. Nothing reads this as far as I can tell, so that means everyone > will end up with 0 sensors. > > 2. On your 2nd block of sensors in the sdm8996 device tree (see > earlier patch in the series) you try to set qcom,sensors to 8. ...but > since you still have a compatible of "qcom,msm8996-tsens" you'll get > 13. That seems wrong. ...or did I miss something? Refer to commit 6d7c70d1cd6 (thermal: qcom: tsens: Allow number of sensors to come from DT) merged earlier. #qcom,sensors will override the platform data if defined.