aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-07 05:03:20 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-05-07 05:32:08 -0400
commitce7e4e11221dd7fbe82c8ad28d1875b0dfa20de4 (patch)
tree7dc1d1ae4f2bb61c26616d2f1045457dd62b98a1
parent63745d4068de8ccea3580214c6dbfdca0ec37859 (diff)
mfd: Fix wm831x register range passing for recent ARM updates
The removal of mach/io.h from most ARM platforms also set the range of valid IO ports to be empty for most platforms when previously any 32 bit integer had been valid. This makes it impossible to add IO resources as the added range is smaller than that of the root resource for IO ports. Since we're not really using IO memory at all fix this by defining our own root resource outside the normal tree and make that the parent of all IO resources. This also ensures we won't conflict with read IO ports if we ever run on a platform which happens to use them. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/wm831x-core.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
index 838056c3493a..476e4d31a823 100644
--- a/drivers/mfd/wm831x-core.c
+++ b/drivers/mfd/wm831x-core.c
@@ -614,8 +614,15 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg,
614} 614}
615EXPORT_SYMBOL_GPL(wm831x_set_bits); 615EXPORT_SYMBOL_GPL(wm831x_set_bits);
616 616
617static struct resource wm831x_io_parent = {
618 .start = 0,
619 .end = 0xffffffff,
620 .flags = IORESOURCE_IO,
621};
622
617static struct resource wm831x_dcdc1_resources[] = { 623static struct resource wm831x_dcdc1_resources[] = {
618 { 624 {
625 .parent = &wm831x_io_parent,
619 .start = WM831X_DC1_CONTROL_1, 626 .start = WM831X_DC1_CONTROL_1,
620 .end = WM831X_DC1_DVS_CONTROL, 627 .end = WM831X_DC1_DVS_CONTROL,
621 .flags = IORESOURCE_IO, 628 .flags = IORESOURCE_IO,
@@ -637,6 +644,7 @@ static struct resource wm831x_dcdc1_resources[] = {
637 644
638static struct resource wm831x_dcdc2_resources[] = { 645static struct resource wm831x_dcdc2_resources[] = {
639 { 646 {
647 .parent = &wm831x_io_parent,
640 .start = WM831X_DC2_CONTROL_1, 648 .start = WM831X_DC2_CONTROL_1,
641 .end = WM831X_DC2_DVS_CONTROL, 649 .end = WM831X_DC2_DVS_CONTROL,
642 .flags = IORESOURCE_IO, 650 .flags = IORESOURCE_IO,
@@ -657,6 +665,7 @@ static struct resource wm831x_dcdc2_resources[] = {
657 665
658static struct resource wm831x_dcdc3_resources[] = { 666static struct resource wm831x_dcdc3_resources[] = {
659 { 667 {
668 .parent = &wm831x_io_parent,
660 .start = WM831X_DC3_CONTROL_1, 669 .start = WM831X_DC3_CONTROL_1,
661 .end = WM831X_DC3_SLEEP_CONTROL, 670 .end = WM831X_DC3_SLEEP_CONTROL,
662 .flags = IORESOURCE_IO, 671 .flags = IORESOURCE_IO,
@@ -671,6 +680,7 @@ static struct resource wm831x_dcdc3_resources[] = {
671 680
672static struct resource wm831x_dcdc4_resources[] = { 681static struct resource wm831x_dcdc4_resources[] = {
673 { 682 {
683 .parent = &wm831x_io_parent,
674 .start = WM831X_DC4_CONTROL, 684 .start = WM831X_DC4_CONTROL,
675 .end = WM831X_DC4_SLEEP_CONTROL, 685 .end = WM831X_DC4_SLEEP_CONTROL,
676 .flags = IORESOURCE_IO, 686 .flags = IORESOURCE_IO,
@@ -685,6 +695,7 @@ static struct resource wm831x_dcdc4_resources[] = {
685 695
686static struct resource wm8320_dcdc4_buck_resources[] = { 696static struct resource wm8320_dcdc4_buck_resources[] = {
687 { 697 {
698 .parent = &wm831x_io_parent,
688 .start = WM831X_DC4_CONTROL, 699 .start = WM831X_DC4_CONTROL,
689 .end = WM832X_DC4_SLEEP_CONTROL, 700 .end = WM832X_DC4_SLEEP_CONTROL,
690 .flags = IORESOURCE_IO, 701 .flags = IORESOURCE_IO,
@@ -707,6 +718,7 @@ static struct resource wm831x_gpio_resources[] = {
707 718
708static struct resource wm831x_isink1_resources[] = { 719static struct resource wm831x_isink1_resources[] = {
709 { 720 {
721 .parent = &wm831x_io_parent,
710 .start = WM831X_CURRENT_SINK_1, 722 .start = WM831X_CURRENT_SINK_1,
711 .end = WM831X_CURRENT_SINK_1, 723 .end = WM831X_CURRENT_SINK_1,
712 .flags = IORESOURCE_IO, 724 .flags = IORESOURCE_IO,
@@ -720,6 +732,7 @@ static struct resource wm831x_isink1_resources[] = {
720 732
721static struct resource wm831x_isink2_resources[] = { 733static struct resource wm831x_isink2_resources[] = {
722 { 734 {
735 .parent = &wm831x_io_parent,
723 .start = WM831X_CURRENT_SINK_2, 736 .start = WM831X_CURRENT_SINK_2,
724 .end = WM831X_CURRENT_SINK_2, 737 .end = WM831X_CURRENT_SINK_2,
725 .flags = IORESOURCE_IO, 738 .flags = IORESOURCE_IO,
@@ -733,6 +746,7 @@ static struct resource wm831x_isink2_resources[] = {
733 746
734static struct resource wm831x_ldo1_resources[] = { 747static struct resource wm831x_ldo1_resources[] = {
735 { 748 {
749 .parent = &wm831x_io_parent,
736 .start = WM831X_LDO1_CONTROL, 750 .start = WM831X_LDO1_CONTROL,
737 .end = WM831X_LDO1_SLEEP_CONTROL, 751 .end = WM831X_LDO1_SLEEP_CONTROL,
738 .flags = IORESOURCE_IO, 752 .flags = IORESOURCE_IO,
@@ -747,6 +761,7 @@ static struct resource wm831x_ldo1_resources[] = {
747 761
748static struct resource wm831x_ldo2_resources[] = { 762static struct resource wm831x_ldo2_resources[] = {
749 { 763 {
764 .parent = &wm831x_io_parent,
750 .start = WM831X_LDO2_CONTROL, 765 .start = WM831X_LDO2_CONTROL,
751 .end = WM831X_LDO2_SLEEP_CONTROL, 766 .end = WM831X_LDO2_SLEEP_CONTROL,
752 .flags = IORESOURCE_IO, 767 .flags = IORESOURCE_IO,
@@ -761,6 +776,7 @@ static struct resource wm831x_ldo2_resources[] = {
761 776
762static struct resource wm831x_ldo3_resources[] = { 777static struct resource wm831x_ldo3_resources[] = {
763 { 778 {
779 .parent = &wm831x_io_parent,
764 .start = WM831X_LDO3_CONTROL, 780 .start = WM831X_LDO3_CONTROL,
765 .end = WM831X_LDO3_SLEEP_CONTROL, 781 .end = WM831X_LDO3_SLEEP_CONTROL,
766 .flags = IORESOURCE_IO, 782 .flags = IORESOURCE_IO,
@@ -775,6 +791,7 @@ static struct resource wm831x_ldo3_resources[] = {
775 791
776static struct resource wm831x_ldo4_resources[] = { 792static struct resource wm831x_ldo4_resources[] = {
777 { 793 {
794 .parent = &wm831x_io_parent,
778 .start = WM831X_LDO4_CONTROL, 795 .start = WM831X_LDO4_CONTROL,
779 .end = WM831X_LDO4_SLEEP_CONTROL, 796 .end = WM831X_LDO4_SLEEP_CONTROL,
780 .flags = IORESOURCE_IO, 797 .flags = IORESOURCE_IO,
@@ -789,6 +806,7 @@ static struct resource wm831x_ldo4_resources[] = {
789 806
790static struct resource wm831x_ldo5_resources[] = { 807static struct resource wm831x_ldo5_resources[] = {
791 { 808 {
809 .parent = &wm831x_io_parent,
792 .start = WM831X_LDO5_CONTROL, 810 .start = WM831X_LDO5_CONTROL,
793 .end = WM831X_LDO5_SLEEP_CONTROL, 811 .end = WM831X_LDO5_SLEEP_CONTROL,
794 .flags = IORESOURCE_IO, 812 .flags = IORESOURCE_IO,
@@ -803,6 +821,7 @@ static struct resource wm831x_ldo5_resources[] = {
803 821
804static struct resource wm831x_ldo6_resources[] = { 822static struct resource wm831x_ldo6_resources[] = {
805 { 823 {
824 .parent = &wm831x_io_parent,
806 .start = WM831X_LDO6_CONTROL, 825 .start = WM831X_LDO6_CONTROL,
807 .end = WM831X_LDO6_SLEEP_CONTROL, 826 .end = WM831X_LDO6_SLEEP_CONTROL,
808 .flags = IORESOURCE_IO, 827 .flags = IORESOURCE_IO,
@@ -817,6 +836,7 @@ static struct resource wm831x_ldo6_resources[] = {
817 836
818static struct resource wm831x_ldo7_resources[] = { 837static struct resource wm831x_ldo7_resources[] = {
819 { 838 {
839 .parent = &wm831x_io_parent,
820 .start = WM831X_LDO7_CONTROL, 840 .start = WM831X_LDO7_CONTROL,
821 .end = WM831X_LDO7_SLEEP_CONTROL, 841 .end = WM831X_LDO7_SLEEP_CONTROL,
822 .flags = IORESOURCE_IO, 842 .flags = IORESOURCE_IO,
@@ -831,6 +851,7 @@ static struct resource wm831x_ldo7_resources[] = {
831 851
832static struct resource wm831x_ldo8_resources[] = { 852static struct resource wm831x_ldo8_resources[] = {
833 { 853 {
854 .parent = &wm831x_io_parent,
834 .start = WM831X_LDO8_CONTROL, 855 .start = WM831X_LDO8_CONTROL,
835 .end = WM831X_LDO8_SLEEP_CONTROL, 856 .end = WM831X_LDO8_SLEEP_CONTROL,
836 .flags = IORESOURCE_IO, 857 .flags = IORESOURCE_IO,
@@ -845,6 +866,7 @@ static struct resource wm831x_ldo8_resources[] = {
845 866
846static struct resource wm831x_ldo9_resources[] = { 867static struct resource wm831x_ldo9_resources[] = {
847 { 868 {
869 .parent = &wm831x_io_parent,
848 .start = WM831X_LDO9_CONTROL, 870 .start = WM831X_LDO9_CONTROL,
849 .end = WM831X_LDO9_SLEEP_CONTROL, 871 .end = WM831X_LDO9_SLEEP_CONTROL,
850 .flags = IORESOURCE_IO, 872 .flags = IORESOURCE_IO,
@@ -859,6 +881,7 @@ static struct resource wm831x_ldo9_resources[] = {
859 881
860static struct resource wm831x_ldo10_resources[] = { 882static struct resource wm831x_ldo10_resources[] = {
861 { 883 {
884 .parent = &wm831x_io_parent,
862 .start = WM831X_LDO10_CONTROL, 885 .start = WM831X_LDO10_CONTROL,
863 .end = WM831X_LDO10_SLEEP_CONTROL, 886 .end = WM831X_LDO10_SLEEP_CONTROL,
864 .flags = IORESOURCE_IO, 887 .flags = IORESOURCE_IO,
@@ -873,6 +896,7 @@ static struct resource wm831x_ldo10_resources[] = {
873 896
874static struct resource wm831x_ldo11_resources[] = { 897static struct resource wm831x_ldo11_resources[] = {
875 { 898 {
899 .parent = &wm831x_io_parent,
876 .start = WM831X_LDO11_ON_CONTROL, 900 .start = WM831X_LDO11_ON_CONTROL,
877 .end = WM831X_LDO11_SLEEP_CONTROL, 901 .end = WM831X_LDO11_SLEEP_CONTROL,
878 .flags = IORESOURCE_IO, 902 .flags = IORESOURCE_IO,
@@ -974,6 +998,7 @@ static struct resource wm831x_rtc_resources[] = {
974 998
975static struct resource wm831x_status1_resources[] = { 999static struct resource wm831x_status1_resources[] = {
976 { 1000 {
1001 .parent = &wm831x_io_parent,
977 .start = WM831X_STATUS_LED_1, 1002 .start = WM831X_STATUS_LED_1,
978 .end = WM831X_STATUS_LED_1, 1003 .end = WM831X_STATUS_LED_1,
979 .flags = IORESOURCE_IO, 1004 .flags = IORESOURCE_IO,
@@ -982,6 +1007,7 @@ static struct resource wm831x_status1_resources[] = {
982 1007
983static struct resource wm831x_status2_resources[] = { 1008static struct resource wm831x_status2_resources[] = {
984 { 1009 {
1010 .parent = &wm831x_io_parent,
985 .start = WM831X_STATUS_LED_2, 1011 .start = WM831X_STATUS_LED_2,
986 .end = WM831X_STATUS_LED_2, 1012 .end = WM831X_STATUS_LED_2,
987 .flags = IORESOURCE_IO, 1013 .flags = IORESOURCE_IO,