diff options
Diffstat (limited to 'drivers/thermal/rcar_thermal.c')
-rw-r--r-- | drivers/thermal/rcar_thermal.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 8803e693fe68..2580a4872f90 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c | |||
@@ -63,7 +63,7 @@ struct rcar_thermal_priv { | |||
63 | struct mutex lock; | 63 | struct mutex lock; |
64 | struct list_head list; | 64 | struct list_head list; |
65 | int id; | 65 | int id; |
66 | int ctemp; | 66 | u32 ctemp; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | #define rcar_thermal_for_each_priv(pos, common) \ | 69 | #define rcar_thermal_for_each_priv(pos, common) \ |
@@ -145,7 +145,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv) | |||
145 | { | 145 | { |
146 | struct device *dev = rcar_priv_to_dev(priv); | 146 | struct device *dev = rcar_priv_to_dev(priv); |
147 | int i; | 147 | int i; |
148 | int ctemp, old, new; | 148 | u32 ctemp, old, new; |
149 | int ret = -EINVAL; | 149 | int ret = -EINVAL; |
150 | 150 | ||
151 | mutex_lock(&priv->lock); | 151 | mutex_lock(&priv->lock); |
@@ -372,6 +372,7 @@ static int rcar_thermal_probe(struct platform_device *pdev) | |||
372 | int i; | 372 | int i; |
373 | int ret = -ENODEV; | 373 | int ret = -ENODEV; |
374 | int idle = IDLE_INTERVAL; | 374 | int idle = IDLE_INTERVAL; |
375 | u32 enr_bits = 0; | ||
375 | 376 | ||
376 | common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL); | 377 | common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL); |
377 | if (!common) | 378 | if (!common) |
@@ -390,7 +391,7 @@ static int rcar_thermal_probe(struct platform_device *pdev) | |||
390 | 391 | ||
391 | /* | 392 | /* |
392 | * platform has IRQ support. | 393 | * platform has IRQ support. |
393 | * Then, drier use common register | 394 | * Then, driver uses common registers |
394 | */ | 395 | */ |
395 | 396 | ||
396 | ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0, | 397 | ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0, |
@@ -408,9 +409,6 @@ static int rcar_thermal_probe(struct platform_device *pdev) | |||
408 | if (IS_ERR(common->base)) | 409 | if (IS_ERR(common->base)) |
409 | return PTR_ERR(common->base); | 410 | return PTR_ERR(common->base); |
410 | 411 | ||
411 | /* enable temperature comparation */ | ||
412 | rcar_thermal_common_write(common, ENR, 0x00030303); | ||
413 | |||
414 | idle = 0; /* polling delay is not needed */ | 412 | idle = 0; /* polling delay is not needed */ |
415 | } | 413 | } |
416 | 414 | ||
@@ -452,8 +450,15 @@ static int rcar_thermal_probe(struct platform_device *pdev) | |||
452 | rcar_thermal_irq_enable(priv); | 450 | rcar_thermal_irq_enable(priv); |
453 | 451 | ||
454 | list_move_tail(&priv->list, &common->head); | 452 | list_move_tail(&priv->list, &common->head); |
453 | |||
454 | /* update ENR bits */ | ||
455 | enr_bits |= 3 << (i * 8); | ||
455 | } | 456 | } |
456 | 457 | ||
458 | /* enable temperature comparation */ | ||
459 | if (irq) | ||
460 | rcar_thermal_common_write(common, ENR, enr_bits); | ||
461 | |||
457 | platform_set_drvdata(pdev, common); | 462 | platform_set_drvdata(pdev, common); |
458 | 463 | ||
459 | dev_info(dev, "%d sensor probed\n", i); | 464 | dev_info(dev, "%d sensor probed\n", i); |