Skip to content

Commit

Permalink
BCM270x: Move thermal sensor to Device Tree
Browse files Browse the repository at this point in the history
Add Device Tree support to bcm2835-thermal driver.
Add thermal sensor device to Device Tree.
Don't add platform device when booting in DT mode.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
  • Loading branch information
notro committed Jun 2, 2015
1 parent acc12c6 commit f788490
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions arch/arm/boot/dts/bcm2708_common.dtsi
Expand Up @@ -143,6 +143,10 @@
reg = <0x7e00b840 0xf>;
interrupts = <0 2>;
};

thermal: thermal {
compatible = "brcm,bcm2835-thermal";
};
};

clocks {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-bcm2708/bcm2708.c
Expand Up @@ -984,7 +984,7 @@ void __init bcm2708_init(void)
}

bcm_register_device(&bcm2835_hwmon_device);
bcm_register_device(&bcm2835_thermal_device);
bcm_register_device_dt(&bcm2835_thermal_device);

#if defined(CONFIG_SND_BCM2708_SOC_I2S) || defined(CONFIG_SND_BCM2708_SOC_I2S_MODULE)
bcm_register_device_dt(&bcm2708_i2s_device);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-bcm2709/bcm2709.c
Expand Up @@ -1007,7 +1007,7 @@ void __init bcm2709_init(void)
}

bcm_register_device(&bcm2835_hwmon_device);
bcm_register_device(&bcm2835_thermal_device);
bcm_register_device_dt(&bcm2835_thermal_device);

#if defined(CONFIG_SND_BCM2708_SOC_I2S) || defined(CONFIG_SND_BCM2708_SOC_I2S_MODULE)
bcm_register_device_dt(&bcm2708_i2s_device);
Expand Down
8 changes: 7 additions & 1 deletion drivers/thermal/bcm2835-thermal.c
Expand Up @@ -167,13 +167,19 @@ static struct thermal_zone_device_ops ops = {
.get_mode = bcm2835_get_mode,
};

/* Thermal Driver */
static const struct of_device_id bcm2835_thermal_of_match_table[] = {
{ .compatible = "brcm,bcm2835-thermal", },
{},
};
MODULE_DEVICE_TABLE(of, bcm2835_thermal_of_match_table);

static struct platform_driver bcm2835_thermal_driver = {
.probe = bcm2835_thermal_probe,
.remove = bcm2835_thermal_remove,
.driver = {
.name = "bcm2835_thermal",
.owner = THIS_MODULE,
.of_match_table = bcm2835_thermal_of_match_table,
},
};

Expand Down

0 comments on commit f788490

Please sign in to comment.