Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lee Jones and committed by
Samuel Ortiz
bad76991 2968ab13

+39 -56
-1
arch/arm/mach-ux500/board-mop500.c
··· 793 793 /* only create devices below soc node */ 794 794 { .compatible = "stericsson,db8500", }, 795 795 { .compatible = "stericsson,db8500-prcmu", }, 796 - { .compatible = "stericsson,ab8500-regulator", }, 797 796 { .compatible = "simple-bus"}, 798 797 { }, 799 798 };
+39 -25
drivers/mfd/ab8500-core.c
··· 970 970 #ifdef CONFIG_DEBUG_FS 971 971 { 972 972 .name = "ab8500-debug", 973 + .of_compatible = "stericsson,ab8500-debug", 973 974 .num_resources = ARRAY_SIZE(ab8500_debug_resources), 974 975 .resources = ab8500_debug_resources, 975 976 }, 976 977 #endif 977 978 { 978 979 .name = "ab8500-sysctrl", 980 + .of_compatible = "stericsson,ab8500-sysctrl", 979 981 }, 980 982 { 981 983 .name = "ab8500-regulator", 984 + .of_compatible = "stericsson,ab8500-regulator", 982 985 }, 983 986 { 984 987 .name = "ab8500-gpadc", 988 + .of_compatible = "stericsson,ab8500-gpadc", 985 989 .num_resources = ARRAY_SIZE(ab8500_gpadc_resources), 986 990 .resources = ab8500_gpadc_resources, 987 991 }, 988 992 { 989 993 .name = "ab8500-rtc", 994 + .of_compatible = "stericsson,ab8500-rtc", 990 995 .num_resources = ARRAY_SIZE(ab8500_rtc_resources), 991 996 .resources = ab8500_rtc_resources, 992 997 }, 993 998 { 994 999 .name = "ab8500-acc-det", 1000 + .of_compatible = "stericsson,ab8500-acc-det", 995 1001 .num_resources = ARRAY_SIZE(ab8500_av_acc_detect_resources), 996 1002 .resources = ab8500_av_acc_detect_resources, 997 1003 }, 998 1004 { 999 1005 .name = "ab8500-poweron-key", 1006 + .of_compatible = "stericsson,ab8500-poweron-key", 1000 1007 .num_resources = ARRAY_SIZE(ab8500_poweronkey_db_resources), 1001 1008 .resources = ab8500_poweronkey_db_resources, 1002 1009 }, 1003 1010 { 1004 1011 .name = "ab8500-pwm", 1012 + .of_compatible = "stericsson,ab8500-pwm", 1005 1013 .id = 1, 1006 1014 }, 1007 1015 { 1008 1016 .name = "ab8500-pwm", 1017 + .of_compatible = "stericsson,ab8500-pwm", 1009 1018 .id = 2, 1010 1019 }, 1011 1020 { 1012 1021 .name = "ab8500-pwm", 1022 + .of_compatible = "stericsson,ab8500-pwm", 1013 1023 .id = 3, 1014 1024 }, 1015 - { .name = "ab8500-leds", }, 1025 + { 1026 + .name = "ab8500-leds", 1027 + .of_compatible = "stericsson,ab8500-leds", 1028 + }, 1016 1029 { 1017 1030 .name = "ab8500-denc", 1031 + .of_compatible = "stericsson,ab8500-denc", 1018 1032 }, 1019 1033 { 1020 1034 .name = "ab8500-temp", 1035 + .of_compatible = "stericsson,ab8500-temp", 1021 1036 .num_resources = ARRAY_SIZE(ab8500_temp_resources), 1022 1037 .resources = ab8500_temp_resources, 1023 1038 }, ··· 1064 1049 static struct mfd_cell __devinitdata ab8500_devs[] = { 1065 1050 { 1066 1051 .name = "ab8500-gpio", 1052 + .of_compatible = "stericsson,ab8500-gpio", 1067 1053 .num_resources = ARRAY_SIZE(ab8500_gpio_resources), 1068 1054 .resources = ab8500_gpio_resources, 1069 1055 }, 1070 1056 { 1071 1057 .name = "ab8500-usb", 1058 + .of_compatible = "stericsson,ab8500-usb", 1072 1059 .num_resources = ARRAY_SIZE(ab8500_usb_resources), 1073 1060 .resources = ab8500_usb_resources, 1074 1061 }, ··· 1416 1399 goto out_freeoldmask; 1417 1400 } 1418 1401 1419 - if (!np) { 1420 - ret = mfd_add_devices(ab8500->dev, 0, abx500_common_devs, 1421 - ARRAY_SIZE(abx500_common_devs), NULL, 1402 + ret = mfd_add_devices(ab8500->dev, 0, abx500_common_devs, 1403 + ARRAY_SIZE(abx500_common_devs), NULL, 1404 + ab8500->irq_base); 1405 + if (ret) 1406 + goto out_freeirq; 1407 + 1408 + if (is_ab9540(ab8500)) 1409 + ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, 1410 + ARRAY_SIZE(ab9540_devs), NULL, 1422 1411 ab8500->irq_base); 1412 + else 1413 + ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs, 1414 + ARRAY_SIZE(ab8500_devs), NULL, 1415 + ab8500->irq_base); 1416 + if (ret) 1417 + goto out_freeirq; 1423 1418 1424 - if (ret) 1425 - goto out_freeirq; 1426 - 1427 - if (is_ab9540(ab8500)) 1428 - ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, 1429 - ARRAY_SIZE(ab9540_devs), NULL, 1430 - ab8500->irq_base); 1431 - else 1432 - ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs, 1433 - ARRAY_SIZE(ab8500_devs), NULL, 1434 - ab8500->irq_base); 1435 - if (ret) 1436 - goto out_freeirq; 1437 - 1438 - if (is_ab9540(ab8500) || is_ab8505(ab8500)) 1439 - ret = mfd_add_devices(ab8500->dev, 0, ab9540_ab8505_devs, 1440 - ARRAY_SIZE(ab9540_ab8505_devs), NULL, 1441 - ab8500->irq_base); 1442 - if (ret) 1443 - goto out_freeirq; 1444 - } 1419 + if (is_ab9540(ab8500) || is_ab8505(ab8500)) 1420 + ret = mfd_add_devices(ab8500->dev, 0, ab9540_ab8505_devs, 1421 + ARRAY_SIZE(ab9540_ab8505_devs), NULL, 1422 + ab8500->irq_base); 1423 + if (ret) 1424 + goto out_freeirq; 1445 1425 1446 1426 if (!no_bm) { 1447 1427 /* Add battery management devices */
-6
drivers/mfd/ab8500-debugfs.c
··· 608 608 return 0; 609 609 } 610 610 611 - static const struct of_device_id ab8500_debug_match[] = { 612 - { .compatible = "stericsson,ab8500-debug", }, 613 - {} 614 - }; 615 - 616 611 static struct platform_driver ab8500_debug_driver = { 617 612 .driver = { 618 613 .name = "ab8500-debug", 619 614 .owner = THIS_MODULE, 620 - .of_match_table = ab8500_debug_match, 621 615 }, 622 616 .probe = ab8500_debug_probe, 623 617 .remove = __devexit_p(ab8500_debug_remove)
-6
drivers/mfd/ab8500-gpadc.c
··· 649 649 return 0; 650 650 } 651 651 652 - static const struct of_device_id ab8500_gpadc_match[] = { 653 - { .compatible = "stericsson,ab8500-gpadc", }, 654 - {} 655 - }; 656 - 657 652 static struct platform_driver ab8500_gpadc_driver = { 658 653 .probe = ab8500_gpadc_probe, 659 654 .remove = __devexit_p(ab8500_gpadc_remove), 660 655 .driver = { 661 656 .name = "ab8500-gpadc", 662 657 .owner = THIS_MODULE, 663 - .of_match_table = ab8500_gpadc_match, 664 658 }, 665 659 }; 666 660
-6
drivers/mfd/ab8500-sysctrl.c
··· 61 61 return 0; 62 62 } 63 63 64 - static const struct of_device_id ab8500_sysctrl_match[] = { 65 - { .compatible = "stericsson,ab8500-sysctrl", }, 66 - {} 67 - }; 68 - 69 64 static struct platform_driver ab8500_sysctrl_driver = { 70 65 .driver = { 71 66 .name = "ab8500-sysctrl", 72 67 .owner = THIS_MODULE, 73 - .of_match_table = ab8500_sysctrl_match, 74 68 }, 75 69 .probe = ab8500_sysctrl_probe, 76 70 .remove = __devexit_p(ab8500_sysctrl_remove),
-6
drivers/misc/ab8500-pwm.c
··· 142 142 return 0; 143 143 } 144 144 145 - static const struct of_device_id ab8500_pwm_match[] = { 146 - { .compatible = "stericsson,ab8500-pwm", }, 147 - {} 148 - }; 149 - 150 145 static struct platform_driver ab8500_pwm_driver = { 151 146 .driver = { 152 147 .name = "ab8500-pwm", 153 148 .owner = THIS_MODULE, 154 - .of_match_table = ab8500_pwm_match, 155 149 }, 156 150 .probe = ab8500_pwm_probe, 157 151 .remove = __devexit_p(ab8500_pwm_remove),
-6
drivers/regulator/ab8500.c
··· 906 906 return 0; 907 907 } 908 908 909 - static const struct of_device_id ab8500_regulator_match[] = { 910 - { .compatible = "stericsson,ab8500-regulator", }, 911 - {} 912 - }; 913 - 914 909 static struct platform_driver ab8500_regulator_driver = { 915 910 .probe = ab8500_regulator_probe, 916 911 .remove = __devexit_p(ab8500_regulator_remove), 917 912 .driver = { 918 913 .name = "ab8500-regulator", 919 914 .owner = THIS_MODULE, 920 - .of_match_table = ab8500_regulator_match, 921 915 }, 922 916 }; 923 917