Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp870629imm; Wed, 11 Jul 2018 12:25:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd0pxJqNNTfsJyVCrhoROo3f2wXfEYOIV0VYNFZ7r3BehNvgt5WNbOfMQW6c29+sznEauaf X-Received: by 2002:a17:902:b693:: with SMTP id c19-v6mr14630170pls.114.1531337121436; Wed, 11 Jul 2018 12:25:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531337121; cv=none; d=google.com; s=arc-20160816; b=orUt8zzpSbVtiQgaXX1fS3t3FclXLUU88teigNYrzLMnvrrFbKw6GgOe/8mP8l8Ogz qRnWapV7xoIJLu6y7P6Ui6P21QnyCI9REIiLmff5hdBt4/3iKGS68x/EED7jWsasKdLo 9V1twwuwLZtFTGHxDJ5uqA+Gg0gPXTWaUhLH8Fe2biuxWtw/CD/OygbYSmP83gTHnKmU 42YsMrvnLUNDMo0UB+qGxcyQH2HiDcR3pIQze6fvlFHfuQWfWqJ5K6z0JRydhaxa1jnu 9uFPCi/PhtdbxeGhy4vbgPNuNCh58w/emlk1kSQqUV4cKyVlIWQiUMvfYAVVGaivDv4w YRpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=TCkqlh9AWJHgA9aS+GR4d8+1MwSUDTEf4bx5hPTLU0w=; b=UTLU3CJUSnHIcZURVjxX4TBGye//Jtww5mMHR13xx/EDKopHGoHuZV0ZBj59wMwSnN 9WLLaB0QVPieYu5zzHHaclIlblXilnGA1FV8u8Ht25WGZtBdR/tgv0btNtW8HX6q97i4 hxxkk93MD1wkdLj4dcdTxkECHtoPwwgvipczMk7nSc6VTWjzoO+IV3pZq9KzAMYikx2b L7YFYcMdTFOAsMhU4lkhkk4jsdowZZqfN+GdUHOoAEtcvkWTdez7V0/nShraouAm0vJk MQKSkcxOfPmP0n/TXG/ySoIumPlLmUSHX7lmdcngsQJF8mP6xwvbTbtA3VP+k1WQwhR1 T/Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ULDdkVKz; 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 k2-v6si19901260plt.374.2018.07.11.12.25.06; Wed, 11 Jul 2018 12:25:21 -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=ULDdkVKz; 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 S2389797AbeGKQnN (ORCPT + 99 others); Wed, 11 Jul 2018 12:43:13 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:43803 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388213AbeGKQnN (ORCPT ); Wed, 11 Jul 2018 12:43:13 -0400 Received: by mail-pf0-f196.google.com with SMTP id y8-v6so18764116pfm.10 for ; Wed, 11 Jul 2018 09:38:04 -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:in-reply-to:user-agent; bh=TCkqlh9AWJHgA9aS+GR4d8+1MwSUDTEf4bx5hPTLU0w=; b=ULDdkVKzyO7QEmvVHDZ2t84Cjg0NY1YZQPzRIR0L/pmEJWv09TloIqgPtL44ghSCcU rOmlv0jkHh5UQWod6eqzVHqKqs03ERuJR+V/2Xyq9yFXutai4281Rq8z4y7zZ/1bUmV2 gdUSDYBgd2XQ0I09rGShP62mgMUL5U78FV1fY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TCkqlh9AWJHgA9aS+GR4d8+1MwSUDTEf4bx5hPTLU0w=; b=VxUYmQr9bMgixNvLIVYCBC6P4SykjSs0IivdK5VMcgzXlMumvIDHSm604avnnSNw6v ziL3g4GfmwbPHlLswmPp/2Uk8R8wullDcBakMlbOPYgcHcTWsB1N1zGmRnYSmkJu92Ss EA3sFtBuzBJn3h3ZlwlQOqaZumPeBs/7uKNBDAKFBBZmQuCVtQWnqUCHU0vtls6wmJFW 2yiLqQQS+aVmpU2/E8JlFcDOFUSYbQiBHernBzswyzMfTxE/GaELw2H39prsd+5XNBOr JW2NoOAM09AmCrukGjUjf38uq9VyZtv9FdF94UjngHfmDh5fZmNAGCwQkAm5EoqjguHa kNbg== X-Gm-Message-State: APt69E2ZJb32ibApjcsNjZoSqB5MSZux/QqDgNX66IyUrO6tPY+XTnPT laqkQ3Wl3fXzX1laCjTo6oJCtg== X-Received: by 2002:a62:9992:: with SMTP id t18-v6mr30869830pfk.239.1531327084285; Wed, 11 Jul 2018 09:38:04 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id q26-v6sm2237641pff.9.2018.07.11.09.38.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 09:38:03 -0700 (PDT) Date: Wed, 11 Jul 2018 09:40:45 -0700 From: Bjorn Andersson To: Amit Kucheria Cc: linux-kernel@vger.kernel.org, rnayak@codeaurora.org, linux-arm-msm@vger.kernel.org, edubezval@gmail.com, smohanad@codeaurora.org, vivek.gautam@codeaurora.org, andy.gross@linaro.org, Zhang Rui , Kees Cook , Rob Herring , linux-pm@vger.kernel.org Subject: Re: [PATCH v6 5/7] thermal: tsens: Add generic support for TSENS v2 IP Message-ID: <20180711164045.GD545@tuxbook-pro> References: <278b59d6a25f874a087995368cecec2572b5be89.1531135999.git.amit.kucheria@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <278b59d6a25f874a087995368cecec2572b5be89.1531135999.git.amit.kucheria@linaro.org> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 09 Jul 04:43 PDT 2018, 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 Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > 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, > }; > - > diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c > index 3440166c..a2c9bfa 100644 > --- a/drivers/thermal/qcom/tsens.c > +++ b/drivers/thermal/qcom/tsens.c > @@ -72,6 +72,9 @@ static const struct of_device_id tsens_table[] = { > }, { > .compatible = "qcom,msm8996-tsens", > .data = &data_8996, > + }, { > + .compatible = "qcom,tsens-v2", > + .data = &data_tsens_v2, > }, > {} > }; > diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h > index d785b37..14331eb 100644 > --- a/drivers/thermal/qcom/tsens.h > +++ b/drivers/thermal/qcom/tsens.h > @@ -88,6 +88,9 @@ void compute_intercept_slope(struct tsens_device *, u32 *, u32 *, u32); > int init_common(struct tsens_device *); > int get_temp_common(struct tsens_device *, int, int *); > > -extern const struct tsens_data data_8916, data_8974, data_8960, data_8996; > +/* TSENS v1 targets */ > +extern const struct tsens_data data_8916, data_8974, data_8960; > +/* TSENS v2 targets */ > +extern const struct tsens_data data_8996, data_tsens_v2; > > #endif /* __QCOM_TSENS_H__ */ > -- > 2.7.4 >