88pm8607.c (b65b34895437915f411882dd40d704eb0863ffb0) | 88pm8607.c (192bbb95ca16f2b4d4383e76b3262672e6116daa) |
---|---|
1/* 2 * Regulators driver for Marvell 88PM8607 3 * 4 * Copyright (C) 2009 Marvell International Ltd. 5 * Haojian Zhuang <haojian.zhuang@marvell.com> 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 --- 470 unchanged lines hidden (view full) --- 479 platform_set_drvdata(pdev, info); 480 return 0; 481} 482 483static int __devexit pm8607_regulator_remove(struct platform_device *pdev) 484{ 485 struct pm8607_regulator_info *info = platform_get_drvdata(pdev); 486 | 1/* 2 * Regulators driver for Marvell 88PM8607 3 * 4 * Copyright (C) 2009 Marvell International Ltd. 5 * Haojian Zhuang <haojian.zhuang@marvell.com> 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 --- 470 unchanged lines hidden (view full) --- 479 platform_set_drvdata(pdev, info); 480 return 0; 481} 482 483static int __devexit pm8607_regulator_remove(struct platform_device *pdev) 484{ 485 struct pm8607_regulator_info *info = platform_get_drvdata(pdev); 486 |
487 platform_set_drvdata(pdev, NULL); |
|
487 regulator_unregister(info->regulator); 488 return 0; 489} 490 | 488 regulator_unregister(info->regulator); 489 return 0; 490} 491 |
491#define PM8607_REGULATOR_DRIVER(_name) \ 492{ \ 493 .driver = { \ 494 .name = "88pm8607-" #_name, \ 495 .owner = THIS_MODULE, \ 496 }, \ 497 .probe = pm8607_regulator_probe, \ 498 .remove = __devexit_p(pm8607_regulator_remove), \ 499} 500 501static struct platform_driver pm8607_regulator_driver[] = { 502 PM8607_REGULATOR_DRIVER(buck1), 503 PM8607_REGULATOR_DRIVER(buck2), 504 PM8607_REGULATOR_DRIVER(buck3), 505 PM8607_REGULATOR_DRIVER(ldo1), 506 PM8607_REGULATOR_DRIVER(ldo2), 507 PM8607_REGULATOR_DRIVER(ldo3), 508 PM8607_REGULATOR_DRIVER(ldo4), 509 PM8607_REGULATOR_DRIVER(ldo5), 510 PM8607_REGULATOR_DRIVER(ldo6), 511 PM8607_REGULATOR_DRIVER(ldo7), 512 PM8607_REGULATOR_DRIVER(ldo8), 513 PM8607_REGULATOR_DRIVER(ldo9), 514 PM8607_REGULATOR_DRIVER(ldo10), 515 PM8607_REGULATOR_DRIVER(ldo12), 516 PM8607_REGULATOR_DRIVER(ldo14), | 492static struct platform_driver pm8607_regulator_driver = { 493 .driver = { 494 .name = "88pm860x-regulator", 495 .owner = THIS_MODULE, 496 }, 497 .probe = pm8607_regulator_probe, 498 .remove = __devexit_p(pm8607_regulator_remove), |
517}; 518 519static int __init pm8607_regulator_init(void) 520{ | 499}; 500 501static int __init pm8607_regulator_init(void) 502{ |
521 int i, count, ret; 522 523 count = ARRAY_SIZE(pm8607_regulator_driver); 524 for (i = 0; i < count; i++) { 525 ret = platform_driver_register(&pm8607_regulator_driver[i]); 526 if (ret != 0) 527 pr_err("Failed to register regulator driver: %d\n", 528 ret); 529 } 530 return 0; | 503 return platform_driver_register(&pm8607_regulator_driver); |
531} 532subsys_initcall(pm8607_regulator_init); 533 534static void __exit pm8607_regulator_exit(void) 535{ | 504} 505subsys_initcall(pm8607_regulator_init); 506 507static void __exit pm8607_regulator_exit(void) 508{ |
536 int i, count; 537 538 count = ARRAY_SIZE(pm8607_regulator_driver); 539 for (i = 0; i < count; i++) 540 platform_driver_unregister(&pm8607_regulator_driver[i]); | 509 platform_driver_unregister(&pm8607_regulator_driver); |
541} 542module_exit(pm8607_regulator_exit); 543 544MODULE_LICENSE("GPL"); 545MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); 546MODULE_DESCRIPTION("Regulator Driver for Marvell 88PM8607 PMIC"); 547MODULE_ALIAS("platform:88pm8607-regulator"); | 510} 511module_exit(pm8607_regulator_exit); 512 513MODULE_LICENSE("GPL"); 514MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); 515MODULE_DESCRIPTION("Regulator Driver for Marvell 88PM8607 PMIC"); 516MODULE_ALIAS("platform:88pm8607-regulator"); |