diff options
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/Kconfig | 3 | ||||
-rw-r--r-- | drivers/mfd/ab8500-gpadc.c | 2 | ||||
-rw-r--r-- | drivers/mfd/da9052-i2c.c | 4 | ||||
-rw-r--r-- | drivers/mfd/db8500-prcmu.c | 1 | ||||
-rw-r--r-- | drivers/mfd/mcp-sa11x0.c | 2 | ||||
-rw-r--r-- | drivers/mfd/menelaus.c | 4 | ||||
-rw-r--r-- | drivers/mfd/rc5t583.c | 2 | ||||
-rw-r--r-- | drivers/mfd/rdc321x-southbridge.c | 2 | ||||
-rw-r--r-- | drivers/mfd/tps6586x.c | 13 | ||||
-rw-r--r-- | drivers/mfd/tps65911-comparator.c | 2 | ||||
-rw-r--r-- | drivers/mfd/twl-core.c | 54 | ||||
-rw-r--r-- | drivers/mfd/wm8994-irq.c | 1 |
12 files changed, 56 insertions, 34 deletions
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index ae511b738441..acab3ef8a310 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -397,7 +397,8 @@ config MFD_TC6387XB | |||
397 | 397 | ||
398 | config MFD_TC6393XB | 398 | config MFD_TC6393XB |
399 | bool "Support Toshiba TC6393XB" | 399 | bool "Support Toshiba TC6393XB" |
400 | depends on GPIOLIB && ARM && HAVE_CLK | 400 | depends on ARM && HAVE_CLK |
401 | select GPIOLIB | ||
401 | select MFD_CORE | 402 | select MFD_CORE |
402 | select MFD_TMIO | 403 | select MFD_TMIO |
403 | help | 404 | help |
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c index 866f95960b4b..29d72a259c85 100644 --- a/drivers/mfd/ab8500-gpadc.c +++ b/drivers/mfd/ab8500-gpadc.c | |||
@@ -342,7 +342,7 @@ int ab8500_gpadc_read_raw(struct ab8500_gpadc *gpadc, u8 channel) | |||
342 | 342 | ||
343 | /* | 343 | /* |
344 | * Delay might be needed for ABB8500 cut 3.0, if not, remove | 344 | * Delay might be needed for ABB8500 cut 3.0, if not, remove |
345 | * when hardware will be availible | 345 | * when hardware will be available |
346 | */ | 346 | */ |
347 | msleep(1); | 347 | msleep(1); |
348 | break; | 348 | break; |
diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c index 82c9d6450286..352c58b5a90d 100644 --- a/drivers/mfd/da9052-i2c.c +++ b/drivers/mfd/da9052-i2c.c | |||
@@ -46,7 +46,7 @@ static int da9052_i2c_enable_multiwrite(struct da9052 *da9052) | |||
46 | return 0; | 46 | return 0; |
47 | } | 47 | } |
48 | 48 | ||
49 | static struct i2c_device_id da9052_i2c_id[] = { | 49 | static const struct i2c_device_id da9052_i2c_id[] = { |
50 | {"da9052", DA9052}, | 50 | {"da9052", DA9052}, |
51 | {"da9053-aa", DA9053_AA}, | 51 | {"da9053-aa", DA9053_AA}, |
52 | {"da9053-ba", DA9053_BA}, | 52 | {"da9053-ba", DA9053_BA}, |
@@ -104,7 +104,7 @@ static int __devinit da9052_i2c_probe(struct i2c_client *client, | |||
104 | const struct of_device_id *deviceid; | 104 | const struct of_device_id *deviceid; |
105 | 105 | ||
106 | deviceid = of_match_node(dialog_dt_ids, np); | 106 | deviceid = of_match_node(dialog_dt_ids, np); |
107 | id = (const struct i2c_device_id *)deviceid->data; | 107 | id = deviceid->data; |
108 | } | 108 | } |
109 | #endif | 109 | #endif |
110 | 110 | ||
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index bac4876d090f..00b8b0f3dfb6 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c | |||
@@ -522,6 +522,7 @@ static struct dsiescclk dsiescclk[3] = { | |||
522 | } | 522 | } |
523 | }; | 523 | }; |
524 | 524 | ||
525 | |||
525 | /* | 526 | /* |
526 | * Used by MCDE to setup all necessary PRCMU registers | 527 | * Used by MCDE to setup all necessary PRCMU registers |
527 | */ | 528 | */ |
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c index c54e244ca0cf..f99d6299ec24 100644 --- a/drivers/mfd/mcp-sa11x0.c +++ b/drivers/mfd/mcp-sa11x0.c | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
26 | #include <asm/mach-types.h> | 26 | #include <asm/mach-types.h> |
27 | #include <mach/mcp.h> | 27 | #include <linux/platform_data/mfd-mcp-sa11x0.h> |
28 | 28 | ||
29 | #define DRIVER_NAME "sa11x0-mcp" | 29 | #define DRIVER_NAME "sa11x0-mcp" |
30 | 30 | ||
diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c index cb4910ac4d12..55d589981412 100644 --- a/drivers/mfd/menelaus.c +++ b/drivers/mfd/menelaus.c | |||
@@ -1259,7 +1259,7 @@ static int menelaus_probe(struct i2c_client *client, | |||
1259 | return 0; | 1259 | return 0; |
1260 | fail2: | 1260 | fail2: |
1261 | free_irq(client->irq, menelaus); | 1261 | free_irq(client->irq, menelaus); |
1262 | flush_work_sync(&menelaus->work); | 1262 | flush_work(&menelaus->work); |
1263 | fail1: | 1263 | fail1: |
1264 | kfree(menelaus); | 1264 | kfree(menelaus); |
1265 | return err; | 1265 | return err; |
@@ -1270,7 +1270,7 @@ static int __exit menelaus_remove(struct i2c_client *client) | |||
1270 | struct menelaus_chip *menelaus = i2c_get_clientdata(client); | 1270 | struct menelaus_chip *menelaus = i2c_get_clientdata(client); |
1271 | 1271 | ||
1272 | free_irq(client->irq, menelaus); | 1272 | free_irq(client->irq, menelaus); |
1273 | flush_work_sync(&menelaus->work); | 1273 | flush_work(&menelaus->work); |
1274 | kfree(menelaus); | 1274 | kfree(menelaus); |
1275 | the_menelaus = NULL; | 1275 | the_menelaus = NULL; |
1276 | return 0; | 1276 | return 0; |
diff --git a/drivers/mfd/rc5t583.c b/drivers/mfd/rc5t583.c index d6b50728ea32..f1a024ecdb1e 100644 --- a/drivers/mfd/rc5t583.c +++ b/drivers/mfd/rc5t583.c | |||
@@ -281,7 +281,7 @@ static int __devinit rc5t583_i2c_probe(struct i2c_client *i2c, | |||
281 | 281 | ||
282 | if (i2c->irq) { | 282 | if (i2c->irq) { |
283 | ret = rc5t583_irq_init(rc5t583, i2c->irq, pdata->irq_base); | 283 | ret = rc5t583_irq_init(rc5t583, i2c->irq, pdata->irq_base); |
284 | /* Still continue with waring if irq init fails */ | 284 | /* Still continue with warning, if irq init fails */ |
285 | if (ret) | 285 | if (ret) |
286 | dev_warn(&i2c->dev, "IRQ init failed: %d\n", ret); | 286 | dev_warn(&i2c->dev, "IRQ init failed: %d\n", ret); |
287 | else | 287 | else |
diff --git a/drivers/mfd/rdc321x-southbridge.c b/drivers/mfd/rdc321x-southbridge.c index 0f70dce61160..fbabc3cbe350 100644 --- a/drivers/mfd/rdc321x-southbridge.c +++ b/drivers/mfd/rdc321x-southbridge.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * RDC321x MFD southbrige driver | 2 | * RDC321x MFD southbridge driver |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2010 Florian Fainelli <florian@openwrt.org> | 4 | * Copyright (C) 2007-2010 Florian Fainelli <florian@openwrt.org> |
5 | * Copyright (C) 2010 Bernhard Loos <bernhardloos@googlemail.com> | 5 | * Copyright (C) 2010 Bernhard Loos <bernhardloos@googlemail.com> |
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c index 95ef40754dd7..467464368773 100644 --- a/drivers/mfd/tps6586x.c +++ b/drivers/mfd/tps6586x.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
26 | #include <linux/regmap.h> | 26 | #include <linux/regmap.h> |
27 | #include <linux/regulator/of_regulator.h> | 27 | #include <linux/regulator/of_regulator.h> |
28 | #include <linux/regulator/machine.h> | ||
28 | 29 | ||
29 | #include <linux/mfd/core.h> | 30 | #include <linux/mfd/core.h> |
30 | #include <linux/mfd/tps6586x.h> | 31 | #include <linux/mfd/tps6586x.h> |
@@ -350,6 +351,7 @@ failed: | |||
350 | 351 | ||
351 | #ifdef CONFIG_OF | 352 | #ifdef CONFIG_OF |
352 | static struct of_regulator_match tps6586x_matches[] = { | 353 | static struct of_regulator_match tps6586x_matches[] = { |
354 | { .name = "sys", .driver_data = (void *)TPS6586X_ID_SYS }, | ||
353 | { .name = "sm0", .driver_data = (void *)TPS6586X_ID_SM_0 }, | 355 | { .name = "sm0", .driver_data = (void *)TPS6586X_ID_SM_0 }, |
354 | { .name = "sm1", .driver_data = (void *)TPS6586X_ID_SM_1 }, | 356 | { .name = "sm1", .driver_data = (void *)TPS6586X_ID_SM_1 }, |
355 | { .name = "sm2", .driver_data = (void *)TPS6586X_ID_SM_2 }, | 357 | { .name = "sm2", .driver_data = (void *)TPS6586X_ID_SM_2 }, |
@@ -373,6 +375,7 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clien | |||
373 | struct tps6586x_platform_data *pdata; | 375 | struct tps6586x_platform_data *pdata; |
374 | struct tps6586x_subdev_info *devs; | 376 | struct tps6586x_subdev_info *devs; |
375 | struct device_node *regs; | 377 | struct device_node *regs; |
378 | const char *sys_rail_name = NULL; | ||
376 | unsigned int count; | 379 | unsigned int count; |
377 | unsigned int i, j; | 380 | unsigned int i, j; |
378 | int err; | 381 | int err; |
@@ -395,12 +398,22 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clien | |||
395 | return NULL; | 398 | return NULL; |
396 | 399 | ||
397 | for (i = 0, j = 0; i < num && j < count; i++) { | 400 | for (i = 0, j = 0; i < num && j < count; i++) { |
401 | struct regulator_init_data *reg_idata; | ||
402 | |||
398 | if (!tps6586x_matches[i].init_data) | 403 | if (!tps6586x_matches[i].init_data) |
399 | continue; | 404 | continue; |
400 | 405 | ||
406 | reg_idata = tps6586x_matches[i].init_data; | ||
401 | devs[j].name = "tps6586x-regulator"; | 407 | devs[j].name = "tps6586x-regulator"; |
402 | devs[j].platform_data = tps6586x_matches[i].init_data; | 408 | devs[j].platform_data = tps6586x_matches[i].init_data; |
403 | devs[j].id = (int)tps6586x_matches[i].driver_data; | 409 | devs[j].id = (int)tps6586x_matches[i].driver_data; |
410 | if (devs[j].id == TPS6586X_ID_SYS) | ||
411 | sys_rail_name = reg_idata->constraints.name; | ||
412 | |||
413 | if ((devs[j].id == TPS6586X_ID_LDO_5) || | ||
414 | (devs[j].id == TPS6586X_ID_LDO_RTC)) | ||
415 | reg_idata->supply_regulator = sys_rail_name; | ||
416 | |||
404 | devs[j].of_node = tps6586x_matches[i].of_node; | 417 | devs[j].of_node = tps6586x_matches[i].of_node; |
405 | j++; | 418 | j++; |
406 | } | 419 | } |
diff --git a/drivers/mfd/tps65911-comparator.c b/drivers/mfd/tps65911-comparator.c index 5a62e6bf89ae..0b6e361432c4 100644 --- a/drivers/mfd/tps65911-comparator.c +++ b/drivers/mfd/tps65911-comparator.c | |||
@@ -136,7 +136,7 @@ static __devinit int tps65911_comparator_probe(struct platform_device *pdev) | |||
136 | 136 | ||
137 | ret = comp_threshold_set(tps65910, COMP2, pdata->vmbch2_threshold); | 137 | ret = comp_threshold_set(tps65910, COMP2, pdata->vmbch2_threshold); |
138 | if (ret < 0) { | 138 | if (ret < 0) { |
139 | dev_err(&pdev->dev, "cannot set COMP2 theshold\n"); | 139 | dev_err(&pdev->dev, "cannot set COMP2 threshold\n"); |
140 | return ret; | 140 | return ret; |
141 | } | 141 | } |
142 | 142 | ||
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 3d700129cf3e..4ae642320205 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c | |||
@@ -1104,12 +1104,7 @@ static void clocks_init(struct device *dev, | |||
1104 | u32 rate; | 1104 | u32 rate; |
1105 | u8 ctrl = HFCLK_FREQ_26_MHZ; | 1105 | u8 ctrl = HFCLK_FREQ_26_MHZ; |
1106 | 1106 | ||
1107 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | 1107 | osc = clk_get(dev, "fck"); |
1108 | if (cpu_is_omap2430()) | ||
1109 | osc = clk_get(dev, "osc_ck"); | ||
1110 | else | ||
1111 | osc = clk_get(dev, "osc_sys_ck"); | ||
1112 | |||
1113 | if (IS_ERR(osc)) { | 1108 | if (IS_ERR(osc)) { |
1114 | printk(KERN_WARNING "Skipping twl internal clock init and " | 1109 | printk(KERN_WARNING "Skipping twl internal clock init and " |
1115 | "using bootloader value (unknown osc rate)\n"); | 1110 | "using bootloader value (unknown osc rate)\n"); |
@@ -1119,18 +1114,6 @@ static void clocks_init(struct device *dev, | |||
1119 | rate = clk_get_rate(osc); | 1114 | rate = clk_get_rate(osc); |
1120 | clk_put(osc); | 1115 | clk_put(osc); |
1121 | 1116 | ||
1122 | #else | ||
1123 | /* REVISIT for non-OMAP systems, pass the clock rate from | ||
1124 | * board init code, using platform_data. | ||
1125 | */ | ||
1126 | osc = ERR_PTR(-EIO); | ||
1127 | |||
1128 | printk(KERN_WARNING "Skipping twl internal clock init and " | ||
1129 | "using bootloader value (unknown osc rate)\n"); | ||
1130 | |||
1131 | return; | ||
1132 | #endif | ||
1133 | |||
1134 | switch (rate) { | 1117 | switch (rate) { |
1135 | case 19200000: | 1118 | case 19200000: |
1136 | ctrl = HFCLK_FREQ_19p2_MHZ; | 1119 | ctrl = HFCLK_FREQ_19p2_MHZ; |
@@ -1192,10 +1175,23 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1192 | { | 1175 | { |
1193 | struct twl4030_platform_data *pdata = client->dev.platform_data; | 1176 | struct twl4030_platform_data *pdata = client->dev.platform_data; |
1194 | struct device_node *node = client->dev.of_node; | 1177 | struct device_node *node = client->dev.of_node; |
1178 | struct platform_device *pdev; | ||
1195 | int irq_base = 0; | 1179 | int irq_base = 0; |
1196 | int status; | 1180 | int status; |
1197 | unsigned i, num_slaves; | 1181 | unsigned i, num_slaves; |
1198 | 1182 | ||
1183 | pdev = platform_device_alloc(DRIVER_NAME, -1); | ||
1184 | if (!pdev) { | ||
1185 | dev_err(&client->dev, "can't alloc pdev\n"); | ||
1186 | return -ENOMEM; | ||
1187 | } | ||
1188 | |||
1189 | status = platform_device_add(pdev); | ||
1190 | if (status) { | ||
1191 | platform_device_put(pdev); | ||
1192 | return status; | ||
1193 | } | ||
1194 | |||
1199 | if (node && !pdata) { | 1195 | if (node && !pdata) { |
1200 | /* | 1196 | /* |
1201 | * XXX: Temporary pdata until the information is correctly | 1197 | * XXX: Temporary pdata until the information is correctly |
@@ -1204,23 +1200,30 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1204 | pdata = devm_kzalloc(&client->dev, | 1200 | pdata = devm_kzalloc(&client->dev, |
1205 | sizeof(struct twl4030_platform_data), | 1201 | sizeof(struct twl4030_platform_data), |
1206 | GFP_KERNEL); | 1202 | GFP_KERNEL); |
1207 | if (!pdata) | 1203 | if (!pdata) { |
1208 | return -ENOMEM; | 1204 | status = -ENOMEM; |
1205 | goto free; | ||
1206 | } | ||
1209 | } | 1207 | } |
1210 | 1208 | ||
1211 | if (!pdata) { | 1209 | if (!pdata) { |
1212 | dev_dbg(&client->dev, "no platform data?\n"); | 1210 | dev_dbg(&client->dev, "no platform data?\n"); |
1213 | return -EINVAL; | 1211 | status = -EINVAL; |
1212 | goto free; | ||
1214 | } | 1213 | } |
1215 | 1214 | ||
1215 | platform_set_drvdata(pdev, pdata); | ||
1216 | |||
1216 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { | 1217 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { |
1217 | dev_dbg(&client->dev, "can't talk I2C?\n"); | 1218 | dev_dbg(&client->dev, "can't talk I2C?\n"); |
1218 | return -EIO; | 1219 | status = -EIO; |
1220 | goto free; | ||
1219 | } | 1221 | } |
1220 | 1222 | ||
1221 | if (inuse) { | 1223 | if (inuse) { |
1222 | dev_dbg(&client->dev, "driver is already in use\n"); | 1224 | dev_dbg(&client->dev, "driver is already in use\n"); |
1223 | return -EBUSY; | 1225 | status = -EBUSY; |
1226 | goto free; | ||
1224 | } | 1227 | } |
1225 | 1228 | ||
1226 | if ((id->driver_data) & TWL6030_CLASS) { | 1229 | if ((id->driver_data) & TWL6030_CLASS) { |
@@ -1255,7 +1258,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1255 | inuse = true; | 1258 | inuse = true; |
1256 | 1259 | ||
1257 | /* setup clock framework */ | 1260 | /* setup clock framework */ |
1258 | clocks_init(&client->dev, pdata->clock); | 1261 | clocks_init(&pdev->dev, pdata->clock); |
1259 | 1262 | ||
1260 | /* read TWL IDCODE Register */ | 1263 | /* read TWL IDCODE Register */ |
1261 | if (twl_id == TWL4030_CLASS_ID) { | 1264 | if (twl_id == TWL4030_CLASS_ID) { |
@@ -1305,6 +1308,9 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1305 | fail: | 1308 | fail: |
1306 | if (status < 0) | 1309 | if (status < 0) |
1307 | twl_remove(client); | 1310 | twl_remove(client); |
1311 | free: | ||
1312 | if (status < 0) | ||
1313 | platform_device_unregister(pdev); | ||
1308 | 1314 | ||
1309 | return status; | 1315 | return status; |
1310 | } | 1316 | } |
diff --git a/drivers/mfd/wm8994-irq.c b/drivers/mfd/wm8994-irq.c index 0aac4aff17a5..a050e56a9bbd 100644 --- a/drivers/mfd/wm8994-irq.c +++ b/drivers/mfd/wm8994-irq.c | |||
@@ -135,6 +135,7 @@ static struct regmap_irq_chip wm8994_irq_chip = { | |||
135 | .status_base = WM8994_INTERRUPT_STATUS_1, | 135 | .status_base = WM8994_INTERRUPT_STATUS_1, |
136 | .mask_base = WM8994_INTERRUPT_STATUS_1_MASK, | 136 | .mask_base = WM8994_INTERRUPT_STATUS_1_MASK, |
137 | .ack_base = WM8994_INTERRUPT_STATUS_1, | 137 | .ack_base = WM8994_INTERRUPT_STATUS_1, |
138 | .runtime_pm = true, | ||
138 | }; | 139 | }; |
139 | 140 | ||
140 | int wm8994_irq_init(struct wm8994 *wm8994) | 141 | int wm8994_irq_init(struct wm8994 *wm8994) |