diff options
author | Amit Daniel Kachhap <amit.kachhap@linaro.org> | 2011-12-21 17:29:58 +0530 |
---|---|---|
committer | Tushar Behera <tushar.behera@linaro.org> | 2011-12-27 12:35:59 +0530 |
commit | bd5765dc24e12d4555c18b585f7c4dabc64ada2c (patch) | |
tree | 05ff4cb6125b8fee9da43bf4e27a886b0eef0be1 | |
parent | e20e41b360fcd052c92e0a06076a1d15d8c72c07 (diff) |
ARM: exynos4: Add thermal sensor driver platform device supportsamsung-lt-v3.2-rc7
This patch adds necessary source definations needed for TMU driver and
the platform device support.
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
-rw-r--r-- | arch/arm/mach-exynos/Kconfig | 11 | ||||
-rw-r--r-- | arch/arm/mach-exynos/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/clock.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-exynos/dev-tmu.c | 64 | ||||
-rw-r--r-- | arch/arm/mach-exynos/include/mach/irqs.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/include/mach/map.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-origen.c | 1 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/devs.h | 1 |
8 files changed, 85 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 4db66dd49bb..e09a85f9e7c 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -92,6 +92,16 @@ config EXYNOS4_DEV_USB_OHCI help Compile in platform device definition for USB OHCI +config EXYNOS4_DEV_TMU + bool "Exynos4 tmu device support" + default n + depends on ARCH_EXYNOS4 + ---help--- + Compile in platform device definitions for TMU. This macro also + enables compilation hwmon base TMU driver and also allows compilation + of the platform device files. The platform data in this case is trip + temperature and some tmu h/w configurations related parameter. + config EXYNOS4_SETUP_I2C1 bool help @@ -307,6 +317,7 @@ config MACH_ORIGEN select SAMSUNG_DEV_PWM select EXYNOS4_DEV_DMA select EXYNOS4_DEV_PD + select EXYNOS4_DEV_TMU select EXYNOS4_DEV_USB_OHCI select EXYNOS4_SETUP_FIMD0 select EXYNOS4_SETUP_I2C1 diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile index ce11623e345..c8336f0325a 100644 --- a/arch/arm/mach-exynos/Makefile +++ b/arch/arm/mach-exynos/Makefile @@ -49,6 +49,7 @@ obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI) += dev-ohci.o obj-$(CONFIG_EXYNOS4_DEV_DMA) += dma.o +obj-$(CONFIG_EXYNOS4_DEV_TMU) += dev-tmu.o obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o obj-$(CONFIG_EXYNOS4_SETUP_FIMD0) += setup-fimd0.o diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c index 41c25f941f0..592b851ce05 100644 --- a/arch/arm/mach-exynos/clock.c +++ b/arch/arm/mach-exynos/clock.c @@ -582,6 +582,10 @@ static struct clk init_clocks_off[] = { .enable = exynos4_clk_ip_peril_ctrl, .ctrlbit = (1 << 15), }, { + .name = "tmu_apbif", + .enable = exynos4_clk_ip_perir_ctrl, + .ctrlbit = (1 << 17), + }, { .name = "keypad", .enable = exynos4_clk_ip_perir_ctrl, .ctrlbit = (1 << 16), diff --git a/arch/arm/mach-exynos/dev-tmu.c b/arch/arm/mach-exynos/dev-tmu.c new file mode 100644 index 00000000000..2e989129746 --- /dev/null +++ b/arch/arm/mach-exynos/dev-tmu.c @@ -0,0 +1,64 @@ +/* linux/arch/arm/mach-exynos4/dev-tmu.c + * + * Copyright 2011 by SAMSUNG + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include <linux/kernel.h> +#include <linux/string.h> +#include <linux/platform_device.h> +#include <linux/slab.h> +#include <linux/platform_data/exynos4_tmu.h> +#include <asm/irq.h> + +#include <mach/irqs.h> +#include <mach/map.h> +#include <plat/devs.h> + +static struct resource exynos4_tmu_resource[] = { + [0] = { + .start = EXYNOS4_PA_TMU, + .end = EXYNOS4_PA_TMU + 0xFFFF - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_TMU_TRIG0, + .end = IRQ_TMU_TRIG0, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct exynos4_tmu_platform_data default_tmu_data = { + .threshold = 80, + .trigger_levels[0] = 2, + .trigger_levels[1] = 5, + .trigger_levels[2] = 20, + .trigger_levels[3] = 30, + .trigger_level0_en = 1, + .trigger_level1_en = 1, + .trigger_level2_en = 1, + .trigger_level3_en = 1, + .gain = 15, + .reference_voltage = 7, + .cal_type = TYPE_ONE_POINT_TRIMMING, + .freq_tab[0] = { + .freq_clip_pctg[0] = 30, + }, + .freq_tab[1] = { + .freq_clip_pctg[0] = 99, + }, + .freq_tab_count = 2, +}; + +struct platform_device exynos4_device_tmu = { + .name = "exynos4-tmu", + .id = -1, + .num_resources = ARRAY_SIZE(exynos4_tmu_resource), + .resource = exynos4_tmu_resource, + .dev = { + .platform_data = &default_tmu_data, + }, +}; diff --git a/arch/arm/mach-exynos/include/mach/irqs.h b/arch/arm/mach-exynos/include/mach/irqs.h index 28080c58a8f..edd9be6ed8b 100644 --- a/arch/arm/mach-exynos/include/mach/irqs.h +++ b/arch/arm/mach-exynos/include/mach/irqs.h @@ -127,6 +127,8 @@ #define COMBINER_GROUP(x) ((x) * MAX_IRQ_IN_COMBINER + IRQ_SPI(128)) #define COMBINER_IRQ(x, y) (COMBINER_GROUP(x) + y) +#define IRQ_TMU_TRIG0 COMBINER_IRQ(2, 4) +#define IRQ_TMU_TRIG1 COMBINER_IRQ(3, 4) #define IRQ_SYSMMU_MDMA0_0 COMBINER_IRQ(4, 0) #define IRQ_SYSMMU_SSS_0 COMBINER_IRQ(4, 1) #define IRQ_SYSMMU_FIMC0_0 COMBINER_IRQ(4, 2) diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h index 9a8e53d0e80..e6a245a0993 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h @@ -68,6 +68,7 @@ #define EXYNOS4_PA_COREPERI 0x10500000 #define EXYNOS4_PA_TWD 0x10500600 #define EXYNOS4_PA_L2CC 0x10502000 +#define EXYNOS4_PA_TMU 0x100C0000 #define EXYNOS4_PA_MDMA0 0x10810000 #define EXYNOS4_PA_MDMA1 0x12840000 diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c index a08f027d4dd..88f2173b57c 100644 --- a/arch/arm/mach-exynos/mach-origen.c +++ b/arch/arm/mach-exynos/mach-origen.c @@ -807,6 +807,7 @@ static struct platform_device *origen_devices[] __initdata = { &origen_lcd_hv070wsa, &origen_leds_gpio, &origen_device_bluetooth, + &exynos4_device_tmu, }; /* LCD Backlight data */ diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h index 982be0865c4..b34fc5438be 100644 --- a/arch/arm/plat-samsung/include/plat/devs.h +++ b/arch/arm/plat-samsung/include/plat/devs.h @@ -137,6 +137,7 @@ extern struct platform_device exynos4_device_pcm2; extern struct platform_device exynos4_device_pd[]; extern struct platform_device exynos4_device_spdif; extern struct platform_device exynos4_device_sysmmu; +extern struct platform_device exynos4_device_tmu; extern struct platform_device samsung_asoc_dma; extern struct platform_device samsung_asoc_idma; |