aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/tps65090.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-29 14:53:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-29 14:53:11 -0400
commit4b781474682434e7881f20e9dfbe6687ea619795 (patch)
treebdd976645ead7f04900e60017502e6a41b03e601 /drivers/mfd/tps65090.c
parent53f2c4a8fd882009a2a75c5b72d6898c0808616e (diff)
parent29f772d41c01ad6b72c3de705e79779857badcde (diff)
Merge tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFD changes from Samuel Ortiz: "Besides the usual cleanups, this one brings: * Support for 5 new chipsets: Intel's ICH LPC and SCH Centerton, ST-E's STAX211, Samsung's MAX77693 and TI's LM3533. * Device tree support for the twl6040, tps65910, da9502 and ab8500 drivers. * Fairly big tps56910, ab8500 and db8500 updates. * i2c support for mc13xxx. * Our regular update for the wm8xxx driver from Mark." Fix up various conflicts with other trees, largely due to ab5500 removal etc. * tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (106 commits) mfd: Fix build break of max77693 by adding REGMAP_I2C option mfd: Fix twl6040 build failure mfd: Fix max77693 build failure mfd: ab8500-core should depend on MFD_DB8500_PRCMU gpio: tps65910: dt: process gpio specific device node info mfd: Remove the parsing of dt info for tps65910 gpio mfd: Save device node parsed platform data for tps65910 sub devices mfd: Add r_select to lm3533 platform data gpio: Add Intel Centerton support to gpio-sch mfd: Emulate active low IRQs as well as active high IRQs for wm831x mfd: Mark two lm3533 zone registers as volatile mfd: Fix return type of lm533 attribute is_visible mfd: Enable Device Tree support in the ab8500-pwm driver mfd: Enable Device Tree support in the ab8500-sysctrl driver mfd: Add support for Device Tree to twl6040 mfd: Register the twl6040 child for the ASoC codec unconditionally mfd: Allocate twl6040 IRQ numbers dynamically mfd: twl6040 code cleanup in interrupt initialization part mfd: Enable ab8500-gpadc driver for Device Tree mfd: Prevent unassigned pointer from being used in ab8500-gpadc driver ...
Diffstat (limited to 'drivers/mfd/tps65090.c')
-rw-r--r--drivers/mfd/tps65090.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c
index 47f802bf184..396b9d1b6bd 100644
--- a/drivers/mfd/tps65090.c
+++ b/drivers/mfd/tps65090.c
@@ -283,27 +283,24 @@ static int __devinit tps65090_i2c_probe(struct i2c_client *client,
283 } 283 }
284 } 284 }
285 285
286 tps65090->rmap = regmap_init_i2c(tps65090->client, 286 tps65090->rmap = devm_regmap_init_i2c(tps65090->client,
287 &tps65090_regmap_config); 287 &tps65090_regmap_config);
288 if (IS_ERR(tps65090->rmap)) { 288 if (IS_ERR(tps65090->rmap)) {
289 dev_err(&client->dev, "regmap_init failed with err: %ld\n", 289 ret = PTR_ERR(tps65090->rmap);
290 PTR_ERR(tps65090->rmap)); 290 dev_err(&client->dev, "regmap_init failed with err: %d\n", ret);
291 goto err_irq_exit; 291 goto err_irq_exit;
292 }; 292 }
293 293
294 ret = mfd_add_devices(tps65090->dev, -1, tps65090s, 294 ret = mfd_add_devices(tps65090->dev, -1, tps65090s,
295 ARRAY_SIZE(tps65090s), NULL, 0); 295 ARRAY_SIZE(tps65090s), NULL, 0);
296 if (ret) { 296 if (ret) {
297 dev_err(&client->dev, "add mfd devices failed with err: %d\n", 297 dev_err(&client->dev, "add mfd devices failed with err: %d\n",
298 ret); 298 ret);
299 goto err_regmap_exit; 299 goto err_irq_exit;
300 } 300 }
301 301
302 return 0; 302 return 0;
303 303
304err_regmap_exit:
305 regmap_exit(tps65090->rmap);
306
307err_irq_exit: 304err_irq_exit:
308 if (client->irq) 305 if (client->irq)
309 free_irq(client->irq, tps65090); 306 free_irq(client->irq, tps65090);
@@ -316,29 +313,34 @@ static int __devexit tps65090_i2c_remove(struct i2c_client *client)
316 struct tps65090 *tps65090 = i2c_get_clientdata(client); 313 struct tps65090 *tps65090 = i2c_get_clientdata(client);
317 314
318 mfd_remove_devices(tps65090->dev); 315 mfd_remove_devices(tps65090->dev);
319 regmap_exit(tps65090->rmap);
320 if (client->irq) 316 if (client->irq)
321 free_irq(client->irq, tps65090); 317 free_irq(client->irq, tps65090);
322 318
323 return 0; 319 return 0;
324} 320}
325 321
326#ifdef CONFIG_PM 322#ifdef CONFIG_PM_SLEEP
327static int tps65090_i2c_suspend(struct i2c_client *client, pm_message_t state) 323static int tps65090_suspend(struct device *dev)
328{ 324{
325 struct i2c_client *client = to_i2c_client(dev);
329 if (client->irq) 326 if (client->irq)
330 disable_irq(client->irq); 327 disable_irq(client->irq);
331 return 0; 328 return 0;
332} 329}
333 330
334static int tps65090_i2c_resume(struct i2c_client *client) 331static int tps65090_resume(struct device *dev)
335{ 332{
333 struct i2c_client *client = to_i2c_client(dev);
336 if (client->irq) 334 if (client->irq)
337 enable_irq(client->irq); 335 enable_irq(client->irq);
338 return 0; 336 return 0;
339} 337}
340#endif 338#endif
341 339
340static const struct dev_pm_ops tps65090_pm_ops = {
341 SET_SYSTEM_SLEEP_PM_OPS(tps65090_suspend, tps65090_resume)
342};
343
342static const struct i2c_device_id tps65090_id_table[] = { 344static const struct i2c_device_id tps65090_id_table[] = {
343 { "tps65090", 0 }, 345 { "tps65090", 0 },
344 { }, 346 { },
@@ -349,13 +351,10 @@ static struct i2c_driver tps65090_driver = {
349 .driver = { 351 .driver = {
350 .name = "tps65090", 352 .name = "tps65090",
351 .owner = THIS_MODULE, 353 .owner = THIS_MODULE,
354 .pm = &tps65090_pm_ops,
352 }, 355 },
353 .probe = tps65090_i2c_probe, 356 .probe = tps65090_i2c_probe,
354 .remove = __devexit_p(tps65090_i2c_remove), 357 .remove = __devexit_p(tps65090_i2c_remove),
355#ifdef CONFIG_PM
356 .suspend = tps65090_i2c_suspend,
357 .resume = tps65090_i2c_resume,
358#endif
359 .id_table = tps65090_id_table, 358 .id_table = tps65090_id_table,
360}; 359};
361 360