aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-07-02 11:10:56 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-07-08 18:16:13 -0400
commitbad76991d7847b7877ae797cc79745d82ffd9120 (patch)
treedcb3c0ae53b8bfcfa9c9094b45cb55a276fe6ba4
parent2968ab133ec790134d4347aa4264c2eb064b42e7 (diff)
mfd: Register ab8500 devices using the newly DT:ed MFD API
Now the MFD API is Device Tree aware we can use it for platform registration again, even when booting with DT enabled. To aid in Device Node pointer allocation we provide each cell with the associative compatible string. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--arch/arm/mach-ux500/board-mop500.c1
-rw-r--r--drivers/mfd/ab8500-core.c64
-rw-r--r--drivers/mfd/ab8500-debugfs.c6
-rw-r--r--drivers/mfd/ab8500-gpadc.c6
-rw-r--r--drivers/mfd/ab8500-sysctrl.c6
-rw-r--r--drivers/misc/ab8500-pwm.c6
-rw-r--r--drivers/regulator/ab8500.c6
7 files changed, 39 insertions, 56 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 44d816ffaeb6..6224400a9d47 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -793,7 +793,6 @@ static const struct of_device_id u8500_local_bus_nodes[] = {
793 /* only create devices below soc node */ 793 /* only create devices below soc node */
794 { .compatible = "stericsson,db8500", }, 794 { .compatible = "stericsson,db8500", },
795 { .compatible = "stericsson,db8500-prcmu", }, 795 { .compatible = "stericsson,db8500-prcmu", },
796 { .compatible = "stericsson,ab8500-regulator", },
797 { .compatible = "simple-bus"}, 796 { .compatible = "simple-bus"},
798 { }, 797 { },
799}; 798};
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index e580c5d535fb..626b4ecaf647 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -970,54 +970,69 @@ static struct mfd_cell __devinitdata abx500_common_devs[] = {
970#ifdef CONFIG_DEBUG_FS 970#ifdef CONFIG_DEBUG_FS
971 { 971 {
972 .name = "ab8500-debug", 972 .name = "ab8500-debug",
973 .of_compatible = "stericsson,ab8500-debug",
973 .num_resources = ARRAY_SIZE(ab8500_debug_resources), 974 .num_resources = ARRAY_SIZE(ab8500_debug_resources),
974 .resources = ab8500_debug_resources, 975 .resources = ab8500_debug_resources,
975 }, 976 },
976#endif 977#endif
977 { 978 {
978 .name = "ab8500-sysctrl", 979 .name = "ab8500-sysctrl",
980 .of_compatible = "stericsson,ab8500-sysctrl",
979 }, 981 },
980 { 982 {
981 .name = "ab8500-regulator", 983 .name = "ab8500-regulator",
984 .of_compatible = "stericsson,ab8500-regulator",
982 }, 985 },
983 { 986 {
984 .name = "ab8500-gpadc", 987 .name = "ab8500-gpadc",
988 .of_compatible = "stericsson,ab8500-gpadc",
985 .num_resources = ARRAY_SIZE(ab8500_gpadc_resources), 989 .num_resources = ARRAY_SIZE(ab8500_gpadc_resources),
986 .resources = ab8500_gpadc_resources, 990 .resources = ab8500_gpadc_resources,
987 }, 991 },
988 { 992 {
989 .name = "ab8500-rtc", 993 .name = "ab8500-rtc",
994 .of_compatible = "stericsson,ab8500-rtc",
990 .num_resources = ARRAY_SIZE(ab8500_rtc_resources), 995 .num_resources = ARRAY_SIZE(ab8500_rtc_resources),
991 .resources = ab8500_rtc_resources, 996 .resources = ab8500_rtc_resources,
992 }, 997 },
993 { 998 {
994 .name = "ab8500-acc-det", 999 .name = "ab8500-acc-det",
1000 .of_compatible = "stericsson,ab8500-acc-det",
995 .num_resources = ARRAY_SIZE(ab8500_av_acc_detect_resources), 1001 .num_resources = ARRAY_SIZE(ab8500_av_acc_detect_resources),
996 .resources = ab8500_av_acc_detect_resources, 1002 .resources = ab8500_av_acc_detect_resources,
997 }, 1003 },
998 { 1004 {
999 .name = "ab8500-poweron-key", 1005 .name = "ab8500-poweron-key",
1006 .of_compatible = "stericsson,ab8500-poweron-key",
1000 .num_resources = ARRAY_SIZE(ab8500_poweronkey_db_resources), 1007 .num_resources = ARRAY_SIZE(ab8500_poweronkey_db_resources),
1001 .resources = ab8500_poweronkey_db_resources, 1008 .resources = ab8500_poweronkey_db_resources,
1002 }, 1009 },
1003 { 1010 {
1004 .name = "ab8500-pwm", 1011 .name = "ab8500-pwm",
1012 .of_compatible = "stericsson,ab8500-pwm",
1005 .id = 1, 1013 .id = 1,
1006 }, 1014 },
1007 { 1015 {
1008 .name = "ab8500-pwm", 1016 .name = "ab8500-pwm",
1017 .of_compatible = "stericsson,ab8500-pwm",
1009 .id = 2, 1018 .id = 2,
1010 }, 1019 },
1011 { 1020 {
1012 .name = "ab8500-pwm", 1021 .name = "ab8500-pwm",
1022 .of_compatible = "stericsson,ab8500-pwm",
1013 .id = 3, 1023 .id = 3,
1014 }, 1024 },
1015 { .name = "ab8500-leds", }, 1025 {
1026 .name = "ab8500-leds",
1027 .of_compatible = "stericsson,ab8500-leds",
1028 },
1016 { 1029 {
1017 .name = "ab8500-denc", 1030 .name = "ab8500-denc",
1031 .of_compatible = "stericsson,ab8500-denc",
1018 }, 1032 },
1019 { 1033 {
1020 .name = "ab8500-temp", 1034 .name = "ab8500-temp",
1035 .of_compatible = "stericsson,ab8500-temp",
1021 .num_resources = ARRAY_SIZE(ab8500_temp_resources), 1036 .num_resources = ARRAY_SIZE(ab8500_temp_resources),
1022 .resources = ab8500_temp_resources, 1037 .resources = ab8500_temp_resources,
1023 }, 1038 },
@@ -1049,11 +1064,13 @@ static struct mfd_cell __devinitdata ab8500_bm_devs[] = {
1049static struct mfd_cell __devinitdata ab8500_devs[] = { 1064static struct mfd_cell __devinitdata ab8500_devs[] = {
1050 { 1065 {
1051 .name = "ab8500-gpio", 1066 .name = "ab8500-gpio",
1067 .of_compatible = "stericsson,ab8500-gpio",
1052 .num_resources = ARRAY_SIZE(ab8500_gpio_resources), 1068 .num_resources = ARRAY_SIZE(ab8500_gpio_resources),
1053 .resources = ab8500_gpio_resources, 1069 .resources = ab8500_gpio_resources,
1054 }, 1070 },
1055 { 1071 {
1056 .name = "ab8500-usb", 1072 .name = "ab8500-usb",
1073 .of_compatible = "stericsson,ab8500-usb",
1057 .num_resources = ARRAY_SIZE(ab8500_usb_resources), 1074 .num_resources = ARRAY_SIZE(ab8500_usb_resources),
1058 .resources = ab8500_usb_resources, 1075 .resources = ab8500_usb_resources,
1059 }, 1076 },
@@ -1399,32 +1416,29 @@ static int __devinit ab8500_probe(struct platform_device *pdev)
1399 goto out_freeoldmask; 1416 goto out_freeoldmask;
1400 } 1417 }
1401 1418
1402 if (!np) { 1419 ret = mfd_add_devices(ab8500->dev, 0, abx500_common_devs,
1403 ret = mfd_add_devices(ab8500->dev, 0, abx500_common_devs, 1420 ARRAY_SIZE(abx500_common_devs), NULL,
1404 ARRAY_SIZE(abx500_common_devs), NULL, 1421 ab8500->irq_base);
1405 ab8500->irq_base); 1422 if (ret)
1423 goto out_freeirq;
1406 1424
1407 if (ret) 1425 if (is_ab9540(ab8500))
1408 goto out_freeirq; 1426 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
1409 1427 ARRAY_SIZE(ab9540_devs), NULL,
1410 if (is_ab9540(ab8500)) 1428 ab8500->irq_base);
1411 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, 1429 else
1412 ARRAY_SIZE(ab9540_devs), NULL, 1430 ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs,
1413 ab8500->irq_base); 1431 ARRAY_SIZE(ab8500_devs), NULL,
1414 else 1432 ab8500->irq_base);
1415 ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs, 1433 if (ret)
1416 ARRAY_SIZE(ab8500_devs), NULL, 1434 goto out_freeirq;
1417 ab8500->irq_base);
1418 if (ret)
1419 goto out_freeirq;
1420 1435
1421 if (is_ab9540(ab8500) || is_ab8505(ab8500)) 1436 if (is_ab9540(ab8500) || is_ab8505(ab8500))
1422 ret = mfd_add_devices(ab8500->dev, 0, ab9540_ab8505_devs, 1437 ret = mfd_add_devices(ab8500->dev, 0, ab9540_ab8505_devs,
1423 ARRAY_SIZE(ab9540_ab8505_devs), NULL, 1438 ARRAY_SIZE(ab9540_ab8505_devs), NULL,
1424 ab8500->irq_base); 1439 ab8500->irq_base);
1425 if (ret) 1440 if (ret)
1426 goto out_freeirq; 1441 goto out_freeirq;
1427 }
1428 1442
1429 if (!no_bm) { 1443 if (!no_bm) {
1430 /* Add battery management devices */ 1444 /* Add battery management devices */
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 361de52aefe5..c4cb806978ac 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -608,16 +608,10 @@ static int __devexit ab8500_debug_remove(struct platform_device *plf)
608 return 0; 608 return 0;
609} 609}
610 610
611static const struct of_device_id ab8500_debug_match[] = {
612 { .compatible = "stericsson,ab8500-debug", },
613 {}
614};
615
616static struct platform_driver ab8500_debug_driver = { 611static struct platform_driver ab8500_debug_driver = {
617 .driver = { 612 .driver = {
618 .name = "ab8500-debug", 613 .name = "ab8500-debug",
619 .owner = THIS_MODULE, 614 .owner = THIS_MODULE,
620 .of_match_table = ab8500_debug_match,
621 }, 615 },
622 .probe = ab8500_debug_probe, 616 .probe = ab8500_debug_probe,
623 .remove = __devexit_p(ab8500_debug_remove) 617 .remove = __devexit_p(ab8500_debug_remove)
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
index b6cbc3ba2695..866f95960b4b 100644
--- a/drivers/mfd/ab8500-gpadc.c
+++ b/drivers/mfd/ab8500-gpadc.c
@@ -649,18 +649,12 @@ static int __devexit ab8500_gpadc_remove(struct platform_device *pdev)
649 return 0; 649 return 0;
650} 650}
651 651
652static const struct of_device_id ab8500_gpadc_match[] = {
653 { .compatible = "stericsson,ab8500-gpadc", },
654 {}
655};
656
657static struct platform_driver ab8500_gpadc_driver = { 652static struct platform_driver ab8500_gpadc_driver = {
658 .probe = ab8500_gpadc_probe, 653 .probe = ab8500_gpadc_probe,
659 .remove = __devexit_p(ab8500_gpadc_remove), 654 .remove = __devexit_p(ab8500_gpadc_remove),
660 .driver = { 655 .driver = {
661 .name = "ab8500-gpadc", 656 .name = "ab8500-gpadc",
662 .owner = THIS_MODULE, 657 .owner = THIS_MODULE,
663 .of_match_table = ab8500_gpadc_match,
664 }, 658 },
665}; 659};
666 660
diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
index 5a3e51ccf258..c28d4eb1eff0 100644
--- a/drivers/mfd/ab8500-sysctrl.c
+++ b/drivers/mfd/ab8500-sysctrl.c
@@ -61,16 +61,10 @@ static int __devexit ab8500_sysctrl_remove(struct platform_device *pdev)
61 return 0; 61 return 0;
62} 62}
63 63
64static const struct of_device_id ab8500_sysctrl_match[] = {
65 { .compatible = "stericsson,ab8500-sysctrl", },
66 {}
67};
68
69static struct platform_driver ab8500_sysctrl_driver = { 64static struct platform_driver ab8500_sysctrl_driver = {
70 .driver = { 65 .driver = {
71 .name = "ab8500-sysctrl", 66 .name = "ab8500-sysctrl",
72 .owner = THIS_MODULE, 67 .owner = THIS_MODULE,
73 .of_match_table = ab8500_sysctrl_match,
74 }, 68 },
75 .probe = ab8500_sysctrl_probe, 69 .probe = ab8500_sysctrl_probe,
76 .remove = __devexit_p(ab8500_sysctrl_remove), 70 .remove = __devexit_p(ab8500_sysctrl_remove),
diff --git a/drivers/misc/ab8500-pwm.c b/drivers/misc/ab8500-pwm.c
index 042a8fe4efaa..d7a9aa14e5d5 100644
--- a/drivers/misc/ab8500-pwm.c
+++ b/drivers/misc/ab8500-pwm.c
@@ -142,16 +142,10 @@ static int __devexit ab8500_pwm_remove(struct platform_device *pdev)
142 return 0; 142 return 0;
143} 143}
144 144
145static const struct of_device_id ab8500_pwm_match[] = {
146 { .compatible = "stericsson,ab8500-pwm", },
147 {}
148};
149
150static struct platform_driver ab8500_pwm_driver = { 145static struct platform_driver ab8500_pwm_driver = {
151 .driver = { 146 .driver = {
152 .name = "ab8500-pwm", 147 .name = "ab8500-pwm",
153 .owner = THIS_MODULE, 148 .owner = THIS_MODULE,
154 .of_match_table = ab8500_pwm_match,
155 }, 149 },
156 .probe = ab8500_pwm_probe, 150 .probe = ab8500_pwm_probe,
157 .remove = __devexit_p(ab8500_pwm_remove), 151 .remove = __devexit_p(ab8500_pwm_remove),
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index a739f5ca936a..6745bd248da4 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -906,18 +906,12 @@ static __devexit int ab8500_regulator_remove(struct platform_device *pdev)
906 return 0; 906 return 0;
907} 907}
908 908
909static const struct of_device_id ab8500_regulator_match[] = {
910 { .compatible = "stericsson,ab8500-regulator", },
911 {}
912};
913
914static struct platform_driver ab8500_regulator_driver = { 909static struct platform_driver ab8500_regulator_driver = {
915 .probe = ab8500_regulator_probe, 910 .probe = ab8500_regulator_probe,
916 .remove = __devexit_p(ab8500_regulator_remove), 911 .remove = __devexit_p(ab8500_regulator_remove),
917 .driver = { 912 .driver = {
918 .name = "ab8500-regulator", 913 .name = "ab8500-regulator",
919 .owner = THIS_MODULE, 914 .owner = THIS_MODULE,
920 .of_match_table = ab8500_regulator_match,
921 }, 915 },
922}; 916};
923 917