Commit fdd9ef3
regmap: sdw-mbq: Add support for further MBQ register sizes
SoundWire MBQ register maps typically contain a variety of register
sizes, which doesn't map ideally to the regmap abstraction which
expects register maps to have a consistent size. Currently the MBQ
register map only allows 16-bit registers to be defined, however
this leads to complex CODEC driver implementations with an 8-bit
register map and a 16-bit MBQ, every control will then have a custom
get and put handler that allows them to access different register
maps. Further more 32-bit MBQ quantities are not currently supported.
Add support for additional MBQ sizes and to avoid the complexity
of multiple register maps treat the val_size as a maximum size for
the register map. Within the regmap use an ancillary callback to
determine how many bytes to actually read/write to the hardware for
a specific register. In the case that no callback is defined the
behaviour defaults back to the existing behaviour of a fixed size
register map.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250107154408.814455-4-ckeepax@opensource.cirrus.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent b21468e commit fdd9ef3
File tree
2 files changed
+139
-22
lines changed- drivers/base/regmap
- include/linux
2 files changed
+139
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
12 | 34 | | |
13 | 35 | | |
14 | | - | |
| 36 | + | |
| 37 | + | |
15 | 38 | | |
| 39 | + | |
| 40 | + | |
16 | 41 | | |
17 | 42 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
21 | 54 | | |
22 | 55 | | |
23 | 56 | | |
24 | 57 | | |
25 | 58 | | |
26 | 59 | | |
27 | | - | |
| 60 | + | |
| 61 | + | |
28 | 62 | | |
29 | | - | |
30 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
31 | 66 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 67 | + | |
| 68 | + | |
35 | 69 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
39 | 73 | | |
40 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
41 | 84 | | |
42 | 85 | | |
43 | 86 | | |
| |||
51 | 94 | | |
52 | 95 | | |
53 | 96 | | |
54 | | - | |
55 | | - | |
| 97 | + | |
56 | 98 | | |
57 | 99 | | |
58 | 100 | | |
| |||
65 | 107 | | |
66 | 108 | | |
67 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
68 | 130 | | |
69 | 131 | | |
| 132 | + | |
70 | 133 | | |
71 | 134 | | |
72 | 135 | | |
| 136 | + | |
73 | 137 | | |
74 | 138 | | |
75 | 139 | | |
76 | 140 | | |
77 | 141 | | |
78 | 142 | | |
79 | | - | |
80 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
81 | 149 | | |
82 | 150 | | |
83 | 151 | | |
84 | 152 | | |
85 | 153 | | |
| 154 | + | |
86 | 155 | | |
87 | 156 | | |
88 | 157 | | |
| 158 | + | |
89 | 159 | | |
90 | 160 | | |
91 | 161 | | |
92 | 162 | | |
93 | 163 | | |
94 | 164 | | |
95 | | - | |
96 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
97 | 171 | | |
98 | 172 | | |
99 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
509 | 520 | | |
510 | 521 | | |
511 | 522 | | |
| |||
652 | 663 | | |
653 | 664 | | |
654 | 665 | | |
| 666 | + | |
655 | 667 | | |
656 | 668 | | |
657 | 669 | | |
| |||
713 | 725 | | |
714 | 726 | | |
715 | 727 | | |
| 728 | + | |
716 | 729 | | |
717 | 730 | | |
718 | 731 | | |
| |||
942 | 955 | | |
943 | 956 | | |
944 | 957 | | |
945 | | - | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
946 | 974 | | |
947 | 975 | | |
948 | 976 | | |
| |||
1155 | 1183 | | |
1156 | 1184 | | |
1157 | 1185 | | |
1158 | | - | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
1159 | 1202 | | |
1160 | 1203 | | |
1161 | 1204 | | |
| |||
0 commit comments