diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 14:47:00 +0900 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 14:47:00 +0900 |
commit | 4fc9ed3344758f22b57db174914b60423c7c1593 (patch) | |
tree | 517e2b3575b319714ea3a8780708c820f8bd20cb /include | |
parent | 7e238a2ecd117e16b154e1b0ed77906596600ff5 (diff) | |
parent | 04bc9ac163a2550c7bc32750ea8dd2e049102be2 (diff) | |
download | linux-4fc9ed3344758f22b57db174914b60423c7c1593.tar.bz2 |
Merge tag 'regmap-v3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap updates from Mark Brown:
"The main thing this time around has been some improvments to async
I/O.
- Cleaned up the async I/O support and extended it to allow single
register writes more easily. This is now used where possible for
internally generated I/O, providing performance improvements for
devices that can do async I/O.
- An API for issuing a sequence of register writes as a single
operation. Some devices and buses can take advantage of this to do
the I/O faster.
- Addition of regmap_field APIs which help drivers for devices with
repeated IPs or which move registers around between revisions to
share helpers.
- Support for SPMI buses"
* tag 'regmap-v3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
regmap: add SPMI support
regmap: debugfs: Fix a boot time crash with early regmap init
regmap: irq: clear status when disable irq
regmap: Only send a single buffer for async I/O if writing one register
regmap: spi: Handle async writes of only one buffer
regmap: new API regmap_multi_reg_write() definition
regmap: Use async I/O during cache sync
regmap: Use async I/O for patch application
regmap: Fix regmap_bulk_write single-rw mutex deadlock
regmap: Provide asynchronous write and update bits operations
regmap: Simplify the initiation of async I/O
regmap: Don't generate gather writes for single register raw writes
regmap: Cache async work structures
regmap: add helper macro to set min/max range of register
regmap: Add regmap_fields APIs
regmap: add regmap_field_update_bits()
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/regmap.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index a10380bfbeac..e55907804d39 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -23,6 +23,7 @@ struct device; struct i2c_client; struct irq_domain; struct spi_device; +struct spmi_device; struct regmap; struct regmap_range_cfg; struct regmap_field; @@ -70,6 +71,8 @@ struct regmap_range { unsigned int range_max; }; +#define regmap_reg_range(low, high) { .range_min = low, .range_max = high, } + /* * A table of ranges including some yes ranges and some no ranges. * If a register belongs to a no_range, the corresponding check function @@ -318,6 +321,8 @@ struct regmap *regmap_init_i2c(struct i2c_client *i2c, const struct regmap_config *config); struct regmap *regmap_init_spi(struct spi_device *dev, const struct regmap_config *config); +struct regmap *regmap_init_spmi(struct spmi_device *dev, + const struct regmap_config *config); struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id, void __iomem *regs, const struct regmap_config *config); @@ -330,6 +335,8 @@ struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c, const struct regmap_config *config); struct regmap *devm_regmap_init_spi(struct spi_device *dev, const struct regmap_config *config); +struct regmap *devm_regmap_init_spmi(struct spmi_device *dev, + const struct regmap_config *config); struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id, void __iomem *regs, const struct regmap_config *config); @@ -374,10 +381,13 @@ int regmap_reinit_cache(struct regmap *map, const struct regmap_config *config); struct regmap *dev_get_regmap(struct device *dev, const char *name); int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); +int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val); int regmap_raw_write(struct regmap *map, unsigned int reg, const void *val, size_t val_len); int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, size_t val_count); +int regmap_multi_reg_write(struct regmap *map, struct reg_default *regs, + int num_regs); int regmap_raw_write_async(struct regmap *map, unsigned int reg, const void *val, size_t val_len); int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val); @@ -387,9 +397,14 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val, size_t val_count); int regmap_update_bits(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val); +int regmap_update_bits_async(struct regmap *map, unsigned int reg, + unsigned int mask, unsigned int val); int regmap_update_bits_check(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val, bool *change); +int regmap_update_bits_check_async(struct regmap *map, unsigned int reg, + unsigned int mask, unsigned int val, + bool *change); int regmap_get_val_bytes(struct regmap *map); int regmap_async_complete(struct regmap *map); bool regmap_can_raw_write(struct regmap *map); @@ -425,11 +440,15 @@ bool regmap_reg_in_ranges(unsigned int reg, * @reg: Offset of the register within the regmap bank * @lsb: lsb of the register field. * @reg: msb of the register field. + * @id_size: port size if it has some ports + * @id_offset: address offset for each ports */ struct reg_field { unsigned int reg; unsigned int lsb; unsigned int msb; + unsigned int id_size; + unsigned int id_offset; }; #define REG_FIELD(_reg, _lsb, _msb) { \ @@ -448,6 +467,15 @@ void devm_regmap_field_free(struct device *dev, struct regmap_field *field); int regmap_field_read(struct regmap_field *field, unsigned int *val); int regmap_field_write(struct regmap_field *field, unsigned int val); +int regmap_field_update_bits(struct regmap_field *field, + unsigned int mask, unsigned int val); + +int regmap_fields_write(struct regmap_field *field, unsigned int id, + unsigned int val); +int regmap_fields_read(struct regmap_field *field, unsigned int id, + unsigned int *val); +int regmap_fields_update_bits(struct regmap_field *field, unsigned int id, + unsigned int mask, unsigned int val); /** * Description of an IRQ for the generic regmap irq_chip. @@ -527,6 +555,13 @@ static inline int regmap_write(struct regmap *map, unsigned int reg, return -EINVAL; } +static inline int regmap_write_async(struct regmap *map, unsigned int reg, + unsigned int val) +{ + WARN_ONCE(1, "regmap API is disabled"); + return -EINVAL; +} + static inline int regmap_raw_write(struct regmap *map, unsigned int reg, const void *val, size_t val_len) { @@ -576,6 +611,14 @@ static inline int regmap_update_bits(struct regmap *map, unsigned int reg, return -EINVAL; } +static inline int regmap_update_bits_async(struct regmap *map, + unsigned int reg, + unsigned int mask, unsigned int val) +{ + WARN_ONCE(1, "regmap API is disabled"); + return -EINVAL; +} + static inline int regmap_update_bits_check(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val, @@ -585,6 +628,16 @@ static inline int regmap_update_bits_check(struct regmap *map, return -EINVAL; } +static inline int regmap_update_bits_check_async(struct regmap *map, + unsigned int reg, + unsigned int mask, + unsigned int val, + bool *change) +{ + WARN_ONCE(1, "regmap API is disabled"); + return -EINVAL; +} + static inline int regmap_get_val_bytes(struct regmap *map) { WARN_ONCE(1, "regmap API is disabled"); |