Lines Matching +full:irqs +full:- +full:map +full:- +full:range

1 /* SPDX-License-Identifier: GPL-2.0-only */
6 * Register map access API
49 * struct reg_default - Default value for a register.
63 * struct reg_sequence - An individual write from a sequence of writes.
86 * regmap_read_poll_timeout - Poll until a condition is met or a timeout occurs
88 * @map: Regmap to read from
93 * tight-loops). Should be less than ~20ms since usleep_range
94 * is used (see Documentation/timers/timers-howto.rst).
97 * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_read
104 #define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \ argument
108 sleep_us, timeout_us, false, (map), (addr), &(val)); \
113 * regmap_read_poll_timeout_atomic - Poll until a condition is met or a timeout occurs
115 * @map: Regmap to read from
119 * @delay_us: Time to udelay between reads in us (0 tight-loops).
121 * (see Documentation/timers/timers-howto.rst).
124 * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_read
134 #define regmap_read_poll_timeout_atomic(map, addr, val, cond, delay_us, timeout_us) \ argument
141 __ret = regmap_read((map), (addr), &(val)); \
148 __ret = regmap_read((map), (addr), &(val)); \
154 __ret ?: ((cond) ? 0 : -ETIMEDOUT); \
158 * regmap_field_read_poll_timeout - Poll until a condition is met or timeout
164 * tight-loops). Should be less than ~20ms since usleep_range
165 * is used (see Documentation/timers/timers-howto.rst).
168 * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_field_read
186 /* Unspecified -> 0 -> Backwards compatible default */
194 * struct regmap_range - A register range, used for access related checks
208 * struct regmap_access_table - A table of register ranges for access checks
217 * will return false. If a register belongs to a yes range, the corresponding
231 * struct regmap_config - Configuration for the register map of a device.
298 * Use it only for "no-bus" cases.
341 * @num_ranges: Number of range configuration entries.
410 * struct regmap_range_cfg - Configuration for indirectly accessed or paged
415 * @range_min: Address of the lowest register address in virtual range.
416 * @range_max: Address of the highest register in virtual range.
425 * Registers, mapped to this virtual range, are accessed in two steps:
432 /* Registers of virtual address range */
472 * struct regmap_bus - Description of a hardware bus for the register map
480 * @gather_write: Write operation with split register/value, return -ENOTSUPP
483 * must serialise with respect to non-async I/O.
643 * for each call. No-op if CONFIG_LOCKDEP is not set.
656 "(" name ")->lock"); \
664 * regmap_init() - Initialise register map
667 * @bus: Bus-specific callbacks to use with device
668 * @bus_context: Data passed to bus-specific callbacks
669 * @config: Configuration for register map
673 * directly, it should be called by bus-specific init functions.
678 int regmap_attach_dev(struct device *dev, struct regmap *map,
682 * regmap_init_i2c() - Initialise register map
685 * @config: Configuration for register map
695 * regmap_init_sccb() - Initialise register map
698 * @config: Configuration for register map
708 * regmap_init_slimbus() - Initialise register map
711 * @config: Configuration for register map
721 * regmap_init_spi() - Initialise register map
724 * @config: Configuration for register map
734 * regmap_init_spmi_base() - Create regmap for the Base register space
737 * @config: Configuration for register map
747 * regmap_init_spmi_ext() - Create regmap for Ext register space
750 * @config: Configuration for register map
760 * regmap_init_w1() - Initialise register map
763 * @config: Configuration for register map
773 * regmap_init_mmio_clk() - Initialise register map with register clock
777 * @regs: Pointer to memory-mapped IO region
778 * @config: Configuration for register map
788 * regmap_init_mmio() - Initialise register map
791 * @regs: Pointer to memory-mapped IO region
792 * @config: Configuration for register map
801 * regmap_init_ac97() - Initialise AC'97 register map
804 * @config: Configuration for register map
815 * regmap_init_sdw() - Initialise register map
818 * @config: Configuration for register map
828 * regmap_init_spi_avmm() - Initialize register map for Intel SPI Slave
832 * @config: Configuration for register map
842 * devm_regmap_init() - Initialise managed register map
845 * @bus: Bus-specific callbacks to use with device
846 * @bus_context: Data passed to bus-specific callbacks
847 * @config: Configuration for register map
851 * directly, it should be called by bus-specific init functions. The
852 * map will be automatically freed by the device management code.
859 * devm_regmap_init_i2c() - Initialise managed register map
862 * @config: Configuration for register map
873 * devm_regmap_init_sccb() - Initialise managed register map
876 * @config: Configuration for register map
887 * devm_regmap_init_spi() - Initialise register map
890 * @config: Configuration for register map
893 * to a struct regmap. The map will be automatically freed by the
901 * devm_regmap_init_spmi_base() - Create managed regmap for Base register space
904 * @config: Configuration for register map
915 * devm_regmap_init_spmi_ext() - Create managed regmap for Ext register space
918 * @config: Configuration for register map
929 * devm_regmap_init_w1() - Initialise managed register map
932 * @config: Configuration for register map
942 * devm_regmap_init_mmio_clk() - Initialise managed register map with clock
946 * @regs: Pointer to memory-mapped IO region
947 * @config: Configuration for register map
958 * devm_regmap_init_mmio() - Initialise managed register map
961 * @regs: Pointer to memory-mapped IO region
962 * @config: Configuration for register map
972 * devm_regmap_init_ac97() - Initialise AC'97 register map
975 * @config: Configuration for register map
986 * devm_regmap_init_sdw() - Initialise managed register map
989 * @config: Configuration for register map
1000 * devm_regmap_init_slimbus() - Initialise managed register map
1003 * @config: Configuration for register map
1014 * devm_regmap_init_i3c() - Initialise managed register map
1017 * @config: Configuration for register map
1028 * devm_regmap_init_spi_avmm() - Initialize register map for Intel SPI Slave
1032 * @config: Configuration for register map
1035 * to a struct regmap. The map will be automatically freed by the
1042 int regmap_mmio_attach_clk(struct regmap *map, struct clk *clk);
1043 void regmap_mmio_detach_clk(struct regmap *map);
1044 void regmap_exit(struct regmap *map);
1045 int regmap_reinit_cache(struct regmap *map,
1048 struct device *regmap_get_device(struct regmap *map);
1049 int regmap_write(struct regmap *map, unsigned int reg, unsigned int val);
1050 int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val);
1051 int regmap_raw_write(struct regmap *map, unsigned int reg,
1053 int regmap_noinc_write(struct regmap *map, unsigned int reg,
1055 int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
1057 int regmap_multi_reg_write(struct regmap *map, const struct reg_sequence *regs,
1059 int regmap_multi_reg_write_bypassed(struct regmap *map,
1062 int regmap_raw_write_async(struct regmap *map, unsigned int reg,
1064 int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val);
1065 int regmap_raw_read(struct regmap *map, unsigned int reg,
1067 int regmap_noinc_read(struct regmap *map, unsigned int reg,
1069 int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
1071 int regmap_update_bits_base(struct regmap *map, unsigned int reg,
1075 static inline int regmap_update_bits(struct regmap *map, unsigned int reg, in regmap_update_bits() argument
1078 return regmap_update_bits_base(map, reg, mask, val, NULL, false, false); in regmap_update_bits()
1081 static inline int regmap_update_bits_async(struct regmap *map, unsigned int reg, in regmap_update_bits_async() argument
1084 return regmap_update_bits_base(map, reg, mask, val, NULL, true, false); in regmap_update_bits_async()
1087 static inline int regmap_update_bits_check(struct regmap *map, unsigned int reg, in regmap_update_bits_check() argument
1091 return regmap_update_bits_base(map, reg, mask, val, in regmap_update_bits_check()
1096 regmap_update_bits_check_async(struct regmap *map, unsigned int reg, in regmap_update_bits_check_async() argument
1100 return regmap_update_bits_base(map, reg, mask, val, in regmap_update_bits_check_async()
1104 static inline int regmap_write_bits(struct regmap *map, unsigned int reg, in regmap_write_bits() argument
1107 return regmap_update_bits_base(map, reg, mask, val, NULL, false, true); in regmap_write_bits()
1110 int regmap_get_val_bytes(struct regmap *map);
1111 int regmap_get_max_register(struct regmap *map);
1112 int regmap_get_reg_stride(struct regmap *map);
1113 int regmap_async_complete(struct regmap *map);
1114 bool regmap_can_raw_write(struct regmap *map);
1115 size_t regmap_get_raw_read_max(struct regmap *map);
1116 size_t regmap_get_raw_write_max(struct regmap *map);
1118 int regcache_sync(struct regmap *map);
1119 int regcache_sync_region(struct regmap *map, unsigned int min,
1121 int regcache_drop_region(struct regmap *map, unsigned int min,
1123 void regcache_cache_only(struct regmap *map, bool enable);
1124 void regcache_cache_bypass(struct regmap *map, bool enable);
1125 void regcache_mark_dirty(struct regmap *map);
1127 bool regmap_check_range_table(struct regmap *map, unsigned int reg,
1130 int regmap_register_patch(struct regmap *map, const struct reg_sequence *regs,
1132 int regmap_parse_val(struct regmap *map, const void *buf,
1136 const struct regmap_range *range) in regmap_reg_in_range() argument
1138 return reg >= range->range_min && reg <= range->range_max; in regmap_reg_in_range()
1145 static inline int regmap_set_bits(struct regmap *map, in regmap_set_bits() argument
1148 return regmap_update_bits_base(map, reg, bits, bits, in regmap_set_bits()
1152 static inline int regmap_clear_bits(struct regmap *map, in regmap_clear_bits() argument
1155 return regmap_update_bits_base(map, reg, bits, 0, NULL, false, false); in regmap_clear_bits()
1158 int regmap_test_bits(struct regmap *map, unsigned int reg, unsigned int bits);
1161 * struct reg_field - Description of an register field
1279 * struct regmap_irq_type - IRQ type definitions.
1299 * struct regmap_irq - Description of an IRQ for the generic regmap irq_chip.
1329 * struct regmap_irq_chip - Description of a generic regmap irq_chip.
1334 * interrupts arranged in separate sub-irq blocks with own IRQ
1336 * sub-irq blocks with unhandled interrupts. For such chips fill
1337 * sub-irq register information in status_base, mask_base and
1347 * 1.st bit to 1.st sub-reg, 2.nd bit to 2.nd sub-reg, ...
1365 * @clear_ack: Use this to set 1 and 0 or vice-versa to clear interrupts.
1377 * @irqs: Descriptors for individual IRQs. Interrupt numbers are
1423 const struct regmap_irq *irqs; member
1436 int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
1440 struct regmap *map, int irq,
1446 int devm_regmap_add_irq_chip(struct device *dev, struct regmap *map, int irq,
1452 struct regmap *map, int irq,
1472 static inline int regmap_write(struct regmap *map, unsigned int reg, in regmap_write() argument
1476 return -EINVAL; in regmap_write()
1479 static inline int regmap_write_async(struct regmap *map, unsigned int reg, in regmap_write_async() argument
1483 return -EINVAL; in regmap_write_async()
1486 static inline int regmap_raw_write(struct regmap *map, unsigned int reg, in regmap_raw_write() argument
1490 return -EINVAL; in regmap_raw_write()
1493 static inline int regmap_raw_write_async(struct regmap *map, unsigned int reg, in regmap_raw_write_async() argument
1497 return -EINVAL; in regmap_raw_write_async()
1500 static inline int regmap_noinc_write(struct regmap *map, unsigned int reg, in regmap_noinc_write() argument
1504 return -EINVAL; in regmap_noinc_write()
1507 static inline int regmap_bulk_write(struct regmap *map, unsigned int reg, in regmap_bulk_write() argument
1511 return -EINVAL; in regmap_bulk_write()
1514 static inline int regmap_read(struct regmap *map, unsigned int reg, in regmap_read() argument
1518 return -EINVAL; in regmap_read()
1521 static inline int regmap_raw_read(struct regmap *map, unsigned int reg, in regmap_raw_read() argument
1525 return -EINVAL; in regmap_raw_read()
1528 static inline int regmap_noinc_read(struct regmap *map, unsigned int reg, in regmap_noinc_read() argument
1532 return -EINVAL; in regmap_noinc_read()
1535 static inline int regmap_bulk_read(struct regmap *map, unsigned int reg, in regmap_bulk_read() argument
1539 return -EINVAL; in regmap_bulk_read()
1542 static inline int regmap_update_bits_base(struct regmap *map, unsigned int reg, in regmap_update_bits_base() argument
1547 return -EINVAL; in regmap_update_bits_base()
1550 static inline int regmap_set_bits(struct regmap *map, in regmap_set_bits() argument
1554 return -EINVAL; in regmap_set_bits()
1557 static inline int regmap_clear_bits(struct regmap *map, in regmap_clear_bits() argument
1561 return -EINVAL; in regmap_clear_bits()
1564 static inline int regmap_test_bits(struct regmap *map, in regmap_test_bits() argument
1568 return -EINVAL; in regmap_test_bits()
1576 return -EINVAL; in regmap_field_update_bits_base()
1585 return -EINVAL; in regmap_fields_update_bits_base()
1588 static inline int regmap_update_bits(struct regmap *map, unsigned int reg, in regmap_update_bits() argument
1592 return -EINVAL; in regmap_update_bits()
1595 static inline int regmap_update_bits_async(struct regmap *map, unsigned int reg, in regmap_update_bits_async() argument
1599 return -EINVAL; in regmap_update_bits_async()
1602 static inline int regmap_update_bits_check(struct regmap *map, unsigned int reg, in regmap_update_bits_check() argument
1607 return -EINVAL; in regmap_update_bits_check()
1611 regmap_update_bits_check_async(struct regmap *map, unsigned int reg, in regmap_update_bits_check_async() argument
1616 return -EINVAL; in regmap_update_bits_check_async()
1619 static inline int regmap_write_bits(struct regmap *map, unsigned int reg, in regmap_write_bits() argument
1623 return -EINVAL; in regmap_write_bits()
1630 return -EINVAL; in regmap_field_write()
1637 return -EINVAL; in regmap_field_force_write()
1644 return -EINVAL; in regmap_field_update_bits()
1652 return -EINVAL; in regmap_field_force_update_bits()
1659 return -EINVAL; in regmap_fields_write()
1666 return -EINVAL; in regmap_fields_force_write()
1674 return -EINVAL; in regmap_fields_update_bits()
1682 return -EINVAL; in regmap_fields_force_update_bits()
1685 static inline int regmap_get_val_bytes(struct regmap *map) in regmap_get_val_bytes() argument
1688 return -EINVAL; in regmap_get_val_bytes()
1691 static inline int regmap_get_max_register(struct regmap *map) in regmap_get_max_register() argument
1694 return -EINVAL; in regmap_get_max_register()
1697 static inline int regmap_get_reg_stride(struct regmap *map) in regmap_get_reg_stride() argument
1700 return -EINVAL; in regmap_get_reg_stride()
1703 static inline int regcache_sync(struct regmap *map) in regcache_sync() argument
1706 return -EINVAL; in regcache_sync()
1709 static inline int regcache_sync_region(struct regmap *map, unsigned int min, in regcache_sync_region() argument
1713 return -EINVAL; in regcache_sync_region()
1716 static inline int regcache_drop_region(struct regmap *map, unsigned int min, in regcache_drop_region() argument
1720 return -EINVAL; in regcache_drop_region()
1723 static inline void regcache_cache_only(struct regmap *map, bool enable) in regcache_cache_only() argument
1728 static inline void regcache_cache_bypass(struct regmap *map, bool enable) in regcache_cache_bypass() argument
1733 static inline void regcache_mark_dirty(struct regmap *map) in regcache_mark_dirty() argument
1738 static inline void regmap_async_complete(struct regmap *map) in regmap_async_complete() argument
1743 static inline int regmap_register_patch(struct regmap *map, in regmap_register_patch() argument
1748 return -EINVAL; in regmap_register_patch()
1751 static inline int regmap_parse_val(struct regmap *map, const void *buf, in regmap_parse_val() argument
1755 return -EINVAL; in regmap_parse_val()
1764 static inline struct device *regmap_get_device(struct regmap *map) in regmap_get_device() argument