Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 374557
b: refs/heads/master
c: d13cb03
h: refs/heads/master
i:
  374555: 54f1e62
v: v3
  • Loading branch information
Zhang Rui committed Apr 15, 2013
1 parent f1e07bc commit 72e7a45
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bbf7fc88c78f7317e2cdcf77e974c8a9a8312641
refs/heads/master: d13cb03aef0c062dcdd16b411bd4c02c1574ff08
10 changes: 5 additions & 5 deletions trunk/drivers/thermal/cpu_cooling.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device,
unsigned long cooling_state)
{
unsigned int cpuid, clip_freq;
struct cpumask *maskPtr = &cpufreq_device->allowed_cpus;
unsigned int cpu = cpumask_any(maskPtr);
struct cpumask *mask = &cpufreq_device->allowed_cpus;
unsigned int cpu = cpumask_any(mask);


/* Check if the old cooling action is same as new cooling action */
Expand All @@ -250,7 +250,7 @@ static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device,
cpufreq_device->cpufreq_val = clip_freq;
notify_device = cpufreq_device;

for_each_cpu(cpuid, maskPtr) {
for_each_cpu(cpuid, mask) {
if (is_cpufreq_valid(cpuid))
cpufreq_update_policy(cpuid);
}
Expand Down Expand Up @@ -301,12 +301,12 @@ static int cpufreq_get_max_state(struct thermal_cooling_device *cdev,
unsigned long *state)
{
struct cpufreq_cooling_device *cpufreq_device = cdev->devdata;
struct cpumask *maskPtr = &cpufreq_device->allowed_cpus;
struct cpumask *mask = &cpufreq_device->allowed_cpus;
unsigned int cpu;
unsigned long count = 0;
int ret;

cpu = cpumask_any(maskPtr);
cpu = cpumask_any(mask);

ret = get_property(cpu, 0, (unsigned int *)&count, GET_MAXL);

Expand Down
19 changes: 12 additions & 7 deletions trunk/drivers/thermal/db8500_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,37 +419,40 @@ static int db8500_thermal_probe(struct platform_device *pdev)
low_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_LOW");
if (low_irq < 0) {
dev_err(&pdev->dev, "Get IRQ_HOTMON_LOW failed.\n");
return low_irq;
ret = low_irq;
goto out_unlock;
}

ret = devm_request_threaded_irq(&pdev->dev, low_irq, NULL,
prcmu_low_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT,
"dbx500_temp_low", pzone);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to allocate temp low irq.\n");
return ret;
goto out_unlock;
}

high_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_HIGH");
if (high_irq < 0) {
dev_err(&pdev->dev, "Get IRQ_HOTMON_HIGH failed.\n");
return high_irq;
ret = high_irq;
goto out_unlock;
}

ret = devm_request_threaded_irq(&pdev->dev, high_irq, NULL,
prcmu_high_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT,
"dbx500_temp_high", pzone);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to allocate temp high irq.\n");
return ret;
goto out_unlock;
}

pzone->therm_dev = thermal_zone_device_register("db8500_thermal_zone",
ptrips->num_trips, 0, pzone, &thdev_ops, NULL, 0, 0);

if (IS_ERR_OR_NULL(pzone->therm_dev)) {
if (IS_ERR(pzone->therm_dev)) {
dev_err(&pdev->dev, "Register thermal zone device failed.\n");
return PTR_ERR(pzone->therm_dev);
ret = PTR_ERR(pzone->therm_dev);
goto out_unlock;
}
dev_info(&pdev->dev, "Thermal zone device registered.\n");

Expand All @@ -461,9 +464,11 @@ static int db8500_thermal_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, pzone);
pzone->mode = THERMAL_DEVICE_ENABLED;

out_unlock:
mutex_unlock(&pzone->th_lock);

return 0;
return ret;
}

static int db8500_thermal_remove(struct platform_device *pdev)
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/thermal/dove_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ static int dove_get_temp(struct thermal_zone_device *thermal,
}

/*
* Calculate temperature. See Section 8.10.1 of 88AP510,
* Documentation/arm/Marvell/README
* Calculate temperature. According to Marvell internal
* documentation the formula for this is:
* Celsius = (322-reg)/1.3625
*/
reg = readl_relaxed(priv->sensor);
reg = (reg >> DOVE_THERMAL_TEMP_OFFSET) & DOVE_THERMAL_TEMP_MASK;
*temp = ((2281638UL - (7298*reg)) / 10);
*temp = ((3220000000UL - (10000000UL * reg)) / 13625);

return 0;
}
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/thermal/kirkwood_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
reg = readl_relaxed(priv->sensor);

/* Valid check */
if (!(reg >> KIRKWOOD_THERMAL_VALID_OFFSET) &
KIRKWOOD_THERMAL_VALID_MASK) {
if (!((reg >> KIRKWOOD_THERMAL_VALID_OFFSET) &
KIRKWOOD_THERMAL_VALID_MASK)) {
dev_err(&thermal->device,
"Temperature sensor reading not valid\n");
return -EIO;
}

/*
* Calculate temperature. See Section 8.10.1 of the 88AP510,
* datasheet, which has the same sensor.
* Documentation/arm/Marvell/README
* Calculate temperature. According to Marvell internal
* documentation the formula for this is:
* Celsius = (322-reg)/1.3625
*/
reg = (reg >> KIRKWOOD_THERMAL_TEMP_OFFSET) &
KIRKWOOD_THERMAL_TEMP_MASK;
*temp = ((2281638UL - (7298*reg)) / 10);
*temp = ((3220000000UL - (10000000UL * reg)) / 13625);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/thermal.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void notify_thermal_framework(struct thermal_zone_device *, int);
extern int thermal_generate_netlink_event(struct thermal_zone_device *tz,
enum events event);
#else
static int thermal_generate_netlink_event(struct thermal_zone_device *tz,
static inline int thermal_generate_netlink_event(struct thermal_zone_device *tz,
enum events event)
{
return 0;
Expand Down

0 comments on commit 72e7a45

Please sign in to comment.