Commit 92c2472
iio: adc: ad7173: fix num_slots
Fix the num_slots value for most chips in the ad7173 driver. The correct
value is the number of CHANNELx registers on the chip.
In commit 4310e15 ("iio: adc: ad7173: don't make copy of
ad_sigma_delta_info struct"), we refactored struct ad_sigma_delta_info
to be static const data instead of being dynamically populated during
driver probe. However, there was an existing bug in commit 76a1e6a
("iio: adc: ad7173: add AD7173 driver") where num_slots was incorrectly
set to the number of CONFIGx registers instead of the number of
CHANNELx registers. This bug was partially propagated to the refactored
code in that the 16-channel chips were only given 8 slots instead of
16 although we did managed to fix the 8-channel chips and one of the
4-channel chips in that commit. However, we botched two of the 4-channel
chips and ended up incorrectly giving them 8 slots during the
refactoring.
This patch fixes that mistake on the 4-channel chips and also
corrects the 16-channel chips to have 16 slots.
Fixes: 4310e15 ("iio: adc: ad7173: don't make copy of ad_sigma_delta_info struct")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20250706-iio-adc-ad7173-fix-num_slots-on-most-chips-v3-1-d1f5453198a7@baylibre.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>1 parent 0eb8d7b commit 92c2472
1 file changed
+26
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
771 | 771 | | |
772 | 772 | | |
773 | 773 | | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
774 | 790 | | |
775 | 791 | | |
776 | 792 | | |
777 | | - | |
| 793 | + | |
778 | 794 | | |
779 | 795 | | |
780 | 796 | | |
| |||
796 | 812 | | |
797 | 813 | | |
798 | 814 | | |
799 | | - | |
| 815 | + | |
800 | 816 | | |
801 | 817 | | |
802 | 818 | | |
| |||
817 | 833 | | |
818 | 834 | | |
819 | 835 | | |
820 | | - | |
| 836 | + | |
821 | 837 | | |
822 | 838 | | |
823 | 839 | | |
| |||
836 | 852 | | |
837 | 853 | | |
838 | 854 | | |
839 | | - | |
| 855 | + | |
840 | 856 | | |
841 | 857 | | |
842 | 858 | | |
| |||
855 | 871 | | |
856 | 872 | | |
857 | 873 | | |
858 | | - | |
| 874 | + | |
859 | 875 | | |
860 | 876 | | |
861 | 877 | | |
| |||
874 | 890 | | |
875 | 891 | | |
876 | 892 | | |
877 | | - | |
| 893 | + | |
878 | 894 | | |
879 | 895 | | |
880 | 896 | | |
| |||
893 | 909 | | |
894 | 910 | | |
895 | 911 | | |
896 | | - | |
| 912 | + | |
897 | 913 | | |
898 | 914 | | |
899 | 915 | | |
| |||
926 | 942 | | |
927 | 943 | | |
928 | 944 | | |
929 | | - | |
| 945 | + | |
930 | 946 | | |
931 | 947 | | |
932 | 948 | | |
| |||
943 | 959 | | |
944 | 960 | | |
945 | 961 | | |
946 | | - | |
| 962 | + | |
947 | 963 | | |
948 | 964 | | |
949 | 965 | | |
| |||
960 | 976 | | |
961 | 977 | | |
962 | 978 | | |
963 | | - | |
| 979 | + | |
964 | 980 | | |
965 | 981 | | |
966 | 982 | | |
| |||
0 commit comments