Commit 1ed81114 authored by Nicolas Boichat's avatar Nicolas Boichat Committed by Mark Brown

regmap: Move documentation to regmap.h

Init functions defined in regmap*.c files are now prefixed with
__, take lockdep key and class parameters, and should not be
called directly: move the documentation to regmap.h, where the
macros are defined.
Signed-off-by: default avatarNicolas Boichat <drinkcat@chromium.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3cfe7a74
...@@ -78,15 +78,6 @@ static const struct regmap_bus ac97_regmap_bus = { ...@@ -78,15 +78,6 @@ static const struct regmap_bus ac97_regmap_bus = {
.reg_read = regmap_ac97_reg_read, .reg_read = regmap_ac97_reg_read,
}; };
/**
* regmap_init_ac97(): Initialise AC'97 register map
*
* @ac97: 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.
*/
struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97, struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97,
const struct regmap_config *config, const struct regmap_config *config,
struct lock_class_key *lock_key, struct lock_class_key *lock_key,
...@@ -97,16 +88,6 @@ struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97, ...@@ -97,16 +88,6 @@ struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97,
} }
EXPORT_SYMBOL_GPL(__regmap_init_ac97); EXPORT_SYMBOL_GPL(__regmap_init_ac97);
/**
* devm_regmap_init_ac97(): Initialise AC'97 register map
*
* @ac97: 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. The regmap will be automatically freed by the
* device management code.
*/
struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97, struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97,
const struct regmap_config *config, const struct regmap_config *config,
struct lock_class_key *lock_key, struct lock_class_key *lock_key,
......
...@@ -233,15 +233,6 @@ static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c, ...@@ -233,15 +233,6 @@ static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c,
return ERR_PTR(-ENOTSUPP); return ERR_PTR(-ENOTSUPP);
} }
/**
* 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.
*/
struct regmap *__regmap_init_i2c(struct i2c_client *i2c, struct regmap *__regmap_init_i2c(struct i2c_client *i2c,
const struct regmap_config *config, const struct regmap_config *config,
struct lock_class_key *lock_key, struct lock_class_key *lock_key,
...@@ -257,16 +248,6 @@ struct regmap *__regmap_init_i2c(struct i2c_client *i2c, ...@@ -257,16 +248,6 @@ struct regmap *__regmap_init_i2c(struct i2c_client *i2c,
} }
EXPORT_SYMBOL_GPL(__regmap_init_i2c); EXPORT_SYMBOL_GPL(__regmap_init_i2c);
/**
* devm_regmap_init_i2c(): Initialise managed 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. The regmap will be automatically freed by the
* device management code.
*/
struct regmap *__devm_regmap_init_i2c(struct i2c_client *i2c, struct regmap *__devm_regmap_init_i2c(struct i2c_client *i2c,
const struct regmap_config *config, const struct regmap_config *config,
struct lock_class_key *lock_key, struct lock_class_key *lock_key,
......
...@@ -296,17 +296,6 @@ static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev, ...@@ -296,17 +296,6 @@ static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev,
return ERR_PTR(ret); return ERR_PTR(ret);
} }
/**
* 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.
*/
struct regmap *__regmap_init_mmio_clk(struct device *dev, const char *clk_id, struct regmap *__regmap_init_mmio_clk(struct device *dev, const char *clk_id,
void __iomem *regs, void __iomem *regs,
const struct regmap_config *config, const struct regmap_config *config,
...@@ -324,18 +313,6 @@ struct regmap *__regmap_init_mmio_clk(struct device *dev, const char *clk_id, ...@@ -324,18 +313,6 @@ struct regmap *__regmap_init_mmio_clk(struct device *dev, const char *clk_id,
} }
EXPORT_SYMBOL_GPL(__regmap_init_mmio_clk); EXPORT_SYMBOL_GPL(__regmap_init_mmio_clk);
/**
* devm_regmap_init_mmio_clk(): Initialise managed register map with 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. The regmap will be automatically freed by the
* device management code.
*/
struct regmap *__devm_regmap_init_mmio_clk(struct device *dev, struct regmap *__devm_regmap_init_mmio_clk(struct device *dev,
const char *clk_id, const char *clk_id,
void __iomem *regs, void __iomem *regs,
......
...@@ -113,15 +113,6 @@ static struct regmap_bus regmap_spi = { ...@@ -113,15 +113,6 @@ static struct regmap_bus regmap_spi = {
.val_format_endian_default = REGMAP_ENDIAN_BIG, .val_format_endian_default = REGMAP_ENDIAN_BIG,
}; };
/**
* 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.
*/
struct regmap *__regmap_init_spi(struct spi_device *spi, struct regmap *__regmap_init_spi(struct spi_device *spi,
const struct regmap_config *config, const struct regmap_config *config,
struct lock_class_key *lock_key, struct lock_class_key *lock_key,
...@@ -132,16 +123,6 @@ struct regmap *__regmap_init_spi(struct spi_device *spi, ...@@ -132,16 +123,6 @@ struct regmap *__regmap_init_spi(struct spi_device *spi,
} }
EXPORT_SYMBOL_GPL(__regmap_init_spi); EXPORT_SYMBOL_GPL(__regmap_init_spi);
/**
* devm_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. The map will be automatically freed by the
* device management code.
*/
struct regmap *__devm_regmap_init_spi(struct spi_device *spi, struct regmap *__devm_regmap_init_spi(struct spi_device *spi,
const struct regmap_config *config, const struct regmap_config *config,
struct lock_class_key *lock_key, struct lock_class_key *lock_key,
......
...@@ -91,14 +91,6 @@ static struct regmap_bus regmap_spmi_base = { ...@@ -91,14 +91,6 @@ static struct regmap_bus regmap_spmi_base = {
.val_format_endian_default = REGMAP_ENDIAN_NATIVE, .val_format_endian_default = REGMAP_ENDIAN_NATIVE,
}; };
/**
* 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.
*/
struct regmap *__regmap_init_spmi_base(struct spmi_device *sdev, struct regmap *__regmap_init_spmi_base(struct spmi_device *sdev,
const struct regmap_config *config, const struct regmap_config *config,
struct lock_class_key *lock_key, struct lock_class_key *lock_key,
...@@ -109,15 +101,6 @@ struct regmap *__regmap_init_spmi_base(struct spmi_device *sdev, ...@@ -109,15 +101,6 @@ struct regmap *__regmap_init_spmi_base(struct spmi_device *sdev,
} }
EXPORT_SYMBOL_GPL(__regmap_init_spmi_base); EXPORT_SYMBOL_GPL(__regmap_init_spmi_base);
/**
* devm_regmap_init_spmi_base(): Create managed regmap for 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. The regmap will be automatically freed by the
* device management code.
*/
struct regmap *__devm_regmap_init_spmi_base(struct spmi_device *sdev, struct regmap *__devm_regmap_init_spmi_base(struct spmi_device *sdev,
const struct regmap_config *config, const struct regmap_config *config,
struct lock_class_key *lock_key, struct lock_class_key *lock_key,
...@@ -228,14 +211,6 @@ static struct regmap_bus regmap_spmi_ext = { ...@@ -228,14 +211,6 @@ static struct regmap_bus regmap_spmi_ext = {
.val_format_endian_default = REGMAP_ENDIAN_NATIVE, .val_format_endian_default = REGMAP_ENDIAN_NATIVE,
}; };
/**
* 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.
*/
struct regmap *__regmap_init_spmi_ext(struct spmi_device *sdev, struct regmap *__regmap_init_spmi_ext(struct spmi_device *sdev,
const struct regmap_config *config, const struct regmap_config *config,
struct lock_class_key *lock_key, struct lock_class_key *lock_key,
...@@ -246,15 +221,6 @@ struct regmap *__regmap_init_spmi_ext(struct spmi_device *sdev, ...@@ -246,15 +221,6 @@ struct regmap *__regmap_init_spmi_ext(struct spmi_device *sdev,
} }
EXPORT_SYMBOL_GPL(__regmap_init_spmi_ext); EXPORT_SYMBOL_GPL(__regmap_init_spmi_ext);
/**
* devm_regmap_init_spmi_ext(): Create managed regmap for Ext 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. The regmap will be automatically freed by the
* device management code.
*/
struct regmap *__devm_regmap_init_spmi_ext(struct spmi_device *sdev, struct regmap *__devm_regmap_init_spmi_ext(struct spmi_device *sdev,
const struct regmap_config *config, const struct regmap_config *config,
struct lock_class_key *lock_key, struct lock_class_key *lock_key,
......
...@@ -515,18 +515,6 @@ enum regmap_endian regmap_get_val_endian(struct device *dev, ...@@ -515,18 +515,6 @@ enum regmap_endian regmap_get_val_endian(struct device *dev,
} }
EXPORT_SYMBOL_GPL(regmap_get_val_endian); EXPORT_SYMBOL_GPL(regmap_get_val_endian);
/**
* 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.
*/
struct regmap *__regmap_init(struct device *dev, struct regmap *__regmap_init(struct device *dev,
const struct regmap_bus *bus, const struct regmap_bus *bus,
void *bus_context, void *bus_context,
...@@ -912,19 +900,6 @@ static void devm_regmap_release(struct device *dev, void *res) ...@@ -912,19 +900,6 @@ static void devm_regmap_release(struct device *dev, void *res)
regmap_exit(*(struct regmap **)res); regmap_exit(*(struct regmap **)res);
} }
/**
* devm_regmap_init(): Initialise managed 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. The
* map will be automatically freed by the device management code.
*/
struct regmap *__devm_regmap_init(struct device *dev, struct regmap *__devm_regmap_init(struct device *dev,
const struct regmap_bus *bus, const struct regmap_bus *bus,
void *bus_context, void *bus_context,
......
...@@ -419,65 +419,202 @@ struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97, ...@@ -419,65 +419,202 @@ struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97,
#define __regmap_lockdep_wrapper(fn, name, ...) fn(__VA_ARGS__, NULL, NULL) #define __regmap_lockdep_wrapper(fn, name, ...) fn(__VA_ARGS__, NULL, NULL)
#endif #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) \ #define regmap_init(dev, bus, bus_context, config) \
__regmap_lockdep_wrapper(__regmap_init, #config, \ __regmap_lockdep_wrapper(__regmap_init, #config, \
dev, bus, bus_context, config) dev, bus, bus_context, config)
int regmap_attach_dev(struct device *dev, struct regmap *map, int regmap_attach_dev(struct device *dev, struct regmap *map,
const struct regmap_config *config); const struct regmap_config *config);
/**
* 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) \ #define regmap_init_i2c(i2c, config) \
__regmap_lockdep_wrapper(__regmap_init_i2c, #config, \ __regmap_lockdep_wrapper(__regmap_init_i2c, #config, \
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) \ #define regmap_init_spi(dev, config) \
__regmap_lockdep_wrapper(__regmap_init_spi, #config, \ __regmap_lockdep_wrapper(__regmap_init_spi, #config, \
dev, 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) \ #define regmap_init_spmi_base(dev, config) \
__regmap_lockdep_wrapper(__regmap_init_spmi_base, #config, \ __regmap_lockdep_wrapper(__regmap_init_spmi_base, #config, \
dev, 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) \ #define regmap_init_spmi_ext(dev, config) \
__regmap_lockdep_wrapper(__regmap_init_spmi_ext, #config, \ __regmap_lockdep_wrapper(__regmap_init_spmi_ext, #config, \
dev, 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) \ #define regmap_init_mmio_clk(dev, clk_id, regs, config) \
__regmap_lockdep_wrapper(__regmap_init_mmio_clk, #config, \ __regmap_lockdep_wrapper(__regmap_init_mmio_clk, #config, \
dev, clk_id, regs, config) dev, clk_id, regs, config)
/**
* regmap_init_mmio(): Initialise register map
*
* @dev: Device that will be interacted with
* @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(dev, regs, config) \
regmap_init_mmio_clk(dev, NULL, regs, config)
/**
* regmap_init_ac97(): Initialise AC'97 register map
*
* @ac97: 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_ac97(ac97, config) \ #define regmap_init_ac97(ac97, config) \
__regmap_lockdep_wrapper(__regmap_init_ac97, #config, \ __regmap_lockdep_wrapper(__regmap_init_ac97, #config, \
ac97, config) ac97, config)
bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
/**
* devm_regmap_init(): Initialise managed 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. The
* map will be automatically freed by the device management code.
*/
#define devm_regmap_init(dev, bus, bus_context, config) \ #define devm_regmap_init(dev, bus, bus_context, config) \
__regmap_lockdep_wrapper(__devm_regmap_init, #config, \ __regmap_lockdep_wrapper(__devm_regmap_init, #config, \
dev, bus, bus_context, config) dev, bus, bus_context, config)
/**
* devm_regmap_init_i2c(): Initialise managed 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. The regmap will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_i2c(i2c, config) \ #define devm_regmap_init_i2c(i2c, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_i2c, #config, \ __regmap_lockdep_wrapper(__devm_regmap_init_i2c, #config, \
i2c, config) i2c, config)
/**
* devm_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. The map will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_spi(dev, config) \ #define devm_regmap_init_spi(dev, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_spi, #config, \ __regmap_lockdep_wrapper(__devm_regmap_init_spi, #config, \
dev, config) dev, config)
/**
* devm_regmap_init_spmi_base(): Create managed regmap for 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. The regmap will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_spmi_base(dev, config) \ #define devm_regmap_init_spmi_base(dev, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_spmi_base, #config, \ __regmap_lockdep_wrapper(__devm_regmap_init_spmi_base, #config, \
dev, config) dev, config)
/**
* devm_regmap_init_spmi_ext(): Create managed regmap for Ext 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. The regmap will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_spmi_ext(dev, config) \ #define devm_regmap_init_spmi_ext(dev, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_spmi_ext, #config, \ __regmap_lockdep_wrapper(__devm_regmap_init_spmi_ext, #config, \
dev, config) dev, config)
#define devm_regmap_init_mmio_clk(dev, clk_id, regs, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_mmio_clk, #config, \
dev, clk_id, regs, config)
#define devm_regmap_init_ac97(ac97, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_ac97, #config, \
ac97, config)
/** /**
* regmap_init_mmio(): Initialise register map * devm_regmap_init_mmio_clk(): Initialise managed register map with clock
* *
* @dev: Device that will be interacted with * @dev: Device that will be interacted with
* @clk_id: register clock consumer ID
* @regs: Pointer to memory-mapped IO region * @regs: Pointer to memory-mapped IO region
* @config: Configuration for register map * @config: Configuration for register map
* *
* The return value will be an ERR_PTR() on error or a valid pointer to * The return value will be an ERR_PTR() on error or a valid pointer
* a struct regmap. * to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/ */
#define regmap_init_mmio(dev, regs, config) \ #define devm_regmap_init_mmio_clk(dev, clk_id, regs, config) \
regmap_init_mmio_clk(dev, NULL, regs, config) __regmap_lockdep_wrapper(__devm_regmap_init_mmio_clk, #config, \
dev, clk_id, regs, config)
/** /**
* devm_regmap_init_mmio(): Initialise managed register map * devm_regmap_init_mmio(): Initialise managed register map
...@@ -493,6 +630,20 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); ...@@ -493,6 +630,20 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
#define devm_regmap_init_mmio(dev, regs, config) \ #define devm_regmap_init_mmio(dev, regs, config) \
devm_regmap_init_mmio_clk(dev, NULL, regs, config) devm_regmap_init_mmio_clk(dev, NULL, regs, config)
/**
* devm_regmap_init_ac97(): Initialise AC'97 register map
*
* @ac97: 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. The regmap will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_ac97(ac97, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_ac97, #config, \
ac97, config)
void regmap_exit(struct regmap *map); void regmap_exit(struct regmap *map);
int regmap_reinit_cache(struct regmap *map, int regmap_reinit_cache(struct regmap *map,
const struct regmap_config *config); const struct regmap_config *config);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment