diff options
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r-- | include/sound/soc.h | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index bfa4836ea107..3a4bd3a3c68d 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -248,8 +248,7 @@ typedef int (*hw_write_t)(void *,const char* ,int); | |||
248 | extern struct snd_ac97_bus_ops soc_ac97_ops; | 248 | extern struct snd_ac97_bus_ops soc_ac97_ops; |
249 | 249 | ||
250 | enum snd_soc_control_type { | 250 | enum snd_soc_control_type { |
251 | SND_SOC_CUSTOM, | 251 | SND_SOC_I2C = 1, |
252 | SND_SOC_I2C, | ||
253 | SND_SOC_SPI, | 252 | SND_SOC_SPI, |
254 | }; | 253 | }; |
255 | 254 | ||
@@ -278,6 +277,10 @@ int snd_soc_register_codec(struct device *dev, | |||
278 | void snd_soc_unregister_codec(struct device *dev); | 277 | void snd_soc_unregister_codec(struct device *dev); |
279 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, | 278 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, |
280 | unsigned int reg); | 279 | unsigned int reg); |
280 | int snd_soc_codec_readable_register(struct snd_soc_codec *codec, | ||
281 | unsigned int reg); | ||
282 | int snd_soc_codec_writable_register(struct snd_soc_codec *codec, | ||
283 | unsigned int reg); | ||
281 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | 284 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, |
282 | int addr_bits, int data_bits, | 285 | int addr_bits, int data_bits, |
283 | enum snd_soc_control_type control); | 286 | enum snd_soc_control_type control); |
@@ -292,6 +295,8 @@ int snd_soc_default_volatile_register(struct snd_soc_codec *codec, | |||
292 | unsigned int reg); | 295 | unsigned int reg); |
293 | int snd_soc_default_readable_register(struct snd_soc_codec *codec, | 296 | int snd_soc_default_readable_register(struct snd_soc_codec *codec, |
294 | unsigned int reg); | 297 | unsigned int reg); |
298 | int snd_soc_default_writable_register(struct snd_soc_codec *codec, | ||
299 | unsigned int reg); | ||
295 | 300 | ||
296 | /* Utility functions to get clock rates from various things */ | 301 | /* Utility functions to get clock rates from various things */ |
297 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); | 302 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); |
@@ -523,6 +528,7 @@ struct snd_soc_codec { | |||
523 | size_t reg_size; /* reg_cache_size * reg_word_size */ | 528 | size_t reg_size; /* reg_cache_size * reg_word_size */ |
524 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); | 529 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); |
525 | int (*readable_register)(struct snd_soc_codec *, unsigned int); | 530 | int (*readable_register)(struct snd_soc_codec *, unsigned int); |
531 | int (*writable_register)(struct snd_soc_codec *, unsigned int); | ||
526 | 532 | ||
527 | /* runtime */ | 533 | /* runtime */ |
528 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ | 534 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ |
@@ -539,10 +545,12 @@ struct snd_soc_codec { | |||
539 | 545 | ||
540 | /* codec IO */ | 546 | /* codec IO */ |
541 | void *control_data; /* codec control (i2c/3wire) data */ | 547 | void *control_data; /* codec control (i2c/3wire) data */ |
548 | enum snd_soc_control_type control_type; | ||
542 | hw_write_t hw_write; | 549 | hw_write_t hw_write; |
543 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); | 550 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); |
544 | unsigned int (*read)(struct snd_soc_codec *, unsigned int); | 551 | unsigned int (*read)(struct snd_soc_codec *, unsigned int); |
545 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); | 552 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); |
553 | int (*bulk_write_raw)(struct snd_soc_codec *, unsigned int, const void *, size_t); | ||
546 | void *reg_cache; | 554 | void *reg_cache; |
547 | const void *reg_def_copy; | 555 | const void *reg_def_copy; |
548 | const struct snd_soc_cache_ops *cache_ops; | 556 | const struct snd_soc_cache_ops *cache_ops; |
@@ -568,7 +576,9 @@ struct snd_soc_codec_driver { | |||
568 | pm_message_t state); | 576 | pm_message_t state); |
569 | int (*resume)(struct snd_soc_codec *); | 577 | int (*resume)(struct snd_soc_codec *); |
570 | 578 | ||
571 | /* Default DAPM setup, added after probe() is run */ | 579 | /* Default control and setup, added after probe() is run */ |
580 | const struct snd_kcontrol_new *controls; | ||
581 | int num_controls; | ||
572 | const struct snd_soc_dapm_widget *dapm_widgets; | 582 | const struct snd_soc_dapm_widget *dapm_widgets; |
573 | int num_dapm_widgets; | 583 | int num_dapm_widgets; |
574 | const struct snd_soc_dapm_route *dapm_routes; | 584 | const struct snd_soc_dapm_route *dapm_routes; |
@@ -587,6 +597,7 @@ struct snd_soc_codec_driver { | |||
587 | size_t, unsigned int); | 597 | size_t, unsigned int); |
588 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); | 598 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); |
589 | int (*readable_register)(struct snd_soc_codec *, unsigned int); | 599 | int (*readable_register)(struct snd_soc_codec *, unsigned int); |
600 | int (*writable_register)(struct snd_soc_codec *, unsigned int); | ||
590 | short reg_cache_size; | 601 | short reg_cache_size; |
591 | short reg_cache_step; | 602 | short reg_cache_step; |
592 | short reg_word_size; | 603 | short reg_word_size; |
@@ -690,6 +701,8 @@ struct snd_soc_aux_dev { | |||
690 | /* SoC card */ | 701 | /* SoC card */ |
691 | struct snd_soc_card { | 702 | struct snd_soc_card { |
692 | const char *name; | 703 | const char *name; |
704 | const char *long_name; | ||
705 | const char *driver_name; | ||
693 | struct device *dev; | 706 | struct device *dev; |
694 | struct snd_card *snd_card; | 707 | struct snd_card *snd_card; |
695 | struct module *owner; | 708 | struct module *owner; |
@@ -737,12 +750,15 @@ struct snd_soc_card { | |||
737 | struct snd_soc_pcm_runtime *rtd_aux; | 750 | struct snd_soc_pcm_runtime *rtd_aux; |
738 | int num_aux_rtd; | 751 | int num_aux_rtd; |
739 | 752 | ||
753 | const struct snd_kcontrol_new *controls; | ||
754 | int num_controls; | ||
755 | |||
740 | /* | 756 | /* |
741 | * Card-specific routes and widgets. | 757 | * Card-specific routes and widgets. |
742 | */ | 758 | */ |
743 | struct snd_soc_dapm_widget *dapm_widgets; | 759 | const struct snd_soc_dapm_widget *dapm_widgets; |
744 | int num_dapm_widgets; | 760 | int num_dapm_widgets; |
745 | struct snd_soc_dapm_route *dapm_routes; | 761 | const struct snd_soc_dapm_route *dapm_routes; |
746 | int num_dapm_routes; | 762 | int num_dapm_routes; |
747 | 763 | ||
748 | struct work_struct deferred_resume_work; | 764 | struct work_struct deferred_resume_work; |
@@ -805,7 +821,7 @@ struct soc_enum { | |||
805 | unsigned char shift_r; | 821 | unsigned char shift_r; |
806 | unsigned int max; | 822 | unsigned int max; |
807 | unsigned int mask; | 823 | unsigned int mask; |
808 | const char **texts; | 824 | const char * const *texts; |
809 | const unsigned int *values; | 825 | const unsigned int *values; |
810 | void *dapm; | 826 | void *dapm; |
811 | }; | 827 | }; |
@@ -814,6 +830,8 @@ struct soc_enum { | |||
814 | unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); | 830 | unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); |
815 | unsigned int snd_soc_write(struct snd_soc_codec *codec, | 831 | unsigned int snd_soc_write(struct snd_soc_codec *codec, |
816 | unsigned int reg, unsigned int val); | 832 | unsigned int reg, unsigned int val); |
833 | unsigned int snd_soc_bulk_write_raw(struct snd_soc_codec *codec, | ||
834 | unsigned int reg, const void *data, size_t len); | ||
817 | 835 | ||
818 | /* device driver data */ | 836 | /* device driver data */ |
819 | 837 | ||
@@ -871,6 +889,9 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) | |||
871 | INIT_LIST_HEAD(&card->dapm_list); | 889 | INIT_LIST_HEAD(&card->dapm_list); |
872 | } | 890 | } |
873 | 891 | ||
892 | int snd_soc_util_init(void); | ||
893 | void snd_soc_util_exit(void); | ||
894 | |||
874 | #include <sound/soc-dai.h> | 895 | #include <sound/soc-dai.h> |
875 | 896 | ||
876 | #ifdef CONFIG_DEBUG_FS | 897 | #ifdef CONFIG_DEBUG_FS |