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

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>

authored by

Mark Brown and committed by
Samuel Ortiz
ce7e4e11 63745d40

+26
+26
drivers/mfd/wm831x-core.c
··· 614 614 } 615 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 + 617 623 static struct resource wm831x_dcdc1_resources[] = { 618 624 { 625 + .parent = &wm831x_io_parent, 619 626 .start = WM831X_DC1_CONTROL_1, 620 627 .end = WM831X_DC1_DVS_CONTROL, 621 628 .flags = IORESOURCE_IO, ··· 644 637 645 638 static struct resource wm831x_dcdc2_resources[] = { 646 639 { 640 + .parent = &wm831x_io_parent, 647 641 .start = WM831X_DC2_CONTROL_1, 648 642 .end = WM831X_DC2_DVS_CONTROL, 649 643 .flags = IORESOURCE_IO, ··· 665 657 666 658 static struct resource wm831x_dcdc3_resources[] = { 667 659 { 660 + .parent = &wm831x_io_parent, 668 661 .start = WM831X_DC3_CONTROL_1, 669 662 .end = WM831X_DC3_SLEEP_CONTROL, 670 663 .flags = IORESOURCE_IO, ··· 680 671 681 672 static struct resource wm831x_dcdc4_resources[] = { 682 673 { 674 + .parent = &wm831x_io_parent, 683 675 .start = WM831X_DC4_CONTROL, 684 676 .end = WM831X_DC4_SLEEP_CONTROL, 685 677 .flags = IORESOURCE_IO, ··· 695 685 696 686 static struct resource wm8320_dcdc4_buck_resources[] = { 697 687 { 688 + .parent = &wm831x_io_parent, 698 689 .start = WM831X_DC4_CONTROL, 699 690 .end = WM832X_DC4_SLEEP_CONTROL, 700 691 .flags = IORESOURCE_IO, ··· 718 707 719 708 static struct resource wm831x_isink1_resources[] = { 720 709 { 710 + .parent = &wm831x_io_parent, 721 711 .start = WM831X_CURRENT_SINK_1, 722 712 .end = WM831X_CURRENT_SINK_1, 723 713 .flags = IORESOURCE_IO, ··· 732 720 733 721 static struct resource wm831x_isink2_resources[] = { 734 722 { 723 + .parent = &wm831x_io_parent, 735 724 .start = WM831X_CURRENT_SINK_2, 736 725 .end = WM831X_CURRENT_SINK_2, 737 726 .flags = IORESOURCE_IO, ··· 746 733 747 734 static struct resource wm831x_ldo1_resources[] = { 748 735 { 736 + .parent = &wm831x_io_parent, 749 737 .start = WM831X_LDO1_CONTROL, 750 738 .end = WM831X_LDO1_SLEEP_CONTROL, 751 739 .flags = IORESOURCE_IO, ··· 761 747 762 748 static struct resource wm831x_ldo2_resources[] = { 763 749 { 750 + .parent = &wm831x_io_parent, 764 751 .start = WM831X_LDO2_CONTROL, 765 752 .end = WM831X_LDO2_SLEEP_CONTROL, 766 753 .flags = IORESOURCE_IO, ··· 776 761 777 762 static struct resource wm831x_ldo3_resources[] = { 778 763 { 764 + .parent = &wm831x_io_parent, 779 765 .start = WM831X_LDO3_CONTROL, 780 766 .end = WM831X_LDO3_SLEEP_CONTROL, 781 767 .flags = IORESOURCE_IO, ··· 791 775 792 776 static struct resource wm831x_ldo4_resources[] = { 793 777 { 778 + .parent = &wm831x_io_parent, 794 779 .start = WM831X_LDO4_CONTROL, 795 780 .end = WM831X_LDO4_SLEEP_CONTROL, 796 781 .flags = IORESOURCE_IO, ··· 806 789 807 790 static struct resource wm831x_ldo5_resources[] = { 808 791 { 792 + .parent = &wm831x_io_parent, 809 793 .start = WM831X_LDO5_CONTROL, 810 794 .end = WM831X_LDO5_SLEEP_CONTROL, 811 795 .flags = IORESOURCE_IO, ··· 821 803 822 804 static struct resource wm831x_ldo6_resources[] = { 823 805 { 806 + .parent = &wm831x_io_parent, 824 807 .start = WM831X_LDO6_CONTROL, 825 808 .end = WM831X_LDO6_SLEEP_CONTROL, 826 809 .flags = IORESOURCE_IO, ··· 836 817 837 818 static struct resource wm831x_ldo7_resources[] = { 838 819 { 820 + .parent = &wm831x_io_parent, 839 821 .start = WM831X_LDO7_CONTROL, 840 822 .end = WM831X_LDO7_SLEEP_CONTROL, 841 823 .flags = IORESOURCE_IO, ··· 851 831 852 832 static struct resource wm831x_ldo8_resources[] = { 853 833 { 834 + .parent = &wm831x_io_parent, 854 835 .start = WM831X_LDO8_CONTROL, 855 836 .end = WM831X_LDO8_SLEEP_CONTROL, 856 837 .flags = IORESOURCE_IO, ··· 866 845 867 846 static struct resource wm831x_ldo9_resources[] = { 868 847 { 848 + .parent = &wm831x_io_parent, 869 849 .start = WM831X_LDO9_CONTROL, 870 850 .end = WM831X_LDO9_SLEEP_CONTROL, 871 851 .flags = IORESOURCE_IO, ··· 881 859 882 860 static struct resource wm831x_ldo10_resources[] = { 883 861 { 862 + .parent = &wm831x_io_parent, 884 863 .start = WM831X_LDO10_CONTROL, 885 864 .end = WM831X_LDO10_SLEEP_CONTROL, 886 865 .flags = IORESOURCE_IO, ··· 896 873 897 874 static struct resource wm831x_ldo11_resources[] = { 898 875 { 876 + .parent = &wm831x_io_parent, 899 877 .start = WM831X_LDO11_ON_CONTROL, 900 878 .end = WM831X_LDO11_SLEEP_CONTROL, 901 879 .flags = IORESOURCE_IO, ··· 998 974 999 975 static struct resource wm831x_status1_resources[] = { 1000 976 { 977 + .parent = &wm831x_io_parent, 1001 978 .start = WM831X_STATUS_LED_1, 1002 979 .end = WM831X_STATUS_LED_1, 1003 980 .flags = IORESOURCE_IO, ··· 1007 982 1008 983 static struct resource wm831x_status2_resources[] = { 1009 984 { 985 + .parent = &wm831x_io_parent, 1010 986 .start = WM831X_STATUS_LED_2, 1011 987 .end = WM831X_STATUS_LED_2, 1012 988 .flags = IORESOURCE_IO,