aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorSangbeom Kim <sbkim73@samsung.com>2012-01-20 02:09:12 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2012-03-06 12:46:37 -0500
commit88a1cfd6f3b8ffc0c7c86471abce43a6e4f3e1c6 (patch)
treef2618bd861bed9b4effbb33530b4618f550669ea /drivers/mfd
parent621210e25d5de02dae111ad90548577dd64c7663 (diff)
mfd: Add support for multiple s5m devices
There are many samsung mfd devices. The s5m core driver try to support various samsung s5m series. It will cover S5M8767A and S5M8763 and S5M8751. This patch is enable to support various s5m series. Signed-off-by: Sangbeom Kim <sbkim73@samsung.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/s5m-core.c42
1 files changed, 38 insertions, 4 deletions
diff --git a/drivers/mfd/s5m-core.c b/drivers/mfd/s5m-core.c
index 75853988fe3e..8b8cf85256c1 100644
--- a/drivers/mfd/s5m-core.c
+++ b/drivers/mfd/s5m-core.c
@@ -26,7 +26,27 @@
26#include <linux/mfd/s5m87xx/s5m-rtc.h> 26#include <linux/mfd/s5m87xx/s5m-rtc.h>
27#include <linux/regmap.h> 27#include <linux/regmap.h>
28 28
29static struct mfd_cell s5m87xx_devs[] = { 29static struct mfd_cell s5m8751_devs[] = {
30 {
31 .name = "s5m8751-pmic",
32 }, {
33 .name = "s5m-charger",
34 }, {
35 .name = "s5m8751-codec",
36 },
37};
38
39static struct mfd_cell s5m8763_devs[] = {
40 {
41 .name = "s5m8763-pmic",
42 }, {
43 .name = "s5m-rtc",
44 }, {
45 .name = "s5m-charger",
46 },
47};
48
49static struct mfd_cell s5m8767_devs[] = {
30 { 50 {
31 .name = "s5m8767-pmic", 51 .name = "s5m8767-pmic",
32 }, { 52 }, {
@@ -113,9 +133,23 @@ static int s5m87xx_i2c_probe(struct i2c_client *i2c,
113 133
114 pm_runtime_set_active(s5m87xx->dev); 134 pm_runtime_set_active(s5m87xx->dev);
115 135
116 ret = mfd_add_devices(s5m87xx->dev, -1, 136 switch (s5m87xx->device_type) {
117 s5m87xx_devs, ARRAY_SIZE(s5m87xx_devs), 137 case S5M8751X:
118 NULL, 0); 138 ret = mfd_add_devices(s5m87xx->dev, -1, s5m8751_devs,
139 ARRAY_SIZE(s5m8751_devs), NULL, 0);
140 break;
141 case S5M8763X:
142 ret = mfd_add_devices(s5m87xx->dev, -1, s5m8763_devs,
143 ARRAY_SIZE(s5m8763_devs), NULL, 0);
144 break;
145 case S5M8767X:
146 ret = mfd_add_devices(s5m87xx->dev, -1, s5m8767_devs,
147 ARRAY_SIZE(s5m8767_devs), NULL, 0);
148 break;
149 default:
150 /* If this happens the probe function is problem */
151 BUG();
152 }
119 153
120 if (ret < 0) 154 if (ret < 0)
121 goto err; 155 goto err;