Changeset 652 for GPL/branches/uniaud32-next/include/linux/regmap.h
- Timestamp:
- Jan 24, 2021, 8:40:08 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-next/include/linux/regmap.h
r625 r652 1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 2 #ifndef __LINUX_REGMAP_H 2 3 #define __LINUX_REGMAP_H … … 8 9 * 9 10 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 10 * 11 * This program is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License version 2 as 13 * published by the Free Software Foundation. 14 */ 15 /* from 4.19.163 */ 11 */ 12 13 /* from 5.10.10 */ 16 14 17 15 #include <linux/list.h> … … 22 20 //#include <linux/bug.h> 23 21 #include <linux/lockdep.h> 22 //#include <linux/iopoll.h> 23 #include <linux/fwnode.h> 24 24 25 25 struct module; 26 26 struct clk; 27 27 struct device; 28 struct device_node; 28 29 struct i2c_client; 30 struct i3c_device; 29 31 struct irq_domain; 30 32 struct slim_device; … … 75 77 }; 76 78 77 #define regmap_update_bits(map, reg, mask, val) \ 78 regmap_update_bits_base(map, reg, mask, val, NULL, false, false) 79 #define regmap_update_bits_async(map, reg, mask, val)\ 80 regmap_update_bits_base(map, reg, mask, val, NULL, true, false) 81 #define regmap_update_bits_check(map, reg, mask, val, change)\ 82 regmap_update_bits_base(map, reg, mask, val, change, false, false) 83 #define regmap_update_bits_check_async(map, reg, mask, val, change)\ 84 regmap_update_bits_base(map, reg, mask, val, change, true, false) 85 86 #define regmap_write_bits(map, reg, mask, val) \ 87 regmap_update_bits_base(map, reg, mask, val, NULL, false, true) 88 89 #define regmap_field_write(field, val) \ 90 regmap_field_update_bits_base(field, ~0, val, NULL, false, false) 91 #define regmap_field_force_write(field, val) \ 92 regmap_field_update_bits_base(field, ~0, val, NULL, false, true) 93 #define regmap_field_update_bits(field, mask, val)\ 94 regmap_field_update_bits_base(field, mask, val, NULL, false, false) 95 #define regmap_field_force_update_bits(field, mask, val) \ 96 regmap_field_update_bits_base(field, mask, val, NULL, false, true) 97 98 #define regmap_fields_write(field, id, val) \ 99 regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, false) 100 #define regmap_fields_force_write(field, id, val) \ 101 regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, true) 102 #define regmap_fields_update_bits(field, id, mask, val)\ 103 regmap_fields_update_bits_base(field, id, mask, val, NULL, false, false) 104 #define regmap_fields_force_update_bits(field, id, mask, val) \ 105 regmap_fields_update_bits_base(field, id, mask, val, NULL, false, true) 79 #define REG_SEQ(_reg, _def, _delay_us) { \ 80 .reg = _reg, \ 81 .def = _def, \ 82 .delay_us = _delay_us, \ 83 } 84 #define REG_SEQ0(_reg, _def) REG_SEQ(_reg, _def, 0) 106 85 107 86 /** … … 114 93 * @sleep_us: Maximum time to sleep between reads in us (0 115 94 * tight-loops). Should be less than ~20ms since usleep_range 116 * is used (see Documentation/timers/timers-howto. txt).95 * is used (see Documentation/timers/timers-howto.rst). 117 96 * @timeout_us: Timeout in us, 0 means never timeout 118 97 * … … 126 105 #define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \ 127 106 ({ \ 107 int __ret, __tmp; \ 108 __tmp = read_poll_timeout(regmap_read, __ret, __ret || (cond), \ 109 sleep_us, timeout_us, false, (map), (addr), &(val)); \ 110 __ret ?: __tmp; \ 111 }) 112 113 /** 114 * regmap_read_poll_timeout_atomic - Poll until a condition is met or a timeout occurs 115 * 116 * @map: Regmap to read from 117 * @addr: Address to poll 118 * @val: Unsigned integer variable to read the value into 119 * @cond: Break condition (usually involving @val) 120 * @delay_us: Time to udelay between reads in us (0 tight-loops). 121 * Should be less than ~10us since udelay is used 122 * (see Documentation/timers/timers-howto.rst). 123 * @timeout_us: Timeout in us, 0 means never timeout 124 * 125 * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_read 126 * error return value in case of a error read. In the two former cases, 127 * the last read value at @addr is stored in @val. 128 * 129 * This is modelled after the readx_poll_timeout_atomic macros in linux/iopoll.h. 130 * 131 * Note: In general regmap cannot be used in atomic context. If you want to use 132 * this macro then first setup your regmap for atomic use (flat or no cache 133 * and MMIO regmap). 134 */ 135 #define regmap_read_poll_timeout_atomic(map, addr, val, cond, delay_us, timeout_us) \ 136 ({ \ 128 137 u64 __timeout_us = (timeout_us); \ 129 unsigned long __ sleep_us = (sleep_us); \138 unsigned long __delay_us = (delay_us); \ 130 139 ktime_t __timeout = ktime_add_us(ktime_get(), __timeout_us); \ 131 140 int __ret; \ 132 might_sleep_if(__sleep_us); \133 141 for (;;) { \ 134 142 __ret = regmap_read((map), (addr), &(val)); \ … … 142 150 break; \ 143 151 } \ 144 if (__ sleep_us) \145 u sleep_range((__sleep_us >> 2) + 1, __sleep_us); \152 if (__delay_us) \ 153 udelay(__delay_us); \ 146 154 } \ 147 155 __ret ?: ((cond) ? 0 : -ETIMEDOUT); \ … … 156 164 * @sleep_us: Maximum time to sleep between reads in us (0 157 165 * tight-loops). Should be less than ~20ms since usleep_range 158 * is used (see Documentation/timers/timers-howto. txt).166 * is used (see Documentation/timers/timers-howto.rst). 159 167 * @timeout_us: Timeout in us, 0 means never timeout 160 168 * … … 168 176 #define regmap_field_read_poll_timeout(field, val, cond, sleep_us, timeout_us) \ 169 177 ({ \ 170 u64 __timeout_us = (timeout_us); \ 171 unsigned long __sleep_us = (sleep_us); \ 172 ktime_t timeout = ktime_add_us(ktime_get(), __timeout_us); \ 173 int pollret; \ 174 might_sleep_if(__sleep_us); \ 175 for (;;) { \ 176 pollret = regmap_field_read((field), &(val)); \ 177 if (pollret) \ 178 break; \ 179 if (cond) \ 180 break; \ 181 if (__timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \ 182 pollret = regmap_field_read((field), &(val)); \ 183 break; \ 184 } \ 185 if (__sleep_us) \ 186 usleep_range((__sleep_us >> 2) + 1, __sleep_us); \ 187 } \ 188 pollret ?: ((cond) ? 0 : -ETIMEDOUT); \ 178 int __ret, __tmp; \ 179 __tmp = read_poll_timeout(regmap_field_read, __ret, __ret || (cond), \ 180 sleep_us, timeout_us, false, (field), &(val)); \ 181 __ret ?: __tmp; \ 189 182 }) 190 183 … … 271 264 * check is performed on such table (a register is precious if 272 265 * it belongs to one of the ranges specified by precious_table). 266 * @writeable_noinc_reg: Optional callback returning true if the register 267 * supports multiple write operations without incrementing 268 * the register number. If this field is NULL but 269 * wr_noinc_table (see below) is not, the check is 270 * performed on such table (a register is no increment 271 * writeable if it belongs to one of the ranges specified 272 * by wr_noinc_table). 273 273 * @readable_noinc_reg: Optional callback returning true if the register 274 274 * supports multiple read operations without incrementing … … 279 279 * by rd_noinc_table). 280 280 * @disable_locking: This regmap is either protected by external means or 281 * is guaranteed not bebe accessed from multiple threads.281 * is guaranteed not to be accessed from multiple threads. 282 282 * Don't use any locking mechanisms. 283 283 * @lock: Optional lock callback (overrides regmap's default lock … … 305 305 * @volatile_table: As above, for volatile registers. 306 306 * @precious_table: As above, for precious registers. 307 * @wr_noinc_table: As above, for no increment writeable registers. 307 308 * @rd_noinc_table: As above, for no increment readable registers. 308 309 * @reg_defaults: Power on reset values for registers (for use with … … 318 319 * @zero_flag_mask: If set, read_flag_mask and write_flag_mask are used even 319 320 * if they are both empty. 320 * @use_single_rw: If set, converts the bulk read and write operations into 321 * a series of single read and write operations. This is useful 322 * for device that does not support bulk read and write. 321 * @use_single_read: If set, converts the bulk read operation into a series of 322 * single read operations. This is useful for a device that 323 * does not support bulk read. 324 * @use_single_write: If set, converts the bulk write operation into a series of 325 * single write operations. This is useful for a device that 326 * does not support bulk write. 323 327 * @can_multi_write: If set, the device supports the multi write mode of bulk 324 328 * write operations, if clear multi write requests will be … … 342 346 * @hwlock_mode: The hardware spinlock mode, should be HWLOCK_IRQSTATE, 343 347 * HWLOCK_IRQ or 0. 348 * @can_sleep: Optional, specifies whether regmap operations can sleep. 344 349 */ 345 350 struct regmap_config { … … 355 360 bool (*volatile_reg)(struct device *dev, unsigned int reg); 356 361 bool (*precious_reg)(struct device *dev, unsigned int reg); 362 bool (*writeable_noinc_reg)(struct device *dev, unsigned int reg); 357 363 bool (*readable_noinc_reg)(struct device *dev, unsigned int reg); 358 364 … … 372 378 const struct regmap_access_table *volatile_table; 373 379 const struct regmap_access_table *precious_table; 380 const struct regmap_access_table *wr_noinc_table; 374 381 const struct regmap_access_table *rd_noinc_table; 375 382 const struct reg_default *reg_defaults; … … 396 403 unsigned int hwlock_id; 397 404 unsigned int hwlock_mode; 405 406 bool can_sleep; 398 407 }; 399 408 … … 408 417 * 409 418 * @selector_reg: Register with selector field. 410 * @selector_mask: Bit shiftfor selector value.411 * @selector_shift: Bit maskfor selector value.419 * @selector_mask: Bit mask for selector value. 420 * @selector_shift: Bit shift for selector value. 412 421 * 413 422 * @window_start: Address of first (lowest) register in data window. … … 565 574 struct lock_class_key *lock_key, 566 575 const char *lock_name); 576 struct regmap *__regmap_init_spi_avmm(struct spi_device *spi, 577 const struct regmap_config *config, 578 struct lock_class_key *lock_key, 579 const char *lock_name); 567 580 568 581 struct regmap *__devm_regmap_init(struct device *dev, … … 614 627 struct lock_class_key *lock_key, 615 628 const char *lock_name); 629 struct regmap *__devm_regmap_init_i3c(struct i3c_device *i3c, 630 const struct regmap_config *config, 631 struct lock_class_key *lock_key, 632 const char *lock_name); 633 struct regmap *__devm_regmap_init_spi_avmm(struct spi_device *spi, 634 const struct regmap_config *config, 635 struct lock_class_key *lock_key, 636 const char *lock_name); 616 637 /* 617 638 * Wrapper for regmap_init macros to include a unique lockdep key and name … … 800 821 sdw, config) 801 822 823 /** 824 * regmap_init_spi_avmm() - Initialize register map for Intel SPI Slave 825 * to AVMM Bus Bridge 826 * 827 * @spi: Device that will be interacted with 828 * @config: Configuration for register map 829 * 830 * The return value will be an ERR_PTR() on error or a valid pointer 831 * to a struct regmap. 832 */ 833 #define regmap_init_spi_avmm(spi, config) \ 834 __regmap_lockdep_wrapper(__regmap_init_spi_avmm, #config, \ 835 spi, config) 802 836 803 837 /** … … 972 1006 __regmap_lockdep_wrapper(__devm_regmap_init_slimbus, #config, \ 973 1007 slimbus, config) 1008 1009 /** 1010 * devm_regmap_init_i3c() - Initialise managed register map 1011 * 1012 * @i3c: Device that will be interacted with 1013 * @config: Configuration for register map 1014 * 1015 * The return value will be an ERR_PTR() on error or a valid pointer 1016 * to a struct regmap. The regmap will be automatically freed by the 1017 * device management code. 1018 */ 1019 #define devm_regmap_init_i3c(i3c, config) \ 1020 __regmap_lockdep_wrapper(__devm_regmap_init_i3c, #config, \ 1021 i3c, config) 1022 1023 /** 1024 * devm_regmap_init_spi_avmm() - Initialize register map for Intel SPI Slave 1025 * to AVMM Bus Bridge 1026 * 1027 * @spi: Device that will be interacted with 1028 * @config: Configuration for register map 1029 * 1030 * The return value will be an ERR_PTR() on error or a valid pointer 1031 * to a struct regmap. The map will be automatically freed by the 1032 * device management code. 1033 */ 1034 #define devm_regmap_init_spi_avmm(spi, config) \ 1035 __regmap_lockdep_wrapper(__devm_regmap_init_spi_avmm, #config, \ 1036 spi, config) 1037 974 1038 int regmap_mmio_attach_clk(struct regmap *map, struct clk *clk); 975 1039 void regmap_mmio_detach_clk(struct regmap *map); … … 982 1046 int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val); 983 1047 int regmap_raw_write(struct regmap *map, unsigned int reg, 1048 const void *val, size_t val_len); 1049 int regmap_noinc_write(struct regmap *map, unsigned int reg, 984 1050 const void *val, size_t val_len); 985 1051 int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, … … 1002 1068 unsigned int mask, unsigned int val, 1003 1069 bool *change, bool async, bool force); 1070 1071 static inline int regmap_update_bits(struct regmap *map, unsigned int reg, 1072 unsigned int mask, unsigned int val) 1073 { 1074 return regmap_update_bits_base(map, reg, mask, val, NULL, false, false); 1075 } 1076 1077 static inline int regmap_update_bits_async(struct regmap *map, unsigned int reg, 1078 unsigned int mask, unsigned int val) 1079 { 1080 return regmap_update_bits_base(map, reg, mask, val, NULL, true, false); 1081 } 1082 1083 static inline int regmap_update_bits_check(struct regmap *map, unsigned int reg, 1084 unsigned int mask, unsigned int val, 1085 bool *change) 1086 { 1087 return regmap_update_bits_base(map, reg, mask, val, 1088 change, false, false); 1089 } 1090 1091 static inline int 1092 regmap_update_bits_check_async(struct regmap *map, unsigned int reg, 1093 unsigned int mask, unsigned int val, 1094 bool *change) 1095 { 1096 return regmap_update_bits_base(map, reg, mask, val, 1097 change, true, false); 1098 } 1099 1100 static inline int regmap_write_bits(struct regmap *map, unsigned int reg, 1101 unsigned int mask, unsigned int val) 1102 { 1103 return regmap_update_bits_base(map, reg, mask, val, NULL, false, true); 1104 } 1105 1004 1106 int regmap_get_val_bytes(struct regmap *map); 1005 1107 int regmap_get_max_register(struct regmap *map); … … 1037 1139 unsigned int nranges); 1038 1140 1141 static inline int regmap_set_bits(struct regmap *map, 1142 unsigned int reg, unsigned int bits) 1143 { 1144 return regmap_update_bits_base(map, reg, bits, bits, 1145 NULL, false, false); 1146 } 1147 1148 static inline int regmap_clear_bits(struct regmap *map, 1149 unsigned int reg, unsigned int bits) 1150 { 1151 return regmap_update_bits_base(map, reg, bits, 0, NULL, false, false); 1152 } 1153 1154 int regmap_test_bits(struct regmap *map, unsigned int reg, unsigned int bits); 1155 1039 1156 /** 1040 1157 * struct reg_field - Description of an register field … … 1060 1177 } 1061 1178 1179 #define REG_FIELD_ID(_reg, _lsb, _msb, _size, _offset) { \ 1180 .reg = _reg, \ 1181 .lsb = _lsb, \ 1182 .msb = _msb, \ 1183 .id_size = _size, \ 1184 .id_offset = _offset, \ 1185 } 1186 1062 1187 struct regmap_field *regmap_field_alloc(struct regmap *regmap, 1063 1188 struct reg_field reg_field); … … 1067 1192 struct regmap *regmap, struct reg_field reg_field); 1068 1193 void devm_regmap_field_free(struct device *dev, struct regmap_field *field); 1194 1195 int regmap_field_bulk_alloc(struct regmap *regmap, 1196 struct regmap_field **rm_field, 1197 struct reg_field *reg_field, 1198 int num_fields); 1199 void regmap_field_bulk_free(struct regmap_field *field); 1200 int devm_regmap_field_bulk_alloc(struct device *dev, struct regmap *regmap, 1201 struct regmap_field **field, 1202 struct reg_field *reg_field, int num_fields); 1203 void devm_regmap_field_bulk_free(struct device *dev, 1204 struct regmap_field *field); 1069 1205 1070 1206 int regmap_field_read(struct regmap_field *field, unsigned int *val); … … 1078 1214 bool *change, bool async, bool force); 1079 1215 1216 static inline int regmap_field_write(struct regmap_field *field, 1217 unsigned int val) 1218 { 1219 return regmap_field_update_bits_base(field, ~0, val, 1220 NULL, false, false); 1221 } 1222 1223 static inline int regmap_field_force_write(struct regmap_field *field, 1224 unsigned int val) 1225 { 1226 return regmap_field_update_bits_base(field, ~0, val, NULL, false, true); 1227 } 1228 1229 static inline int regmap_field_update_bits(struct regmap_field *field, 1230 unsigned int mask, unsigned int val) 1231 { 1232 return regmap_field_update_bits_base(field, mask, val, 1233 NULL, false, false); 1234 } 1235 1236 static inline int 1237 regmap_field_force_update_bits(struct regmap_field *field, 1238 unsigned int mask, unsigned int val) 1239 { 1240 return regmap_field_update_bits_base(field, mask, val, 1241 NULL, false, true); 1242 } 1243 1244 static inline int regmap_fields_write(struct regmap_field *field, 1245 unsigned int id, unsigned int val) 1246 { 1247 return regmap_fields_update_bits_base(field, id, ~0, val, 1248 NULL, false, false); 1249 } 1250 1251 static inline int regmap_fields_force_write(struct regmap_field *field, 1252 unsigned int id, unsigned int val) 1253 { 1254 return regmap_fields_update_bits_base(field, id, ~0, val, 1255 NULL, false, true); 1256 } 1257 1258 static inline int 1259 regmap_fields_update_bits(struct regmap_field *field, unsigned int id, 1260 unsigned int mask, unsigned int val) 1261 { 1262 return regmap_fields_update_bits_base(field, id, mask, val, 1263 NULL, false, false); 1264 } 1265 1266 static inline int 1267 regmap_fields_force_update_bits(struct regmap_field *field, unsigned int id, 1268 unsigned int mask, unsigned int val) 1269 { 1270 return regmap_fields_update_bits_base(field, id, mask, val, 1271 NULL, false, true); 1272 } 1273 1274 /** 1275 * struct regmap_irq_type - IRQ type definitions. 1276 * 1277 * @type_reg_offset: Offset register for the irq type setting. 1278 * @type_rising_val: Register value to configure RISING type irq. 1279 * @type_falling_val: Register value to configure FALLING type irq. 1280 * @type_level_low_val: Register value to configure LEVEL_LOW type irq. 1281 * @type_level_high_val: Register value to configure LEVEL_HIGH type irq. 1282 * @types_supported: logical OR of IRQ_TYPE_* flags indicating supported types. 1283 */ 1284 struct regmap_irq_type { 1285 unsigned int type_reg_offset; 1286 unsigned int type_reg_mask; 1287 unsigned int type_rising_val; 1288 unsigned int type_falling_val; 1289 unsigned int type_level_low_val; 1290 unsigned int type_level_high_val; 1291 unsigned int types_supported; 1292 }; 1293 1080 1294 /** 1081 1295 * struct regmap_irq - Description of an IRQ for the generic regmap irq_chip. … … 1083 1297 * @reg_offset: Offset of the status/mask register within the bank 1084 1298 * @mask: Mask used to flag/control the register. 1085 * @type_reg_offset: Offset register for the irq type setting. 1086 * @type_rising_mask: Mask bit to configure RISING type irq. 1087 * @type_falling_mask: Mask bit to configure FALLING type irq. 1299 * @type: IRQ trigger type setting details if supported. 1088 1300 */ 1089 1301 struct regmap_irq { 1090 1302 unsigned int reg_offset; 1091 1303 unsigned int mask; 1092 unsigned int type_reg_offset; 1093 unsigned int type_rising_mask; 1094 unsigned int type_falling_mask; 1304 struct regmap_irq_type type; 1095 1305 }; 1096 1306 … … 1098 1308 [_irq] = { .reg_offset = (_off), .mask = (_mask) } 1099 1309 1310 #define REGMAP_IRQ_REG_LINE(_id, _reg_bits) \ 1311 [_id] = { \ 1312 .mask = BIT((_id) % (_reg_bits)), \ 1313 .reg_offset = (_id) / (_reg_bits), \ 1314 } 1315 1316 #define REGMAP_IRQ_MAIN_REG_OFFSET(arr) \ 1317 { .num_regs = ARRAY_SIZE((arr)), .offset = &(arr)[0] } 1318 1319 struct regmap_irq_sub_irq_map { 1320 unsigned int num_regs; 1321 unsigned int *offset; 1322 }; 1323 1100 1324 /** 1101 1325 * struct regmap_irq_chip - Description of a generic regmap irq_chip. 1102 1326 * 1103 1327 * @name: Descriptive name for IRQ controller. 1328 * 1329 * @main_status: Base main status register address. For chips which have 1330 * interrupts arranged in separate sub-irq blocks with own IRQ 1331 * registers and which have a main IRQ registers indicating 1332 * sub-irq blocks with unhandled interrupts. For such chips fill 1333 * sub-irq register information in status_base, mask_base and 1334 * ack_base. 1335 * @num_main_status_bits: Should be given to chips where number of meaningfull 1336 * main status bits differs from num_regs. 1337 * @sub_reg_offsets: arrays of mappings from main register bits to sub irq 1338 * registers. First item in array describes the registers 1339 * for first main status bit. Second array for second bit etc. 1340 * Offset is given as sub register status offset to 1341 * status_base. Should contain num_regs arrays. 1342 * Can be provided for chips with more complex mapping than 1343 * 1.st bit to 1.st sub-reg, 2.nd bit to 2.nd sub-reg, ... 1344 * @num_main_regs: Number of 'main status' irq registers for chips which have 1345 * main_status set. 1104 1346 * 1105 1347 * @status_base: Base status register address. … … 1117 1359 * @use_ack: Use @ack register even if it is zero. 1118 1360 * @ack_invert: Inverted ack register: cleared bits for ack. 1361 * @clear_ack: Use this to set 1 and 0 or vice-versa to clear interrupts. 1119 1362 * @wake_invert: Inverted wake register: cleared bits are wake enabled. 1120 1363 * @type_invert: Invert the type flags. 1364 * @type_in_mask: Use the mask registers for controlling irq type. For 1365 * interrupts defining type_rising/falling_mask use mask_base 1366 * for edge configuration and never update bits in type_base. 1367 * @clear_on_unmask: For chips with interrupts cleared on read: read the status 1368 * registers before unmasking interrupts to clear any bits 1369 * set when they were masked. 1121 1370 * @runtime_pm: Hold a runtime PM lock on the device when accessing it. 1122 1371 * … … 1142 1391 const char *name; 1143 1392 1393 unsigned int main_status; 1394 unsigned int num_main_status_bits; 1395 struct regmap_irq_sub_irq_map *sub_reg_offsets; 1396 int num_main_regs; 1397 1144 1398 unsigned int status_base; 1145 1399 unsigned int mask_base; … … 1154 1408 bool use_ack:1; 1155 1409 bool ack_invert:1; 1410 bool clear_ack:1; 1156 1411 bool wake_invert:1; 1157 1412 bool runtime_pm:1; 1158 1413 bool type_invert:1; 1414 bool type_in_mask:1; 1415 bool clear_on_unmask:1; 1159 1416 1160 1417 int num_regs; … … 1176 1433 int irq_base, const struct regmap_irq_chip *chip, 1177 1434 struct regmap_irq_chip_data **data); 1435 int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, 1436 struct regmap *map, int irq, 1437 int irq_flags, int irq_base, 1438 const struct regmap_irq_chip *chip, 1439 struct regmap_irq_chip_data **data); 1178 1440 void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); 1179 1441 … … 1182 1444 const struct regmap_irq_chip *chip, 1183 1445 struct regmap_irq_chip_data **data); 1446 int devm_regmap_add_irq_chip_fwnode(struct device *dev, 1447 struct fwnode_handle *fwnode, 1448 struct regmap *map, int irq, 1449 int irq_flags, int irq_base, 1450 const struct regmap_irq_chip *chip, 1451 struct regmap_irq_chip_data **data); 1184 1452 void devm_regmap_del_irq_chip(struct device *dev, int irq, 1185 1453 struct regmap_irq_chip_data *data); … … 1226 1494 } 1227 1495 1496 static inline int regmap_noinc_write(struct regmap *map, unsigned int reg, 1497 const void *val, size_t val_len) 1498 { 1499 WARN_ONCE(1, "regmap API is disabled"); 1500 return -EINVAL; 1501 } 1502 1228 1503 static inline int regmap_bulk_write(struct regmap *map, unsigned int reg, 1229 1504 const void *val, size_t val_count) … … 1264 1539 unsigned int mask, unsigned int val, 1265 1540 bool *change, bool async, bool force) 1541 { 1542 WARN_ONCE(1, "regmap API is disabled"); 1543 return -EINVAL; 1544 } 1545 1546 static inline int regmap_set_bits(struct regmap *map, 1547 unsigned int reg, unsigned int bits) 1548 { 1549 WARN_ONCE(1, "regmap API is disabled"); 1550 return -EINVAL; 1551 } 1552 1553 static inline int regmap_clear_bits(struct regmap *map, 1554 unsigned int reg, unsigned int bits) 1555 { 1556 WARN_ONCE(1, "regmap API is disabled"); 1557 return -EINVAL; 1558 } 1559 1560 static inline int regmap_test_bits(struct regmap *map, 1561 unsigned int reg, unsigned int bits) 1266 1562 { 1267 1563 WARN_ONCE(1, "regmap API is disabled"); … … 1286 1582 } 1287 1583 1584 static inline int regmap_update_bits(struct regmap *map, unsigned int reg, 1585 unsigned int mask, unsigned int val) 1586 { 1587 WARN_ONCE(1, "regmap API is disabled"); 1588 return -EINVAL; 1589 } 1590 1591 static inline int regmap_update_bits_async(struct regmap *map, unsigned int reg, 1592 unsigned int mask, unsigned int val) 1593 { 1594 WARN_ONCE(1, "regmap API is disabled"); 1595 return -EINVAL; 1596 } 1597 1598 static inline int regmap_update_bits_check(struct regmap *map, unsigned int reg, 1599 unsigned int mask, unsigned int val, 1600 bool *change) 1601 { 1602 WARN_ONCE(1, "regmap API is disabled"); 1603 return -EINVAL; 1604 } 1605 1606 static inline int 1607 regmap_update_bits_check_async(struct regmap *map, unsigned int reg, 1608 unsigned int mask, unsigned int val, 1609 bool *change) 1610 { 1611 WARN_ONCE(1, "regmap API is disabled"); 1612 return -EINVAL; 1613 } 1614 1615 static inline int regmap_write_bits(struct regmap *map, unsigned int reg, 1616 unsigned int mask, unsigned int val) 1617 { 1618 WARN_ONCE(1, "regmap API is disabled"); 1619 return -EINVAL; 1620 } 1621 1622 static inline int regmap_field_write(struct regmap_field *field, 1623 unsigned int val) 1624 { 1625 WARN_ONCE(1, "regmap API is disabled"); 1626 return -EINVAL; 1627 } 1628 1629 static inline int regmap_field_force_write(struct regmap_field *field, 1630 unsigned int val) 1631 { 1632 WARN_ONCE(1, "regmap API is disabled"); 1633 return -EINVAL; 1634 } 1635 1636 static inline int regmap_field_update_bits(struct regmap_field *field, 1637 unsigned int mask, unsigned int val) 1638 { 1639 WARN_ONCE(1, "regmap API is disabled"); 1640 return -EINVAL; 1641 } 1642 1643 static inline int 1644 regmap_field_force_update_bits(struct regmap_field *field, 1645 unsigned int mask, unsigned int val) 1646 { 1647 WARN_ONCE(1, "regmap API is disabled"); 1648 return -EINVAL; 1649 } 1650 1651 static inline int regmap_fields_write(struct regmap_field *field, 1652 unsigned int id, unsigned int val) 1653 { 1654 WARN_ONCE(1, "regmap API is disabled"); 1655 return -EINVAL; 1656 } 1657 1658 static inline int regmap_fields_force_write(struct regmap_field *field, 1659 unsigned int id, unsigned int val) 1660 { 1661 WARN_ONCE(1, "regmap API is disabled"); 1662 return -EINVAL; 1663 } 1664 1665 static inline int 1666 regmap_fields_update_bits(struct regmap_field *field, unsigned int id, 1667 unsigned int mask, unsigned int val) 1668 { 1669 WARN_ONCE(1, "regmap API is disabled"); 1670 return -EINVAL; 1671 } 1672 1673 static inline int 1674 regmap_fields_force_update_bits(struct regmap_field *field, unsigned int id, 1675 unsigned int mask, unsigned int val) 1676 { 1677 WARN_ONCE(1, "regmap API is disabled"); 1678 return -EINVAL; 1679 } 1680 1288 1681 static inline int regmap_get_val_bytes(struct regmap *map) 1289 1682 {
Note:
See TracChangeset
for help on using the changeset viewer.