Lines Matching +full:irqs +full:- +full:map +full:- +full:range
1 /* SPDX-License-Identifier: GPL-2.0-only */
6 * Register map access API
54 #define REGMAP_UPSHIFT(s) (-(s))
66 * struct reg_default - Default value for a register.
80 * struct reg_sequence - An individual write from a sequence of writes.
103 * regmap_read_poll_timeout - Poll until a condition is met or a timeout occurs
105 * @map: Regmap to read from
110 * tight-loops). Should be less than ~20ms since usleep_range
111 * is used (see Documentation/timers/timers-howto.rst).
114 * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_read
121 #define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \ argument
125 sleep_us, timeout_us, false, (map), (addr), &(val)); \
130 * regmap_read_poll_timeout_atomic - Poll until a condition is met or a timeout occurs
132 * @map: Regmap to read from
136 * @delay_us: Time to udelay between reads in us (0 tight-loops).
138 * (see Documentation/timers/timers-howto.rst).
141 * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_read
151 #define regmap_read_poll_timeout_atomic(map, addr, val, cond, delay_us, timeout_us) \ argument
158 __ret = regmap_read((map), (addr), &(val)); \
165 __ret = regmap_read((map), (addr), &(val)); \
171 __ret ?: ((cond) ? 0 : -ETIMEDOUT); \
175 * regmap_field_read_poll_timeout - Poll until a condition is met or timeout
181 * tight-loops). Should be less than ~20ms since usleep_range
182 * is used (see Documentation/timers/timers-howto.rst).
185 * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_field_read
203 /* Unspecified -> 0 -> Backwards compatible default */
211 * struct regmap_range - A register range, used for access related checks
225 * struct regmap_access_table - A table of register ranges for access checks
234 * will return false. If a register belongs to a yes range, the corresponding
248 * struct regmap_config - Configuration for the register map of a device.
323 * Use it only for "no-bus" cases.
390 * @num_ranges: Number of range configuration entries.
466 * struct regmap_range_cfg - Configuration for indirectly accessed or paged
471 * @range_min: Address of the lowest register address in virtual range.
472 * @range_max: Address of the highest register in virtual range.
481 * Registers, mapped to this virtual range, are accessed in two steps:
488 /* Registers of virtual address range */
530 * struct regmap_bus - Description of a hardware bus for the register map
539 * @gather_write: Write operation with split register/value, return -ENOTSUPP
542 * must serialise with respect to non-async I/O.
730 * for each call. No-op if CONFIG_LOCKDEP is not set.
743 "(" name ")->lock"); \
751 * regmap_init() - Initialise register map
754 * @bus: Bus-specific callbacks to use with device
755 * @bus_context: Data passed to bus-specific callbacks
756 * @config: Configuration for register map
760 * directly, it should be called by bus-specific init functions.
765 int regmap_attach_dev(struct device *dev, struct regmap *map,
769 * regmap_init_i2c() - Initialise register map
772 * @config: Configuration for register map
782 * regmap_init_mdio() - Initialise register map
785 * @config: Configuration for register map
795 * regmap_init_sccb() - Initialise register map
798 * @config: Configuration for register map
808 * regmap_init_slimbus() - Initialise register map
811 * @config: Configuration for register map
821 * regmap_init_spi() - Initialise register map
824 * @config: Configuration for register map
834 * regmap_init_spmi_base() - Create regmap for the Base register space
837 * @config: Configuration for register map
847 * regmap_init_spmi_ext() - Create regmap for Ext register space
850 * @config: Configuration for register map
860 * regmap_init_w1() - Initialise register map
863 * @config: Configuration for register map
873 * regmap_init_mmio_clk() - Initialise register map with register clock
877 * @regs: Pointer to memory-mapped IO region
878 * @config: Configuration for register map
888 * regmap_init_mmio() - Initialise register map
891 * @regs: Pointer to memory-mapped IO region
892 * @config: Configuration for register map
901 * regmap_init_ac97() - Initialise AC'97 register map
904 * @config: Configuration for register map
915 * regmap_init_sdw() - Initialise register map
918 * @config: Configuration for register map
928 * regmap_init_sdw_mbq() - Initialise register map
931 * @config: Configuration for register map
941 * regmap_init_spi_avmm() - Initialize register map for Intel SPI Slave
945 * @config: Configuration for register map
955 * regmap_init_fsi() - Initialise register map
958 * @config: Configuration for register map
968 * devm_regmap_init() - Initialise managed register map
971 * @bus: Bus-specific callbacks to use with device
972 * @bus_context: Data passed to bus-specific callbacks
973 * @config: Configuration for register map
977 * directly, it should be called by bus-specific init functions. The
978 * map will be automatically freed by the device management code.
985 * devm_regmap_init_i2c() - Initialise managed register map
988 * @config: Configuration for register map
999 * devm_regmap_init_mdio() - Initialise managed register map
1002 * @config: Configuration for register map
1013 * devm_regmap_init_sccb() - Initialise managed register map
1016 * @config: Configuration for register map
1027 * devm_regmap_init_spi() - Initialise register map
1030 * @config: Configuration for register map
1033 * to a struct regmap. The map will be automatically freed by the
1041 * devm_regmap_init_spmi_base() - Create managed regmap for Base register space
1044 * @config: Configuration for register map
1055 * devm_regmap_init_spmi_ext() - Create managed regmap for Ext register space
1058 * @config: Configuration for register map
1069 * devm_regmap_init_w1() - Initialise managed register map
1072 * @config: Configuration for register map
1082 * devm_regmap_init_mmio_clk() - Initialise managed register map with clock
1086 * @regs: Pointer to memory-mapped IO region
1087 * @config: Configuration for register map
1098 * devm_regmap_init_mmio() - Initialise managed register map
1101 * @regs: Pointer to memory-mapped IO region
1102 * @config: Configuration for register map
1112 * devm_regmap_init_ac97() - Initialise AC'97 register map
1115 * @config: Configuration for register map
1126 * devm_regmap_init_sdw() - Initialise managed register map
1129 * @config: Configuration for register map
1140 * devm_regmap_init_sdw_mbq() - Initialise managed register map
1143 * @config: Configuration for register map
1154 * devm_regmap_init_slimbus() - Initialise managed register map
1157 * @config: Configuration for register map
1168 * devm_regmap_init_i3c() - Initialise managed register map
1171 * @config: Configuration for register map
1182 * devm_regmap_init_spi_avmm() - Initialize register map for Intel SPI Slave
1186 * @config: Configuration for register map
1189 * to a struct regmap. The map will be automatically freed by the
1197 * devm_regmap_init_fsi() - Initialise managed register map
1200 * @config: Configuration for register map
1210 int regmap_mmio_attach_clk(struct regmap *map, struct clk *clk);
1211 void regmap_mmio_detach_clk(struct regmap *map);
1212 void regmap_exit(struct regmap *map);
1213 int regmap_reinit_cache(struct regmap *map,
1216 struct device *regmap_get_device(struct regmap *map);
1217 int regmap_write(struct regmap *map, unsigned int reg, unsigned int val);
1218 int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val);
1219 int regmap_raw_write(struct regmap *map, unsigned int reg,
1221 int regmap_noinc_write(struct regmap *map, unsigned int reg,
1223 int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
1225 int regmap_multi_reg_write(struct regmap *map, const struct reg_sequence *regs,
1227 int regmap_multi_reg_write_bypassed(struct regmap *map,
1230 int regmap_raw_write_async(struct regmap *map, unsigned int reg,
1232 int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val);
1233 int regmap_read_bypassed(struct regmap *map, unsigned int reg, unsigned int *val);
1234 int regmap_raw_read(struct regmap *map, unsigned int reg,
1236 int regmap_noinc_read(struct regmap *map, unsigned int reg,
1238 int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
1240 int regmap_multi_reg_read(struct regmap *map, unsigned int *reg, void *val,
1242 int regmap_update_bits_base(struct regmap *map, unsigned int reg,
1246 static inline int regmap_update_bits(struct regmap *map, unsigned int reg, in regmap_update_bits() argument
1249 return regmap_update_bits_base(map, reg, mask, val, NULL, false, false); in regmap_update_bits()
1252 static inline int regmap_update_bits_async(struct regmap *map, unsigned int reg, in regmap_update_bits_async() argument
1255 return regmap_update_bits_base(map, reg, mask, val, NULL, true, false); in regmap_update_bits_async()
1258 static inline int regmap_update_bits_check(struct regmap *map, unsigned int reg, in regmap_update_bits_check() argument
1262 return regmap_update_bits_base(map, reg, mask, val, in regmap_update_bits_check()
1267 regmap_update_bits_check_async(struct regmap *map, unsigned int reg, in regmap_update_bits_check_async() argument
1271 return regmap_update_bits_base(map, reg, mask, val, in regmap_update_bits_check_async()
1275 static inline int regmap_write_bits(struct regmap *map, unsigned int reg, in regmap_write_bits() argument
1278 return regmap_update_bits_base(map, reg, mask, val, NULL, false, true); in regmap_write_bits()
1281 int regmap_get_val_bytes(struct regmap *map);
1282 int regmap_get_max_register(struct regmap *map);
1283 int regmap_get_reg_stride(struct regmap *map);
1284 bool regmap_might_sleep(struct regmap *map);
1285 int regmap_async_complete(struct regmap *map);
1286 bool regmap_can_raw_write(struct regmap *map);
1287 size_t regmap_get_raw_read_max(struct regmap *map);
1288 size_t regmap_get_raw_write_max(struct regmap *map);
1290 int regcache_sync(struct regmap *map);
1291 int regcache_sync_region(struct regmap *map, unsigned int min,
1293 int regcache_drop_region(struct regmap *map, unsigned int min,
1295 void regcache_cache_only(struct regmap *map, bool enable);
1296 void regcache_cache_bypass(struct regmap *map, bool enable);
1297 void regcache_mark_dirty(struct regmap *map);
1298 bool regcache_reg_cached(struct regmap *map, unsigned int reg);
1300 bool regmap_check_range_table(struct regmap *map, unsigned int reg,
1303 int regmap_register_patch(struct regmap *map, const struct reg_sequence *regs,
1305 int regmap_parse_val(struct regmap *map, const void *buf,
1309 const struct regmap_range *range) in regmap_reg_in_range() argument
1311 return reg >= range->range_min && reg <= range->range_max; in regmap_reg_in_range()
1318 static inline int regmap_set_bits(struct regmap *map, in regmap_set_bits() argument
1321 return regmap_update_bits_base(map, reg, bits, bits, in regmap_set_bits()
1325 static inline int regmap_clear_bits(struct regmap *map, in regmap_clear_bits() argument
1328 return regmap_update_bits_base(map, reg, bits, 0, NULL, false, false); in regmap_clear_bits()
1331 int regmap_test_bits(struct regmap *map, unsigned int reg, unsigned int bits);
1334 * struct reg_field - Description of an register field
1469 * struct regmap_irq_type - IRQ type definitions.
1489 * struct regmap_irq - Description of an IRQ for the generic regmap irq_chip.
1521 * struct regmap_irq_chip - Description of a generic regmap irq_chip.
1525 * when multiple regmap-IRQ controllers are created from same
1529 * interrupts arranged in separate sub-irq blocks with own IRQ
1531 * sub-irq blocks with unhandled interrupts. For such chips fill
1532 * sub-irq register information in status_base, mask_base and
1542 * 1.st bit to 1.st sub-reg, 2.nd bit to 2.nd sub-reg, ...
1567 * @clear_ack: Use this to set 1 and 0 or vice-versa to clear interrupts.
1583 * @irqs: Descriptors for individual IRQs. Interrupt numbers are
1594 * in the range [0, num_regs)
1599 * The index will be in the range [0, num_main_regs[ for the
1640 const struct regmap_irq *irqs; member
1664 int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
1668 struct regmap *map, int irq,
1674 int devm_regmap_add_irq_chip(struct device *dev, struct regmap *map, int irq,
1680 struct regmap *map, int irq,
1700 static inline int regmap_write(struct regmap *map, unsigned int reg, in regmap_write() argument
1704 return -EINVAL; in regmap_write()
1707 static inline int regmap_write_async(struct regmap *map, unsigned int reg, in regmap_write_async() argument
1711 return -EINVAL; in regmap_write_async()
1714 static inline int regmap_raw_write(struct regmap *map, unsigned int reg, in regmap_raw_write() argument
1718 return -EINVAL; in regmap_raw_write()
1721 static inline int regmap_raw_write_async(struct regmap *map, unsigned int reg, in regmap_raw_write_async() argument
1725 return -EINVAL; in regmap_raw_write_async()
1728 static inline int regmap_noinc_write(struct regmap *map, unsigned int reg, in regmap_noinc_write() argument
1732 return -EINVAL; in regmap_noinc_write()
1735 static inline int regmap_bulk_write(struct regmap *map, unsigned int reg, in regmap_bulk_write() argument
1739 return -EINVAL; in regmap_bulk_write()
1742 static inline int regmap_read(struct regmap *map, unsigned int reg, in regmap_read() argument
1746 return -EINVAL; in regmap_read()
1749 static inline int regmap_read_bypassed(struct regmap *map, unsigned int reg, in regmap_read_bypassed() argument
1753 return -EINVAL; in regmap_read_bypassed()
1756 static inline int regmap_raw_read(struct regmap *map, unsigned int reg, in regmap_raw_read() argument
1760 return -EINVAL; in regmap_raw_read()
1763 static inline int regmap_noinc_read(struct regmap *map, unsigned int reg, in regmap_noinc_read() argument
1767 return -EINVAL; in regmap_noinc_read()
1770 static inline int regmap_bulk_read(struct regmap *map, unsigned int reg, in regmap_bulk_read() argument
1774 return -EINVAL; in regmap_bulk_read()
1777 static inline int regmap_update_bits_base(struct regmap *map, unsigned int reg, in regmap_update_bits_base() argument
1782 return -EINVAL; in regmap_update_bits_base()
1785 static inline int regmap_set_bits(struct regmap *map, in regmap_set_bits() argument
1789 return -EINVAL; in regmap_set_bits()
1792 static inline int regmap_clear_bits(struct regmap *map, in regmap_clear_bits() argument
1796 return -EINVAL; in regmap_clear_bits()
1799 static inline int regmap_test_bits(struct regmap *map, in regmap_test_bits() argument
1803 return -EINVAL; in regmap_test_bits()
1811 return -EINVAL; in regmap_field_update_bits_base()
1820 return -EINVAL; in regmap_fields_update_bits_base()
1823 static inline int regmap_update_bits(struct regmap *map, unsigned int reg, in regmap_update_bits() argument
1827 return -EINVAL; in regmap_update_bits()
1830 static inline int regmap_update_bits_async(struct regmap *map, unsigned int reg, in regmap_update_bits_async() argument
1834 return -EINVAL; in regmap_update_bits_async()
1837 static inline int regmap_update_bits_check(struct regmap *map, unsigned int reg, in regmap_update_bits_check() argument
1842 return -EINVAL; in regmap_update_bits_check()
1846 regmap_update_bits_check_async(struct regmap *map, unsigned int reg, in regmap_update_bits_check_async() argument
1851 return -EINVAL; in regmap_update_bits_check_async()
1854 static inline int regmap_write_bits(struct regmap *map, unsigned int reg, in regmap_write_bits() argument
1858 return -EINVAL; in regmap_write_bits()
1865 return -EINVAL; in regmap_field_write()
1872 return -EINVAL; in regmap_field_force_write()
1879 return -EINVAL; in regmap_field_update_bits()
1887 return -EINVAL; in regmap_field_force_update_bits()
1894 return -EINVAL; in regmap_field_set_bits()
1901 return -EINVAL; in regmap_field_clear_bits()
1908 return -EINVAL; in regmap_field_test_bits()
1915 return -EINVAL; in regmap_fields_write()
1922 return -EINVAL; in regmap_fields_force_write()
1930 return -EINVAL; in regmap_fields_update_bits()
1938 return -EINVAL; in regmap_fields_force_update_bits()
1941 static inline int regmap_get_val_bytes(struct regmap *map) in regmap_get_val_bytes() argument
1944 return -EINVAL; in regmap_get_val_bytes()
1947 static inline int regmap_get_max_register(struct regmap *map) in regmap_get_max_register() argument
1950 return -EINVAL; in regmap_get_max_register()
1953 static inline int regmap_get_reg_stride(struct regmap *map) in regmap_get_reg_stride() argument
1956 return -EINVAL; in regmap_get_reg_stride()
1959 static inline bool regmap_might_sleep(struct regmap *map) in regmap_might_sleep() argument
1965 static inline int regcache_sync(struct regmap *map) in regcache_sync() argument
1968 return -EINVAL; in regcache_sync()
1971 static inline int regcache_sync_region(struct regmap *map, unsigned int min, in regcache_sync_region() argument
1975 return -EINVAL; in regcache_sync_region()
1978 static inline int regcache_drop_region(struct regmap *map, unsigned int min, in regcache_drop_region() argument
1982 return -EINVAL; in regcache_drop_region()
1985 static inline void regcache_cache_only(struct regmap *map, bool enable) in regcache_cache_only() argument
1990 static inline void regcache_cache_bypass(struct regmap *map, bool enable) in regcache_cache_bypass() argument
1995 static inline void regcache_mark_dirty(struct regmap *map) in regcache_mark_dirty() argument
2000 static inline void regmap_async_complete(struct regmap *map) in regmap_async_complete() argument
2005 static inline int regmap_register_patch(struct regmap *map, in regmap_register_patch() argument
2010 return -EINVAL; in regmap_register_patch()
2013 static inline int regmap_parse_val(struct regmap *map, const void *buf, in regmap_parse_val() argument
2017 return -EINVAL; in regmap_parse_val()
2026 static inline struct device *regmap_get_device(struct regmap *map) in regmap_get_device() argument