aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/regmap.h47
1 files changed, 41 insertions, 6 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index b7e95bf942c9..f0480a3297e4 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -285,9 +285,9 @@ struct regmap *regmap_init_i2c(struct i2c_client *i2c,
285 const struct regmap_config *config); 285 const struct regmap_config *config);
286struct regmap *regmap_init_spi(struct spi_device *dev, 286struct regmap *regmap_init_spi(struct spi_device *dev,
287 const struct regmap_config *config); 287 const struct regmap_config *config);
288struct regmap *regmap_init_mmio(struct device *dev, 288struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id,
289 void __iomem *regs, 289 void __iomem *regs,
290 const struct regmap_config *config); 290 const struct regmap_config *config);
291 291
292struct regmap *devm_regmap_init(struct device *dev, 292struct regmap *devm_regmap_init(struct device *dev,
293 const struct regmap_bus *bus, 293 const struct regmap_bus *bus,
@@ -297,9 +297,44 @@ struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c,
297 const struct regmap_config *config); 297 const struct regmap_config *config);
298struct regmap *devm_regmap_init_spi(struct spi_device *dev, 298struct regmap *devm_regmap_init_spi(struct spi_device *dev,
299 const struct regmap_config *config); 299 const struct regmap_config *config);
300struct regmap *devm_regmap_init_mmio(struct device *dev, 300struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id,
301 void __iomem *regs, 301 void __iomem *regs,
302 const struct regmap_config *config); 302 const struct regmap_config *config);
303
304/**
305 * regmap_init_mmio(): Initialise register map
306 *
307 * @dev: Device that will be interacted with
308 * @regs: Pointer to memory-mapped IO region
309 * @config: Configuration for register map
310 *
311 * The return value will be an ERR_PTR() on error or a valid pointer to
312 * a struct regmap.
313 */
314static inline struct regmap *regmap_init_mmio(struct device *dev,
315 void __iomem *regs,
316 const struct regmap_config *config)
317{
318 return regmap_init_mmio_clk(dev, NULL, regs, config);
319}
320
321/**
322 * devm_regmap_init_mmio(): Initialise managed register map
323 *
324 * @dev: Device that will be interacted with
325 * @regs: Pointer to memory-mapped IO region
326 * @config: Configuration for register map
327 *
328 * The return value will be an ERR_PTR() on error or a valid pointer
329 * to a struct regmap. The regmap will be automatically freed by the
330 * device management code.
331 */
332static inline struct regmap *devm_regmap_init_mmio(struct device *dev,
333 void __iomem *regs,
334 const struct regmap_config *config)
335{
336 return devm_regmap_init_mmio_clk(dev, NULL, regs, config);
337}
303 338
304void regmap_exit(struct regmap *map); 339void regmap_exit(struct regmap *map);
305int regmap_reinit_cache(struct regmap *map, 340int regmap_reinit_cache(struct regmap *map,