aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regmap.h
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2015-08-11 06:04:21 -0400
committerMark Brown <broonie@kernel.org>2015-08-11 12:21:44 -0400
commit1ed8111443ae8caa455e7107031da36d1a6d351a (patch)
treec1e2d17a8ca32b9b66ff8f5056fe133295eeb40f /include/linux/regmap.h
parent3cfe7a74d42b7e3644f8b2b26aa20146d4f90f0f (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>
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r--include/linux/regmap.h173
1 files changed, 162 insertions, 11 deletions
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)
425int regmap_attach_dev(struct device *dev, struct regmap *map, 437int 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)
445bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); 530bool 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
496void regmap_exit(struct regmap *map); 647void regmap_exit(struct regmap *map);
497int regmap_reinit_cache(struct regmap *map, 648int regmap_reinit_cache(struct regmap *map,
498 const struct regmap_config *config); 649 const struct regmap_config *config);