diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-07 14:42:47 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-09-11 04:15:03 -0400 |
commit | 5656098e198e793f7b43a11c301b5025c6e51c9a (patch) | |
tree | d94203bb1ba9f0e49026f138bb99221365f51cb3 | |
parent | c04a9cb813f124abcfad50f93b101ceaee8f3b9f (diff) |
mfd: wm831x: Convert to IORESOURCE_REG
This was originally written by Russell King who unfortunately found
himself unable to take the patch futher.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Tested-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | drivers/mfd/wm831x-core.c | 66 | ||||
-rw-r--r-- | drivers/regulator/wm831x-dcdc.c | 12 | ||||
-rw-r--r-- | drivers/regulator/wm831x-isink.c | 4 | ||||
-rw-r--r-- | drivers/regulator/wm831x-ldo.c | 12 |
4 files changed, 34 insertions, 60 deletions
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c index 946698fd2dc6..2e5d58eb2ec1 100644 --- a/drivers/mfd/wm831x-core.c +++ b/drivers/mfd/wm831x-core.c | |||
@@ -614,18 +614,11 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg, | |||
614 | } | 614 | } |
615 | EXPORT_SYMBOL_GPL(wm831x_set_bits); | 615 | EXPORT_SYMBOL_GPL(wm831x_set_bits); |
616 | 616 | ||
617 | static struct resource wm831x_io_parent = { | ||
618 | .start = 0, | ||
619 | .end = 0xffffffff, | ||
620 | .flags = IORESOURCE_IO, | ||
621 | }; | ||
622 | |||
623 | static struct resource wm831x_dcdc1_resources[] = { | 617 | static struct resource wm831x_dcdc1_resources[] = { |
624 | { | 618 | { |
625 | .parent = &wm831x_io_parent, | ||
626 | .start = WM831X_DC1_CONTROL_1, | 619 | .start = WM831X_DC1_CONTROL_1, |
627 | .end = WM831X_DC1_DVS_CONTROL, | 620 | .end = WM831X_DC1_DVS_CONTROL, |
628 | .flags = IORESOURCE_IO, | 621 | .flags = IORESOURCE_REG, |
629 | }, | 622 | }, |
630 | { | 623 | { |
631 | .name = "UV", | 624 | .name = "UV", |
@@ -644,10 +637,9 @@ static struct resource wm831x_dcdc1_resources[] = { | |||
644 | 637 | ||
645 | static struct resource wm831x_dcdc2_resources[] = { | 638 | static struct resource wm831x_dcdc2_resources[] = { |
646 | { | 639 | { |
647 | .parent = &wm831x_io_parent, | ||
648 | .start = WM831X_DC2_CONTROL_1, | 640 | .start = WM831X_DC2_CONTROL_1, |
649 | .end = WM831X_DC2_DVS_CONTROL, | 641 | .end = WM831X_DC2_DVS_CONTROL, |
650 | .flags = IORESOURCE_IO, | 642 | .flags = IORESOURCE_REG, |
651 | }, | 643 | }, |
652 | { | 644 | { |
653 | .name = "UV", | 645 | .name = "UV", |
@@ -665,10 +657,9 @@ static struct resource wm831x_dcdc2_resources[] = { | |||
665 | 657 | ||
666 | static struct resource wm831x_dcdc3_resources[] = { | 658 | static struct resource wm831x_dcdc3_resources[] = { |
667 | { | 659 | { |
668 | .parent = &wm831x_io_parent, | ||
669 | .start = WM831X_DC3_CONTROL_1, | 660 | .start = WM831X_DC3_CONTROL_1, |
670 | .end = WM831X_DC3_SLEEP_CONTROL, | 661 | .end = WM831X_DC3_SLEEP_CONTROL, |
671 | .flags = IORESOURCE_IO, | 662 | .flags = IORESOURCE_REG, |
672 | }, | 663 | }, |
673 | { | 664 | { |
674 | .name = "UV", | 665 | .name = "UV", |
@@ -680,10 +671,9 @@ static struct resource wm831x_dcdc3_resources[] = { | |||
680 | 671 | ||
681 | static struct resource wm831x_dcdc4_resources[] = { | 672 | static struct resource wm831x_dcdc4_resources[] = { |
682 | { | 673 | { |
683 | .parent = &wm831x_io_parent, | ||
684 | .start = WM831X_DC4_CONTROL, | 674 | .start = WM831X_DC4_CONTROL, |
685 | .end = WM831X_DC4_SLEEP_CONTROL, | 675 | .end = WM831X_DC4_SLEEP_CONTROL, |
686 | .flags = IORESOURCE_IO, | 676 | .flags = IORESOURCE_REG, |
687 | }, | 677 | }, |
688 | { | 678 | { |
689 | .name = "UV", | 679 | .name = "UV", |
@@ -695,10 +685,9 @@ static struct resource wm831x_dcdc4_resources[] = { | |||
695 | 685 | ||
696 | static struct resource wm8320_dcdc4_buck_resources[] = { | 686 | static struct resource wm8320_dcdc4_buck_resources[] = { |
697 | { | 687 | { |
698 | .parent = &wm831x_io_parent, | ||
699 | .start = WM831X_DC4_CONTROL, | 688 | .start = WM831X_DC4_CONTROL, |
700 | .end = WM832X_DC4_SLEEP_CONTROL, | 689 | .end = WM832X_DC4_SLEEP_CONTROL, |
701 | .flags = IORESOURCE_IO, | 690 | .flags = IORESOURCE_REG, |
702 | }, | 691 | }, |
703 | { | 692 | { |
704 | .name = "UV", | 693 | .name = "UV", |
@@ -718,10 +707,9 @@ static struct resource wm831x_gpio_resources[] = { | |||
718 | 707 | ||
719 | static struct resource wm831x_isink1_resources[] = { | 708 | static struct resource wm831x_isink1_resources[] = { |
720 | { | 709 | { |
721 | .parent = &wm831x_io_parent, | ||
722 | .start = WM831X_CURRENT_SINK_1, | 710 | .start = WM831X_CURRENT_SINK_1, |
723 | .end = WM831X_CURRENT_SINK_1, | 711 | .end = WM831X_CURRENT_SINK_1, |
724 | .flags = IORESOURCE_IO, | 712 | .flags = IORESOURCE_REG, |
725 | }, | 713 | }, |
726 | { | 714 | { |
727 | .start = WM831X_IRQ_CS1, | 715 | .start = WM831X_IRQ_CS1, |
@@ -732,10 +720,9 @@ static struct resource wm831x_isink1_resources[] = { | |||
732 | 720 | ||
733 | static struct resource wm831x_isink2_resources[] = { | 721 | static struct resource wm831x_isink2_resources[] = { |
734 | { | 722 | { |
735 | .parent = &wm831x_io_parent, | ||
736 | .start = WM831X_CURRENT_SINK_2, | 723 | .start = WM831X_CURRENT_SINK_2, |
737 | .end = WM831X_CURRENT_SINK_2, | 724 | .end = WM831X_CURRENT_SINK_2, |
738 | .flags = IORESOURCE_IO, | 725 | .flags = IORESOURCE_REG, |
739 | }, | 726 | }, |
740 | { | 727 | { |
741 | .start = WM831X_IRQ_CS2, | 728 | .start = WM831X_IRQ_CS2, |
@@ -746,10 +733,9 @@ static struct resource wm831x_isink2_resources[] = { | |||
746 | 733 | ||
747 | static struct resource wm831x_ldo1_resources[] = { | 734 | static struct resource wm831x_ldo1_resources[] = { |
748 | { | 735 | { |
749 | .parent = &wm831x_io_parent, | ||
750 | .start = WM831X_LDO1_CONTROL, | 736 | .start = WM831X_LDO1_CONTROL, |
751 | .end = WM831X_LDO1_SLEEP_CONTROL, | 737 | .end = WM831X_LDO1_SLEEP_CONTROL, |
752 | .flags = IORESOURCE_IO, | 738 | .flags = IORESOURCE_REG, |
753 | }, | 739 | }, |
754 | { | 740 | { |
755 | .name = "UV", | 741 | .name = "UV", |
@@ -761,10 +747,9 @@ static struct resource wm831x_ldo1_resources[] = { | |||
761 | 747 | ||
762 | static struct resource wm831x_ldo2_resources[] = { | 748 | static struct resource wm831x_ldo2_resources[] = { |
763 | { | 749 | { |
764 | .parent = &wm831x_io_parent, | ||
765 | .start = WM831X_LDO2_CONTROL, | 750 | .start = WM831X_LDO2_CONTROL, |
766 | .end = WM831X_LDO2_SLEEP_CONTROL, | 751 | .end = WM831X_LDO2_SLEEP_CONTROL, |
767 | .flags = IORESOURCE_IO, | 752 | .flags = IORESOURCE_REG, |
768 | }, | 753 | }, |
769 | { | 754 | { |
770 | .name = "UV", | 755 | .name = "UV", |
@@ -776,10 +761,9 @@ static struct resource wm831x_ldo2_resources[] = { | |||
776 | 761 | ||
777 | static struct resource wm831x_ldo3_resources[] = { | 762 | static struct resource wm831x_ldo3_resources[] = { |
778 | { | 763 | { |
779 | .parent = &wm831x_io_parent, | ||
780 | .start = WM831X_LDO3_CONTROL, | 764 | .start = WM831X_LDO3_CONTROL, |
781 | .end = WM831X_LDO3_SLEEP_CONTROL, | 765 | .end = WM831X_LDO3_SLEEP_CONTROL, |
782 | .flags = IORESOURCE_IO, | 766 | .flags = IORESOURCE_REG, |
783 | }, | 767 | }, |
784 | { | 768 | { |
785 | .name = "UV", | 769 | .name = "UV", |
@@ -791,10 +775,9 @@ static struct resource wm831x_ldo3_resources[] = { | |||
791 | 775 | ||
792 | static struct resource wm831x_ldo4_resources[] = { | 776 | static struct resource wm831x_ldo4_resources[] = { |
793 | { | 777 | { |
794 | .parent = &wm831x_io_parent, | ||
795 | .start = WM831X_LDO4_CONTROL, | 778 | .start = WM831X_LDO4_CONTROL, |
796 | .end = WM831X_LDO4_SLEEP_CONTROL, | 779 | .end = WM831X_LDO4_SLEEP_CONTROL, |
797 | .flags = IORESOURCE_IO, | 780 | .flags = IORESOURCE_REG, |
798 | }, | 781 | }, |
799 | { | 782 | { |
800 | .name = "UV", | 783 | .name = "UV", |
@@ -806,10 +789,9 @@ static struct resource wm831x_ldo4_resources[] = { | |||
806 | 789 | ||
807 | static struct resource wm831x_ldo5_resources[] = { | 790 | static struct resource wm831x_ldo5_resources[] = { |
808 | { | 791 | { |
809 | .parent = &wm831x_io_parent, | ||
810 | .start = WM831X_LDO5_CONTROL, | 792 | .start = WM831X_LDO5_CONTROL, |
811 | .end = WM831X_LDO5_SLEEP_CONTROL, | 793 | .end = WM831X_LDO5_SLEEP_CONTROL, |
812 | .flags = IORESOURCE_IO, | 794 | .flags = IORESOURCE_REG, |
813 | }, | 795 | }, |
814 | { | 796 | { |
815 | .name = "UV", | 797 | .name = "UV", |
@@ -821,10 +803,9 @@ static struct resource wm831x_ldo5_resources[] = { | |||
821 | 803 | ||
822 | static struct resource wm831x_ldo6_resources[] = { | 804 | static struct resource wm831x_ldo6_resources[] = { |
823 | { | 805 | { |
824 | .parent = &wm831x_io_parent, | ||
825 | .start = WM831X_LDO6_CONTROL, | 806 | .start = WM831X_LDO6_CONTROL, |
826 | .end = WM831X_LDO6_SLEEP_CONTROL, | 807 | .end = WM831X_LDO6_SLEEP_CONTROL, |
827 | .flags = IORESOURCE_IO, | 808 | .flags = IORESOURCE_REG, |
828 | }, | 809 | }, |
829 | { | 810 | { |
830 | .name = "UV", | 811 | .name = "UV", |
@@ -836,10 +817,9 @@ static struct resource wm831x_ldo6_resources[] = { | |||
836 | 817 | ||
837 | static struct resource wm831x_ldo7_resources[] = { | 818 | static struct resource wm831x_ldo7_resources[] = { |
838 | { | 819 | { |
839 | .parent = &wm831x_io_parent, | ||
840 | .start = WM831X_LDO7_CONTROL, | 820 | .start = WM831X_LDO7_CONTROL, |
841 | .end = WM831X_LDO7_SLEEP_CONTROL, | 821 | .end = WM831X_LDO7_SLEEP_CONTROL, |
842 | .flags = IORESOURCE_IO, | 822 | .flags = IORESOURCE_REG, |
843 | }, | 823 | }, |
844 | { | 824 | { |
845 | .name = "UV", | 825 | .name = "UV", |
@@ -851,10 +831,9 @@ static struct resource wm831x_ldo7_resources[] = { | |||
851 | 831 | ||
852 | static struct resource wm831x_ldo8_resources[] = { | 832 | static struct resource wm831x_ldo8_resources[] = { |
853 | { | 833 | { |
854 | .parent = &wm831x_io_parent, | ||
855 | .start = WM831X_LDO8_CONTROL, | 834 | .start = WM831X_LDO8_CONTROL, |
856 | .end = WM831X_LDO8_SLEEP_CONTROL, | 835 | .end = WM831X_LDO8_SLEEP_CONTROL, |
857 | .flags = IORESOURCE_IO, | 836 | .flags = IORESOURCE_REG, |
858 | }, | 837 | }, |
859 | { | 838 | { |
860 | .name = "UV", | 839 | .name = "UV", |
@@ -866,10 +845,9 @@ static struct resource wm831x_ldo8_resources[] = { | |||
866 | 845 | ||
867 | static struct resource wm831x_ldo9_resources[] = { | 846 | static struct resource wm831x_ldo9_resources[] = { |
868 | { | 847 | { |
869 | .parent = &wm831x_io_parent, | ||
870 | .start = WM831X_LDO9_CONTROL, | 848 | .start = WM831X_LDO9_CONTROL, |
871 | .end = WM831X_LDO9_SLEEP_CONTROL, | 849 | .end = WM831X_LDO9_SLEEP_CONTROL, |
872 | .flags = IORESOURCE_IO, | 850 | .flags = IORESOURCE_REG, |
873 | }, | 851 | }, |
874 | { | 852 | { |
875 | .name = "UV", | 853 | .name = "UV", |
@@ -881,10 +859,9 @@ static struct resource wm831x_ldo9_resources[] = { | |||
881 | 859 | ||
882 | static struct resource wm831x_ldo10_resources[] = { | 860 | static struct resource wm831x_ldo10_resources[] = { |
883 | { | 861 | { |
884 | .parent = &wm831x_io_parent, | ||
885 | .start = WM831X_LDO10_CONTROL, | 862 | .start = WM831X_LDO10_CONTROL, |
886 | .end = WM831X_LDO10_SLEEP_CONTROL, | 863 | .end = WM831X_LDO10_SLEEP_CONTROL, |
887 | .flags = IORESOURCE_IO, | 864 | .flags = IORESOURCE_REG, |
888 | }, | 865 | }, |
889 | { | 866 | { |
890 | .name = "UV", | 867 | .name = "UV", |
@@ -896,10 +873,9 @@ static struct resource wm831x_ldo10_resources[] = { | |||
896 | 873 | ||
897 | static struct resource wm831x_ldo11_resources[] = { | 874 | static struct resource wm831x_ldo11_resources[] = { |
898 | { | 875 | { |
899 | .parent = &wm831x_io_parent, | ||
900 | .start = WM831X_LDO11_ON_CONTROL, | 876 | .start = WM831X_LDO11_ON_CONTROL, |
901 | .end = WM831X_LDO11_SLEEP_CONTROL, | 877 | .end = WM831X_LDO11_SLEEP_CONTROL, |
902 | .flags = IORESOURCE_IO, | 878 | .flags = IORESOURCE_REG, |
903 | }, | 879 | }, |
904 | }; | 880 | }; |
905 | 881 | ||
@@ -998,19 +974,17 @@ static struct resource wm831x_rtc_resources[] = { | |||
998 | 974 | ||
999 | static struct resource wm831x_status1_resources[] = { | 975 | static struct resource wm831x_status1_resources[] = { |
1000 | { | 976 | { |
1001 | .parent = &wm831x_io_parent, | ||
1002 | .start = WM831X_STATUS_LED_1, | 977 | .start = WM831X_STATUS_LED_1, |
1003 | .end = WM831X_STATUS_LED_1, | 978 | .end = WM831X_STATUS_LED_1, |
1004 | .flags = IORESOURCE_IO, | 979 | .flags = IORESOURCE_REG, |
1005 | }, | 980 | }, |
1006 | }; | 981 | }; |
1007 | 982 | ||
1008 | static struct resource wm831x_status2_resources[] = { | 983 | static struct resource wm831x_status2_resources[] = { |
1009 | { | 984 | { |
1010 | .parent = &wm831x_io_parent, | ||
1011 | .start = WM831X_STATUS_LED_2, | 985 | .start = WM831X_STATUS_LED_2, |
1012 | .end = WM831X_STATUS_LED_2, | 986 | .end = WM831X_STATUS_LED_2, |
1013 | .flags = IORESOURCE_IO, | 987 | .flags = IORESOURCE_REG, |
1014 | }, | 988 | }, |
1015 | }; | 989 | }; |
1016 | 990 | ||
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c index 7413885be01b..64111f4935a4 100644 --- a/drivers/regulator/wm831x-dcdc.c +++ b/drivers/regulator/wm831x-dcdc.c | |||
@@ -476,9 +476,9 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev) | |||
476 | 476 | ||
477 | dcdc->wm831x = wm831x; | 477 | dcdc->wm831x = wm831x; |
478 | 478 | ||
479 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | 479 | res = platform_get_resource(pdev, IORESOURCE_REG, 0); |
480 | if (res == NULL) { | 480 | if (res == NULL) { |
481 | dev_err(&pdev->dev, "No I/O resource\n"); | 481 | dev_err(&pdev->dev, "No REG resource\n"); |
482 | ret = -EINVAL; | 482 | ret = -EINVAL; |
483 | goto err; | 483 | goto err; |
484 | } | 484 | } |
@@ -651,9 +651,9 @@ static __devinit int wm831x_buckp_probe(struct platform_device *pdev) | |||
651 | 651 | ||
652 | dcdc->wm831x = wm831x; | 652 | dcdc->wm831x = wm831x; |
653 | 653 | ||
654 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | 654 | res = platform_get_resource(pdev, IORESOURCE_REG, 0); |
655 | if (res == NULL) { | 655 | if (res == NULL) { |
656 | dev_err(&pdev->dev, "No I/O resource\n"); | 656 | dev_err(&pdev->dev, "No REG resource\n"); |
657 | ret = -EINVAL; | 657 | ret = -EINVAL; |
658 | goto err; | 658 | goto err; |
659 | } | 659 | } |
@@ -795,9 +795,9 @@ static __devinit int wm831x_boostp_probe(struct platform_device *pdev) | |||
795 | 795 | ||
796 | dcdc->wm831x = wm831x; | 796 | dcdc->wm831x = wm831x; |
797 | 797 | ||
798 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | 798 | res = platform_get_resource(pdev, IORESOURCE_REG, 0); |
799 | if (res == NULL) { | 799 | if (res == NULL) { |
800 | dev_err(&pdev->dev, "No I/O resource\n"); | 800 | dev_err(&pdev->dev, "No REG resource\n"); |
801 | ret = -EINVAL; | 801 | ret = -EINVAL; |
802 | goto err; | 802 | goto err; |
803 | } | 803 | } |
diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c index 0d207c297714..2646a1902b33 100644 --- a/drivers/regulator/wm831x-isink.c +++ b/drivers/regulator/wm831x-isink.c | |||
@@ -172,9 +172,9 @@ static __devinit int wm831x_isink_probe(struct platform_device *pdev) | |||
172 | 172 | ||
173 | isink->wm831x = wm831x; | 173 | isink->wm831x = wm831x; |
174 | 174 | ||
175 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | 175 | res = platform_get_resource(pdev, IORESOURCE_REG, 0); |
176 | if (res == NULL) { | 176 | if (res == NULL) { |
177 | dev_err(&pdev->dev, "No I/O resource\n"); | 177 | dev_err(&pdev->dev, "No REG resource\n"); |
178 | ret = -EINVAL; | 178 | ret = -EINVAL; |
179 | goto err; | 179 | goto err; |
180 | } | 180 | } |
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c index 5cb70ca1e98d..da73daf2eb7c 100644 --- a/drivers/regulator/wm831x-ldo.c +++ b/drivers/regulator/wm831x-ldo.c | |||
@@ -269,9 +269,9 @@ static __devinit int wm831x_gp_ldo_probe(struct platform_device *pdev) | |||
269 | 269 | ||
270 | ldo->wm831x = wm831x; | 270 | ldo->wm831x = wm831x; |
271 | 271 | ||
272 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | 272 | res = platform_get_resource(pdev, IORESOURCE_REG, 0); |
273 | if (res == NULL) { | 273 | if (res == NULL) { |
274 | dev_err(&pdev->dev, "No I/O resource\n"); | 274 | dev_err(&pdev->dev, "No REG resource\n"); |
275 | ret = -EINVAL; | 275 | ret = -EINVAL; |
276 | goto err; | 276 | goto err; |
277 | } | 277 | } |
@@ -520,9 +520,9 @@ static __devinit int wm831x_aldo_probe(struct platform_device *pdev) | |||
520 | 520 | ||
521 | ldo->wm831x = wm831x; | 521 | ldo->wm831x = wm831x; |
522 | 522 | ||
523 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | 523 | res = platform_get_resource(pdev, IORESOURCE_REG, 0); |
524 | if (res == NULL) { | 524 | if (res == NULL) { |
525 | dev_err(&pdev->dev, "No I/O resource\n"); | 525 | dev_err(&pdev->dev, "No REG resource\n"); |
526 | ret = -EINVAL; | 526 | ret = -EINVAL; |
527 | goto err; | 527 | goto err; |
528 | } | 528 | } |
@@ -675,9 +675,9 @@ static __devinit int wm831x_alive_ldo_probe(struct platform_device *pdev) | |||
675 | 675 | ||
676 | ldo->wm831x = wm831x; | 676 | ldo->wm831x = wm831x; |
677 | 677 | ||
678 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | 678 | res = platform_get_resource(pdev, IORESOURCE_REG, 0); |
679 | if (res == NULL) { | 679 | if (res == NULL) { |
680 | dev_err(&pdev->dev, "No I/O resource\n"); | 680 | dev_err(&pdev->dev, "No REG resource\n"); |
681 | ret = -EINVAL; | 681 | ret = -EINVAL; |
682 | goto err; | 682 | goto err; |
683 | } | 683 | } |