* [PATCH v2 0/2] thermal: rcar: minor fixes
@ 2015-01-07 1:13 Yoshihiro Shimoda
2015-01-07 1:13 ` [PATCH v2 1/2] thermal: rcar: fix ENR register value Yoshihiro Shimoda
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Yoshihiro Shimoda @ 2015-01-07 1:13 UTC (permalink / raw)
To: rui.zhang, edubezval; +Cc: linux-pm, linux-sh, Yoshihiro Shimoda
This patch series is based on linux-soc-thermal.git / fixes branch.
(commit id = 5a723e81923410f0d3ae4c38974607b13befdda9)
Changes from v1:
- The driver calculate the ENR value using IO resource sets in patch 1.
- Update description about the helper variables 'old' and 'new' in patch 2.
- Add "Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>" in patch 2.
Yoshihiro Shimoda (2):
thermal: rcar: fix ENR register value
thermal: rcar: change type of ctemp in rcar_thermal_update_temp()
drivers/thermal/rcar_thermal.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] thermal: rcar: fix ENR register value
2015-01-07 1:13 [PATCH v2 0/2] thermal: rcar: minor fixes Yoshihiro Shimoda
@ 2015-01-07 1:13 ` Yoshihiro Shimoda
2015-01-07 8:26 ` Geert Uytterhoeven
2015-01-07 1:13 ` [PATCH v2 2/2] thermal: rcar: change type of ctemp in rcar_thermal_update_temp() Yoshihiro Shimoda
2015-01-07 13:30 ` [PATCH v2 0/2] thermal: rcar: minor fixes Eduardo Valentin
2 siblings, 1 reply; 5+ messages in thread
From: Yoshihiro Shimoda @ 2015-01-07 1:13 UTC (permalink / raw)
To: rui.zhang, edubezval; +Cc: linux-pm, linux-sh, Yoshihiro Shimoda
On R-Mobile APE6, since it has 3 thermal zones, ENR register
has enable bits in bit 19-16, bit 11-8 and bit 3-0.
However, on R-Car gen2, since it has 1 thermal zone, ENR register has
enable bits in bit 3-0. (In other words, the write value should always
be 0 for bit 31-4 of ENR register.)
So, this patch fixes the ENR register value using I/O resource sets.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
drivers/thermal/rcar_thermal.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 8803e69..2f3b4ff 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -372,6 +372,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
int i;
int ret = -ENODEV;
int idle = IDLE_INTERVAL;
+ u32 enr_bits = 0;
common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL);
if (!common)
@@ -408,9 +409,6 @@ static int rcar_thermal_probe(struct platform_device *pdev)
if (IS_ERR(common->base))
return PTR_ERR(common->base);
- /* enable temperature comparation */
- rcar_thermal_common_write(common, ENR, 0x00030303);
-
idle = 0; /* polling delay is not needed */
}
@@ -452,8 +450,15 @@ static int rcar_thermal_probe(struct platform_device *pdev)
rcar_thermal_irq_enable(priv);
list_move_tail(&priv->list, &common->head);
+
+ /* update ENR bits */
+ enr_bits |= 3 << (i * 8);
}
+ /* enable temperature comparation */
+ if (irq)
+ rcar_thermal_common_write(common, ENR, enr_bits);
+
platform_set_drvdata(pdev, common);
dev_info(dev, "%d sensor probed\n", i);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] thermal: rcar: change type of ctemp in rcar_thermal_update_temp()
2015-01-07 1:13 [PATCH v2 0/2] thermal: rcar: minor fixes Yoshihiro Shimoda
2015-01-07 1:13 ` [PATCH v2 1/2] thermal: rcar: fix ENR register value Yoshihiro Shimoda
@ 2015-01-07 1:13 ` Yoshihiro Shimoda
2015-01-07 13:30 ` [PATCH v2 0/2] thermal: rcar: minor fixes Eduardo Valentin
2 siblings, 0 replies; 5+ messages in thread
From: Yoshihiro Shimoda @ 2015-01-07 1:13 UTC (permalink / raw)
To: rui.zhang, edubezval; +Cc: linux-pm, linux-sh, Yoshihiro Shimoda
Since the ctemp is used for rcar_thermal_write() in
rcar_thermal_update_temp(), the type of 'ctemp' should be "u32" instead
of "int". This patch also changes type of the helper variables 'old'
and 'new'.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/thermal/rcar_thermal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 2f3b4ff..70bb02c 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -63,7 +63,7 @@ struct rcar_thermal_priv {
struct mutex lock;
struct list_head list;
int id;
- int ctemp;
+ u32 ctemp;
};
#define rcar_thermal_for_each_priv(pos, common) \
@@ -145,7 +145,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv)
{
struct device *dev = rcar_priv_to_dev(priv);
int i;
- int ctemp, old, new;
+ u32 ctemp, old, new;
int ret = -EINVAL;
mutex_lock(&priv->lock);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/2] thermal: rcar: fix ENR register value
2015-01-07 1:13 ` [PATCH v2 1/2] thermal: rcar: fix ENR register value Yoshihiro Shimoda
@ 2015-01-07 8:26 ` Geert Uytterhoeven
0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2015-01-07 8:26 UTC (permalink / raw)
To: Yoshihiro Shimoda
Cc: Zhang Rui, Eduardo Valentin, Linux PM list, Linux-sh list
On Wed, Jan 7, 2015 at 2:13 AM, Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> On R-Mobile APE6, since it has 3 thermal zones, ENR register
> has enable bits in bit 19-16, bit 11-8 and bit 3-0.
>
> However, on R-Car gen2, since it has 1 thermal zone, ENR register has
> enable bits in bit 3-0. (In other words, the write value should always
> be 0 for bit 31-4 of ENR register.)
>
> So, this patch fixes the ENR register value using I/O resource sets.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Thanks for the update!
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] thermal: rcar: minor fixes
2015-01-07 1:13 [PATCH v2 0/2] thermal: rcar: minor fixes Yoshihiro Shimoda
2015-01-07 1:13 ` [PATCH v2 1/2] thermal: rcar: fix ENR register value Yoshihiro Shimoda
2015-01-07 1:13 ` [PATCH v2 2/2] thermal: rcar: change type of ctemp in rcar_thermal_update_temp() Yoshihiro Shimoda
@ 2015-01-07 13:30 ` Eduardo Valentin
2 siblings, 0 replies; 5+ messages in thread
From: Eduardo Valentin @ 2015-01-07 13:30 UTC (permalink / raw)
To: Yoshihiro Shimoda; +Cc: rui.zhang, linux-pm, linux-sh
[-- Attachment #1: Type: text/plain, Size: 787 bytes --]
On Wed, Jan 07, 2015 at 10:13:09AM +0900, Yoshihiro Shimoda wrote:
> This patch series is based on linux-soc-thermal.git / fixes branch.
> (commit id = 5a723e81923410f0d3ae4c38974607b13befdda9)
>
> Changes from v1:
> - The driver calculate the ENR value using IO resource sets in patch 1.
> - Update description about the helper variables 'old' and 'new' in patch 2.
> - Add "Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>" in patch 2.
>
> Yoshihiro Shimoda (2):
> thermal: rcar: fix ENR register value
> thermal: rcar: change type of ctemp in rcar_thermal_update_temp()
Applied to my -fixes branch.
Thanks
>
> drivers/thermal/rcar_thermal.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> --
> 1.7.9.5
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-01-07 13:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-07 1:13 [PATCH v2 0/2] thermal: rcar: minor fixes Yoshihiro Shimoda
2015-01-07 1:13 ` [PATCH v2 1/2] thermal: rcar: fix ENR register value Yoshihiro Shimoda
2015-01-07 8:26 ` Geert Uytterhoeven
2015-01-07 1:13 ` [PATCH v2 2/2] thermal: rcar: change type of ctemp in rcar_thermal_update_temp() Yoshihiro Shimoda
2015-01-07 13:30 ` [PATCH v2 0/2] thermal: rcar: minor fixes Eduardo Valentin
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).