aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
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/regulator
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/regulator')
-rw-r--r--drivers/regulator/Kconfig8
-rw-r--r--drivers/regulator/Makefile1
-rw-r--r--drivers/regulator/bq24022.c162
3 files changed, 0 insertions, 171 deletions
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");