diff options
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/max98095.h | 54 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 5 | ||||
-rw-r--r-- | include/sound/soc.h | 28 | ||||
-rw-r--r-- | include/sound/wm8915.h | 55 | ||||
-rw-r--r-- | include/sound/wm8962.h | 22 |
5 files changed, 158 insertions, 6 deletions
diff --git a/include/sound/max98095.h b/include/sound/max98095.h new file mode 100644 index 000000000000..7513a42dd4aa --- /dev/null +++ b/include/sound/max98095.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * Platform data for MAX98095 | ||
3 | * | ||
4 | * Copyright 2011 Maxim Integrated Products | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef __SOUND_MAX98095_PDATA_H__ | ||
14 | #define __SOUND_MAX98095_PDATA_H__ | ||
15 | |||
16 | /* Equalizer filter response configuration */ | ||
17 | struct max98095_eq_cfg { | ||
18 | const char *name; | ||
19 | unsigned int rate; | ||
20 | u16 band1[5]; | ||
21 | u16 band2[5]; | ||
22 | u16 band3[5]; | ||
23 | u16 band4[5]; | ||
24 | u16 band5[5]; | ||
25 | }; | ||
26 | |||
27 | /* Biquad filter response configuration */ | ||
28 | struct max98095_biquad_cfg { | ||
29 | const char *name; | ||
30 | unsigned int rate; | ||
31 | u16 band1[5]; | ||
32 | u16 band2[5]; | ||
33 | }; | ||
34 | |||
35 | /* codec platform data */ | ||
36 | struct max98095_pdata { | ||
37 | |||
38 | /* Equalizers for DAI1 and DAI2 */ | ||
39 | struct max98095_eq_cfg *eq_cfg; | ||
40 | unsigned int eq_cfgcnt; | ||
41 | |||
42 | /* Biquad filter for DAI1 and DAI2 */ | ||
43 | struct max98095_biquad_cfg *bq_cfg; | ||
44 | unsigned int bq_cfgcnt; | ||
45 | |||
46 | /* Analog/digital microphone configuration: | ||
47 | * 0 = analog microphone input (normal setting) | ||
48 | * 1 = digital microphone input | ||
49 | */ | ||
50 | unsigned int digmic_left_mode:1; | ||
51 | unsigned int digmic_right_mode:1; | ||
52 | }; | ||
53 | |||
54 | #endif | ||
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index f72c1039a6fb..f8a7c9a6f12a 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -24,7 +24,7 @@ | |||
24 | * SoC dynamic audio power management | 24 | * SoC dynamic audio power management |
25 | * | 25 | * |
26 | * We can have up to 4 power domains | 26 | * We can have up to 4 power domains |
27 | * 1. Codec domain - VREF, VMID | 27 | * 1. Codec domain - VREF, VMID |
28 | * Usually controlled at codec probe/remove, although can be set | 28 | * Usually controlled at codec probe/remove, although can be set |
29 | * at stream time if power is not needed for sidetone, etc. | 29 | * at stream time if power is not needed for sidetone, etc. |
30 | * 2. Platform/Machine domain - physically connected inputs and outputs | 30 | * 2. Platform/Machine domain - physically connected inputs and outputs |
@@ -356,7 +356,8 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card); | |||
356 | 356 | ||
357 | /* dapm sys fs - used by the core */ | 357 | /* dapm sys fs - used by the core */ |
358 | int snd_soc_dapm_sys_add(struct device *dev); | 358 | int snd_soc_dapm_sys_add(struct device *dev); |
359 | void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm); | 359 | void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, |
360 | struct dentry *parent); | ||
360 | 361 | ||
361 | /* dapm audio pin control and status */ | 362 | /* dapm audio pin control and status */ |
362 | int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, | 363 | int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, |
diff --git a/include/sound/soc.h b/include/sound/soc.h index bfa4836ea107..6ce3e573fb40 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -248,7 +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_CUSTOM = 1, |
252 | SND_SOC_I2C, | 252 | SND_SOC_I2C, |
253 | SND_SOC_SPI, | 253 | SND_SOC_SPI, |
254 | }; | 254 | }; |
@@ -278,6 +278,10 @@ int snd_soc_register_codec(struct device *dev, | |||
278 | void snd_soc_unregister_codec(struct device *dev); | 278 | void snd_soc_unregister_codec(struct device *dev); |
279 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, | 279 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, |
280 | unsigned int reg); | 280 | unsigned int reg); |
281 | int snd_soc_codec_readable_register(struct snd_soc_codec *codec, | ||
282 | unsigned int reg); | ||
283 | int snd_soc_codec_writable_register(struct snd_soc_codec *codec, | ||
284 | unsigned int reg); | ||
281 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | 285 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, |
282 | int addr_bits, int data_bits, | 286 | int addr_bits, int data_bits, |
283 | enum snd_soc_control_type control); | 287 | enum snd_soc_control_type control); |
@@ -292,6 +296,8 @@ int snd_soc_default_volatile_register(struct snd_soc_codec *codec, | |||
292 | unsigned int reg); | 296 | unsigned int reg); |
293 | int snd_soc_default_readable_register(struct snd_soc_codec *codec, | 297 | int snd_soc_default_readable_register(struct snd_soc_codec *codec, |
294 | unsigned int reg); | 298 | unsigned int reg); |
299 | int snd_soc_default_writable_register(struct snd_soc_codec *codec, | ||
300 | unsigned int reg); | ||
295 | 301 | ||
296 | /* Utility functions to get clock rates from various things */ | 302 | /* Utility functions to get clock rates from various things */ |
297 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); | 303 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); |
@@ -523,6 +529,7 @@ struct snd_soc_codec { | |||
523 | size_t reg_size; /* reg_cache_size * reg_word_size */ | 529 | size_t reg_size; /* reg_cache_size * reg_word_size */ |
524 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); | 530 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); |
525 | int (*readable_register)(struct snd_soc_codec *, unsigned int); | 531 | int (*readable_register)(struct snd_soc_codec *, unsigned int); |
532 | int (*writable_register)(struct snd_soc_codec *, unsigned int); | ||
526 | 533 | ||
527 | /* runtime */ | 534 | /* runtime */ |
528 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ | 535 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ |
@@ -539,10 +546,12 @@ struct snd_soc_codec { | |||
539 | 546 | ||
540 | /* codec IO */ | 547 | /* codec IO */ |
541 | void *control_data; /* codec control (i2c/3wire) data */ | 548 | void *control_data; /* codec control (i2c/3wire) data */ |
549 | enum snd_soc_control_type control_type; | ||
542 | hw_write_t hw_write; | 550 | hw_write_t hw_write; |
543 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); | 551 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); |
544 | unsigned int (*read)(struct snd_soc_codec *, unsigned int); | 552 | unsigned int (*read)(struct snd_soc_codec *, unsigned int); |
545 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); | 553 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); |
554 | int (*bulk_write_raw)(struct snd_soc_codec *, unsigned int, const void *, size_t); | ||
546 | void *reg_cache; | 555 | void *reg_cache; |
547 | const void *reg_def_copy; | 556 | const void *reg_def_copy; |
548 | const struct snd_soc_cache_ops *cache_ops; | 557 | const struct snd_soc_cache_ops *cache_ops; |
@@ -568,7 +577,9 @@ struct snd_soc_codec_driver { | |||
568 | pm_message_t state); | 577 | pm_message_t state); |
569 | int (*resume)(struct snd_soc_codec *); | 578 | int (*resume)(struct snd_soc_codec *); |
570 | 579 | ||
571 | /* Default DAPM setup, added after probe() is run */ | 580 | /* Default control and setup, added after probe() is run */ |
581 | const struct snd_kcontrol_new *controls; | ||
582 | int num_controls; | ||
572 | const struct snd_soc_dapm_widget *dapm_widgets; | 583 | const struct snd_soc_dapm_widget *dapm_widgets; |
573 | int num_dapm_widgets; | 584 | int num_dapm_widgets; |
574 | const struct snd_soc_dapm_route *dapm_routes; | 585 | const struct snd_soc_dapm_route *dapm_routes; |
@@ -587,6 +598,7 @@ struct snd_soc_codec_driver { | |||
587 | size_t, unsigned int); | 598 | size_t, unsigned int); |
588 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); | 599 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); |
589 | int (*readable_register)(struct snd_soc_codec *, unsigned int); | 600 | int (*readable_register)(struct snd_soc_codec *, unsigned int); |
601 | int (*writable_register)(struct snd_soc_codec *, unsigned int); | ||
590 | short reg_cache_size; | 602 | short reg_cache_size; |
591 | short reg_cache_step; | 603 | short reg_cache_step; |
592 | short reg_word_size; | 604 | short reg_word_size; |
@@ -737,12 +749,15 @@ struct snd_soc_card { | |||
737 | struct snd_soc_pcm_runtime *rtd_aux; | 749 | struct snd_soc_pcm_runtime *rtd_aux; |
738 | int num_aux_rtd; | 750 | int num_aux_rtd; |
739 | 751 | ||
752 | const struct snd_kcontrol_new *controls; | ||
753 | int num_controls; | ||
754 | |||
740 | /* | 755 | /* |
741 | * Card-specific routes and widgets. | 756 | * Card-specific routes and widgets. |
742 | */ | 757 | */ |
743 | struct snd_soc_dapm_widget *dapm_widgets; | 758 | const struct snd_soc_dapm_widget *dapm_widgets; |
744 | int num_dapm_widgets; | 759 | int num_dapm_widgets; |
745 | struct snd_soc_dapm_route *dapm_routes; | 760 | const struct snd_soc_dapm_route *dapm_routes; |
746 | int num_dapm_routes; | 761 | int num_dapm_routes; |
747 | 762 | ||
748 | struct work_struct deferred_resume_work; | 763 | struct work_struct deferred_resume_work; |
@@ -814,6 +829,8 @@ struct soc_enum { | |||
814 | unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); | 829 | unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); |
815 | unsigned int snd_soc_write(struct snd_soc_codec *codec, | 830 | unsigned int snd_soc_write(struct snd_soc_codec *codec, |
816 | unsigned int reg, unsigned int val); | 831 | unsigned int reg, unsigned int val); |
832 | unsigned int snd_soc_bulk_write_raw(struct snd_soc_codec *codec, | ||
833 | unsigned int reg, const void *data, size_t len); | ||
817 | 834 | ||
818 | /* device driver data */ | 835 | /* device driver data */ |
819 | 836 | ||
@@ -871,6 +888,9 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) | |||
871 | INIT_LIST_HEAD(&card->dapm_list); | 888 | INIT_LIST_HEAD(&card->dapm_list); |
872 | } | 889 | } |
873 | 890 | ||
891 | int snd_soc_util_init(void); | ||
892 | void snd_soc_util_exit(void); | ||
893 | |||
874 | #include <sound/soc-dai.h> | 894 | #include <sound/soc-dai.h> |
875 | 895 | ||
876 | #ifdef CONFIG_DEBUG_FS | 896 | #ifdef CONFIG_DEBUG_FS |
diff --git a/include/sound/wm8915.h b/include/sound/wm8915.h new file mode 100644 index 000000000000..5817d762f6f3 --- /dev/null +++ b/include/sound/wm8915.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * linux/sound/wm8915.h -- Platform data for WM8915 | ||
3 | * | ||
4 | * Copyright 2011 Wolfson Microelectronics. PLC. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_SND_WM8903_H | ||
12 | #define __LINUX_SND_WM8903_H | ||
13 | |||
14 | enum wm8915_inmode { | ||
15 | WM8915_DIFFERRENTIAL_1 = 0, /* IN1xP - IN1xN */ | ||
16 | WM8915_INVERTING = 1, /* IN1xN */ | ||
17 | WM8915_NON_INVERTING = 2, /* IN1xP */ | ||
18 | WM8915_DIFFERENTIAL_2 = 3, /* IN2xP - IN2xP */ | ||
19 | }; | ||
20 | |||
21 | /** | ||
22 | * ReTune Mobile configurations are specified with a label, sample | ||
23 | * rate and set of values to write (the enable bits will be ignored). | ||
24 | * | ||
25 | * Configurations are expected to be generated using the ReTune Mobile | ||
26 | * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/ | ||
27 | */ | ||
28 | struct wm8915_retune_mobile_config { | ||
29 | const char *name; | ||
30 | int rate; | ||
31 | u16 regs[20]; | ||
32 | }; | ||
33 | |||
34 | #define WM8915_SET_DEFAULT 0x10000 | ||
35 | |||
36 | struct wm8915_pdata { | ||
37 | int irq_flags; /** Set IRQ trigger flags; default active low */ | ||
38 | |||
39 | int ldo_ena; /** GPIO for LDO1; -1 for none */ | ||
40 | |||
41 | int micdet_def; /** Default MICDET_SRC/HP1FB_SRC/MICD_BIAS */ | ||
42 | |||
43 | enum wm8915_inmode inl_mode; | ||
44 | enum wm8915_inmode inr_mode; | ||
45 | |||
46 | u32 spkmute_seq; /** Value for register 0x802 */ | ||
47 | |||
48 | int gpio_base; | ||
49 | u32 gpio_default[5]; | ||
50 | |||
51 | int num_retune_mobile_cfgs; | ||
52 | struct wm8915_retune_mobile_config *retune_mobile_cfgs; | ||
53 | }; | ||
54 | |||
55 | #endif | ||
diff --git a/include/sound/wm8962.h b/include/sound/wm8962.h index 2b5306c503fb..1750bed7c2f6 100644 --- a/include/sound/wm8962.h +++ b/include/sound/wm8962.h | |||
@@ -14,6 +14,28 @@ | |||
14 | /* Use to set GPIO default values to zero */ | 14 | /* Use to set GPIO default values to zero */ |
15 | #define WM8962_GPIO_SET 0x10000 | 15 | #define WM8962_GPIO_SET 0x10000 |
16 | 16 | ||
17 | #define WM8962_GPIO_FN_CLKOUT 0 | ||
18 | #define WM8962_GPIO_FN_LOGIC 1 | ||
19 | #define WM8962_GPIO_FN_SDOUT 2 | ||
20 | #define WM8962_GPIO_FN_IRQ 3 | ||
21 | #define WM8962_GPIO_FN_THERMAL 4 | ||
22 | #define WM8962_GPIO_FN_PLL2_LOCK 6 | ||
23 | #define WM8962_GPIO_FN_PLL3_LOCK 7 | ||
24 | #define WM8962_GPIO_FN_FLL_LOCK 9 | ||
25 | #define WM8962_GPIO_FN_DRC_ACT 10 | ||
26 | #define WM8962_GPIO_FN_WSEQ_DONE 11 | ||
27 | #define WM8962_GPIO_FN_ALC_NG_ACT 12 | ||
28 | #define WM8962_GPIO_FN_ALC_PEAK_LIMIT 13 | ||
29 | #define WM8962_GPIO_FN_ALC_SATURATION 14 | ||
30 | #define WM8962_GPIO_FN_ALC_LEVEL_THR 15 | ||
31 | #define WM8962_GPIO_FN_ALC_LEVEL_LOCK 16 | ||
32 | #define WM8962_GPIO_FN_FIFO_ERR 17 | ||
33 | #define WM8962_GPIO_FN_OPCLK 18 | ||
34 | #define WM8962_GPIO_FN_DMICCLK 19 | ||
35 | #define WM8962_GPIO_FN_DMICDAT 20 | ||
36 | #define WM8962_GPIO_FN_MICD 21 | ||
37 | #define WM8962_GPIO_FN_MICSCD 22 | ||
38 | |||
17 | struct wm8962_pdata { | 39 | struct wm8962_pdata { |
18 | int gpio_base; | 40 | int gpio_base; |
19 | u32 gpio_init[WM8962_MAX_GPIO]; | 41 | u32 gpio_init[WM8962_MAX_GPIO]; |