aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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 /drivers
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 'drivers')
-rw-r--r--drivers/gpio/gpio-tegra.c59
-rw-r--r--drivers/i2c/busses/i2c-imx.c4
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c6
-rw-r--r--drivers/mmc/host/sdhci-s3c.c6
-rw-r--r--drivers/net/Space.c2
-rw-r--r--drivers/net/ethernet/cirrus/Kconfig19
-rw-r--r--drivers/net/ethernet/cirrus/cs89x0.c148
-rw-r--r--drivers/regulator/Kconfig8
-rw-r--r--drivers/regulator/Makefile1
-rw-r--r--drivers/regulator/bq24022.c162
-rw-r--r--drivers/rtc/Kconfig4
-rw-r--r--drivers/rtc/rtc-s3c.c71
-rw-r--r--drivers/rtc/rtc-sa1100.c127
-rw-r--r--drivers/tty/serial/imx.c7
14 files changed, 346 insertions, 278 deletions
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index bdc293791590..6f17671260e1 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -25,6 +25,7 @@
25#include <linux/of.h> 25#include <linux/of.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/irqdomain.h>
28 29
29#include <asm/mach/irq.h> 30#include <asm/mach/irq.h>
30 31
@@ -74,9 +75,10 @@ struct tegra_gpio_bank {
74#endif 75#endif
75}; 76};
76 77
77 78static struct irq_domain *irq_domain;
78static void __iomem *regs; 79static void __iomem *regs;
79static struct tegra_gpio_bank tegra_gpio_banks[7]; 80static u32 tegra_gpio_bank_count;
81static struct tegra_gpio_bank *tegra_gpio_banks;
80 82
81static inline void tegra_gpio_writel(u32 val, u32 reg) 83static inline void tegra_gpio_writel(u32 val, u32 reg)
82{ 84{
@@ -139,7 +141,7 @@ static int tegra_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
139 141
140static int tegra_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 142static int tegra_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
141{ 143{
142 return TEGRA_GPIO_TO_IRQ(offset); 144 return irq_find_mapping(irq_domain, offset);
143} 145}
144 146
145static struct gpio_chip tegra_gpio_chip = { 147static struct gpio_chip tegra_gpio_chip = {
@@ -155,28 +157,28 @@ static struct gpio_chip tegra_gpio_chip = {
155 157
156static void tegra_gpio_irq_ack(struct irq_data *d) 158static void tegra_gpio_irq_ack(struct irq_data *d)
157{ 159{
158 int gpio = d->irq - INT_GPIO_BASE; 160 int gpio = d->hwirq;
159 161
160 tegra_gpio_writel(1 << GPIO_BIT(gpio), GPIO_INT_CLR(gpio)); 162 tegra_gpio_writel(1 << GPIO_BIT(gpio), GPIO_INT_CLR(gpio));
161} 163}
162 164
163static void tegra_gpio_irq_mask(struct irq_data *d) 165static void tegra_gpio_irq_mask(struct irq_data *d)
164{ 166{
165 int gpio = d->irq - INT_GPIO_BASE; 167 int gpio = d->hwirq;
166 168
167 tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 0); 169 tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 0);
168} 170}
169 171
170static void tegra_gpio_irq_unmask(struct irq_data *d) 172static void tegra_gpio_irq_unmask(struct irq_data *d)
171{ 173{
172 int gpio = d->irq - INT_GPIO_BASE; 174 int gpio = d->hwirq;
173 175
174 tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 1); 176 tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 1);
175} 177}
176 178
177static int tegra_gpio_irq_set_type(struct irq_data *d, unsigned int type) 179static int tegra_gpio_irq_set_type(struct irq_data *d, unsigned int type)
178{ 180{
179 int gpio = d->irq - INT_GPIO_BASE; 181 int gpio = d->hwirq;
180 struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d); 182 struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d);
181 int port = GPIO_PORT(gpio); 183 int port = GPIO_PORT(gpio);
182 int lvl_type; 184 int lvl_type;
@@ -273,7 +275,7 @@ void tegra_gpio_resume(void)
273 275
274 local_irq_save(flags); 276 local_irq_save(flags);
275 277
276 for (b = 0; b < ARRAY_SIZE(tegra_gpio_banks); b++) { 278 for (b = 0; b < tegra_gpio_bank_count; b++) {
277 struct tegra_gpio_bank *bank = &tegra_gpio_banks[b]; 279 struct tegra_gpio_bank *bank = &tegra_gpio_banks[b];
278 280
279 for (p = 0; p < ARRAY_SIZE(bank->oe); p++) { 281 for (p = 0; p < ARRAY_SIZE(bank->oe); p++) {
@@ -296,7 +298,7 @@ void tegra_gpio_suspend(void)
296 int p; 298 int p;
297 299
298 local_irq_save(flags); 300 local_irq_save(flags);
299 for (b = 0; b < ARRAY_SIZE(tegra_gpio_banks); b++) { 301 for (b = 0; b < tegra_gpio_bank_count; b++) {
300 struct tegra_gpio_bank *bank = &tegra_gpio_banks[b]; 302 struct tegra_gpio_bank *bank = &tegra_gpio_banks[b];
301 303
302 for (p = 0; p < ARRAY_SIZE(bank->oe); p++) { 304 for (p = 0; p < ARRAY_SIZE(bank->oe); p++) {
@@ -337,13 +339,44 @@ static struct lock_class_key gpio_lock_class;
337 339
338static int __devinit tegra_gpio_probe(struct platform_device *pdev) 340static int __devinit tegra_gpio_probe(struct platform_device *pdev)
339{ 341{
342 int irq_base;
340 struct resource *res; 343 struct resource *res;
341 struct tegra_gpio_bank *bank; 344 struct tegra_gpio_bank *bank;
342 int gpio; 345 int gpio;
343 int i; 346 int i;
344 int j; 347 int j;
345 348
346 for (i = 0; i < ARRAY_SIZE(tegra_gpio_banks); i++) { 349 for (;;) {
350 res = platform_get_resource(pdev, IORESOURCE_IRQ, tegra_gpio_bank_count);
351 if (!res)
352 break;
353 tegra_gpio_bank_count++;
354 }
355 if (!tegra_gpio_bank_count) {
356 dev_err(&pdev->dev, "Missing IRQ resource\n");
357 return -ENODEV;
358 }
359
360 tegra_gpio_chip.ngpio = tegra_gpio_bank_count * 32;
361
362 tegra_gpio_banks = devm_kzalloc(&pdev->dev,
363 tegra_gpio_bank_count * sizeof(*tegra_gpio_banks),
364 GFP_KERNEL);
365 if (!tegra_gpio_banks) {
366 dev_err(&pdev->dev, "Couldn't allocate bank structure\n");
367 return -ENODEV;
368 }
369
370 irq_base = irq_alloc_descs(-1, 0, tegra_gpio_chip.ngpio, 0);
371 if (irq_base < 0) {
372 dev_err(&pdev->dev, "Couldn't allocate IRQ numbers\n");
373 return -ENODEV;
374 }
375 irq_domain = irq_domain_add_legacy(pdev->dev.of_node,
376 tegra_gpio_chip.ngpio, irq_base, 0,
377 &irq_domain_simple_ops, NULL);
378
379 for (i = 0; i < tegra_gpio_bank_count; i++) {
347 res = platform_get_resource(pdev, IORESOURCE_IRQ, i); 380 res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
348 if (!res) { 381 if (!res) {
349 dev_err(&pdev->dev, "Missing IRQ resource\n"); 382 dev_err(&pdev->dev, "Missing IRQ resource\n");
@@ -380,8 +413,8 @@ static int __devinit tegra_gpio_probe(struct platform_device *pdev)
380 413
381 gpiochip_add(&tegra_gpio_chip); 414 gpiochip_add(&tegra_gpio_chip);
382 415
383 for (gpio = 0; gpio < TEGRA_NR_GPIOS; gpio++) { 416 for (gpio = 0; gpio < tegra_gpio_chip.ngpio; gpio++) {
384 int irq = TEGRA_GPIO_TO_IRQ(gpio); 417 int irq = irq_find_mapping(irq_domain, gpio);
385 /* No validity check; all Tegra GPIOs are valid IRQs */ 418 /* No validity check; all Tegra GPIOs are valid IRQs */
386 419
387 bank = &tegra_gpio_banks[GPIO_BANK(gpio)]; 420 bank = &tegra_gpio_banks[GPIO_BANK(gpio)];
@@ -393,7 +426,7 @@ static int __devinit tegra_gpio_probe(struct platform_device *pdev)
393 set_irq_flags(irq, IRQF_VALID); 426 set_irq_flags(irq, IRQF_VALID);
394 } 427 }
395 428
396 for (i = 0; i < ARRAY_SIZE(tegra_gpio_banks); i++) { 429 for (i = 0; i < tegra_gpio_bank_count; i++) {
397 bank = &tegra_gpio_banks[i]; 430 bank = &tegra_gpio_banks[i];
398 431
399 irq_set_chained_handler(bank->irq, tegra_gpio_irq_handler); 432 irq_set_chained_handler(bank->irq, tegra_gpio_irq_handler);
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 124d9c594f40..dfb84b7ee550 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -191,7 +191,7 @@ static int i2c_imx_start(struct imx_i2c_struct *i2c_imx)
191 191
192 dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); 192 dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
193 193
194 clk_enable(i2c_imx->clk); 194 clk_prepare_enable(i2c_imx->clk);
195 writeb(i2c_imx->ifdr, i2c_imx->base + IMX_I2C_IFDR); 195 writeb(i2c_imx->ifdr, i2c_imx->base + IMX_I2C_IFDR);
196 /* Enable I2C controller */ 196 /* Enable I2C controller */
197 writeb(0, i2c_imx->base + IMX_I2C_I2SR); 197 writeb(0, i2c_imx->base + IMX_I2C_I2SR);
@@ -240,7 +240,7 @@ static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx)
240 240
241 /* Disable I2C controller */ 241 /* Disable I2C controller */
242 writeb(0, i2c_imx->base + IMX_I2C_I2CR); 242 writeb(0, i2c_imx->base + IMX_I2C_I2CR);
243 clk_disable(i2c_imx->clk); 243 clk_disable_unprepare(i2c_imx->clk);
244} 244}
245 245
246static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, 246static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx,
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 0be4e2013632..6193a0d7bde5 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -464,7 +464,7 @@ static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev)
464 err = PTR_ERR(clk); 464 err = PTR_ERR(clk);
465 goto err_clk_get; 465 goto err_clk_get;
466 } 466 }
467 clk_enable(clk); 467 clk_prepare_enable(clk);
468 pltfm_host->clk = clk; 468 pltfm_host->clk = clk;
469 469
470 if (!is_imx25_esdhc(imx_data)) 470 if (!is_imx25_esdhc(imx_data))
@@ -559,7 +559,7 @@ no_card_detect_irq:
559 gpio_free(boarddata->wp_gpio); 559 gpio_free(boarddata->wp_gpio);
560no_card_detect_pin: 560no_card_detect_pin:
561no_board_data: 561no_board_data:
562 clk_disable(pltfm_host->clk); 562 clk_disable_unprepare(pltfm_host->clk);
563 clk_put(pltfm_host->clk); 563 clk_put(pltfm_host->clk);
564err_clk_get: 564err_clk_get:
565 kfree(imx_data); 565 kfree(imx_data);
@@ -586,7 +586,7 @@ static int __devexit sdhci_esdhc_imx_remove(struct platform_device *pdev)
586 gpio_free(boarddata->cd_gpio); 586 gpio_free(boarddata->cd_gpio);
587 } 587 }
588 588
589 clk_disable(pltfm_host->clk); 589 clk_disable_unprepare(pltfm_host->clk);
590 clk_put(pltfm_host->clk); 590 clk_put(pltfm_host->clk);
591 kfree(imx_data); 591 kfree(imx_data);
592 592
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 1af756ee0f9a..b19e7d435f8d 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -518,9 +518,6 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
518 if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT) 518 if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
519 host->mmc->caps = MMC_CAP_NONREMOVABLE; 519 host->mmc->caps = MMC_CAP_NONREMOVABLE;
520 520
521 if (pdata->host_caps)
522 host->mmc->caps |= pdata->host_caps;
523
524 if (pdata->pm_caps) 521 if (pdata->pm_caps)
525 host->mmc->pm_caps |= pdata->pm_caps; 522 host->mmc->pm_caps |= pdata->pm_caps;
526 523
@@ -544,6 +541,9 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
544 if (pdata->host_caps) 541 if (pdata->host_caps)
545 host->mmc->caps |= pdata->host_caps; 542 host->mmc->caps |= pdata->host_caps;
546 543
544 if (pdata->host_caps2)
545 host->mmc->caps2 |= pdata->host_caps2;
546
547 ret = sdhci_add_host(host); 547 ret = sdhci_add_host(host);
548 if (ret) { 548 if (ret) {
549 dev_err(dev, "sdhci_add_host() failed\n"); 549 dev_err(dev, "sdhci_add_host() failed\n");
diff --git a/drivers/net/Space.c b/drivers/net/Space.c
index 068c3563e00f..88bbd8ffa7fe 100644
--- a/drivers/net/Space.c
+++ b/drivers/net/Space.c
@@ -190,8 +190,10 @@ static struct devprobe2 isa_probes[] __initdata = {
190 {seeq8005_probe, 0}, 190 {seeq8005_probe, 0},
191#endif 191#endif
192#ifdef CONFIG_CS89x0 192#ifdef CONFIG_CS89x0
193#ifndef CONFIG_CS89x0_PLATFORM
193 {cs89x0_probe, 0}, 194 {cs89x0_probe, 0},
194#endif 195#endif
196#endif
195#ifdef CONFIG_AT1700 197#ifdef CONFIG_AT1700
196 {at1700_probe, 0}, 198 {at1700_probe, 0},
197#endif 199#endif
diff --git a/drivers/net/ethernet/cirrus/Kconfig b/drivers/net/ethernet/cirrus/Kconfig
index 1f8648f099c7..8388e36cf08f 100644
--- a/drivers/net/ethernet/cirrus/Kconfig
+++ b/drivers/net/ethernet/cirrus/Kconfig
@@ -5,8 +5,7 @@
5config NET_VENDOR_CIRRUS 5config NET_VENDOR_CIRRUS
6 bool "Cirrus devices" 6 bool "Cirrus devices"
7 default y 7 default y
8 depends on ISA || EISA || MACH_IXDP2351 || ARCH_IXDP2X01 \ 8 depends on ISA || EISA || ARM || MAC
9 || MACH_MX31ADS || MACH_QQ2440 || (ARM && ARCH_EP93XX) || MAC
10 ---help--- 9 ---help---
11 If you have a network (Ethernet) card belonging to this class, say Y 10 If you have a network (Ethernet) card belonging to this class, say Y
12 and read the Ethernet-HOWTO, available from 11 and read the Ethernet-HOWTO, available from
@@ -21,8 +20,7 @@ if NET_VENDOR_CIRRUS
21 20
22config CS89x0 21config CS89x0
23 tristate "CS89x0 support" 22 tristate "CS89x0 support"
24 depends on (ISA || EISA || MACH_IXDP2351 \ 23 depends on ISA || EISA || ARM
25 || ARCH_IXDP2X01 || MACH_MX31ADS || MACH_QQ2440)
26 ---help--- 24 ---help---
27 Support for CS89x0 chipset based Ethernet cards. If you have a 25 Support for CS89x0 chipset based Ethernet cards. If you have a
28 network (Ethernet) card of this type, say Y and read the 26 network (Ethernet) card of this type, say Y and read the
@@ -33,10 +31,15 @@ config CS89x0
33 To compile this driver as a module, choose M here. The module 31 To compile this driver as a module, choose M here. The module
34 will be called cs89x0. 32 will be called cs89x0.
35 33
36config CS89x0_NONISA_IRQ 34config CS89x0_PLATFORM
37 def_bool y 35 bool "CS89x0 platform driver support"
38 depends on CS89x0 != n 36 depends on CS89x0
39 depends on MACH_IXDP2351 || ARCH_IXDP2X01 || MACH_MX31ADS || MACH_QQ2440 37 help
38 Say Y to compile the cs89x0 driver as a platform driver. This
39 makes this driver suitable for use on certain evaluation boards
40 such as the iMX21ADS.
41
42 If you are unsure, say N.
40 43
41config EP93XX_ETH 44config EP93XX_ETH
42 tristate "EP93xx Ethernet support" 45 tristate "EP93xx Ethernet support"
diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
index d5ff93653e4c..30fee428c489 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -100,9 +100,6 @@
100 100
101*/ 101*/
102 102
103/* Always include 'config.h' first in case the user wants to turn on
104 or override something. */
105#include <linux/module.h>
106 103
107/* 104/*
108 * Set this to zero to disable DMA code 105 * Set this to zero to disable DMA code
@@ -131,9 +128,12 @@
131 128
132*/ 129*/
133 130
131#include <linux/module.h>
132#include <linux/printk.h>
134#include <linux/errno.h> 133#include <linux/errno.h>
135#include <linux/netdevice.h> 134#include <linux/netdevice.h>
136#include <linux/etherdevice.h> 135#include <linux/etherdevice.h>
136#include <linux/platform_device.h>
137#include <linux/kernel.h> 137#include <linux/kernel.h>
138#include <linux/types.h> 138#include <linux/types.h>
139#include <linux/fcntl.h> 139#include <linux/fcntl.h>
@@ -151,6 +151,7 @@
151#include <asm/system.h> 151#include <asm/system.h>
152#include <asm/io.h> 152#include <asm/io.h>
153#include <asm/irq.h> 153#include <asm/irq.h>
154#include <linux/atomic.h>
154#if ALLOW_DMA 155#if ALLOW_DMA
155#include <asm/dma.h> 156#include <asm/dma.h>
156#endif 157#endif
@@ -174,26 +175,20 @@ static char version[] __initdata =
174 them to system IRQ numbers. This mapping is card specific and is set to 175 them to system IRQ numbers. This mapping is card specific and is set to
175 the configuration of the Cirrus Eval board for this chip. */ 176 the configuration of the Cirrus Eval board for this chip. */
176#if defined(CONFIG_MACH_IXDP2351) 177#if defined(CONFIG_MACH_IXDP2351)
178#define CS89x0_NONISA_IRQ
177static unsigned int netcard_portlist[] __used __initdata = {IXDP2351_VIRT_CS8900_BASE, 0}; 179static unsigned int netcard_portlist[] __used __initdata = {IXDP2351_VIRT_CS8900_BASE, 0};
178static unsigned int cs8900_irq_map[] = {IRQ_IXDP2351_CS8900, 0, 0, 0}; 180static unsigned int cs8900_irq_map[] = {IRQ_IXDP2351_CS8900, 0, 0, 0};
179#elif defined(CONFIG_ARCH_IXDP2X01) 181#elif defined(CONFIG_ARCH_IXDP2X01)
182#define CS89x0_NONISA_IRQ
180static unsigned int netcard_portlist[] __used __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0}; 183static unsigned int netcard_portlist[] __used __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0};
181static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0}; 184static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0};
182#elif defined(CONFIG_MACH_QQ2440)
183#include <mach/qq2440.h>
184static unsigned int netcard_portlist[] __used __initdata = { QQ2440_CS8900_VIRT_BASE + 0x300, 0 };
185static unsigned int cs8900_irq_map[] = { QQ2440_CS8900_IRQ, 0, 0, 0 };
186#elif defined(CONFIG_MACH_MX31ADS)
187#include <mach/board-mx31ads.h>
188static unsigned int netcard_portlist[] __used __initdata = {
189 PBC_BASE_ADDRESS + PBC_CS8900A_IOBASE + 0x300, 0
190};
191static unsigned cs8900_irq_map[] = {EXPIO_INT_ENET_INT, 0, 0, 0};
192#else 185#else
186#ifndef CONFIG_CS89x0_PLATFORM
193static unsigned int netcard_portlist[] __used __initdata = 187static unsigned int netcard_portlist[] __used __initdata =
194 { 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0}; 188 { 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
195static unsigned int cs8900_irq_map[] = {10,11,12,5}; 189static unsigned int cs8900_irq_map[] = {10,11,12,5};
196#endif 190#endif
191#endif
197 192
198#if DEBUGGING 193#if DEBUGGING
199static unsigned int net_debug = DEBUGGING; 194static unsigned int net_debug = DEBUGGING;
@@ -236,11 +231,16 @@ struct net_local {
236 unsigned char *end_dma_buff; /* points to the end of the buffer */ 231 unsigned char *end_dma_buff; /* points to the end of the buffer */
237 unsigned char *rx_dma_ptr; /* points to the next packet */ 232 unsigned char *rx_dma_ptr; /* points to the next packet */
238#endif 233#endif
234#ifdef CONFIG_CS89x0_PLATFORM
235 void __iomem *virt_addr;/* Virtual address for accessing the CS89x0. */
236 unsigned long phys_addr;/* Physical address for accessing the CS89x0. */
237 unsigned long size; /* Length of CS89x0 memory region. */
238#endif
239}; 239};
240 240
241/* Index to functions, as function prototypes. */ 241/* Index to functions, as function prototypes. */
242 242
243static int cs89x0_probe1(struct net_device *dev, int ioaddr, int modular); 243static int cs89x0_probe1(struct net_device *dev, unsigned long ioaddr, int modular);
244static int net_open(struct net_device *dev); 244static int net_open(struct net_device *dev);
245static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev); 245static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev);
246static irqreturn_t net_interrupt(int irq, void *dev_id); 246static irqreturn_t net_interrupt(int irq, void *dev_id);
@@ -294,6 +294,7 @@ static int __init media_fn(char *str)
294__setup("cs89x0_media=", media_fn); 294__setup("cs89x0_media=", media_fn);
295 295
296 296
297#ifndef CONFIG_CS89x0_PLATFORM
297/* Check for a network adaptor of this type, and return '0' iff one exists. 298/* Check for a network adaptor of this type, and return '0' iff one exists.
298 If dev->base_addr == 0, probe all likely locations. 299 If dev->base_addr == 0, probe all likely locations.
299 If dev->base_addr == 1, always return failure. 300 If dev->base_addr == 1, always return failure.
@@ -343,6 +344,7 @@ out:
343 return ERR_PTR(err); 344 return ERR_PTR(err);
344} 345}
345#endif 346#endif
347#endif
346 348
347#if defined(CONFIG_MACH_IXDP2351) 349#if defined(CONFIG_MACH_IXDP2351)
348static u16 350static u16
@@ -504,7 +506,7 @@ static const struct net_device_ops net_ops = {
504 */ 506 */
505 507
506static int __init 508static int __init
507cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) 509cs89x0_probe1(struct net_device *dev, unsigned long ioaddr, int modular)
508{ 510{
509 struct net_local *lp = netdev_priv(dev); 511 struct net_local *lp = netdev_priv(dev);
510 static unsigned version_printed; 512 static unsigned version_printed;
@@ -529,15 +531,12 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
529 lp->force = g_cs89x0_media__force; 531 lp->force = g_cs89x0_media__force;
530#endif 532#endif
531 533
532#if defined(CONFIG_MACH_QQ2440)
533 lp->force |= FORCE_RJ45 | FORCE_FULL;
534#endif
535 } 534 }
536 535
537 /* Grab the region so we can find another board if autoIRQ fails. */ 536 /* Grab the region so we can find another board if autoIRQ fails. */
538 /* WTF is going on here? */ 537 /* WTF is going on here? */
539 if (!request_region(ioaddr & ~3, NETCARD_IO_EXTENT, DRV_NAME)) { 538 if (!request_region(ioaddr & ~3, NETCARD_IO_EXTENT, DRV_NAME)) {
540 printk(KERN_ERR "%s: request_region(0x%x, 0x%x) failed\n", 539 printk(KERN_ERR "%s: request_region(0x%lx, 0x%x) failed\n",
541 DRV_NAME, ioaddr, NETCARD_IO_EXTENT); 540 DRV_NAME, ioaddr, NETCARD_IO_EXTENT);
542 retval = -EBUSY; 541 retval = -EBUSY;
543 goto out1; 542 goto out1;
@@ -549,7 +548,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
549 will skip the test for the ADD_PORT. */ 548 will skip the test for the ADD_PORT. */
550 if (ioaddr & 1) { 549 if (ioaddr & 1) {
551 if (net_debug > 1) 550 if (net_debug > 1)
552 printk(KERN_INFO "%s: odd ioaddr 0x%x\n", dev->name, ioaddr); 551 printk(KERN_INFO "%s: odd ioaddr 0x%lx\n", dev->name, ioaddr);
553 if ((ioaddr & 2) != 2) 552 if ((ioaddr & 2) != 2)
554 if ((readword(ioaddr & ~3, ADD_PORT) & ADD_MASK) != ADD_SIG) { 553 if ((readword(ioaddr & ~3, ADD_PORT) & ADD_MASK) != ADD_SIG) {
555 printk(KERN_ERR "%s: bad signature 0x%x\n", 554 printk(KERN_ERR "%s: bad signature 0x%x\n",
@@ -560,13 +559,13 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
560 } 559 }
561 560
562 ioaddr &= ~3; 561 ioaddr &= ~3;
563 printk(KERN_DEBUG "PP_addr at %x[%x]: 0x%x\n", 562 printk(KERN_DEBUG "PP_addr at %lx[%x]: 0x%x\n",
564 ioaddr, ADD_PORT, readword(ioaddr, ADD_PORT)); 563 ioaddr, ADD_PORT, readword(ioaddr, ADD_PORT));
565 writeword(ioaddr, ADD_PORT, PP_ChipID); 564 writeword(ioaddr, ADD_PORT, PP_ChipID);
566 565
567 tmp = readword(ioaddr, DATA_PORT); 566 tmp = readword(ioaddr, DATA_PORT);
568 if (tmp != CHIP_EISA_ID_SIG) { 567 if (tmp != CHIP_EISA_ID_SIG) {
569 printk(KERN_DEBUG "%s: incorrect signature at %x[%x]: 0x%x!=" 568 printk(KERN_DEBUG "%s: incorrect signature at %lx[%x]: 0x%x!="
570 CHIP_EISA_ID_SIG_STR "\n", 569 CHIP_EISA_ID_SIG_STR "\n",
571 dev->name, ioaddr, DATA_PORT, tmp); 570 dev->name, ioaddr, DATA_PORT, tmp);
572 retval = -ENODEV; 571 retval = -ENODEV;
@@ -736,8 +735,9 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
736 dev->irq = i; 735 dev->irq = i;
737 } else { 736 } else {
738 i = lp->isa_config & INT_NO_MASK; 737 i = lp->isa_config & INT_NO_MASK;
738#ifndef CONFIG_CS89x0_PLATFORM
739 if (lp->chip_type == CS8900) { 739 if (lp->chip_type == CS8900) {
740#ifdef CONFIG_CS89x0_NONISA_IRQ 740#ifdef CS89x0_NONISA_IRQ
741 i = cs8900_irq_map[0]; 741 i = cs8900_irq_map[0];
742#else 742#else
743 /* Translate the IRQ using the IRQ mapping table. */ 743 /* Translate the IRQ using the IRQ mapping table. */
@@ -758,6 +758,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
758 } 758 }
759#endif 759#endif
760 } 760 }
761#endif
761 if (!dev->irq) 762 if (!dev->irq)
762 dev->irq = i; 763 dev->irq = i;
763 } 764 }
@@ -1168,6 +1169,7 @@ write_irq(struct net_device *dev, int chip_type, int irq)
1168 int i; 1169 int i;
1169 1170
1170 if (chip_type == CS8900) { 1171 if (chip_type == CS8900) {
1172#ifndef CONFIG_CS89x0_PLATFORM
1171 /* Search the mapping table for the corresponding IRQ pin. */ 1173 /* Search the mapping table for the corresponding IRQ pin. */
1172 for (i = 0; i != ARRAY_SIZE(cs8900_irq_map); i++) 1174 for (i = 0; i != ARRAY_SIZE(cs8900_irq_map); i++)
1173 if (cs8900_irq_map[i] == irq) 1175 if (cs8900_irq_map[i] == irq)
@@ -1175,6 +1177,10 @@ write_irq(struct net_device *dev, int chip_type, int irq)
1175 /* Not found */ 1177 /* Not found */
1176 if (i == ARRAY_SIZE(cs8900_irq_map)) 1178 if (i == ARRAY_SIZE(cs8900_irq_map))
1177 i = 3; 1179 i = 3;
1180#else
1181 /* INTRQ0 pin is used for interrupt generation. */
1182 i = 0;
1183#endif
1178 writereg(dev, PP_CS8900_ISAINT, i); 1184 writereg(dev, PP_CS8900_ISAINT, i);
1179 } else { 1185 } else {
1180 writereg(dev, PP_CS8920_ISAINT, irq); 1186 writereg(dev, PP_CS8920_ISAINT, irq);
@@ -1228,7 +1234,7 @@ net_open(struct net_device *dev)
1228 } 1234 }
1229 else 1235 else
1230 { 1236 {
1231#ifndef CONFIG_CS89x0_NONISA_IRQ 1237#if !defined(CS89x0_NONISA_IRQ) && !defined(CONFIG_CS89x0_PLATFORM)
1232 if (((1 << dev->irq) & lp->irq_map) == 0) { 1238 if (((1 << dev->irq) & lp->irq_map) == 0) {
1233 printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n", 1239 printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n",
1234 dev->name, dev->irq, lp->irq_map); 1240 dev->name, dev->irq, lp->irq_map);
@@ -1746,7 +1752,7 @@ static int set_mac_address(struct net_device *dev, void *p)
1746 return 0; 1752 return 0;
1747} 1753}
1748 1754
1749#ifdef MODULE 1755#if defined(MODULE) && !defined(CONFIG_CS89x0_PLATFORM)
1750 1756
1751static struct net_device *dev_cs89x0; 1757static struct net_device *dev_cs89x0;
1752 1758
@@ -1900,7 +1906,97 @@ cleanup_module(void)
1900 release_region(dev_cs89x0->base_addr, NETCARD_IO_EXTENT); 1906 release_region(dev_cs89x0->base_addr, NETCARD_IO_EXTENT);
1901 free_netdev(dev_cs89x0); 1907 free_netdev(dev_cs89x0);
1902} 1908}
1903#endif /* MODULE */ 1909#endif /* MODULE && !CONFIG_CS89x0_PLATFORM */
1910
1911#ifdef CONFIG_CS89x0_PLATFORM
1912static int __init cs89x0_platform_probe(struct platform_device *pdev)
1913{
1914 struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
1915 struct net_local *lp;
1916 struct resource *mem_res;
1917 int err;
1918
1919 if (!dev)
1920 return -ENOMEM;
1921
1922 lp = netdev_priv(dev);
1923
1924 mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1925 dev->irq = platform_get_irq(pdev, 0);
1926 if (mem_res == NULL || dev->irq <= 0) {
1927 dev_warn(&dev->dev, "memory/interrupt resource missing.\n");
1928 err = -ENXIO;
1929 goto free;
1930 }
1931
1932 lp->phys_addr = mem_res->start;
1933 lp->size = resource_size(mem_res);
1934 if (!request_mem_region(lp->phys_addr, lp->size, DRV_NAME)) {
1935 dev_warn(&dev->dev, "request_mem_region() failed.\n");
1936 err = -EBUSY;
1937 goto free;
1938 }
1939
1940 lp->virt_addr = ioremap(lp->phys_addr, lp->size);
1941 if (!lp->virt_addr) {
1942 dev_warn(&dev->dev, "ioremap() failed.\n");
1943 err = -ENOMEM;
1944 goto release;
1945 }
1946
1947 err = cs89x0_probe1(dev, (unsigned long)lp->virt_addr, 0);
1948 if (err) {
1949 dev_warn(&dev->dev, "no cs8900 or cs8920 detected.\n");
1950 goto unmap;
1951 }
1952
1953 platform_set_drvdata(pdev, dev);
1954 return 0;
1955
1956unmap:
1957 iounmap(lp->virt_addr);
1958release:
1959 release_mem_region(lp->phys_addr, lp->size);
1960free:
1961 free_netdev(dev);
1962 return err;
1963}
1964
1965static int cs89x0_platform_remove(struct platform_device *pdev)
1966{
1967 struct net_device *dev = platform_get_drvdata(pdev);
1968 struct net_local *lp = netdev_priv(dev);
1969
1970 unregister_netdev(dev);
1971 iounmap(lp->virt_addr);
1972 release_mem_region(lp->phys_addr, lp->size);
1973 free_netdev(dev);
1974 return 0;
1975}
1976
1977static struct platform_driver cs89x0_driver = {
1978 .driver = {
1979 .name = DRV_NAME,
1980 .owner = THIS_MODULE,
1981 },
1982 .remove = cs89x0_platform_remove,
1983};
1984
1985static int __init cs89x0_init(void)
1986{
1987 return platform_driver_probe(&cs89x0_driver, cs89x0_platform_probe);
1988}
1989
1990module_init(cs89x0_init);
1991
1992static void __exit cs89x0_cleanup(void)
1993{
1994 platform_driver_unregister(&cs89x0_driver);
1995}
1996
1997module_exit(cs89x0_cleanup);
1998
1999#endif /* CONFIG_CS89x0_PLATFORM */
1904 2000
1905/* 2001/*
1906 * Local variables: 2002 * Local variables:
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index a229de98ae6f..36db5a441eba 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -258,14 +258,6 @@ config REGULATOR_DB8500_PRCMU
258 This driver supports the voltage domain regulators controlled by the 258 This driver supports the voltage domain regulators controlled by the
259 DB8500 PRCMU 259 DB8500 PRCMU
260 260
261config REGULATOR_BQ24022
262 tristate "TI bq24022 Dual Input 1-Cell Li-Ion Charger IC"
263 help
264 This driver controls a TI bq24022 Charger attached via
265 GPIOs. The provided current regulator can enable/disable
266 charging select between 100 mA and 500 mA charging current
267 limit.
268
269config REGULATOR_TPS6105X 261config REGULATOR_TPS6105X
270 tristate "TI TPS6105X Power regulators" 262 tristate "TI TPS6105X Power regulators"
271 depends on TPS6105X 263 depends on TPS6105X
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index b5042c885d89..94b52745e957 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -16,7 +16,6 @@ obj-$(CONFIG_REGULATOR_AB3100) += ab3100.o
16obj-$(CONFIG_REGULATOR_AB8500) += ab8500.o 16obj-$(CONFIG_REGULATOR_AB8500) += ab8500.o
17obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o 17obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o
18obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o 18obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o
19obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o
20obj-$(CONFIG_REGULATOR_DA903X) += da903x.o 19obj-$(CONFIG_REGULATOR_DA903X) += da903x.o
21obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o 20obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o
22obj-$(CONFIG_REGULATOR_DBX500_PRCMU) += dbx500-prcmu.o 21obj-$(CONFIG_REGULATOR_DBX500_PRCMU) += dbx500-prcmu.o
diff --git a/drivers/regulator/bq24022.c b/drivers/regulator/bq24022.c
deleted file mode 100644
index 9fab6d1bbe80..000000000000
--- a/drivers/regulator/bq24022.c
+++ /dev/null
@@ -1,162 +0,0 @@
1/*
2 * Support for TI bq24022 (bqTINY-II) Dual Input (USB/AC Adpater)
3 * 1-Cell Li-Ion Charger connected via GPIOs.
4 *
5 * Copyright (c) 2008 Philipp Zabel
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/err.h>
17#include <linux/module.h>
18#include <linux/gpio.h>
19#include <linux/regulator/bq24022.h>
20#include <linux/regulator/driver.h>
21
22
23static int bq24022_set_current_limit(struct regulator_dev *rdev,
24 int min_uA, int max_uA)
25{
26 struct bq24022_mach_info *pdata = rdev_get_drvdata(rdev);
27
28 dev_dbg(rdev_get_dev(rdev), "setting current limit to %s mA\n",
29 max_uA >= 500000 ? "500" : "100");
30
31 /* REVISIT: maybe return error if min_uA != 0 ? */
32 gpio_set_value(pdata->gpio_iset2, max_uA >= 500000);
33 return 0;
34}
35
36static int bq24022_get_current_limit(struct regulator_dev *rdev)
37{
38 struct bq24022_mach_info *pdata = rdev_get_drvdata(rdev);
39
40 return gpio_get_value(pdata->gpio_iset2) ? 500000 : 100000;
41}
42
43static int bq24022_enable(struct regulator_dev *rdev)
44{
45 struct bq24022_mach_info *pdata = rdev_get_drvdata(rdev);
46
47 dev_dbg(rdev_get_dev(rdev), "enabling charger\n");
48
49 gpio_set_value(pdata->gpio_nce, 0);
50 return 0;
51}
52
53static int bq24022_disable(struct regulator_dev *rdev)
54{
55 struct bq24022_mach_info *pdata = rdev_get_drvdata(rdev);
56
57 dev_dbg(rdev_get_dev(rdev), "disabling charger\n");
58
59 gpio_set_value(pdata->gpio_nce, 1);
60 return 0;
61}
62
63static int bq24022_is_enabled(struct regulator_dev *rdev)
64{
65 struct bq24022_mach_info *pdata = rdev_get_drvdata(rdev);
66
67 return !gpio_get_value(pdata->gpio_nce);
68}
69
70static struct regulator_ops bq24022_ops = {
71 .set_current_limit = bq24022_set_current_limit,
72 .get_current_limit = bq24022_get_current_limit,
73 .enable = bq24022_enable,
74 .disable = bq24022_disable,
75 .is_enabled = bq24022_is_enabled,
76};
77
78static struct regulator_desc bq24022_desc = {
79 .name = "bq24022",
80 .ops = &bq24022_ops,
81 .type = REGULATOR_CURRENT,
82 .owner = THIS_MODULE,
83};
84
85static int __init bq24022_probe(struct platform_device *pdev)
86{
87 struct bq24022_mach_info *pdata = pdev->dev.platform_data;
88 struct regulator_dev *bq24022;
89 int ret;
90
91 if (!pdata || !pdata->gpio_nce || !pdata->gpio_iset2)
92 return -EINVAL;
93
94 ret = gpio_request(pdata->gpio_nce, "ncharge_en");
95 if (ret) {
96 dev_dbg(&pdev->dev, "couldn't request nCE GPIO: %d\n",
97 pdata->gpio_nce);
98 goto err_ce;
99 }
100 ret = gpio_request(pdata->gpio_iset2, "charge_mode");
101 if (ret) {
102 dev_dbg(&pdev->dev, "couldn't request ISET2 GPIO: %d\n",
103 pdata->gpio_iset2);
104 goto err_iset2;
105 }
106 ret = gpio_direction_output(pdata->gpio_iset2, 0);
107 ret = gpio_direction_output(pdata->gpio_nce, 1);
108
109 bq24022 = regulator_register(&bq24022_desc, &pdev->dev,
110 pdata->init_data, pdata, NULL);
111 if (IS_ERR(bq24022)) {
112 dev_dbg(&pdev->dev, "couldn't register regulator\n");
113 ret = PTR_ERR(bq24022);
114 goto err_reg;
115 }
116 platform_set_drvdata(pdev, bq24022);
117 dev_dbg(&pdev->dev, "registered regulator\n");
118
119 return 0;
120err_reg:
121 gpio_free(pdata->gpio_iset2);
122err_iset2:
123 gpio_free(pdata->gpio_nce);
124err_ce:
125 return ret;
126}
127
128static int __devexit bq24022_remove(struct platform_device *pdev)
129{
130 struct bq24022_mach_info *pdata = pdev->dev.platform_data;
131 struct regulator_dev *bq24022 = platform_get_drvdata(pdev);
132
133 regulator_unregister(bq24022);
134 gpio_free(pdata->gpio_iset2);
135 gpio_free(pdata->gpio_nce);
136
137 return 0;
138}
139
140static struct platform_driver bq24022_driver = {
141 .driver = {
142 .name = "bq24022",
143 },
144 .remove = __devexit_p(bq24022_remove),
145};
146
147static int __init bq24022_init(void)
148{
149 return platform_driver_probe(&bq24022_driver, bq24022_probe);
150}
151
152static void __exit bq24022_exit(void)
153{
154 platform_driver_unregister(&bq24022_driver);
155}
156
157module_init(bq24022_init);
158module_exit(bq24022_exit);
159
160MODULE_AUTHOR("Philipp Zabel");
161MODULE_DESCRIPTION("TI bq24022 Li-Ion Charger driver");
162MODULE_LICENSE("GPL");
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 4768a9d28375..8c8377d50c4c 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -780,8 +780,8 @@ config RTC_DRV_EP93XX
780 will be called rtc-ep93xx. 780 will be called rtc-ep93xx.
781 781
782config RTC_DRV_SA1100 782config RTC_DRV_SA1100
783 tristate "SA11x0/PXA2xx" 783 tristate "SA11x0/PXA2xx/PXA910"
784 depends on ARCH_SA1100 || ARCH_PXA 784 depends on ARCH_SA1100 || ARCH_PXA || ARCH_MMP
785 help 785 help
786 If you say Y here you will get access to the real time clock 786 If you say Y here you will get access to the real time clock
787 built into your SA11x0 or PXA2xx CPU. 787 built into your SA11x0 or PXA2xx CPU.
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index c543f6f1eec2..9ccea134a996 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -35,6 +35,8 @@
35 35
36enum s3c_cpu_type { 36enum s3c_cpu_type {
37 TYPE_S3C2410, 37 TYPE_S3C2410,
38 TYPE_S3C2416,
39 TYPE_S3C2443,
38 TYPE_S3C64XX, 40 TYPE_S3C64XX,
39}; 41};
40 42
@@ -132,6 +134,7 @@ static int s3c_rtc_setfreq(struct device *dev, int freq)
132 struct platform_device *pdev = to_platform_device(dev); 134 struct platform_device *pdev = to_platform_device(dev);
133 struct rtc_device *rtc_dev = platform_get_drvdata(pdev); 135 struct rtc_device *rtc_dev = platform_get_drvdata(pdev);
134 unsigned int tmp = 0; 136 unsigned int tmp = 0;
137 int val;
135 138
136 if (!is_power_of_2(freq)) 139 if (!is_power_of_2(freq))
137 return -EINVAL; 140 return -EINVAL;
@@ -139,12 +142,22 @@ static int s3c_rtc_setfreq(struct device *dev, int freq)
139 clk_enable(rtc_clk); 142 clk_enable(rtc_clk);
140 spin_lock_irq(&s3c_rtc_pie_lock); 143 spin_lock_irq(&s3c_rtc_pie_lock);
141 144
142 if (s3c_rtc_cpu_type == TYPE_S3C2410) { 145 if (s3c_rtc_cpu_type != TYPE_S3C64XX) {
143 tmp = readb(s3c_rtc_base + S3C2410_TICNT); 146 tmp = readb(s3c_rtc_base + S3C2410_TICNT);
144 tmp &= S3C2410_TICNT_ENABLE; 147 tmp &= S3C2410_TICNT_ENABLE;
145 } 148 }
146 149
147 tmp |= (rtc_dev->max_user_freq / freq)-1; 150 val = (rtc_dev->max_user_freq / freq) - 1;
151
152 if (s3c_rtc_cpu_type == TYPE_S3C2416 || s3c_rtc_cpu_type == TYPE_S3C2443) {
153 tmp |= S3C2443_TICNT_PART(val);
154 writel(S3C2443_TICNT1_PART(val), s3c_rtc_base + S3C2443_TICNT1);
155
156 if (s3c_rtc_cpu_type == TYPE_S3C2416)
157 writel(S3C2416_TICNT2_PART(val), s3c_rtc_base + S3C2416_TICNT2);
158 } else {
159 tmp |= val;
160 }
148 161
149 writel(tmp, s3c_rtc_base + S3C2410_TICNT); 162 writel(tmp, s3c_rtc_base + S3C2410_TICNT);
150 spin_unlock_irq(&s3c_rtc_pie_lock); 163 spin_unlock_irq(&s3c_rtc_pie_lock);
@@ -371,7 +384,7 @@ static void s3c_rtc_enable(struct platform_device *pdev, int en)
371 tmp &= ~S3C2410_RTCCON_RTCEN; 384 tmp &= ~S3C2410_RTCCON_RTCEN;
372 writew(tmp, base + S3C2410_RTCCON); 385 writew(tmp, base + S3C2410_RTCCON);
373 386
374 if (s3c_rtc_cpu_type == TYPE_S3C2410) { 387 if (s3c_rtc_cpu_type != TYPE_S3C64XX) {
375 tmp = readb(base + S3C2410_TICNT); 388 tmp = readb(base + S3C2410_TICNT);
376 tmp &= ~S3C2410_TICNT_ENABLE; 389 tmp &= ~S3C2410_TICNT_ENABLE;
377 writeb(tmp, base + S3C2410_TICNT); 390 writeb(tmp, base + S3C2410_TICNT);
@@ -428,12 +441,27 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev)
428 return 0; 441 return 0;
429} 442}
430 443
444static const struct of_device_id s3c_rtc_dt_match[];
445
446static inline int s3c_rtc_get_driver_data(struct platform_device *pdev)
447{
448#ifdef CONFIG_OF
449 if (pdev->dev.of_node) {
450 const struct of_device_id *match;
451 match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node);
452 return match->data;
453 }
454#endif
455 return platform_get_device_id(pdev)->driver_data;
456}
457
431static int __devinit s3c_rtc_probe(struct platform_device *pdev) 458static int __devinit s3c_rtc_probe(struct platform_device *pdev)
432{ 459{
433 struct rtc_device *rtc; 460 struct rtc_device *rtc;
434 struct rtc_time rtc_tm; 461 struct rtc_time rtc_tm;
435 struct resource *res; 462 struct resource *res;
436 int ret; 463 int ret;
464 int tmp;
437 465
438 pr_debug("%s: probe=%p\n", __func__, pdev); 466 pr_debug("%s: probe=%p\n", __func__, pdev);
439 467
@@ -508,13 +536,7 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
508 goto err_nortc; 536 goto err_nortc;
509 } 537 }
510 538
511#ifdef CONFIG_OF 539 s3c_rtc_cpu_type = s3c_rtc_get_driver_data(pdev);
512 if (pdev->dev.of_node)
513 s3c_rtc_cpu_type = of_device_is_compatible(pdev->dev.of_node,
514 "samsung,s3c6410-rtc") ? TYPE_S3C64XX : TYPE_S3C2410;
515 else
516#endif
517 s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
518 540
519 /* Check RTC Time */ 541 /* Check RTC Time */
520 542
@@ -533,11 +555,17 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
533 dev_warn(&pdev->dev, "warning: invalid RTC value so initializing it\n"); 555 dev_warn(&pdev->dev, "warning: invalid RTC value so initializing it\n");
534 } 556 }
535 557
536 if (s3c_rtc_cpu_type == TYPE_S3C64XX) 558 if (s3c_rtc_cpu_type != TYPE_S3C2410)
537 rtc->max_user_freq = 32768; 559 rtc->max_user_freq = 32768;
538 else 560 else
539 rtc->max_user_freq = 128; 561 rtc->max_user_freq = 128;
540 562
563 if (s3c_rtc_cpu_type == TYPE_S3C2416 || s3c_rtc_cpu_type == TYPE_S3C2443) {
564 tmp = readw(s3c_rtc_base + S3C2410_RTCCON);
565 tmp |= S3C2443_RTCCON_TICSEL;
566 writew(tmp, s3c_rtc_base + S3C2410_RTCCON);
567 }
568
541 platform_set_drvdata(pdev, rtc); 569 platform_set_drvdata(pdev, rtc);
542 570
543 s3c_rtc_setfreq(&pdev->dev, 1); 571 s3c_rtc_setfreq(&pdev->dev, 1);
@@ -638,8 +666,19 @@ static int s3c_rtc_resume(struct platform_device *pdev)
638 666
639#ifdef CONFIG_OF 667#ifdef CONFIG_OF
640static const struct of_device_id s3c_rtc_dt_match[] = { 668static const struct of_device_id s3c_rtc_dt_match[] = {
641 { .compatible = "samsung,s3c2410-rtc" }, 669 {
642 { .compatible = "samsung,s3c6410-rtc" }, 670 .compatible = "samsung,s3c2410-rtc"
671 .data = TYPE_S3C2410,
672 }, {
673 .compatible = "samsung,s3c2416-rtc"
674 .data = TYPE_S3C2416,
675 }, {
676 .compatible = "samsung,s3c2443-rtc"
677 .data = TYPE_S3C2443,
678 }, {
679 .compatible = "samsung,s3c6410-rtc"
680 .data = TYPE_S3C64XX,
681 },
643 {}, 682 {},
644}; 683};
645MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match); 684MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
@@ -652,6 +691,12 @@ static struct platform_device_id s3c_rtc_driver_ids[] = {
652 .name = "s3c2410-rtc", 691 .name = "s3c2410-rtc",
653 .driver_data = TYPE_S3C2410, 692 .driver_data = TYPE_S3C2410,
654 }, { 693 }, {
694 .name = "s3c2416-rtc",
695 .driver_data = TYPE_S3C2416,
696 }, {
697 .name = "s3c2443-rtc",
698 .driver_data = TYPE_S3C2443,
699 }, {
655 .name = "s3c64xx-rtc", 700 .name = "s3c64xx-rtc",
656 .driver_data = TYPE_S3C64XX, 701 .driver_data = TYPE_S3C64XX,
657 }, 702 },
diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c
index 44cd81c72ea1..fa512ed42017 100644
--- a/drivers/rtc/rtc-sa1100.c
+++ b/drivers/rtc/rtc-sa1100.c
@@ -23,35 +23,44 @@
23 23
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/clk.h>
26#include <linux/rtc.h> 27#include <linux/rtc.h>
27#include <linux/init.h> 28#include <linux/init.h>
28#include <linux/fs.h> 29#include <linux/fs.h>
29#include <linux/interrupt.h> 30#include <linux/interrupt.h>
31#include <linux/slab.h>
30#include <linux/string.h> 32#include <linux/string.h>
33#include <linux/of.h>
31#include <linux/pm.h> 34#include <linux/pm.h>
32#include <linux/bitops.h> 35#include <linux/bitops.h>
33 36
34#include <mach/hardware.h> 37#include <mach/hardware.h>
35#include <asm/irq.h> 38#include <asm/irq.h>
36 39
37#ifdef CONFIG_ARCH_PXA 40#if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP)
38#include <mach/regs-rtc.h> 41#include <mach/regs-rtc.h>
39#endif 42#endif
40 43
41#define RTC_DEF_DIVIDER (32768 - 1) 44#define RTC_DEF_DIVIDER (32768 - 1)
42#define RTC_DEF_TRIM 0 45#define RTC_DEF_TRIM 0
43 46#define RTC_FREQ 1024
44static const unsigned long RTC_FREQ = 1024; 47
45static DEFINE_SPINLOCK(sa1100_rtc_lock); 48struct sa1100_rtc {
49 spinlock_t lock;
50 int irq_1hz;
51 int irq_alarm;
52 struct rtc_device *rtc;
53 struct clk *clk;
54};
46 55
47static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id) 56static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id)
48{ 57{
49 struct platform_device *pdev = to_platform_device(dev_id); 58 struct sa1100_rtc *info = dev_get_drvdata(dev_id);
50 struct rtc_device *rtc = platform_get_drvdata(pdev); 59 struct rtc_device *rtc = info->rtc;
51 unsigned int rtsr; 60 unsigned int rtsr;
52 unsigned long events = 0; 61 unsigned long events = 0;
53 62
54 spin_lock(&sa1100_rtc_lock); 63 spin_lock(&info->lock);
55 64
56 rtsr = RTSR; 65 rtsr = RTSR;
57 /* clear interrupt sources */ 66 /* clear interrupt sources */
@@ -87,26 +96,28 @@ static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id)
87 96
88 rtc_update_irq(rtc, 1, events); 97 rtc_update_irq(rtc, 1, events);
89 98
90 spin_unlock(&sa1100_rtc_lock); 99 spin_unlock(&info->lock);
91 100
92 return IRQ_HANDLED; 101 return IRQ_HANDLED;
93} 102}
94 103
95static int sa1100_rtc_open(struct device *dev) 104static int sa1100_rtc_open(struct device *dev)
96{ 105{
106 struct sa1100_rtc *info = dev_get_drvdata(dev);
107 struct rtc_device *rtc = info->rtc;
97 int ret; 108 int ret;
98 struct platform_device *plat_dev = to_platform_device(dev);
99 struct rtc_device *rtc = platform_get_drvdata(plat_dev);
100 109
101 ret = request_irq(IRQ_RTC1Hz, sa1100_rtc_interrupt, 0, "rtc 1Hz", dev); 110 ret = clk_prepare_enable(info->clk);
111 if (ret)
112 goto fail_clk;
113 ret = request_irq(info->irq_1hz, sa1100_rtc_interrupt, 0, "rtc 1Hz", dev);
102 if (ret) { 114 if (ret) {
103 dev_err(dev, "IRQ %d already in use.\n", IRQ_RTC1Hz); 115 dev_err(dev, "IRQ %d already in use.\n", info->irq_1hz);
104 goto fail_ui; 116 goto fail_ui;
105 } 117 }
106 ret = request_irq(IRQ_RTCAlrm, sa1100_rtc_interrupt, 0, 118 ret = request_irq(info->irq_alarm, sa1100_rtc_interrupt, 0, "rtc Alrm", dev);
107 "rtc Alrm", dev);
108 if (ret) { 119 if (ret) {
109 dev_err(dev, "IRQ %d already in use.\n", IRQ_RTCAlrm); 120 dev_err(dev, "IRQ %d already in use.\n", info->irq_alarm);
110 goto fail_ai; 121 goto fail_ai;
111 } 122 }
112 rtc->max_user_freq = RTC_FREQ; 123 rtc->max_user_freq = RTC_FREQ;
@@ -115,29 +126,36 @@ static int sa1100_rtc_open(struct device *dev)
115 return 0; 126 return 0;
116 127
117 fail_ai: 128 fail_ai:
118 free_irq(IRQ_RTC1Hz, dev); 129 free_irq(info->irq_1hz, dev);
119 fail_ui: 130 fail_ui:
131 clk_disable_unprepare(info->clk);
132 fail_clk:
120 return ret; 133 return ret;
121} 134}
122 135
123static void sa1100_rtc_release(struct device *dev) 136static void sa1100_rtc_release(struct device *dev)
124{ 137{
125 spin_lock_irq(&sa1100_rtc_lock); 138 struct sa1100_rtc *info = dev_get_drvdata(dev);
139
140 spin_lock_irq(&info->lock);
126 RTSR = 0; 141 RTSR = 0;
127 spin_unlock_irq(&sa1100_rtc_lock); 142 spin_unlock_irq(&info->lock);
128 143
129 free_irq(IRQ_RTCAlrm, dev); 144 free_irq(info->irq_alarm, dev);
130 free_irq(IRQ_RTC1Hz, dev); 145 free_irq(info->irq_1hz, dev);
146 clk_disable_unprepare(info->clk);
131} 147}
132 148
133static int sa1100_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) 149static int sa1100_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
134{ 150{
135 spin_lock_irq(&sa1100_rtc_lock); 151 struct sa1100_rtc *info = dev_get_drvdata(dev);
152
153 spin_lock_irq(&info->lock);
136 if (enabled) 154 if (enabled)
137 RTSR |= RTSR_ALE; 155 RTSR |= RTSR_ALE;
138 else 156 else
139 RTSR &= ~RTSR_ALE; 157 RTSR &= ~RTSR_ALE;
140 spin_unlock_irq(&sa1100_rtc_lock); 158 spin_unlock_irq(&info->lock);
141 return 0; 159 return 0;
142} 160}
143 161
@@ -170,10 +188,11 @@ static int sa1100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
170 188
171static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) 189static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
172{ 190{
191 struct sa1100_rtc *info = dev_get_drvdata(dev);
173 unsigned long time; 192 unsigned long time;
174 int ret; 193 int ret;
175 194
176 spin_lock_irq(&sa1100_rtc_lock); 195 spin_lock_irq(&info->lock);
177 ret = rtc_tm_to_time(&alrm->time, &time); 196 ret = rtc_tm_to_time(&alrm->time, &time);
178 if (ret != 0) 197 if (ret != 0)
179 goto out; 198 goto out;
@@ -184,7 +203,7 @@ static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
184 else 203 else
185 RTSR &= ~RTSR_ALE; 204 RTSR &= ~RTSR_ALE;
186out: 205out:
187 spin_unlock_irq(&sa1100_rtc_lock); 206 spin_unlock_irq(&info->lock);
188 207
189 return ret; 208 return ret;
190} 209}
@@ -211,6 +230,27 @@ static const struct rtc_class_ops sa1100_rtc_ops = {
211static int sa1100_rtc_probe(struct platform_device *pdev) 230static int sa1100_rtc_probe(struct platform_device *pdev)
212{ 231{
213 struct rtc_device *rtc; 232 struct rtc_device *rtc;
233 struct sa1100_rtc *info;
234 int irq_1hz, irq_alarm, ret = 0;
235
236 irq_1hz = platform_get_irq_byname(pdev, "rtc 1Hz");
237 irq_alarm = platform_get_irq_byname(pdev, "rtc alarm");
238 if (irq_1hz < 0 || irq_alarm < 0)
239 return -ENODEV;
240
241 info = kzalloc(sizeof(struct sa1100_rtc), GFP_KERNEL);
242 if (!info)
243 return -ENOMEM;
244 info->clk = clk_get(&pdev->dev, NULL);
245 if (IS_ERR(info->clk)) {
246 dev_err(&pdev->dev, "failed to find rtc clock source\n");
247 ret = PTR_ERR(info->clk);
248 goto err_clk;
249 }
250 info->irq_1hz = irq_1hz;
251 info->irq_alarm = irq_alarm;
252 spin_lock_init(&info->lock);
253 platform_set_drvdata(pdev, info);
214 254
215 /* 255 /*
216 * According to the manual we should be able to let RTTR be zero 256 * According to the manual we should be able to let RTTR be zero
@@ -232,10 +272,11 @@ static int sa1100_rtc_probe(struct platform_device *pdev)
232 rtc = rtc_device_register(pdev->name, &pdev->dev, &sa1100_rtc_ops, 272 rtc = rtc_device_register(pdev->name, &pdev->dev, &sa1100_rtc_ops,
233 THIS_MODULE); 273 THIS_MODULE);
234 274
235 if (IS_ERR(rtc)) 275 if (IS_ERR(rtc)) {
236 return PTR_ERR(rtc); 276 ret = PTR_ERR(rtc);
237 277 goto err_dev;
238 platform_set_drvdata(pdev, rtc); 278 }
279 info->rtc = rtc;
239 280
240 /* Fix for a nasty initialization problem the in SA11xx RTSR register. 281 /* Fix for a nasty initialization problem the in SA11xx RTSR register.
241 * See also the comments in sa1100_rtc_interrupt(). 282 * See also the comments in sa1100_rtc_interrupt().
@@ -262,14 +303,24 @@ static int sa1100_rtc_probe(struct platform_device *pdev)
262 RTSR = RTSR_AL | RTSR_HZ; 303 RTSR = RTSR_AL | RTSR_HZ;
263 304
264 return 0; 305 return 0;
306err_dev:
307 platform_set_drvdata(pdev, NULL);
308 clk_put(info->clk);
309err_clk:
310 kfree(info);
311 return ret;
265} 312}
266 313
267static int sa1100_rtc_remove(struct platform_device *pdev) 314static int sa1100_rtc_remove(struct platform_device *pdev)
268{ 315{
269 struct rtc_device *rtc = platform_get_drvdata(pdev); 316 struct sa1100_rtc *info = platform_get_drvdata(pdev);
270 317
271 if (rtc) 318 if (info) {
272 rtc_device_unregister(rtc); 319 rtc_device_unregister(info->rtc);
320 clk_put(info->clk);
321 platform_set_drvdata(pdev, NULL);
322 kfree(info);
323 }
273 324
274 return 0; 325 return 0;
275} 326}
@@ -277,15 +328,17 @@ static int sa1100_rtc_remove(struct platform_device *pdev)
277#ifdef CONFIG_PM 328#ifdef CONFIG_PM
278static int sa1100_rtc_suspend(struct device *dev) 329static int sa1100_rtc_suspend(struct device *dev)
279{ 330{
331 struct sa1100_rtc *info = dev_get_drvdata(dev);
280 if (device_may_wakeup(dev)) 332 if (device_may_wakeup(dev))
281 enable_irq_wake(IRQ_RTCAlrm); 333 enable_irq_wake(info->irq_alarm);
282 return 0; 334 return 0;
283} 335}
284 336
285static int sa1100_rtc_resume(struct device *dev) 337static int sa1100_rtc_resume(struct device *dev)
286{ 338{
339 struct sa1100_rtc *info = dev_get_drvdata(dev);
287 if (device_may_wakeup(dev)) 340 if (device_may_wakeup(dev))
288 disable_irq_wake(IRQ_RTCAlrm); 341 disable_irq_wake(info->irq_alarm);
289 return 0; 342 return 0;
290} 343}
291 344
@@ -295,6 +348,13 @@ static const struct dev_pm_ops sa1100_rtc_pm_ops = {
295}; 348};
296#endif 349#endif
297 350
351static struct of_device_id sa1100_rtc_dt_ids[] = {
352 { .compatible = "mrvl,sa1100-rtc", },
353 { .compatible = "mrvl,mmp-rtc", },
354 {}
355};
356MODULE_DEVICE_TABLE(of, sa1100_rtc_dt_ids);
357
298static struct platform_driver sa1100_rtc_driver = { 358static struct platform_driver sa1100_rtc_driver = {
299 .probe = sa1100_rtc_probe, 359 .probe = sa1100_rtc_probe,
300 .remove = sa1100_rtc_remove, 360 .remove = sa1100_rtc_remove,
@@ -303,6 +363,7 @@ static struct platform_driver sa1100_rtc_driver = {
303#ifdef CONFIG_PM 363#ifdef CONFIG_PM
304 .pm = &sa1100_rtc_pm_ops, 364 .pm = &sa1100_rtc_pm_ops,
305#endif 365#endif
366 .of_match_table = sa1100_rtc_dt_ids,
306 }, 367 },
307}; 368};
308 369
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 0b7fed746b27..e7feceeebc2f 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1508,7 +1508,7 @@ static int serial_imx_probe(struct platform_device *pdev)
1508 ret = PTR_ERR(sport->clk); 1508 ret = PTR_ERR(sport->clk);
1509 goto unmap; 1509 goto unmap;
1510 } 1510 }
1511 clk_enable(sport->clk); 1511 clk_prepare_enable(sport->clk);
1512 1512
1513 sport->port.uartclk = clk_get_rate(sport->clk); 1513 sport->port.uartclk = clk_get_rate(sport->clk);
1514 1514
@@ -1531,8 +1531,8 @@ deinit:
1531 if (pdata && pdata->exit) 1531 if (pdata && pdata->exit)
1532 pdata->exit(pdev); 1532 pdata->exit(pdev);
1533clkput: 1533clkput:
1534 clk_disable_unprepare(sport->clk);
1534 clk_put(sport->clk); 1535 clk_put(sport->clk);
1535 clk_disable(sport->clk);
1536unmap: 1536unmap:
1537 iounmap(sport->port.membase); 1537 iounmap(sport->port.membase);
1538free: 1538free:
@@ -1552,11 +1552,10 @@ static int serial_imx_remove(struct platform_device *pdev)
1552 1552
1553 if (sport) { 1553 if (sport) {
1554 uart_remove_one_port(&imx_reg, &sport->port); 1554 uart_remove_one_port(&imx_reg, &sport->port);
1555 clk_disable_unprepare(sport->clk);
1555 clk_put(sport->clk); 1556 clk_put(sport->clk);
1556 } 1557 }
1557 1558
1558 clk_disable(sport->clk);
1559
1560 if (pdata && pdata->exit) 1559 if (pdata && pdata->exit)
1561 pdata->exit(pdev); 1560 pdata->exit(pdev);
1562 1561