linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Amit Kucheria <amit.kucheria@linaro.org>
Cc: linux-kernel@vger.kernel.org, rnayak@codeaurora.org,
	linux-arm-msm@vger.kernel.org, edubezval@gmail.com,
	Zhang Rui <rui.zhang@intel.com>,
	"open list:THERMAL" <linux-pm@vger.kernel.org>
Subject: Re: [PATCH v2 3/5] thermal: tsens: Move 8996 get_temp() to common code for reuse
Date: Tue, 12 Jun 2018 12:43:02 -0700	[thread overview]
Message-ID: <20180612194302.GP14924@minitux> (raw)
In-Reply-To: <ed6b51a1b08e195968f5423a86e40146279a8807.1528799892.git.amit.kucheria@linaro.org>

On Tue 12 Jun 03:54 PDT 2018, Amit Kucheria wrote:
> diff --git a/drivers/thermal/qcom/tsens-8996.c b/drivers/thermal/qcom/tsens-8996.c
[..]
>  static const struct tsens_ops ops_8996 = {
>  	.init		= init_common,
> -	.get_temp	= get_temp_8996,
> +	.get_temp	= get_temp_tsens_v2,
>  };
>  
>  const struct tsens_data data_8996 = {
> diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c
[..]
> +int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp)

I like the function name, but it's not really common for tsens, it's
just common for tsens v2. Also as patch 4 shows we end up adding a set
of essentially empty platform specific files for referencing this
function.

I would suggest that you instead rename tsens-8996.c to tsens-v2.c,
rename ops_8996 to ops_v2 and either add new tsens_data for each
platform or simply rename that too to data_v2 which we point to from
tsens_table.


I think we should take it once step further and add "qcom,tsens-v2" as a
valid compatible in tsens_table and make the dts do:

	comaptible = "qcom,msm8996-tsens", "qcom,tsens-v2";

and
	compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";

Regards,
Bjorn

  reply	other threads:[~2018-06-12 19:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 10:54 [PATCH v2 0/5] thermal: tsens: Prepare for version 2 of TSENS IP Amit Kucheria
2018-06-12 10:54 ` [PATCH v2 1/5] thermal: tsens: Get rid of unused fields in structure Amit Kucheria
2018-06-12 10:54 ` [PATCH v2 2/5] dt: qcom: 8996: thermal: Move to DT initialisation Amit Kucheria
2018-06-12 19:35   ` Bjorn Andersson
2018-06-13  8:13     ` Amit Kucheria
2018-06-12 10:54 ` [PATCH v2 3/5] thermal: tsens: Move 8996 get_temp() to common code for reuse Amit Kucheria
2018-06-12 19:43   ` Bjorn Andersson [this message]
2018-06-12 20:55     ` Amit Kucheria
2018-06-12 10:54 ` [PATCH v2 4/5] thermal: tsens: Add support for SDM845 Amit Kucheria
2018-06-12 19:28   ` Rob Herring
2018-06-14  6:48   ` Vivek Gautam
2018-06-14 10:24     ` Amit Kucheria
2018-06-12 10:54 ` [PATCH v2 5/5] thermal: tsens: Check if we have valid data before reading Amit Kucheria
2018-06-12 19:43   ` Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180612194302.GP14924@minitux \
    --to=bjorn.andersson@linaro.org \
    --cc=amit.kucheria@linaro.org \
    --cc=edubezval@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rnayak@codeaurora.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).