diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2015-08-11 06:04:21 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-08-11 12:21:44 -0400 |
commit | 1ed8111443ae8caa455e7107031da36d1a6d351a (patch) | |
tree | c1e2d17a8ca32b9b66ff8f5056fe133295eeb40f | |
parent | 3cfe7a74d42b7e3644f8b2b26aa20146d4f90f0f (diff) |
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: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/base/regmap/regmap-ac97.c | 19 | ||||
-rw-r--r-- | drivers/base/regmap/regmap-i2c.c | 19 | ||||
-rw-r--r-- | drivers/base/regmap/regmap-mmio.c | 23 | ||||
-rw-r--r-- | drivers/base/regmap/regmap-spi.c | 19 | ||||
-rw-r--r-- | drivers/base/regmap/regmap-spmi.c | 34 | ||||
-rw-r--r-- | drivers/base/regmap/regmap.c | 25 | ||||
-rw-r--r-- | include/linux/regmap.h | 173 |
7 files changed, 162 insertions, 150 deletions
diff --git a/drivers/base/regmap/regmap-ac97.c b/drivers/base/regmap/regmap-ac97.c index aa631be8b821..c03ebfd4c731 100644 --- a/drivers/base/regmap/regmap-ac97.c +++ b/drivers/base/regmap/regmap-ac97.c | |||
@@ -78,15 +78,6 @@ static const struct regmap_bus ac97_regmap_bus = { | |||
78 | .reg_read = regmap_ac97_reg_read, | 78 | .reg_read = regmap_ac97_reg_read, |
79 | }; | 79 | }; |
80 | 80 | ||
81 | /** | ||
82 | * regmap_init_ac97(): Initialise AC'97 register map | ||
83 | * | ||
84 | * @ac97: Device that will be interacted with | ||
85 | * @config: Configuration for register map | ||
86 | * | ||
87 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
88 | * a struct regmap. | ||
89 | */ | ||
90 | struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97, | 81 | struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97, |
91 | const struct regmap_config *config, | 82 | const struct regmap_config *config, |
92 | struct lock_class_key *lock_key, | 83 | struct lock_class_key *lock_key, |
@@ -97,16 +88,6 @@ struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97, | |||
97 | } | 88 | } |
98 | EXPORT_SYMBOL_GPL(__regmap_init_ac97); | 89 | EXPORT_SYMBOL_GPL(__regmap_init_ac97); |
99 | 90 | ||
100 | /** | ||
101 | * devm_regmap_init_ac97(): Initialise AC'97 register map | ||
102 | * | ||
103 | * @ac97: Device that will be interacted with | ||
104 | * @config: Configuration for register map | ||
105 | * | ||
106 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
107 | * to a struct regmap. The regmap will be automatically freed by the | ||
108 | * device management code. | ||
109 | */ | ||
110 | struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97, | 91 | struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97, |
111 | const struct regmap_config *config, | 92 | const struct regmap_config *config, |
112 | struct lock_class_key *lock_key, | 93 | struct lock_class_key *lock_key, |
diff --git a/drivers/base/regmap/regmap-i2c.c b/drivers/base/regmap/regmap-i2c.c index 3163b22e2baf..7007d6ea333c 100644 --- a/drivers/base/regmap/regmap-i2c.c +++ b/drivers/base/regmap/regmap-i2c.c | |||
@@ -233,15 +233,6 @@ static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c, | |||
233 | return ERR_PTR(-ENOTSUPP); | 233 | return ERR_PTR(-ENOTSUPP); |
234 | } | 234 | } |
235 | 235 | ||
236 | /** | ||
237 | * regmap_init_i2c(): Initialise register map | ||
238 | * | ||
239 | * @i2c: Device that will be interacted with | ||
240 | * @config: Configuration for register map | ||
241 | * | ||
242 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
243 | * a struct regmap. | ||
244 | */ | ||
245 | struct regmap *__regmap_init_i2c(struct i2c_client *i2c, | 236 | struct regmap *__regmap_init_i2c(struct i2c_client *i2c, |
246 | const struct regmap_config *config, | 237 | const struct regmap_config *config, |
247 | struct lock_class_key *lock_key, | 238 | struct lock_class_key *lock_key, |
@@ -257,16 +248,6 @@ struct regmap *__regmap_init_i2c(struct i2c_client *i2c, | |||
257 | } | 248 | } |
258 | EXPORT_SYMBOL_GPL(__regmap_init_i2c); | 249 | EXPORT_SYMBOL_GPL(__regmap_init_i2c); |
259 | 250 | ||
260 | /** | ||
261 | * devm_regmap_init_i2c(): Initialise managed register map | ||
262 | * | ||
263 | * @i2c: Device that will be interacted with | ||
264 | * @config: Configuration for register map | ||
265 | * | ||
266 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
267 | * to a struct regmap. The regmap will be automatically freed by the | ||
268 | * device management code. | ||
269 | */ | ||
270 | struct regmap *__devm_regmap_init_i2c(struct i2c_client *i2c, | 251 | struct regmap *__devm_regmap_init_i2c(struct i2c_client *i2c, |
271 | const struct regmap_config *config, | 252 | const struct regmap_config *config, |
272 | struct lock_class_key *lock_key, | 253 | struct lock_class_key *lock_key, |
diff --git a/drivers/base/regmap/regmap-mmio.c b/drivers/base/regmap/regmap-mmio.c index a1b2b270e4bc..426a57e41ac7 100644 --- a/drivers/base/regmap/regmap-mmio.c +++ b/drivers/base/regmap/regmap-mmio.c | |||
@@ -296,17 +296,6 @@ err_free: | |||
296 | return ERR_PTR(ret); | 296 | return ERR_PTR(ret); |
297 | } | 297 | } |
298 | 298 | ||
299 | /** | ||
300 | * regmap_init_mmio_clk(): Initialise register map with register clock | ||
301 | * | ||
302 | * @dev: Device that will be interacted with | ||
303 | * @clk_id: register clock consumer ID | ||
304 | * @regs: Pointer to memory-mapped IO region | ||
305 | * @config: Configuration for register map | ||
306 | * | ||
307 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
308 | * a struct regmap. | ||
309 | */ | ||
310 | struct regmap *__regmap_init_mmio_clk(struct device *dev, const char *clk_id, | 299 | struct regmap *__regmap_init_mmio_clk(struct device *dev, const char *clk_id, |
311 | void __iomem *regs, | 300 | void __iomem *regs, |
312 | const struct regmap_config *config, | 301 | const struct regmap_config *config, |
@@ -324,18 +313,6 @@ struct regmap *__regmap_init_mmio_clk(struct device *dev, const char *clk_id, | |||
324 | } | 313 | } |
325 | EXPORT_SYMBOL_GPL(__regmap_init_mmio_clk); | 314 | EXPORT_SYMBOL_GPL(__regmap_init_mmio_clk); |
326 | 315 | ||
327 | /** | ||
328 | * devm_regmap_init_mmio_clk(): Initialise managed register map with clock | ||
329 | * | ||
330 | * @dev: Device that will be interacted with | ||
331 | * @clk_id: register clock consumer ID | ||
332 | * @regs: Pointer to memory-mapped IO region | ||
333 | * @config: Configuration for register map | ||
334 | * | ||
335 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
336 | * to a struct regmap. The regmap will be automatically freed by the | ||
337 | * device management code. | ||
338 | */ | ||
339 | struct regmap *__devm_regmap_init_mmio_clk(struct device *dev, | 316 | struct regmap *__devm_regmap_init_mmio_clk(struct device *dev, |
340 | const char *clk_id, | 317 | const char *clk_id, |
341 | void __iomem *regs, | 318 | void __iomem *regs, |
diff --git a/drivers/base/regmap/regmap-spi.c b/drivers/base/regmap/regmap-spi.c index 4c7850d660d1..edd9a839d004 100644 --- a/drivers/base/regmap/regmap-spi.c +++ b/drivers/base/regmap/regmap-spi.c | |||
@@ -113,15 +113,6 @@ static struct regmap_bus regmap_spi = { | |||
113 | .val_format_endian_default = REGMAP_ENDIAN_BIG, | 113 | .val_format_endian_default = REGMAP_ENDIAN_BIG, |
114 | }; | 114 | }; |
115 | 115 | ||
116 | /** | ||
117 | * regmap_init_spi(): Initialise register map | ||
118 | * | ||
119 | * @spi: Device that will be interacted with | ||
120 | * @config: Configuration for register map | ||
121 | * | ||
122 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
123 | * a struct regmap. | ||
124 | */ | ||
125 | struct regmap *__regmap_init_spi(struct spi_device *spi, | 116 | struct regmap *__regmap_init_spi(struct spi_device *spi, |
126 | const struct regmap_config *config, | 117 | const struct regmap_config *config, |
127 | struct lock_class_key *lock_key, | 118 | struct lock_class_key *lock_key, |
@@ -132,16 +123,6 @@ struct regmap *__regmap_init_spi(struct spi_device *spi, | |||
132 | } | 123 | } |
133 | EXPORT_SYMBOL_GPL(__regmap_init_spi); | 124 | EXPORT_SYMBOL_GPL(__regmap_init_spi); |
134 | 125 | ||
135 | /** | ||
136 | * devm_regmap_init_spi(): Initialise register map | ||
137 | * | ||
138 | * @spi: Device that will be interacted with | ||
139 | * @config: Configuration for register map | ||
140 | * | ||
141 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
142 | * to a struct regmap. The map will be automatically freed by the | ||
143 | * device management code. | ||
144 | */ | ||
145 | struct regmap *__devm_regmap_init_spi(struct spi_device *spi, | 126 | struct regmap *__devm_regmap_init_spi(struct spi_device *spi, |
146 | const struct regmap_config *config, | 127 | const struct regmap_config *config, |
147 | struct lock_class_key *lock_key, | 128 | struct lock_class_key *lock_key, |
diff --git a/drivers/base/regmap/regmap-spmi.c b/drivers/base/regmap/regmap-spmi.c index 7f50f5862d39..7e58f6560399 100644 --- a/drivers/base/regmap/regmap-spmi.c +++ b/drivers/base/regmap/regmap-spmi.c | |||
@@ -91,14 +91,6 @@ static struct regmap_bus regmap_spmi_base = { | |||
91 | .val_format_endian_default = REGMAP_ENDIAN_NATIVE, | 91 | .val_format_endian_default = REGMAP_ENDIAN_NATIVE, |
92 | }; | 92 | }; |
93 | 93 | ||
94 | /** | ||
95 | * regmap_init_spmi_base(): Create regmap for the Base register space | ||
96 | * @sdev: SPMI device that will be interacted with | ||
97 | * @config: Configuration for register map | ||
98 | * | ||
99 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
100 | * a struct regmap. | ||
101 | */ | ||
102 | struct regmap *__regmap_init_spmi_base(struct spmi_device *sdev, | 94 | struct regmap *__regmap_init_spmi_base(struct spmi_device *sdev, |
103 | const struct regmap_config *config, | 95 | const struct regmap_config *config, |
104 | struct lock_class_key *lock_key, | 96 | struct lock_class_key *lock_key, |
@@ -109,15 +101,6 @@ struct regmap *__regmap_init_spmi_base(struct spmi_device *sdev, | |||
109 | } | 101 | } |
110 | EXPORT_SYMBOL_GPL(__regmap_init_spmi_base); | 102 | EXPORT_SYMBOL_GPL(__regmap_init_spmi_base); |
111 | 103 | ||
112 | /** | ||
113 | * devm_regmap_init_spmi_base(): Create managed regmap for Base register space | ||
114 | * @sdev: SPMI device that will be interacted with | ||
115 | * @config: Configuration for register map | ||
116 | * | ||
117 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
118 | * to a struct regmap. The regmap will be automatically freed by the | ||
119 | * device management code. | ||
120 | */ | ||
121 | struct regmap *__devm_regmap_init_spmi_base(struct spmi_device *sdev, | 104 | struct regmap *__devm_regmap_init_spmi_base(struct spmi_device *sdev, |
122 | const struct regmap_config *config, | 105 | const struct regmap_config *config, |
123 | struct lock_class_key *lock_key, | 106 | struct lock_class_key *lock_key, |
@@ -228,14 +211,6 @@ static struct regmap_bus regmap_spmi_ext = { | |||
228 | .val_format_endian_default = REGMAP_ENDIAN_NATIVE, | 211 | .val_format_endian_default = REGMAP_ENDIAN_NATIVE, |
229 | }; | 212 | }; |
230 | 213 | ||
231 | /** | ||
232 | * regmap_init_spmi_ext(): Create regmap for Ext register space | ||
233 | * @sdev: Device that will be interacted with | ||
234 | * @config: Configuration for register map | ||
235 | * | ||
236 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
237 | * a struct regmap. | ||
238 | */ | ||
239 | struct regmap *__regmap_init_spmi_ext(struct spmi_device *sdev, | 214 | struct regmap *__regmap_init_spmi_ext(struct spmi_device *sdev, |
240 | const struct regmap_config *config, | 215 | const struct regmap_config *config, |
241 | struct lock_class_key *lock_key, | 216 | struct lock_class_key *lock_key, |
@@ -246,15 +221,6 @@ struct regmap *__regmap_init_spmi_ext(struct spmi_device *sdev, | |||
246 | } | 221 | } |
247 | EXPORT_SYMBOL_GPL(__regmap_init_spmi_ext); | 222 | EXPORT_SYMBOL_GPL(__regmap_init_spmi_ext); |
248 | 223 | ||
249 | /** | ||
250 | * devm_regmap_init_spmi_ext(): Create managed regmap for Ext register space | ||
251 | * @sdev: SPMI device that will be interacted with | ||
252 | * @config: Configuration for register map | ||
253 | * | ||
254 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
255 | * to a struct regmap. The regmap will be automatically freed by the | ||
256 | * device management code. | ||
257 | */ | ||
258 | struct regmap *__devm_regmap_init_spmi_ext(struct spmi_device *sdev, | 224 | struct regmap *__devm_regmap_init_spmi_ext(struct spmi_device *sdev, |
259 | const struct regmap_config *config, | 225 | const struct regmap_config *config, |
260 | struct lock_class_key *lock_key, | 226 | struct lock_class_key *lock_key, |
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index b9fddccd6e06..53ba9d9e17d1 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c | |||
@@ -515,18 +515,6 @@ enum regmap_endian regmap_get_val_endian(struct device *dev, | |||
515 | } | 515 | } |
516 | EXPORT_SYMBOL_GPL(regmap_get_val_endian); | 516 | EXPORT_SYMBOL_GPL(regmap_get_val_endian); |
517 | 517 | ||
518 | /** | ||
519 | * regmap_init(): Initialise register map | ||
520 | * | ||
521 | * @dev: Device that will be interacted with | ||
522 | * @bus: Bus-specific callbacks to use with device | ||
523 | * @bus_context: Data passed to bus-specific callbacks | ||
524 | * @config: Configuration for register map | ||
525 | * | ||
526 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
527 | * a struct regmap. This function should generally not be called | ||
528 | * directly, it should be called by bus-specific init functions. | ||
529 | */ | ||
530 | struct regmap *__regmap_init(struct device *dev, | 518 | struct regmap *__regmap_init(struct device *dev, |
531 | const struct regmap_bus *bus, | 519 | const struct regmap_bus *bus, |
532 | void *bus_context, | 520 | void *bus_context, |
@@ -912,19 +900,6 @@ static void devm_regmap_release(struct device *dev, void *res) | |||
912 | regmap_exit(*(struct regmap **)res); | 900 | regmap_exit(*(struct regmap **)res); |
913 | } | 901 | } |
914 | 902 | ||
915 | /** | ||
916 | * devm_regmap_init(): Initialise managed register map | ||
917 | * | ||
918 | * @dev: Device that will be interacted with | ||
919 | * @bus: Bus-specific callbacks to use with device | ||
920 | * @bus_context: Data passed to bus-specific callbacks | ||
921 | * @config: Configuration for register map | ||
922 | * | ||
923 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
924 | * to a struct regmap. This function should generally not be called | ||
925 | * directly, it should be called by bus-specific init functions. The | ||
926 | * map will be automatically freed by the device management code. | ||
927 | */ | ||
928 | struct regmap *__devm_regmap_init(struct device *dev, | 903 | struct regmap *__devm_regmap_init(struct device *dev, |
929 | const struct regmap_bus *bus, | 904 | const struct regmap_bus *bus, |
930 | void *bus_context, | 905 | void *bus_context, |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 5d7027286032..ee032eca630d 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -419,65 +419,202 @@ struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97, | |||
419 | #define __regmap_lockdep_wrapper(fn, name, ...) fn(__VA_ARGS__, NULL, NULL) | 419 | #define __regmap_lockdep_wrapper(fn, name, ...) fn(__VA_ARGS__, NULL, NULL) |
420 | #endif | 420 | #endif |
421 | 421 | ||
422 | /** | ||
423 | * regmap_init(): Initialise register map | ||
424 | * | ||
425 | * @dev: Device that will be interacted with | ||
426 | * @bus: Bus-specific callbacks to use with device | ||
427 | * @bus_context: Data passed to bus-specific callbacks | ||
428 | * @config: Configuration for register map | ||
429 | * | ||
430 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
431 | * a struct regmap. This function should generally not be called | ||
432 | * directly, it should be called by bus-specific init functions. | ||
433 | */ | ||
422 | #define regmap_init(dev, bus, bus_context, config) \ | 434 | #define regmap_init(dev, bus, bus_context, config) \ |
423 | __regmap_lockdep_wrapper(__regmap_init, #config, \ | 435 | __regmap_lockdep_wrapper(__regmap_init, #config, \ |
424 | dev, bus, bus_context, config) | 436 | dev, bus, bus_context, config) |
425 | int regmap_attach_dev(struct device *dev, struct regmap *map, | 437 | int regmap_attach_dev(struct device *dev, struct regmap *map, |
426 | const struct regmap_config *config); | 438 | const struct regmap_config *config); |
439 | |||
440 | /** | ||
441 | * regmap_init_i2c(): Initialise register map | ||
442 | * | ||
443 | * @i2c: Device that will be interacted with | ||
444 | * @config: Configuration for register map | ||
445 | * | ||
446 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
447 | * a struct regmap. | ||
448 | */ | ||
427 | #define regmap_init_i2c(i2c, config) \ | 449 | #define regmap_init_i2c(i2c, config) \ |
428 | __regmap_lockdep_wrapper(__regmap_init_i2c, #config, \ | 450 | __regmap_lockdep_wrapper(__regmap_init_i2c, #config, \ |
429 | i2c, config) | 451 | i2c, config) |
452 | |||
453 | /** | ||
454 | * regmap_init_spi(): Initialise register map | ||
455 | * | ||
456 | * @spi: Device that will be interacted with | ||
457 | * @config: Configuration for register map | ||
458 | * | ||
459 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
460 | * a struct regmap. | ||
461 | */ | ||
430 | #define regmap_init_spi(dev, config) \ | 462 | #define regmap_init_spi(dev, config) \ |
431 | __regmap_lockdep_wrapper(__regmap_init_spi, #config, \ | 463 | __regmap_lockdep_wrapper(__regmap_init_spi, #config, \ |
432 | dev, config) | 464 | dev, config) |
465 | |||
466 | /** | ||
467 | * regmap_init_spmi_base(): Create regmap for the Base register space | ||
468 | * @sdev: SPMI device that will be interacted with | ||
469 | * @config: Configuration for register map | ||
470 | * | ||
471 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
472 | * a struct regmap. | ||
473 | */ | ||
433 | #define regmap_init_spmi_base(dev, config) \ | 474 | #define regmap_init_spmi_base(dev, config) \ |
434 | __regmap_lockdep_wrapper(__regmap_init_spmi_base, #config, \ | 475 | __regmap_lockdep_wrapper(__regmap_init_spmi_base, #config, \ |
435 | dev, config) | 476 | dev, config) |
477 | |||
478 | /** | ||
479 | * regmap_init_spmi_ext(): Create regmap for Ext register space | ||
480 | * @sdev: Device that will be interacted with | ||
481 | * @config: Configuration for register map | ||
482 | * | ||
483 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
484 | * a struct regmap. | ||
485 | */ | ||
436 | #define regmap_init_spmi_ext(dev, config) \ | 486 | #define regmap_init_spmi_ext(dev, config) \ |
437 | __regmap_lockdep_wrapper(__regmap_init_spmi_ext, #config, \ | 487 | __regmap_lockdep_wrapper(__regmap_init_spmi_ext, #config, \ |
438 | dev, config) | 488 | dev, config) |
489 | |||
490 | /** | ||
491 | * regmap_init_mmio_clk(): Initialise register map with register clock | ||
492 | * | ||
493 | * @dev: Device that will be interacted with | ||
494 | * @clk_id: register clock consumer ID | ||
495 | * @regs: Pointer to memory-mapped IO region | ||
496 | * @config: Configuration for register map | ||
497 | * | ||
498 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
499 | * a struct regmap. | ||
500 | */ | ||
439 | #define regmap_init_mmio_clk(dev, clk_id, regs, config) \ | 501 | #define regmap_init_mmio_clk(dev, clk_id, regs, config) \ |
440 | __regmap_lockdep_wrapper(__regmap_init_mmio_clk, #config, \ | 502 | __regmap_lockdep_wrapper(__regmap_init_mmio_clk, #config, \ |
441 | dev, clk_id, regs, config) | 503 | dev, clk_id, regs, config) |
504 | |||
505 | /** | ||
506 | * regmap_init_mmio(): Initialise register map | ||
507 | * | ||
508 | * @dev: Device that will be interacted with | ||
509 | * @regs: Pointer to memory-mapped IO region | ||
510 | * @config: Configuration for register map | ||
511 | * | ||
512 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
513 | * a struct regmap. | ||
514 | */ | ||
515 | #define regmap_init_mmio(dev, regs, config) \ | ||
516 | regmap_init_mmio_clk(dev, NULL, regs, config) | ||
517 | |||
518 | /** | ||
519 | * regmap_init_ac97(): Initialise AC'97 register map | ||
520 | * | ||
521 | * @ac97: Device that will be interacted with | ||
522 | * @config: Configuration for register map | ||
523 | * | ||
524 | * The return value will be an ERR_PTR() on error or a valid pointer to | ||
525 | * a struct regmap. | ||
526 | */ | ||
442 | #define regmap_init_ac97(ac97, config) \ | 527 | #define regmap_init_ac97(ac97, config) \ |
443 | __regmap_lockdep_wrapper(__regmap_init_ac97, #config, \ | 528 | __regmap_lockdep_wrapper(__regmap_init_ac97, #config, \ |
444 | ac97, config) | 529 | ac97, config) |
445 | bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); | 530 | bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); |
446 | 531 | ||
532 | /** | ||
533 | * devm_regmap_init(): Initialise managed register map | ||
534 | * | ||
535 | * @dev: Device that will be interacted with | ||
536 | * @bus: Bus-specific callbacks to use with device | ||
537 | * @bus_context: Data passed to bus-specific callbacks | ||
538 | * @config: Configuration for register map | ||
539 | * | ||
540 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
541 | * to a struct regmap. This function should generally not be called | ||
542 | * directly, it should be called by bus-specific init functions. The | ||
543 | * map will be automatically freed by the device management code. | ||
544 | */ | ||
447 | #define devm_regmap_init(dev, bus, bus_context, config) \ | 545 | #define devm_regmap_init(dev, bus, bus_context, config) \ |
448 | __regmap_lockdep_wrapper(__devm_regmap_init, #config, \ | 546 | __regmap_lockdep_wrapper(__devm_regmap_init, #config, \ |
449 | dev, bus, bus_context, config) | 547 | dev, bus, bus_context, config) |
548 | |||
549 | /** | ||
550 | * devm_regmap_init_i2c(): Initialise managed register map | ||
551 | * | ||
552 | * @i2c: Device that will be interacted with | ||
553 | * @config: Configuration for register map | ||
554 | * | ||
555 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
556 | * to a struct regmap. The regmap will be automatically freed by the | ||
557 | * device management code. | ||
558 | */ | ||
450 | #define devm_regmap_init_i2c(i2c, config) \ | 559 | #define devm_regmap_init_i2c(i2c, config) \ |
451 | __regmap_lockdep_wrapper(__devm_regmap_init_i2c, #config, \ | 560 | __regmap_lockdep_wrapper(__devm_regmap_init_i2c, #config, \ |
452 | i2c, config) | 561 | i2c, config) |
562 | |||
563 | /** | ||
564 | * devm_regmap_init_spi(): Initialise register map | ||
565 | * | ||
566 | * @spi: Device that will be interacted with | ||
567 | * @config: Configuration for register map | ||
568 | * | ||
569 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
570 | * to a struct regmap. The map will be automatically freed by the | ||
571 | * device management code. | ||
572 | */ | ||
453 | #define devm_regmap_init_spi(dev, config) \ | 573 | #define devm_regmap_init_spi(dev, config) \ |
454 | __regmap_lockdep_wrapper(__devm_regmap_init_spi, #config, \ | 574 | __regmap_lockdep_wrapper(__devm_regmap_init_spi, #config, \ |
455 | dev, config) | 575 | dev, config) |
576 | |||
577 | /** | ||
578 | * devm_regmap_init_spmi_base(): Create managed regmap for Base register space | ||
579 | * @sdev: SPMI device that will be interacted with | ||
580 | * @config: Configuration for register map | ||
581 | * | ||
582 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
583 | * to a struct regmap. The regmap will be automatically freed by the | ||
584 | * device management code. | ||
585 | */ | ||
456 | #define devm_regmap_init_spmi_base(dev, config) \ | 586 | #define devm_regmap_init_spmi_base(dev, config) \ |
457 | __regmap_lockdep_wrapper(__devm_regmap_init_spmi_base, #config, \ | 587 | __regmap_lockdep_wrapper(__devm_regmap_init_spmi_base, #config, \ |
458 | dev, config) | 588 | dev, config) |
589 | |||
590 | /** | ||
591 | * devm_regmap_init_spmi_ext(): Create managed regmap for Ext register space | ||
592 | * @sdev: SPMI device that will be interacted with | ||
593 | * @config: Configuration for register map | ||
594 | * | ||
595 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
596 | * to a struct regmap. The regmap will be automatically freed by the | ||
597 | * device management code. | ||
598 | */ | ||
459 | #define devm_regmap_init_spmi_ext(dev, config) \ | 599 | #define devm_regmap_init_spmi_ext(dev, config) \ |
460 | __regmap_lockdep_wrapper(__devm_regmap_init_spmi_ext, #config, \ | 600 | __regmap_lockdep_wrapper(__devm_regmap_init_spmi_ext, #config, \ |
461 | dev, config) | 601 | dev, config) |
462 | #define devm_regmap_init_mmio_clk(dev, clk_id, regs, config) \ | ||
463 | __regmap_lockdep_wrapper(__devm_regmap_init_mmio_clk, #config, \ | ||
464 | dev, clk_id, regs, config) | ||
465 | #define devm_regmap_init_ac97(ac97, config) \ | ||
466 | __regmap_lockdep_wrapper(__devm_regmap_init_ac97, #config, \ | ||
467 | ac97, config) | ||
468 | 602 | ||
469 | /** | 603 | /** |
470 | * regmap_init_mmio(): Initialise register map | 604 | * devm_regmap_init_mmio_clk(): Initialise managed register map with clock |
471 | * | 605 | * |
472 | * @dev: Device that will be interacted with | 606 | * @dev: Device that will be interacted with |
607 | * @clk_id: register clock consumer ID | ||
473 | * @regs: Pointer to memory-mapped IO region | 608 | * @regs: Pointer to memory-mapped IO region |
474 | * @config: Configuration for register map | 609 | * @config: Configuration for register map |
475 | * | 610 | * |
476 | * The return value will be an ERR_PTR() on error or a valid pointer to | 611 | * The return value will be an ERR_PTR() on error or a valid pointer |
477 | * a struct regmap. | 612 | * to a struct regmap. The regmap will be automatically freed by the |
613 | * device management code. | ||
478 | */ | 614 | */ |
479 | #define regmap_init_mmio(dev, regs, config) \ | 615 | #define devm_regmap_init_mmio_clk(dev, clk_id, regs, config) \ |
480 | regmap_init_mmio_clk(dev, NULL, regs, config) | 616 | __regmap_lockdep_wrapper(__devm_regmap_init_mmio_clk, #config, \ |
617 | dev, clk_id, regs, config) | ||
481 | 618 | ||
482 | /** | 619 | /** |
483 | * devm_regmap_init_mmio(): Initialise managed register map | 620 | * devm_regmap_init_mmio(): Initialise managed register map |
@@ -493,6 +630,20 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); | |||
493 | #define devm_regmap_init_mmio(dev, regs, config) \ | 630 | #define devm_regmap_init_mmio(dev, regs, config) \ |
494 | devm_regmap_init_mmio_clk(dev, NULL, regs, config) | 631 | devm_regmap_init_mmio_clk(dev, NULL, regs, config) |
495 | 632 | ||
633 | /** | ||
634 | * devm_regmap_init_ac97(): Initialise AC'97 register map | ||
635 | * | ||
636 | * @ac97: Device that will be interacted with | ||
637 | * @config: Configuration for register map | ||
638 | * | ||
639 | * The return value will be an ERR_PTR() on error or a valid pointer | ||
640 | * to a struct regmap. The regmap will be automatically freed by the | ||
641 | * device management code. | ||
642 | */ | ||
643 | #define devm_regmap_init_ac97(ac97, config) \ | ||
644 | __regmap_lockdep_wrapper(__devm_regmap_init_ac97, #config, \ | ||
645 | ac97, config) | ||
646 | |||
496 | void regmap_exit(struct regmap *map); | 647 | void regmap_exit(struct regmap *map); |
497 | int regmap_reinit_cache(struct regmap *map, | 648 | int regmap_reinit_cache(struct regmap *map, |
498 | const struct regmap_config *config); | 649 | const struct regmap_config *config); |