[1/2] thermal: rcar: fix ENR register value
diff mbox

Message ID 1420538528-5236-2-git-send-email-yoshihiro.shimoda.uh@renesas.com
State Changes Requested
Delegated to: Eduardo Valentin
Headers show

Commit Message

Yoshihiro Shimoda Jan. 6, 2015, 10:02 a.m. UTC
Since the write value should always be 0 for bit 31-4 of ENR register
on R-Car H2, this patch fixes the value.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/thermal/rcar_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Geert Uytterhoeven Jan. 6, 2015, 10:53 a.m. UTC | #1
Hi Shimoda-san,

On Tue, Jan 6, 2015 at 11:02 AM, Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> Since the write value should always be 0 for bit 31-4 of ENR register
> on R-Car H2, this patch fixes the value.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  drivers/thermal/rcar_thermal.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 8803e69..bbdf64e 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -409,7 +409,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>                         return PTR_ERR(common->base);
>
>                 /* enable temperature comparation */
> -               rcar_thermal_common_write(common, ENR, 0x00030303);
> +               rcar_thermal_common_write(common, ENR, 0x00000003);

While your patch is correct for R-Car gen2, this driver is also used on
R-Mobile APE6 (r8a73a4), which does have 3 thermal zones.
So I think you should count the other I/O resource sets to calculate
the correct mask.

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
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yoshihiro Shimoda Jan. 6, 2015, 11:13 a.m. UTC | #2
SGkgR2VlcnQtc2FuLA0KDQo+IEhpIFNoaW1vZGEtc2FuLA0KPiANCj4gT24gVHVlLCBKYW4gNiwg
MjAxNSBhdCAxMTowMiBBTSwgWW9zaGloaXJvIFNoaW1vZGENCj4gPHlvc2hpaGlyby5zaGltb2Rh
LnVoQHJlbmVzYXMuY29tPiB3cm90ZToNCj4gPiBTaW5jZSB0aGUgd3JpdGUgdmFsdWUgc2hvdWxk
IGFsd2F5cyBiZSAwIGZvciBiaXQgMzEtNCBvZiBFTlIgcmVnaXN0ZXINCj4gPiBvbiBSLUNhciBI
MiwgdGhpcyBwYXRjaCBmaXhlcyB0aGUgdmFsdWUuDQo+ID4NCj4gPiBTaWduZWQtb2ZmLWJ5OiBZ
b3NoaWhpcm8gU2hpbW9kYSA8eW9zaGloaXJvLnNoaW1vZGEudWhAcmVuZXNhcy5jb20+DQo+ID4g
LS0tDQo+ID4gIGRyaXZlcnMvdGhlcm1hbC9yY2FyX3RoZXJtYWwuYyB8ICAgIDIgKy0NCj4gPiAg
MSBmaWxlIGNoYW5nZWQsIDEgaW5zZXJ0aW9uKCspLCAxIGRlbGV0aW9uKC0pDQo+ID4NCj4gPiBk
aWZmIC0tZ2l0IGEvZHJpdmVycy90aGVybWFsL3JjYXJfdGhlcm1hbC5jIGIvZHJpdmVycy90aGVy
bWFsL3JjYXJfdGhlcm1hbC5jDQo+ID4gaW5kZXggODgwM2U2OS4uYmJkZjY0ZSAxMDA2NDQNCj4g
PiAtLS0gYS9kcml2ZXJzL3RoZXJtYWwvcmNhcl90aGVybWFsLmMNCj4gPiArKysgYi9kcml2ZXJz
L3RoZXJtYWwvcmNhcl90aGVybWFsLmMNCj4gPiBAQCAtNDA5LDcgKzQwOSw3IEBAIHN0YXRpYyBp
bnQgcmNhcl90aGVybWFsX3Byb2JlKHN0cn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3RzIG9mIExpbnV4IGJleW9uZCBpYTMyIC0tIGdl
ZXJ0QGxpbnV4LW02OGsub3JnDQo+IA0KPiBJbiBwZXJzb25hbCBjb252ZXJzYXRpb25zIHdpdGgg
dGVjaG5pY2FsIHBlb3BsZSwgSSBjYWxsIG15c2VsZiBhIGhhY2tlci4gQnV0DQo+IHdoZW4gSSdt
IHRhbGtpbmcgdG8gam91cm5hbGlzdHMgSSBqdXN0IHNheSAicHJvZ3JhbW1lciIgb3Igc29tZXRo
aW5nIGxpa2UgdGhhdC4NCj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLSBMaW51
cyBUb3J2YWxkcw0K
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 8803e69..bbdf64e 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -409,7 +409,7 @@  static int rcar_thermal_probe(struct platform_device *pdev)
 			return PTR_ERR(common->base);
 
 		/* enable temperature comparation */
-		rcar_thermal_common_write(common, ENR, 0x00030303);
+		rcar_thermal_common_write(common, ENR, 0x00000003);
 
 		idle = 0; /* polling delay is not needed */
 	}