From f78849073148c3cd965ffdb33227b853a0176fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 2 Jun 2015 13:55:05 +0200 Subject: [PATCH] BCM270x: Move thermal sensor to Device Tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- arch/arm/boot/dts/bcm2708_common.dtsi | 4 ++++ arch/arm/mach-bcm2708/bcm2708.c | 2 +- arch/arm/mach-bcm2709/bcm2709.c | 2 +- drivers/thermal/bcm2835-thermal.c | 8 +++++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi index dc7df477c183d..fcb5828274be6 100644 --- a/arch/arm/boot/dts/bcm2708_common.dtsi +++ b/arch/arm/boot/dts/bcm2708_common.dtsi @@ -143,6 +143,10 @@ reg = <0x7e00b840 0xf>; interrupts = <0 2>; }; + + thermal: thermal { + compatible = "brcm,bcm2835-thermal"; + }; }; clocks { diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c index 6298309f108af..e141c0b8791b8 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -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); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c index d8c2336d3bdd4..6dadb8099af71 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -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); diff --git a/drivers/thermal/bcm2835-thermal.c b/drivers/thermal/bcm2835-thermal.c index 0c556d10c8532..3bc80f19ffe31 100644 --- a/drivers/thermal/bcm2835-thermal.c +++ b/drivers/thermal/bcm2835-thermal.c @@ -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, }, };