devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Valentin <edubezval@gmail.com>
To: Baoyou Xie <baoyou.xie@linaro.org>
Cc: jun.nie@linaro.org, rui.zhang@intel.com, robh+dt@kernel.org,
	mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, shawnguo@kernel.org,
	xie.baoyou@zte.com.cn, chen.chaokai@zte.com.cn,
	wang.qiang01@zte.com.cn
Subject: Re: [PATCH v5 3/3] thermal: zx2967: add thermal driver for ZTE's zx2967 family
Date: Wed, 1 Feb 2017 21:04:27 -0800	[thread overview]
Message-ID: <20170202050425.GA7360@localhost.localdomain> (raw)
In-Reply-To: <1484714522-26651-3-git-send-email-baoyou.xie@linaro.org>

Hey Bao,

On Wed, Jan 18, 2017 at 12:42:02PM +0800, Baoyou Xie wrote:
> This patch adds thermal driver for ZTE's zx2967 family.
> 
> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>

<cut>

> +
> +	/*
> +	 * Calculate temperature
> +	 *   922	initial value of calibration cure
> +	 *   1.951	slope of calibration cure
> +	 */
> +	*temp = DIV_ROUND_CLOSEST((val - 922) * 1000, 1951);

You can describe the offset and slope using DT and avoid this to be hard
coded in your driver. Besides, if you read offset and slope from DT,
your driver will be ready for any upcoming sensor addition that you may
want to support in future, given that would required slope and offset
change, per sensor, per chip version.

Can you please check if you can move these to DT?

BR,
> -- 
> 2.7.4
> 

  reply	other threads:[~2017-02-02  5:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-18  4:42 [PATCH v5 1/3] dt: bindings: add documentation for zx2967 family thermal sensor Baoyou Xie
2017-01-18  4:42 ` [PATCH v5 2/3] MAINTAINERS: add zx2967 thermal drivers to ARM ZTE architecture Baoyou Xie
     [not found] ` <1484714522-26651-1-git-send-email-baoyou.xie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-01-18  4:42   ` [PATCH v5 3/3] thermal: zx2967: add thermal driver for ZTE's zx2967 family Baoyou Xie
2017-02-02  5:04     ` Eduardo Valentin [this message]
2017-02-02  8:48       ` Baoyou Xie
2017-02-02  5:12 ` [PATCH v5 1/3] dt: bindings: add documentation for zx2967 family thermal sensor Eduardo Valentin

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=20170202050425.GA7360@localhost.localdomain \
    --to=edubezval@gmail.com \
    --cc=baoyou.xie@linaro.org \
    --cc=chen.chaokai@zte.com.cn \
    --cc=devicetree@vger.kernel.org \
    --cc=jun.nie@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=shawnguo@kernel.org \
    --cc=wang.qiang01@zte.com.cn \
    --cc=xie.baoyou@zte.com.cn \
    /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).