u8 read_flag_mask;
enum regmap_endian reg_format_endian_default;
enum regmap_endian val_format_endian_default;
++ size_t max_raw_read;
++ size_t max_raw_write;
};
- -struct regmap *regmap_init(struct device *dev,
- - const struct regmap_bus *bus,
- - void *bus_context,
- - const struct regmap_config *config);
+ +/*
+ + * __regmap_init functions.
+ + *
+ + * These functions take a lock key and name parameter, and should not be called
+ + * directly. Instead, use the regmap_init macros that generate a key and name
+ + * for each call.
+ + */
+ +struct regmap *__regmap_init(struct device *dev,
+ + const struct regmap_bus *bus,
+ + void *bus_context,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +struct regmap *__regmap_init_i2c(struct i2c_client *i2c,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +struct regmap *__regmap_init_spi(struct spi_device *dev,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +struct regmap *__regmap_init_spmi_base(struct spmi_device *dev,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +struct regmap *__regmap_init_spmi_ext(struct spmi_device *dev,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +struct regmap *__regmap_init_mmio_clk(struct device *dev, const char *clk_id,
+ + void __iomem *regs,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +
+ +struct regmap *__devm_regmap_init(struct device *dev,
+ + const struct regmap_bus *bus,
+ + void *bus_context,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +struct regmap *__devm_regmap_init_i2c(struct i2c_client *i2c,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +struct regmap *__devm_regmap_init_spi(struct spi_device *dev,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +struct regmap *__devm_regmap_init_spmi_base(struct spmi_device *dev,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +struct regmap *__devm_regmap_init_spmi_ext(struct spmi_device *dev,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +struct regmap *__devm_regmap_init_mmio_clk(struct device *dev,
+ + const char *clk_id,
+ + void __iomem *regs,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97,
+ + const struct regmap_config *config,
+ + struct lock_class_key *lock_key,
+ + const char *lock_name);
+ +
+ +/*
+ + * Wrapper for regmap_init macros to include a unique lockdep key and name
+ + * for each call. No-op if CONFIG_LOCKDEP is not set.
+ + *
+ + * @fn: Real function to call (in the form __[*_]regmap_init[_*])
+ + * @name: Config variable name (#config in the calling macro)
+ + **/
+ +#ifdef CONFIG_LOCKDEP
+ +#define __regmap_lockdep_wrapper(fn, name, ...) \
+ +( \
+ + ({ \
+ + static struct lock_class_key _key; \
+ + fn(__VA_ARGS__, &_key, \
+ + KBUILD_BASENAME ":" \
+ + __stringify(__LINE__) ":" \
+ + "(" name ")->lock"); \
+ + }) \
+ +)
+ +#else
+ +#define __regmap_lockdep_wrapper(fn, name, ...) fn(__VA_ARGS__, NULL, NULL)
+ +#endif
+ +
+ +/**
+ + * regmap_init(): Initialise register map
+ + *
+ + * @dev: Device that will be interacted with
+ + * @bus: Bus-specific callbacks to use with device
+ + * @bus_context: Data passed to bus-specific callbacks
+ + * @config: Configuration for register map
+ + *
+ + * The return value will be an ERR_PTR() on error or a valid pointer to
+ + * a struct regmap. This function should generally not be called
+ + * directly, it should be called by bus-specific init functions.
+ + */
+ +#define regmap_init(dev, bus, bus_context, config) \
+ + __regmap_lockdep_wrapper(__regmap_init, #config, \
+ + dev, bus, bus_context, config)
int regmap_attach_dev(struct device *dev, struct regmap *map,
- - const struct regmap_config *config);
- -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_base(struct spmi_device *dev,
- - const struct regmap_config *config);
- -struct regmap *regmap_init_spmi_ext(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);
- -struct regmap *regmap_init_ac97(struct snd_ac97 *ac97,
- - const struct regmap_config *config);
- -
- -struct regmap *devm_regmap_init(struct device *dev,
- - const struct regmap_bus *bus,
- - void *bus_context,
- - const struct regmap_config *config);
- -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_base(struct spmi_device *dev,
- - const struct regmap_config *config);
- -struct regmap *devm_regmap_init_spmi_ext(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);
- -struct regmap *devm_regmap_init_ac97(struct snd_ac97 *ac97,
- - const struct regmap_config *config);
+ + const struct regmap_config *config);
- -bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
+ +/**
+ + * regmap_init_i2c(): Initialise register map
+ + *
+ + * @i2c: Device that will be interacted with
+ + * @config: Configuration for register map
+ + *
+ + * The return value will be an ERR_PTR() on error or a valid pointer to
+ + * a struct regmap.
+ + */
+ +#define regmap_init_i2c(i2c, config) \
+ + __regmap_lockdep_wrapper(__regmap_init_i2c, #config, \
+ + i2c, config)
+ +
+ +/**
+ + * regmap_init_spi(): Initialise register map
+ + *
+ + * @spi: Device that will be interacted with
+ + * @config: Configuration for register map
+ + *
+ + * The return value will be an ERR_PTR() on error or a valid pointer to
+ + * a struct regmap.
+ + */
+ +#define regmap_init_spi(dev, config) \
+ + __regmap_lockdep_wrapper(__regmap_init_spi, #config, \
+ + dev, config)
+ +
+ +/**
+ + * regmap_init_spmi_base(): Create regmap for the Base register space
+ + * @sdev: SPMI device that will be interacted with
+ + * @config: Configuration for register map
+ + *
+ + * The return value will be an ERR_PTR() on error or a valid pointer to
+ + * a struct regmap.
+ + */
+ +#define regmap_init_spmi_base(dev, config) \
+ + __regmap_lockdep_wrapper(__regmap_init_spmi_base, #config, \
+ + dev, config)
+ +
+ +/**
+ + * regmap_init_spmi_ext(): Create regmap for Ext register space
+ + * @sdev: Device that will be interacted with
+ + * @config: Configuration for register map
+ + *
+ + * The return value will be an ERR_PTR() on error or a valid pointer to
+ + * a struct regmap.
+ + */
+ +#define regmap_init_spmi_ext(dev, config) \
+ + __regmap_lockdep_wrapper(__regmap_init_spmi_ext, #config, \
+ + dev, config)
+ +
+ +/**
+ + * regmap_init_mmio_clk(): Initialise register map with register clock
+ + *
+ + * @dev: Device that will be interacted with
+ + * @clk_id: register clock consumer ID
+ + * @regs: Pointer to memory-mapped IO region
+ + * @config: Configuration for register map
+ + *
+ + * The return value will be an ERR_PTR() on error or a valid pointer to
+ + * a struct regmap.
+ + */
+ +#define regmap_init_mmio_clk(dev, clk_id, regs, config) \
+ + __regmap_lockdep_wrapper(__regmap_init_mmio_clk, #config, \
+ + dev, clk_id, regs, config)
/**
* regmap_init_mmio(): Initialise register map