Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Nicolas Boichat and committed by
Mark Brown
1ed81114 3cfe7a74

+177 -165
-19
drivers/base/regmap/regmap-ac97.c
··· 78 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 81 struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97, 91 82 const struct regmap_config *config, 92 83 struct lock_class_key *lock_key, ··· 88 97 } 89 98 EXPORT_SYMBOL_GPL(__regmap_init_ac97); 90 99 91 - /** 92 - * devm_regmap_init_ac97(): Initialise AC'97 register map 93 - * 94 - * @ac97: Device that will be interacted with 95 - * @config: Configuration for register map 96 - * 97 - * The return value will be an ERR_PTR() on error or a valid pointer 98 - * to a struct regmap. The regmap will be automatically freed by the 99 - * device management code. 100 - */ 101 100 struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97, 102 101 const struct regmap_config *config, 103 102 struct lock_class_key *lock_key,
-19
drivers/base/regmap/regmap-i2c.c
··· 233 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 236 struct regmap *__regmap_init_i2c(struct i2c_client *i2c, 246 237 const struct regmap_config *config, 247 238 struct lock_class_key *lock_key, ··· 248 257 } 249 258 EXPORT_SYMBOL_GPL(__regmap_init_i2c); 250 259 251 - /** 252 - * devm_regmap_init_i2c(): Initialise managed register map 253 - * 254 - * @i2c: Device that will be interacted with 255 - * @config: Configuration for register map 256 - * 257 - * The return value will be an ERR_PTR() on error or a valid pointer 258 - * to a struct regmap. The regmap will be automatically freed by the 259 - * device management code. 260 - */ 261 260 struct regmap *__devm_regmap_init_i2c(struct i2c_client *i2c, 262 261 const struct regmap_config *config, 263 262 struct lock_class_key *lock_key,
-23
drivers/base/regmap/regmap-mmio.c
··· 296 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 299 struct regmap *__regmap_init_mmio_clk(struct device *dev, const char *clk_id, 311 300 void __iomem *regs, 312 301 const struct regmap_config *config, ··· 313 324 } 314 325 EXPORT_SYMBOL_GPL(__regmap_init_mmio_clk); 315 326 316 - /** 317 - * devm_regmap_init_mmio_clk(): Initialise managed register map with clock 318 - * 319 - * @dev: Device that will be interacted with 320 - * @clk_id: register clock consumer ID 321 - * @regs: Pointer to memory-mapped IO region 322 - * @config: Configuration for register map 323 - * 324 - * The return value will be an ERR_PTR() on error or a valid pointer 325 - * to a struct regmap. The regmap will be automatically freed by the 326 - * device management code. 327 - */ 328 327 struct regmap *__devm_regmap_init_mmio_clk(struct device *dev, 329 328 const char *clk_id, 330 329 void __iomem *regs,
-19
drivers/base/regmap/regmap-spi.c
··· 113 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 116 struct regmap *__regmap_init_spi(struct spi_device *spi, 126 117 const struct regmap_config *config, 127 118 struct lock_class_key *lock_key, ··· 123 132 } 124 133 EXPORT_SYMBOL_GPL(__regmap_init_spi); 125 134 126 - /** 127 - * devm_regmap_init_spi(): Initialise register map 128 - * 129 - * @spi: Device that will be interacted with 130 - * @config: Configuration for register map 131 - * 132 - * The return value will be an ERR_PTR() on error or a valid pointer 133 - * to a struct regmap. The map will be automatically freed by the 134 - * device management code. 135 - */ 136 135 struct regmap *__devm_regmap_init_spi(struct spi_device *spi, 137 136 const struct regmap_config *config, 138 137 struct lock_class_key *lock_key,
-34
drivers/base/regmap/regmap-spmi.c
··· 91 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 94 struct regmap *__regmap_init_spmi_base(struct spmi_device *sdev, 103 95 const struct regmap_config *config, 104 96 struct lock_class_key *lock_key, ··· 101 109 } 102 110 EXPORT_SYMBOL_GPL(__regmap_init_spmi_base); 103 111 104 - /** 105 - * devm_regmap_init_spmi_base(): Create managed regmap for Base register space 106 - * @sdev: SPMI device that will be interacted with 107 - * @config: Configuration for register map 108 - * 109 - * The return value will be an ERR_PTR() on error or a valid pointer 110 - * to a struct regmap. The regmap will be automatically freed by the 111 - * device management code. 112 - */ 113 112 struct regmap *__devm_regmap_init_spmi_base(struct spmi_device *sdev, 114 113 const struct regmap_config *config, 115 114 struct lock_class_key *lock_key, ··· 211 228 .val_format_endian_default = REGMAP_ENDIAN_NATIVE, 212 229 }; 213 230 214 - /** 215 - * regmap_init_spmi_ext(): Create regmap for Ext register space 216 - * @sdev: Device that will be interacted with 217 - * @config: Configuration for register map 218 - * 219 - * The return value will be an ERR_PTR() on error or a valid pointer to 220 - * a struct regmap. 221 - */ 222 231 struct regmap *__regmap_init_spmi_ext(struct spmi_device *sdev, 223 232 const struct regmap_config *config, 224 233 struct lock_class_key *lock_key, ··· 221 246 } 222 247 EXPORT_SYMBOL_GPL(__regmap_init_spmi_ext); 223 248 224 - /** 225 - * devm_regmap_init_spmi_ext(): Create managed regmap for Ext register space 226 - * @sdev: SPMI device that will be interacted with 227 - * @config: Configuration for register map 228 - * 229 - * The return value will be an ERR_PTR() on error or a valid pointer 230 - * to a struct regmap. The regmap will be automatically freed by the 231 - * device management code. 232 - */ 233 249 struct regmap *__devm_regmap_init_spmi_ext(struct spmi_device *sdev, 234 250 const struct regmap_config *config, 235 251 struct lock_class_key *lock_key,
-25
drivers/base/regmap/regmap.c
··· 515 515 } 516 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 518 struct regmap *__regmap_init(struct device *dev, 531 519 const struct regmap_bus *bus, 532 520 void *bus_context, ··· 900 912 regmap_exit(*(struct regmap **)res); 901 913 } 902 914 903 - /** 904 - * devm_regmap_init(): Initialise managed register map 905 - * 906 - * @dev: Device that will be interacted with 907 - * @bus: Bus-specific callbacks to use with device 908 - * @bus_context: Data passed to bus-specific callbacks 909 - * @config: Configuration for register map 910 - * 911 - * The return value will be an ERR_PTR() on error or a valid pointer 912 - * to a struct regmap. This function should generally not be called 913 - * directly, it should be called by bus-specific init functions. The 914 - * map will be automatically freed by the device management code. 915 - */ 916 915 struct regmap *__devm_regmap_init(struct device *dev, 917 916 const struct regmap_bus *bus, 918 917 void *bus_context,
+177 -26
include/linux/regmap.h
··· 419 419 #define __regmap_lockdep_wrapper(fn, name, ...) fn(__VA_ARGS__, NULL, NULL) 420 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 434 #define regmap_init(dev, bus, bus_context, config) \ 423 435 __regmap_lockdep_wrapper(__regmap_init, #config, \ 424 436 dev, bus, bus_context, config) 425 437 int regmap_attach_dev(struct device *dev, struct regmap *map, 426 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 449 #define regmap_init_i2c(i2c, config) \ 428 450 __regmap_lockdep_wrapper(__regmap_init_i2c, #config, \ 429 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 462 #define regmap_init_spi(dev, config) \ 431 463 __regmap_lockdep_wrapper(__regmap_init_spi, #config, \ 432 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 474 #define regmap_init_spmi_base(dev, config) \ 434 475 __regmap_lockdep_wrapper(__regmap_init_spmi_base, #config, \ 435 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 486 #define regmap_init_spmi_ext(dev, config) \ 437 487 __regmap_lockdep_wrapper(__regmap_init_spmi_ext, #config, \ 438 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 501 #define regmap_init_mmio_clk(dev, clk_id, regs, config) \ 440 502 __regmap_lockdep_wrapper(__regmap_init_mmio_clk, #config, \ 441 503 dev, clk_id, regs, config) 442 - #define regmap_init_ac97(ac97, config) \ 443 - __regmap_lockdep_wrapper(__regmap_init_ac97, #config, \ 444 - ac97, config) 445 - bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); 446 - 447 - #define devm_regmap_init(dev, bus, bus_context, config) \ 448 - __regmap_lockdep_wrapper(__devm_regmap_init, #config, \ 449 - dev, bus, bus_context, config) 450 - #define devm_regmap_init_i2c(i2c, config) \ 451 - __regmap_lockdep_wrapper(__devm_regmap_init_i2c, #config, \ 452 - i2c, config) 453 - #define devm_regmap_init_spi(dev, config) \ 454 - __regmap_lockdep_wrapper(__devm_regmap_init_spi, #config, \ 455 - dev, config) 456 - #define devm_regmap_init_spmi_base(dev, config) \ 457 - __regmap_lockdep_wrapper(__devm_regmap_init_spmi_base, #config, \ 458 - dev, config) 459 - #define devm_regmap_init_spmi_ext(dev, config) \ 460 - __regmap_lockdep_wrapper(__devm_regmap_init_spmi_ext, #config, \ 461 - 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 504 469 505 /** 470 506 * regmap_init_mmio(): Initialise register map ··· 516 480 regmap_init_mmio_clk(dev, NULL, regs, config) 517 481 518 482 /** 483 + * regmap_init_ac97(): Initialise AC'97 register map 484 + * 485 + * @ac97: Device that will be interacted with 486 + * @config: Configuration for register map 487 + * 488 + * The return value will be an ERR_PTR() on error or a valid pointer to 489 + * a struct regmap. 490 + */ 491 + #define regmap_init_ac97(ac97, config) \ 492 + __regmap_lockdep_wrapper(__regmap_init_ac97, #config, \ 493 + ac97, config) 494 + bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); 495 + 496 + /** 497 + * devm_regmap_init(): Initialise managed register map 498 + * 499 + * @dev: Device that will be interacted with 500 + * @bus: Bus-specific callbacks to use with device 501 + * @bus_context: Data passed to bus-specific callbacks 502 + * @config: Configuration for register map 503 + * 504 + * The return value will be an ERR_PTR() on error or a valid pointer 505 + * to a struct regmap. This function should generally not be called 506 + * directly, it should be called by bus-specific init functions. The 507 + * map will be automatically freed by the device management code. 508 + */ 509 + #define devm_regmap_init(dev, bus, bus_context, config) \ 510 + __regmap_lockdep_wrapper(__devm_regmap_init, #config, \ 511 + dev, bus, bus_context, config) 512 + 513 + /** 514 + * devm_regmap_init_i2c(): Initialise managed register map 515 + * 516 + * @i2c: Device that will be interacted with 517 + * @config: Configuration for register map 518 + * 519 + * The return value will be an ERR_PTR() on error or a valid pointer 520 + * to a struct regmap. The regmap will be automatically freed by the 521 + * device management code. 522 + */ 523 + #define devm_regmap_init_i2c(i2c, config) \ 524 + __regmap_lockdep_wrapper(__devm_regmap_init_i2c, #config, \ 525 + i2c, config) 526 + 527 + /** 528 + * devm_regmap_init_spi(): Initialise register map 529 + * 530 + * @spi: Device that will be interacted with 531 + * @config: Configuration for register map 532 + * 533 + * The return value will be an ERR_PTR() on error or a valid pointer 534 + * to a struct regmap. The map will be automatically freed by the 535 + * device management code. 536 + */ 537 + #define devm_regmap_init_spi(dev, config) \ 538 + __regmap_lockdep_wrapper(__devm_regmap_init_spi, #config, \ 539 + dev, config) 540 + 541 + /** 542 + * devm_regmap_init_spmi_base(): Create managed regmap for Base register space 543 + * @sdev: SPMI device that will be interacted with 544 + * @config: Configuration for register map 545 + * 546 + * The return value will be an ERR_PTR() on error or a valid pointer 547 + * to a struct regmap. The regmap will be automatically freed by the 548 + * device management code. 549 + */ 550 + #define devm_regmap_init_spmi_base(dev, config) \ 551 + __regmap_lockdep_wrapper(__devm_regmap_init_spmi_base, #config, \ 552 + dev, config) 553 + 554 + /** 555 + * devm_regmap_init_spmi_ext(): Create managed regmap for Ext register space 556 + * @sdev: SPMI device that will be interacted with 557 + * @config: Configuration for register map 558 + * 559 + * The return value will be an ERR_PTR() on error or a valid pointer 560 + * to a struct regmap. The regmap will be automatically freed by the 561 + * device management code. 562 + */ 563 + #define devm_regmap_init_spmi_ext(dev, config) \ 564 + __regmap_lockdep_wrapper(__devm_regmap_init_spmi_ext, #config, \ 565 + dev, config) 566 + 567 + /** 568 + * devm_regmap_init_mmio_clk(): Initialise managed register map with clock 569 + * 570 + * @dev: Device that will be interacted with 571 + * @clk_id: register clock consumer ID 572 + * @regs: Pointer to memory-mapped IO region 573 + * @config: Configuration for register map 574 + * 575 + * The return value will be an ERR_PTR() on error or a valid pointer 576 + * to a struct regmap. The regmap will be automatically freed by the 577 + * device management code. 578 + */ 579 + #define devm_regmap_init_mmio_clk(dev, clk_id, regs, config) \ 580 + __regmap_lockdep_wrapper(__devm_regmap_init_mmio_clk, #config, \ 581 + dev, clk_id, regs, config) 582 + 583 + /** 519 584 * devm_regmap_init_mmio(): Initialise managed register map 520 585 * 521 586 * @dev: Device that will be interacted with ··· 629 492 */ 630 493 #define devm_regmap_init_mmio(dev, regs, config) \ 631 494 devm_regmap_init_mmio_clk(dev, NULL, regs, config) 495 + 496 + /** 497 + * devm_regmap_init_ac97(): Initialise AC'97 register map 498 + * 499 + * @ac97: Device that will be interacted with 500 + * @config: Configuration for register map 501 + * 502 + * The return value will be an ERR_PTR() on error or a valid pointer 503 + * to a struct regmap. The regmap will be automatically freed by the 504 + * device management code. 505 + */ 506 + #define devm_regmap_init_ac97(ac97, config) \ 507 + __regmap_lockdep_wrapper(__devm_regmap_init_ac97, #config, \ 508 + ac97, config) 632 509 633 510 void regmap_exit(struct regmap *map); 634 511 int regmap_reinit_cache(struct regmap *map,