aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-lpc32xx
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 19:41:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 19:41:24 -0400
commit34800598b2eebe061445216473b1e4c2ff5cba99 (patch)
treea6d0eb6fe45d9480888d7ddb34840e172ed80e56 /arch/arm/mach-lpc32xx
parent46b407ca4a6149c8d27fcec1881d4f184bec7c77 (diff)
parent511f1cb6d426938fabf9c6d69ce4861b66ffd919 (diff)
Merge tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull "ARM: driver specific updates" from Arnd Bergmann: "These are all specific to some driver. They are typically the platform side of a change in the drivers directory, such as adding a new driver or extending the interface to the platform. In cases where there is no maintainer for the driver, or the maintainer prefers to have the platform changes in the same branch as the driver changes, the patches to the drivers are included as well. A much smaller set of driver updates that depend on other branches getting merged first will be sent later. The new export of tegra_chip_uid conflicts with other changes in fuse.c. In rtc-sa1100.c, the global removal of IRQF_DISABLED conflicts with the cleanup of the interrupt handling of that driver. Signed-off-by: Arnd Bergmann <arnd@arndb.de>" Fixed up aforementioned trivial conflicts. * tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (94 commits) ARM: SAMSUNG: change the name from s3c-sdhci to exynos4-sdhci mmc: sdhci-s3c: add platform data for the second capability ARM: SAMSUNG: support the second capability for samsung-soc ARM: EXYNOS: add support DMA for EXYNOS4X12 SoC ARM: EXYNOS: Add apb_pclk clkdev entry for mdma1 ARM: EXYNOS: Enable MDMA driver regulator: Remove bq24022 regulator driver rtc: sa1100: add OF support pxa: magician/hx4700: Convert to gpio-regulator from bq24022 ARM: OMAP3+: SmartReflex: fix error handling ARM: OMAP3+: SmartReflex: fix the use of debugfs_create_* API ARM: OMAP3+: SmartReflex: micro-optimization for sanity check ARM: OMAP3+: SmartReflex: misc cleanups ARM: OMAP3+: SmartReflex: move late_initcall() closer to its argument ARM: OMAP3+: SmartReflex: add missing platform_set_drvdata() ARM: OMAP3+: hwmod: add SmartReflex IRQs ARM: OMAP3+: SmartReflex: clear ERRCONFIG_VPBOUNDINTST only on a need ARM: OMAP3+: SmartReflex: Fix status masking in ERRCONFIG register ARM: OMAP3+: SmartReflex: Add a shutdown hook ARM: OMAP3+: SmartReflex Class3: disable errorgen before disable VP ... Conflicts: arch/arm/mach-tegra/Makefile arch/arm/mach-tegra/fuse.c drivers/rtc/rtc-sa1100.c
Diffstat (limited to 'arch/arm/mach-lpc32xx')
-rw-r--r--arch/arm/mach-lpc32xx/clock.c36
-rw-r--r--arch/arm/mach-lpc32xx/common.c22
-rw-r--r--arch/arm/mach-lpc32xx/common.h1
-rw-r--r--arch/arm/mach-lpc32xx/phy3250.c1
4 files changed, 60 insertions, 0 deletions
diff --git a/arch/arm/mach-lpc32xx/clock.c b/arch/arm/mach-lpc32xx/clock.c
index 0e01bf44479c..f55c772d1816 100644
--- a/arch/arm/mach-lpc32xx/clock.c
+++ b/arch/arm/mach-lpc32xx/clock.c
@@ -721,6 +721,41 @@ static struct clk clk_tsc = {
721 .get_rate = local_return_parent_rate, 721 .get_rate = local_return_parent_rate,
722}; 722};
723 723
724static int adc_onoff_enable(struct clk *clk, int enable)
725{
726 u32 tmp;
727 u32 divider;
728
729 /* Use PERIPH_CLOCK */
730 tmp = __raw_readl(LPC32XX_CLKPWR_ADC_CLK_CTRL_1);
731 tmp |= LPC32XX_CLKPWR_ADCCTRL1_PCLK_SEL;
732 /*
733 * Set clock divider so that we have equal to or less than
734 * 4.5MHz clock at ADC
735 */
736 divider = clk->get_rate(clk) / 4500000 + 1;
737 tmp |= divider;
738 __raw_writel(tmp, LPC32XX_CLKPWR_ADC_CLK_CTRL_1);
739
740 /* synchronize rate of this clock w/ actual HW setting */
741 clk->rate = clk->get_rate(clk->parent) / divider;
742
743 if (enable == 0)
744 __raw_writel(0, clk->enable_reg);
745 else
746 __raw_writel(clk->enable_mask, clk->enable_reg);
747
748 return 0;
749}
750
751static struct clk clk_adc = {
752 .parent = &clk_pclk,
753 .enable = adc_onoff_enable,
754 .enable_reg = LPC32XX_CLKPWR_ADC_CLK_CTRL,
755 .enable_mask = LPC32XX_CLKPWR_ADC32CLKCTRL_CLK_EN,
756 .get_rate = local_return_parent_rate,
757};
758
724static int mmc_onoff_enable(struct clk *clk, int enable) 759static int mmc_onoff_enable(struct clk *clk, int enable)
725{ 760{
726 u32 tmp; 761 u32 tmp;
@@ -1055,6 +1090,7 @@ static struct clk_lookup lookups[] = {
1055 _REGISTER_CLOCK("dev:ssp1", NULL, clk_ssp1) 1090 _REGISTER_CLOCK("dev:ssp1", NULL, clk_ssp1)
1056 _REGISTER_CLOCK("lpc32xx_keys.0", NULL, clk_kscan) 1091 _REGISTER_CLOCK("lpc32xx_keys.0", NULL, clk_kscan)
1057 _REGISTER_CLOCK("lpc32xx-nand.0", "nand_ck", clk_nand) 1092 _REGISTER_CLOCK("lpc32xx-nand.0", "nand_ck", clk_nand)
1093 _REGISTER_CLOCK("lpc32xx-adc", NULL, clk_adc)
1058 _REGISTER_CLOCK(NULL, "i2s0_ck", clk_i2s0) 1094 _REGISTER_CLOCK(NULL, "i2s0_ck", clk_i2s0)
1059 _REGISTER_CLOCK(NULL, "i2s1_ck", clk_i2s1) 1095 _REGISTER_CLOCK(NULL, "i2s1_ck", clk_i2s1)
1060 _REGISTER_CLOCK("ts-lpc32xx", NULL, clk_tsc) 1096 _REGISTER_CLOCK("ts-lpc32xx", NULL, clk_tsc)
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c
index 369b152896cd..6c76bb36559b 100644
--- a/arch/arm/mach-lpc32xx/common.c
+++ b/arch/arm/mach-lpc32xx/common.c
@@ -138,6 +138,28 @@ struct platform_device lpc32xx_rtc_device = {
138}; 138};
139 139
140/* 140/*
141 * ADC support
142 */
143static struct resource adc_resources[] = {
144 {
145 .start = LPC32XX_ADC_BASE,
146 .end = LPC32XX_ADC_BASE + SZ_4K - 1,
147 .flags = IORESOURCE_MEM,
148 }, {
149 .start = IRQ_LPC32XX_TS_IRQ,
150 .end = IRQ_LPC32XX_TS_IRQ,
151 .flags = IORESOURCE_IRQ,
152 },
153};
154
155struct platform_device lpc32xx_adc_device = {
156 .name = "lpc32xx-adc",
157 .id = -1,
158 .num_resources = ARRAY_SIZE(adc_resources),
159 .resource = adc_resources,
160};
161
162/*
141 * Returns the unique ID for the device 163 * Returns the unique ID for the device
142 */ 164 */
143void lpc32xx_get_uid(u32 devid[4]) 165void lpc32xx_get_uid(u32 devid[4])
diff --git a/arch/arm/mach-lpc32xx/common.h b/arch/arm/mach-lpc32xx/common.h
index 75640bfb097f..68f2e46d98ad 100644
--- a/arch/arm/mach-lpc32xx/common.h
+++ b/arch/arm/mach-lpc32xx/common.h
@@ -29,6 +29,7 @@ extern struct platform_device lpc32xx_i2c0_device;
29extern struct platform_device lpc32xx_i2c1_device; 29extern struct platform_device lpc32xx_i2c1_device;
30extern struct platform_device lpc32xx_i2c2_device; 30extern struct platform_device lpc32xx_i2c2_device;
31extern struct platform_device lpc32xx_tsc_device; 31extern struct platform_device lpc32xx_tsc_device;
32extern struct platform_device lpc32xx_adc_device;
32extern struct platform_device lpc32xx_rtc_device; 33extern struct platform_device lpc32xx_rtc_device;
33 34
34/* 35/*
diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index 8571d6250dc1..0d79a3f8a5e0 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -254,6 +254,7 @@ static struct platform_device *phy3250_devs[] __initdata = {
254 &lpc32xx_i2c2_device, 254 &lpc32xx_i2c2_device,
255 &lpc32xx_watchdog_device, 255 &lpc32xx_watchdog_device,
256 &lpc32xx_gpio_led_device, 256 &lpc32xx_gpio_led_device,
257 &lpc32xx_adc_device,
257}; 258};
258 259
259static struct amba_device *amba_devs[] __initdata = { 260static struct amba_device *amba_devs[] __initdata = {