diff options
Diffstat (limited to 'include/sound')
| -rw-r--r-- | include/sound/Kbuild | 9 | ||||
| -rw-r--r-- | include/sound/ak4113.h | 2 | ||||
| -rw-r--r-- | include/sound/asound.h | 28 | ||||
| -rw-r--r-- | include/sound/core.h | 3 | ||||
| -rw-r--r-- | include/sound/cs46xx_dsp_spos.h | 6 | ||||
| -rw-r--r-- | include/sound/emu10k1.h | 1 | ||||
| -rw-r--r-- | include/sound/es1688.h | 11 | ||||
| -rw-r--r-- | include/sound/info.h | 24 | ||||
| -rw-r--r-- | include/sound/jack.h | 8 | ||||
| -rw-r--r-- | include/sound/pcm.h | 61 | ||||
| -rw-r--r-- | include/sound/pcm_oss.h | 2 | ||||
| -rw-r--r-- | include/sound/sb.h | 1 | ||||
| -rw-r--r-- | include/sound/sh_fsi.h | 49 | ||||
| -rw-r--r-- | include/sound/soc-dai.h | 27 | ||||
| -rw-r--r-- | include/sound/soc-dapm.h | 42 | ||||
| -rw-r--r-- | include/sound/soc.h | 109 | ||||
| -rw-r--r-- | include/sound/tlv320aic3x.h | 17 | ||||
| -rw-r--r-- | include/sound/tlv320dac33-plat.h | 4 | ||||
| -rw-r--r-- | include/sound/tpa6130a2-plat.h | 6 | ||||
| -rw-r--r-- | include/sound/uda134x.h | 13 | ||||
| -rw-r--r-- | include/sound/version.h | 2 | ||||
| -rw-r--r-- | include/sound/wm2000.h | 26 | ||||
| -rw-r--r-- | include/sound/wm8903.h | 249 | ||||
| -rw-r--r-- | include/sound/wm8904.h | 163 | ||||
| -rw-r--r-- | include/sound/wm8955.h | 26 | ||||
| -rw-r--r-- | include/sound/wm8960.h | 24 | ||||
| -rw-r--r-- | include/sound/wm9090.h | 28 |
27 files changed, 874 insertions, 67 deletions
diff --git a/include/sound/Kbuild b/include/sound/Kbuild index e9dd9369ecb9..802947f60915 100644 --- a/include/sound/Kbuild +++ b/include/sound/Kbuild | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | header-y += asequencer.h | ||
| 2 | header-y += asound.h | ||
| 1 | header-y += asound_fm.h | 3 | header-y += asound_fm.h |
| 4 | header-y += emu10k1.h | ||
| 2 | header-y += hdsp.h | 5 | header-y += hdsp.h |
| 3 | header-y += hdspm.h | 6 | header-y += hdspm.h |
| 7 | header-y += sb16_csp.h | ||
| 4 | header-y += sfnt_info.h | 8 | header-y += sfnt_info.h |
| 5 | |||
| 6 | unifdef-y += asequencer.h | ||
| 7 | unifdef-y += asound.h | ||
| 8 | unifdef-y += emu10k1.h | ||
| 9 | unifdef-y += sb16_csp.h | ||
diff --git a/include/sound/ak4113.h b/include/sound/ak4113.h index 8988edae1609..2609048c1d44 100644 --- a/include/sound/ak4113.h +++ b/include/sound/ak4113.h | |||
| @@ -307,7 +307,7 @@ struct ak4113 { | |||
| 307 | 307 | ||
| 308 | int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, | 308 | int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, |
| 309 | ak4113_write_t *write, | 309 | ak4113_write_t *write, |
| 310 | const unsigned char pgm[AK4113_WRITABLE_REGS], | 310 | const unsigned char *pgm, |
| 311 | void *private_data, struct ak4113 **r_ak4113); | 311 | void *private_data, struct ak4113 **r_ak4113); |
| 312 | void snd_ak4113_reg_write(struct ak4113 *ak4113, unsigned char reg, | 312 | void snd_ak4113_reg_write(struct ak4113 *ak4113, unsigned char reg, |
| 313 | unsigned char mask, unsigned char val); | 313 | unsigned char mask, unsigned char val); |
diff --git a/include/sound/asound.h b/include/sound/asound.h index 1f57bb92eb5a..a1803ecea34d 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
| @@ -212,7 +212,11 @@ typedef int __bitwise snd_pcm_format_t; | |||
| 212 | #define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */ | 212 | #define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */ |
| 213 | #define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */ | 213 | #define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */ |
| 214 | #define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */ | 214 | #define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */ |
| 215 | #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_U18_3BE | 215 | #define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44) /* 8 samples in 3 bytes */ |
| 216 | #define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */ | ||
| 217 | #define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */ | ||
| 218 | #define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */ | ||
| 219 | #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_G723_40_1B | ||
| 216 | 220 | ||
| 217 | #ifdef SNDRV_LITTLE_ENDIAN | 221 | #ifdef SNDRV_LITTLE_ENDIAN |
| 218 | #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE | 222 | #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE |
| @@ -544,7 +548,7 @@ struct snd_rawmidi_status { | |||
| 544 | * Timer section - /dev/snd/timer | 548 | * Timer section - /dev/snd/timer |
| 545 | */ | 549 | */ |
| 546 | 550 | ||
| 547 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5) | 551 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6) |
| 548 | 552 | ||
| 549 | enum { | 553 | enum { |
| 550 | SNDRV_TIMER_CLASS_NONE = -1, | 554 | SNDRV_TIMER_CLASS_NONE = -1, |
| @@ -574,7 +578,7 @@ enum { | |||
| 574 | #define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */ | 578 | #define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */ |
| 575 | 579 | ||
| 576 | struct snd_timer_id { | 580 | struct snd_timer_id { |
| 577 | int dev_class; | 581 | int dev_class; |
| 578 | int dev_sclass; | 582 | int dev_sclass; |
| 579 | int card; | 583 | int card; |
| 580 | int device; | 584 | int device; |
| @@ -762,7 +766,7 @@ struct snd_ctl_elem_id { | |||
| 762 | snd_ctl_elem_iface_t iface; /* interface identifier */ | 766 | snd_ctl_elem_iface_t iface; /* interface identifier */ |
| 763 | unsigned int device; /* device/client number */ | 767 | unsigned int device; /* device/client number */ |
| 764 | unsigned int subdevice; /* subdevice (substream) number */ | 768 | unsigned int subdevice; /* subdevice (substream) number */ |
| 765 | unsigned char name[44]; /* ASCII name of item */ | 769 | unsigned char name[44]; /* ASCII name of item */ |
| 766 | unsigned int index; /* index of item */ | 770 | unsigned int index; /* index of item */ |
| 767 | }; | 771 | }; |
| 768 | 772 | ||
| @@ -809,7 +813,7 @@ struct snd_ctl_elem_info { | |||
| 809 | struct snd_ctl_elem_value { | 813 | struct snd_ctl_elem_value { |
| 810 | struct snd_ctl_elem_id id; /* W: element ID */ | 814 | struct snd_ctl_elem_id id; /* W: element ID */ |
| 811 | unsigned int indirect: 1; /* W: indirect access - obsoleted */ | 815 | unsigned int indirect: 1; /* W: indirect access - obsoleted */ |
| 812 | union { | 816 | union { |
| 813 | union { | 817 | union { |
| 814 | long value[128]; | 818 | long value[128]; |
| 815 | long *value_ptr; /* obsoleted */ | 819 | long *value_ptr; /* obsoleted */ |
| @@ -827,15 +831,15 @@ struct snd_ctl_elem_value { | |||
| 827 | unsigned char *data_ptr; /* obsoleted */ | 831 | unsigned char *data_ptr; /* obsoleted */ |
| 828 | } bytes; | 832 | } bytes; |
| 829 | struct snd_aes_iec958 iec958; | 833 | struct snd_aes_iec958 iec958; |
| 830 | } value; /* RO */ | 834 | } value; /* RO */ |
| 831 | struct timespec tstamp; | 835 | struct timespec tstamp; |
| 832 | unsigned char reserved[128-sizeof(struct timespec)]; | 836 | unsigned char reserved[128-sizeof(struct timespec)]; |
| 833 | }; | 837 | }; |
| 834 | 838 | ||
| 835 | struct snd_ctl_tlv { | 839 | struct snd_ctl_tlv { |
| 836 | unsigned int numid; /* control element numeric identification */ | 840 | unsigned int numid; /* control element numeric identification */ |
| 837 | unsigned int length; /* in bytes aligned to 4 */ | 841 | unsigned int length; /* in bytes aligned to 4 */ |
| 838 | unsigned int tlv[0]; /* first TLV */ | 842 | unsigned int tlv[0]; /* first TLV */ |
| 839 | }; | 843 | }; |
| 840 | 844 | ||
| 841 | #define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int) | 845 | #define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int) |
| @@ -886,8 +890,8 @@ struct snd_ctl_event { | |||
| 886 | unsigned int mask; | 890 | unsigned int mask; |
| 887 | struct snd_ctl_elem_id id; | 891 | struct snd_ctl_elem_id id; |
| 888 | } elem; | 892 | } elem; |
| 889 | unsigned char data8[60]; | 893 | unsigned char data8[60]; |
| 890 | } data; | 894 | } data; |
| 891 | }; | 895 | }; |
| 892 | 896 | ||
| 893 | /* | 897 | /* |
diff --git a/include/sound/core.h b/include/sound/core.h index a61499c22b0b..89e0ac17f44a 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
| @@ -458,5 +458,8 @@ struct snd_pci_quirk { | |||
| 458 | const struct snd_pci_quirk * | 458 | const struct snd_pci_quirk * |
| 459 | snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list); | 459 | snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list); |
| 460 | 460 | ||
| 461 | const struct snd_pci_quirk * | ||
| 462 | snd_pci_quirk_lookup_id(u16 vendor, u16 device, | ||
| 463 | const struct snd_pci_quirk *list); | ||
| 461 | 464 | ||
| 462 | #endif /* __SOUND_CORE_H */ | 465 | #endif /* __SOUND_CORE_H */ |
diff --git a/include/sound/cs46xx_dsp_spos.h b/include/sound/cs46xx_dsp_spos.h index 7c44667e79a6..49b03c9e5e55 100644 --- a/include/sound/cs46xx_dsp_spos.h +++ b/include/sound/cs46xx_dsp_spos.h | |||
| @@ -118,9 +118,11 @@ struct dsp_scb_descriptor { | |||
| 118 | 118 | ||
| 119 | struct snd_info_entry *proc_info; | 119 | struct snd_info_entry *proc_info; |
| 120 | int ref_count; | 120 | int ref_count; |
| 121 | spinlock_t lock; | ||
| 122 | 121 | ||
| 123 | int deleted; | 122 | u16 volume[2]; |
| 123 | unsigned int deleted :1; | ||
| 124 | unsigned int updated :1; | ||
| 125 | unsigned int volume_set :1; | ||
| 124 | }; | 126 | }; |
| 125 | 127 | ||
| 126 | struct dsp_task_descriptor { | 128 | struct dsp_task_descriptor { |
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 6a664c3f7c1e..7dc97d12253c 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
| @@ -1707,6 +1707,7 @@ struct snd_emu10k1 { | |||
| 1707 | unsigned int card_type; /* EMU10K1_CARD_* */ | 1707 | unsigned int card_type; /* EMU10K1_CARD_* */ |
| 1708 | unsigned int ecard_ctrl; /* ecard control bits */ | 1708 | unsigned int ecard_ctrl; /* ecard control bits */ |
| 1709 | unsigned long dma_mask; /* PCI DMA mask */ | 1709 | unsigned long dma_mask; /* PCI DMA mask */ |
| 1710 | unsigned int delay_pcm_irq; /* in samples */ | ||
| 1710 | int max_cache_pages; /* max memory size / PAGE_SIZE */ | 1711 | int max_cache_pages; /* max memory size / PAGE_SIZE */ |
| 1711 | struct snd_dma_buffer silent_page; /* silent page */ | 1712 | struct snd_dma_buffer silent_page; /* silent page */ |
| 1712 | struct snd_dma_buffer ptb_pages; /* page table pages */ | 1713 | struct snd_dma_buffer ptb_pages; /* page table pages */ |
diff --git a/include/sound/es1688.h b/include/sound/es1688.h index 10fcf1465810..3ec7ecbe2502 100644 --- a/include/sound/es1688.h +++ b/include/sound/es1688.h | |||
| @@ -44,7 +44,6 @@ struct snd_es1688 { | |||
| 44 | unsigned char pad; | 44 | unsigned char pad; |
| 45 | unsigned int dma_size; | 45 | unsigned int dma_size; |
| 46 | 46 | ||
| 47 | struct snd_card *card; | ||
| 48 | struct snd_pcm *pcm; | 47 | struct snd_pcm *pcm; |
| 49 | struct snd_pcm_substream *playback_substream; | 48 | struct snd_pcm_substream *playback_substream; |
| 50 | struct snd_pcm_substream *capture_substream; | 49 | struct snd_pcm_substream *capture_substream; |
| @@ -108,14 +107,16 @@ struct snd_es1688 { | |||
| 108 | void snd_es1688_mixer_write(struct snd_es1688 *chip, unsigned char reg, unsigned char data); | 107 | void snd_es1688_mixer_write(struct snd_es1688 *chip, unsigned char reg, unsigned char data); |
| 109 | 108 | ||
| 110 | int snd_es1688_create(struct snd_card *card, | 109 | int snd_es1688_create(struct snd_card *card, |
| 110 | struct snd_es1688 *chip, | ||
| 111 | unsigned long port, | 111 | unsigned long port, |
| 112 | unsigned long mpu_port, | 112 | unsigned long mpu_port, |
| 113 | int irq, | 113 | int irq, |
| 114 | int mpu_irq, | 114 | int mpu_irq, |
| 115 | int dma8, | 115 | int dma8, |
| 116 | unsigned short hardware, | 116 | unsigned short hardware); |
| 117 | struct snd_es1688 ** rchip); | 117 | int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device, |
| 118 | int snd_es1688_pcm(struct snd_es1688 *chip, int device, struct snd_pcm ** rpcm); | 118 | struct snd_pcm **rpcm); |
| 119 | int snd_es1688_mixer(struct snd_es1688 *chip); | 119 | int snd_es1688_mixer(struct snd_card *card, struct snd_es1688 *chip); |
| 120 | int snd_es1688_reset(struct snd_es1688 *chip); | ||
| 120 | 121 | ||
| 121 | #endif /* __SOUND_ES1688_H */ | 122 | #endif /* __SOUND_ES1688_H */ |
diff --git a/include/sound/info.h b/include/sound/info.h index 112e8949e1a7..4e94cf1ff762 100644 --- a/include/sound/info.h +++ b/include/sound/info.h | |||
| @@ -51,18 +51,18 @@ struct snd_info_entry_ops { | |||
| 51 | unsigned short mode, void **file_private_data); | 51 | unsigned short mode, void **file_private_data); |
| 52 | int (*release)(struct snd_info_entry *entry, | 52 | int (*release)(struct snd_info_entry *entry, |
| 53 | unsigned short mode, void *file_private_data); | 53 | unsigned short mode, void *file_private_data); |
| 54 | long (*read)(struct snd_info_entry *entry, void *file_private_data, | 54 | ssize_t (*read)(struct snd_info_entry *entry, void *file_private_data, |
| 55 | struct file *file, char __user *buf, | 55 | struct file *file, char __user *buf, |
| 56 | unsigned long count, unsigned long pos); | 56 | size_t count, loff_t pos); |
| 57 | long (*write)(struct snd_info_entry *entry, void *file_private_data, | 57 | ssize_t (*write)(struct snd_info_entry *entry, void *file_private_data, |
| 58 | struct file *file, const char __user *buf, | 58 | struct file *file, const char __user *buf, |
| 59 | unsigned long count, unsigned long pos); | 59 | size_t count, loff_t pos); |
| 60 | long long (*llseek)(struct snd_info_entry *entry, | 60 | loff_t (*llseek)(struct snd_info_entry *entry, |
| 61 | void *file_private_data, struct file *file, | 61 | void *file_private_data, struct file *file, |
| 62 | long long offset, int orig); | 62 | loff_t offset, int orig); |
| 63 | unsigned int(*poll)(struct snd_info_entry *entry, | 63 | unsigned int (*poll)(struct snd_info_entry *entry, |
| 64 | void *file_private_data, struct file *file, | 64 | void *file_private_data, struct file *file, |
| 65 | poll_table *wait); | 65 | poll_table *wait); |
| 66 | int (*ioctl)(struct snd_info_entry *entry, void *file_private_data, | 66 | int (*ioctl)(struct snd_info_entry *entry, void *file_private_data, |
| 67 | struct file *file, unsigned int cmd, unsigned long arg); | 67 | struct file *file, unsigned int cmd, unsigned long arg); |
| 68 | int (*mmap)(struct snd_info_entry *entry, void *file_private_data, | 68 | int (*mmap)(struct snd_info_entry *entry, void *file_private_data, |
diff --git a/include/sound/jack.h b/include/sound/jack.h index f236e426a706..d90b9fa32707 100644 --- a/include/sound/jack.h +++ b/include/sound/jack.h | |||
| @@ -42,6 +42,11 @@ enum snd_jack_types { | |||
| 42 | SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ | 42 | SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ |
| 43 | SND_JACK_VIDEOOUT = 0x0010, | 43 | SND_JACK_VIDEOOUT = 0x0010, |
| 44 | SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, | 44 | SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, |
| 45 | |||
| 46 | /* Kept separate from switches to facilitate implementation */ | ||
| 47 | SND_JACK_BTN_0 = 0x4000, | ||
| 48 | SND_JACK_BTN_1 = 0x2000, | ||
| 49 | SND_JACK_BTN_2 = 0x1000, | ||
| 45 | }; | 50 | }; |
| 46 | 51 | ||
| 47 | struct snd_jack { | 52 | struct snd_jack { |
| @@ -50,6 +55,7 @@ struct snd_jack { | |||
| 50 | int type; | 55 | int type; |
| 51 | const char *id; | 56 | const char *id; |
| 52 | char name[100]; | 57 | char name[100]; |
| 58 | unsigned int key[3]; /* Keep in sync with definitions above */ | ||
| 53 | void *private_data; | 59 | void *private_data; |
| 54 | void (*private_free)(struct snd_jack *); | 60 | void (*private_free)(struct snd_jack *); |
| 55 | }; | 61 | }; |
| @@ -59,6 +65,8 @@ struct snd_jack { | |||
| 59 | int snd_jack_new(struct snd_card *card, const char *id, int type, | 65 | int snd_jack_new(struct snd_card *card, const char *id, int type, |
| 60 | struct snd_jack **jack); | 66 | struct snd_jack **jack); |
| 61 | void snd_jack_set_parent(struct snd_jack *jack, struct device *parent); | 67 | void snd_jack_set_parent(struct snd_jack *jack, struct device *parent); |
| 68 | int snd_jack_set_key(struct snd_jack *jack, enum snd_jack_types type, | ||
| 69 | int keytype); | ||
| 62 | 70 | ||
| 63 | void snd_jack_report(struct snd_jack *jack, int status); | 71 | void snd_jack_report(struct snd_jack *jack, int status); |
| 64 | 72 | ||
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index c83a4a79f16b..85f1c6bf8566 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/poll.h> | 29 | #include <linux/poll.h> |
| 30 | #include <linux/mm.h> | 30 | #include <linux/mm.h> |
| 31 | #include <linux/bitops.h> | 31 | #include <linux/bitops.h> |
| 32 | #include <linux/pm_qos_params.h> | ||
| 32 | 33 | ||
| 33 | #define snd_pcm_substream_chip(substream) ((substream)->private_data) | 34 | #define snd_pcm_substream_chip(substream) ((substream)->private_data) |
| 34 | #define snd_pcm_chip(pcm) ((pcm)->private_data) | 35 | #define snd_pcm_chip(pcm) ((pcm)->private_data) |
| @@ -173,6 +174,10 @@ struct snd_pcm_ops { | |||
| 173 | #define SNDRV_PCM_FMTBIT_U18_3LE (1ULL << SNDRV_PCM_FORMAT_U18_3LE) | 174 | #define SNDRV_PCM_FMTBIT_U18_3LE (1ULL << SNDRV_PCM_FORMAT_U18_3LE) |
| 174 | #define SNDRV_PCM_FMTBIT_S18_3BE (1ULL << SNDRV_PCM_FORMAT_S18_3BE) | 175 | #define SNDRV_PCM_FMTBIT_S18_3BE (1ULL << SNDRV_PCM_FORMAT_S18_3BE) |
| 175 | #define SNDRV_PCM_FMTBIT_U18_3BE (1ULL << SNDRV_PCM_FORMAT_U18_3BE) | 176 | #define SNDRV_PCM_FMTBIT_U18_3BE (1ULL << SNDRV_PCM_FORMAT_U18_3BE) |
| 177 | #define SNDRV_PCM_FMTBIT_G723_24 (1ULL << SNDRV_PCM_FORMAT_G723_24) | ||
| 178 | #define SNDRV_PCM_FMTBIT_G723_24_1B (1ULL << SNDRV_PCM_FORMAT_G723_24_1B) | ||
| 179 | #define SNDRV_PCM_FMTBIT_G723_40 (1ULL << SNDRV_PCM_FORMAT_G723_40) | ||
| 180 | #define SNDRV_PCM_FMTBIT_G723_40_1B (1ULL << SNDRV_PCM_FORMAT_G723_40_1B) | ||
| 176 | 181 | ||
| 177 | #ifdef SNDRV_LITTLE_ENDIAN | 182 | #ifdef SNDRV_LITTLE_ENDIAN |
| 178 | #define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE | 183 | #define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE |
| @@ -262,6 +267,8 @@ struct snd_pcm_hw_constraint_list { | |||
| 262 | unsigned int mask; | 267 | unsigned int mask; |
| 263 | }; | 268 | }; |
| 264 | 269 | ||
| 270 | struct snd_pcm_hwptr_log; | ||
| 271 | |||
| 265 | struct snd_pcm_runtime { | 272 | struct snd_pcm_runtime { |
| 266 | /* -- Status -- */ | 273 | /* -- Status -- */ |
| 267 | struct snd_pcm_substream *trigger_master; | 274 | struct snd_pcm_substream *trigger_master; |
| @@ -310,7 +317,9 @@ struct snd_pcm_runtime { | |||
| 310 | struct snd_pcm_mmap_control *control; | 317 | struct snd_pcm_mmap_control *control; |
| 311 | 318 | ||
| 312 | /* -- locking / scheduling -- */ | 319 | /* -- locking / scheduling -- */ |
| 313 | wait_queue_head_t sleep; | 320 | snd_pcm_uframes_t twake; /* do transfer (!poll) wakeup if non-zero */ |
| 321 | wait_queue_head_t sleep; /* poll sleep */ | ||
| 322 | wait_queue_head_t tsleep; /* transfer sleep */ | ||
| 314 | struct fasync_struct *fasync; | 323 | struct fasync_struct *fasync; |
| 315 | 324 | ||
| 316 | /* -- private section -- */ | 325 | /* -- private section -- */ |
| @@ -340,6 +349,10 @@ struct snd_pcm_runtime { | |||
| 340 | /* -- OSS things -- */ | 349 | /* -- OSS things -- */ |
| 341 | struct snd_pcm_oss_runtime oss; | 350 | struct snd_pcm_oss_runtime oss; |
| 342 | #endif | 351 | #endif |
| 352 | |||
| 353 | #ifdef CONFIG_SND_PCM_XRUN_DEBUG | ||
| 354 | struct snd_pcm_hwptr_log *hwptr_log; | ||
| 355 | #endif | ||
| 343 | }; | 356 | }; |
| 344 | 357 | ||
| 345 | struct snd_pcm_group { /* keep linked substreams */ | 358 | struct snd_pcm_group { /* keep linked substreams */ |
| @@ -357,7 +370,7 @@ struct snd_pcm_substream { | |||
| 357 | int number; | 370 | int number; |
| 358 | char name[32]; /* substream name */ | 371 | char name[32]; /* substream name */ |
| 359 | int stream; /* stream (direction) */ | 372 | int stream; /* stream (direction) */ |
| 360 | char latency_id[20]; /* latency identifier */ | 373 | struct pm_qos_request_list latency_pm_qos_req; /* pm_qos request */ |
| 361 | size_t buffer_bytes_max; /* limit ring buffer size */ | 374 | size_t buffer_bytes_max; /* limit ring buffer size */ |
| 362 | struct snd_dma_buffer dma_buffer; | 375 | struct snd_dma_buffer dma_buffer; |
| 363 | unsigned int dma_buf_id; | 376 | unsigned int dma_buf_id; |
| @@ -834,6 +847,8 @@ void snd_pcm_set_sync(struct snd_pcm_substream *substream); | |||
| 834 | int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream); | 847 | int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream); |
| 835 | int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, | 848 | int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, |
| 836 | unsigned int cmd, void *arg); | 849 | unsigned int cmd, void *arg); |
| 850 | int snd_pcm_update_state(struct snd_pcm_substream *substream, | ||
| 851 | struct snd_pcm_runtime *runtime); | ||
| 837 | int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream); | 852 | int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream); |
| 838 | int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream); | 853 | int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream); |
| 839 | int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream); | 854 | int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream); |
| @@ -905,6 +920,44 @@ int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm, | |||
| 905 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); | 920 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); |
| 906 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); | 921 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); |
| 907 | 922 | ||
| 923 | int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream, | ||
| 924 | size_t size, gfp_t gfp_flags); | ||
| 925 | int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream); | ||
| 926 | struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream, | ||
| 927 | unsigned long offset); | ||
| 928 | #if 0 /* for kernel-doc */ | ||
| 929 | /** | ||
| 930 | * snd_pcm_lib_alloc_vmalloc_buffer - allocate virtual DMA buffer | ||
| 931 | * @substream: the substream to allocate the buffer to | ||
| 932 | * @size: the requested buffer size, in bytes | ||
| 933 | * | ||
| 934 | * Allocates the PCM substream buffer using vmalloc(), i.e., the memory is | ||
| 935 | * contiguous in kernel virtual space, but not in physical memory. Use this | ||
| 936 | * if the buffer is accessed by kernel code but not by device DMA. | ||
| 937 | * | ||
| 938 | * Returns 1 if the buffer was changed, 0 if not changed, or a negative error | ||
| 939 | * code. | ||
| 940 | */ | ||
| 941 | static int snd_pcm_lib_alloc_vmalloc_buffer | ||
| 942 | (struct snd_pcm_substream *substream, size_t size); | ||
| 943 | /** | ||
| 944 | * snd_pcm_lib_alloc_vmalloc_32_buffer - allocate 32-bit-addressable buffer | ||
| 945 | * @substream: the substream to allocate the buffer to | ||
| 946 | * @size: the requested buffer size, in bytes | ||
| 947 | * | ||
| 948 | * This function works like snd_pcm_lib_alloc_vmalloc_buffer(), but uses | ||
| 949 | * vmalloc_32(), i.e., the pages are allocated from 32-bit-addressable memory. | ||
| 950 | */ | ||
| 951 | static int snd_pcm_lib_alloc_vmalloc_32_buffer | ||
| 952 | (struct snd_pcm_substream *substream, size_t size); | ||
| 953 | #endif | ||
| 954 | #define snd_pcm_lib_alloc_vmalloc_buffer(subs, size) \ | ||
| 955 | _snd_pcm_lib_alloc_vmalloc_buffer \ | ||
| 956 | (subs, size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO) | ||
| 957 | #define snd_pcm_lib_alloc_vmalloc_32_buffer(subs, size) \ | ||
| 958 | _snd_pcm_lib_alloc_vmalloc_buffer \ | ||
| 959 | (subs, size, GFP_KERNEL | GFP_DMA32 | __GFP_ZERO) | ||
| 960 | |||
| 908 | #ifdef CONFIG_SND_DMA_SGBUF | 961 | #ifdef CONFIG_SND_DMA_SGBUF |
| 909 | /* | 962 | /* |
| 910 | * SG-buffer handling | 963 | * SG-buffer handling |
| @@ -975,6 +1028,10 @@ int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_s | |||
| 975 | #define snd_pcm_lib_mmap_iomem NULL | 1028 | #define snd_pcm_lib_mmap_iomem NULL |
| 976 | #endif | 1029 | #endif |
| 977 | 1030 | ||
| 1031 | int snd_pcm_lib_mmap_noncached(struct snd_pcm_substream *substream, | ||
| 1032 | struct vm_area_struct *area); | ||
| 1033 | #define snd_pcm_lib_mmap_vmalloc snd_pcm_lib_mmap_noncached | ||
| 1034 | |||
| 978 | static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) | 1035 | static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) |
| 979 | { | 1036 | { |
| 980 | *max = dma < 4 ? 64 * 1024 : 128 * 1024; | 1037 | *max = dma < 4 ? 64 * 1024 : 128 * 1024; |
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h index cc4e226f35fd..760c969d885d 100644 --- a/include/sound/pcm_oss.h +++ b/include/sound/pcm_oss.h | |||
| @@ -61,7 +61,7 @@ struct snd_pcm_oss_runtime { | |||
| 61 | struct snd_pcm_plugin *plugin_first; | 61 | struct snd_pcm_plugin *plugin_first; |
| 62 | struct snd_pcm_plugin *plugin_last; | 62 | struct snd_pcm_plugin *plugin_last; |
| 63 | #endif | 63 | #endif |
| 64 | unsigned int prev_hw_ptr_interrupt; | 64 | unsigned int prev_hw_ptr_period; |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 67 | struct snd_pcm_oss_file { | 67 | struct snd_pcm_oss_file { |
diff --git a/include/sound/sb.h b/include/sound/sb.h index 4e62ee1e4115..95353542256a 100644 --- a/include/sound/sb.h +++ b/include/sound/sb.h | |||
| @@ -33,6 +33,7 @@ enum sb_hw_type { | |||
| 33 | SB_HW_20, | 33 | SB_HW_20, |
| 34 | SB_HW_201, | 34 | SB_HW_201, |
| 35 | SB_HW_PRO, | 35 | SB_HW_PRO, |
| 36 | SB_HW_JAZZ16, /* Media Vision Jazz16 */ | ||
| 36 | SB_HW_16, | 37 | SB_HW_16, |
| 37 | SB_HW_16CSP, /* SB16 with CSP chip */ | 38 | SB_HW_16CSP, /* SB16 with CSP chip */ |
| 38 | SB_HW_ALS100, /* Avance Logic ALS100 chip */ | 39 | SB_HW_ALS100, /* Avance Logic ALS100 chip */ |
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h index c0227361a876..9d51d6f35893 100644 --- a/include/sound/sh_fsi.h +++ b/include/sound/sh_fsi.h | |||
| @@ -12,6 +12,9 @@ | |||
| 12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #define FSI_PORT_A 0 | ||
| 16 | #define FSI_PORT_B 1 | ||
| 17 | |||
| 15 | /* flags format | 18 | /* flags format |
| 16 | 19 | ||
| 17 | * 0xABCDEEFF | 20 | * 0xABCDEEFF |
| @@ -55,12 +58,14 @@ | |||
| 55 | #define SH_FSI_GET_IFMT(x) ((x >> 8) & SH_FSI_FMT_MASK) | 58 | #define SH_FSI_GET_IFMT(x) ((x >> 8) & SH_FSI_FMT_MASK) |
| 56 | #define SH_FSI_GET_OFMT(x) ((x >> 0) & SH_FSI_FMT_MASK) | 59 | #define SH_FSI_GET_OFMT(x) ((x >> 0) & SH_FSI_FMT_MASK) |
| 57 | 60 | ||
| 58 | #define SH_FSI_FMT_MONO (1 << 0) | 61 | #define SH_FSI_FMT_MONO 0 |
| 59 | #define SH_FSI_FMT_MONO_DELAY (1 << 1) | 62 | #define SH_FSI_FMT_MONO_DELAY 1 |
| 60 | #define SH_FSI_FMT_PCM (1 << 2) | 63 | #define SH_FSI_FMT_PCM 2 |
| 61 | #define SH_FSI_FMT_I2S (1 << 3) | 64 | #define SH_FSI_FMT_I2S 3 |
| 62 | #define SH_FSI_FMT_TDM (1 << 4) | 65 | #define SH_FSI_FMT_TDM 4 |
| 63 | #define SH_FSI_FMT_TDM_DELAY (1 << 5) | 66 | #define SH_FSI_FMT_TDM_DELAY 5 |
| 67 | #define SH_FSI_FMT_SPDIF 6 | ||
| 68 | |||
| 64 | 69 | ||
| 65 | #define SH_FSI_IFMT_TDM_CH(x) \ | 70 | #define SH_FSI_IFMT_TDM_CH(x) \ |
| 66 | (SH_FSI_IFMT(TDM) | SH_FSI_SET_CH_I(x)) | 71 | (SH_FSI_IFMT(TDM) | SH_FSI_SET_CH_I(x)) |
| @@ -72,9 +77,41 @@ | |||
| 72 | #define SH_FSI_OFMT_TDM_DELAY_CH(x) \ | 77 | #define SH_FSI_OFMT_TDM_DELAY_CH(x) \ |
| 73 | (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x)) | 78 | (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x)) |
| 74 | 79 | ||
| 80 | |||
| 81 | /* | ||
| 82 | * set_rate return value | ||
| 83 | * | ||
| 84 | * see ACKMD/BPFMD on | ||
| 85 | * ACK_MD (FSI2) | ||
| 86 | * CKG1 (FSI) | ||
| 87 | * | ||
| 88 | * err: return value < 0 | ||
| 89 | * | ||
| 90 | * 0x-00000AB | ||
| 91 | * | ||
| 92 | * A: ACKMD value | ||
| 93 | * B: BPFMD value | ||
| 94 | */ | ||
| 95 | |||
| 96 | #define SH_FSI_ACKMD_MASK (0xF << 0) | ||
| 97 | #define SH_FSI_ACKMD_512 (1 << 0) | ||
| 98 | #define SH_FSI_ACKMD_256 (2 << 0) | ||
| 99 | #define SH_FSI_ACKMD_128 (3 << 0) | ||
| 100 | #define SH_FSI_ACKMD_64 (4 << 0) | ||
| 101 | #define SH_FSI_ACKMD_32 (5 << 0) | ||
| 102 | |||
| 103 | #define SH_FSI_BPFMD_MASK (0xF << 4) | ||
| 104 | #define SH_FSI_BPFMD_512 (1 << 4) | ||
| 105 | #define SH_FSI_BPFMD_256 (2 << 4) | ||
| 106 | #define SH_FSI_BPFMD_128 (3 << 4) | ||
| 107 | #define SH_FSI_BPFMD_64 (4 << 4) | ||
| 108 | #define SH_FSI_BPFMD_32 (5 << 4) | ||
| 109 | #define SH_FSI_BPFMD_16 (6 << 4) | ||
| 110 | |||
| 75 | struct sh_fsi_platform_info { | 111 | struct sh_fsi_platform_info { |
| 76 | unsigned long porta_flags; | 112 | unsigned long porta_flags; |
| 77 | unsigned long portb_flags; | 113 | unsigned long portb_flags; |
| 114 | int (*set_rate)(int is_porta, int rate); /* for master mode */ | ||
| 78 | }; | 115 | }; |
| 79 | 116 | ||
| 80 | extern struct snd_soc_dai fsi_soc_dai[2]; | 117 | extern struct snd_soc_dai fsi_soc_dai[2]; |
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index ca24e7f7a3f5..377693a14385 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | 16 | ||
| 17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
| 18 | 18 | ||
| 19 | #include <sound/soc.h> | ||
| 20 | |||
| 19 | struct snd_pcm_substream; | 21 | struct snd_pcm_substream; |
| 20 | 22 | ||
| 21 | /* | 23 | /* |
| @@ -180,6 +182,12 @@ struct snd_soc_dai_ops { | |||
| 180 | struct snd_soc_dai *); | 182 | struct snd_soc_dai *); |
| 181 | int (*trigger)(struct snd_pcm_substream *, int, | 183 | int (*trigger)(struct snd_pcm_substream *, int, |
| 182 | struct snd_soc_dai *); | 184 | struct snd_soc_dai *); |
| 185 | /* | ||
| 186 | * For hardware based FIFO caused delay reporting. | ||
| 187 | * Optional. | ||
| 188 | */ | ||
| 189 | snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, | ||
| 190 | struct snd_soc_dai *); | ||
| 183 | }; | 191 | }; |
| 184 | 192 | ||
| 185 | /* | 193 | /* |
| @@ -213,11 +221,9 @@ struct snd_soc_dai { | |||
| 213 | unsigned int symmetric_rates:1; | 221 | unsigned int symmetric_rates:1; |
| 214 | 222 | ||
| 215 | /* DAI runtime info */ | 223 | /* DAI runtime info */ |
| 216 | struct snd_pcm_runtime *runtime; | ||
| 217 | struct snd_soc_codec *codec; | 224 | struct snd_soc_codec *codec; |
| 218 | unsigned int active; | 225 | unsigned int active; |
| 219 | unsigned char pop_wait:1; | 226 | unsigned char pop_wait:1; |
| 220 | void *dma_data; | ||
| 221 | 227 | ||
| 222 | /* DAI private data */ | 228 | /* DAI private data */ |
| 223 | void *private_data; | 229 | void *private_data; |
| @@ -228,4 +234,21 @@ struct snd_soc_dai { | |||
| 228 | struct list_head list; | 234 | struct list_head list; |
| 229 | }; | 235 | }; |
| 230 | 236 | ||
| 237 | static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai, | ||
| 238 | const struct snd_pcm_substream *ss) | ||
| 239 | { | ||
| 240 | return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ? | ||
| 241 | dai->playback.dma_data : dai->capture.dma_data; | ||
| 242 | } | ||
| 243 | |||
| 244 | static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai, | ||
| 245 | const struct snd_pcm_substream *ss, | ||
| 246 | void *data) | ||
| 247 | { | ||
| 248 | if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
| 249 | dai->playback.dma_data = data; | ||
| 250 | else | ||
| 251 | dai->capture.dma_data = data; | ||
| 252 | } | ||
| 253 | |||
| 231 | #endif | 254 | #endif |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index c5c95e1da65b..c5d9987bc897 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
| @@ -95,6 +95,21 @@ | |||
| 95 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ | 95 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ |
| 96 | .num_kcontrols = 1} | 96 | .num_kcontrols = 1} |
| 97 | 97 | ||
| 98 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ | ||
| 99 | #define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ | ||
| 100 | wcontrols) \ | ||
| 101 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | ||
| 102 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} | ||
| 103 | #define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ | ||
| 104 | wcontrols)\ | ||
| 105 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | ||
| 106 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} | ||
| 107 | #define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ | ||
| 108 | wcontrols)\ | ||
| 109 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ | ||
| 110 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ | ||
| 111 | .num_kcontrols = ARRAY_SIZE(wcontrols)} | ||
| 112 | |||
| 98 | /* path domain with event - event handler must return 0 for success */ | 113 | /* path domain with event - event handler must return 0 for success */ |
| 99 | #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ | 114 | #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ |
| 100 | wncontrols, wevent, wflags) \ | 115 | wncontrols, wevent, wflags) \ |
| @@ -126,6 +141,23 @@ | |||
| 126 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ | 141 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ |
| 127 | .event = wevent, .event_flags = wflags} | 142 | .event = wevent, .event_flags = wflags} |
| 128 | 143 | ||
| 144 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ | ||
| 145 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ | ||
| 146 | wevent, wflags) \ | ||
| 147 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | ||
| 148 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ | ||
| 149 | .event = wevent, .event_flags = wflags} | ||
| 150 | #define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ | ||
| 151 | wevent, wflags) \ | ||
| 152 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | ||
| 153 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ | ||
| 154 | .event = wevent, .event_flags = wflags} | ||
| 155 | #define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ | ||
| 156 | wcontrols, wevent, wflags) \ | ||
| 157 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | ||
| 158 | .invert = winvert, .kcontrols = wcontrols, \ | ||
| 159 | .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags} | ||
| 160 | |||
| 129 | /* events that are pre and post DAPM */ | 161 | /* events that are pre and post DAPM */ |
| 130 | #define SND_SOC_DAPM_PRE(wname, wevent) \ | 162 | #define SND_SOC_DAPM_PRE(wname, wevent) \ |
| 131 | { .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \ | 163 | { .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \ |
| @@ -241,6 +273,8 @@ | |||
| 241 | #define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ | 273 | #define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ |
| 242 | #define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ | 274 | #define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ |
| 243 | #define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ | 275 | #define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ |
| 276 | #define SND_SOC_DAPM_PRE_POST_PMD \ | ||
| 277 | (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD) | ||
| 244 | 278 | ||
| 245 | /* convenience event type detection */ | 279 | /* convenience event type detection */ |
| 246 | #define SND_SOC_DAPM_EVENT_ON(e) \ | 280 | #define SND_SOC_DAPM_EVENT_ON(e) \ |
| @@ -307,6 +341,9 @@ int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, const char *pin); | |||
| 307 | int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin); | 341 | int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin); |
| 308 | int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin); | 342 | int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin); |
| 309 | int snd_soc_dapm_sync(struct snd_soc_codec *codec); | 343 | int snd_soc_dapm_sync(struct snd_soc_codec *codec); |
| 344 | int snd_soc_dapm_force_enable_pin(struct snd_soc_codec *codec, | ||
| 345 | const char *pin); | ||
| 346 | int snd_soc_dapm_ignore_suspend(struct snd_soc_codec *codec, const char *pin); | ||
| 310 | 347 | ||
| 311 | /* dapm widget types */ | 348 | /* dapm widget types */ |
| 312 | enum snd_soc_dapm_type { | 349 | enum snd_soc_dapm_type { |
| @@ -393,9 +430,8 @@ struct snd_soc_dapm_widget { | |||
| 393 | unsigned char connected:1; /* connected codec pin */ | 430 | unsigned char connected:1; /* connected codec pin */ |
| 394 | unsigned char new:1; /* cnew complete */ | 431 | unsigned char new:1; /* cnew complete */ |
| 395 | unsigned char ext:1; /* has external widgets */ | 432 | unsigned char ext:1; /* has external widgets */ |
| 396 | unsigned char muted:1; /* muted for pop reduction */ | 433 | unsigned char force:1; /* force state */ |
| 397 | unsigned char suspend:1; /* was active before suspend */ | 434 | unsigned char ignore_suspend:1; /* kept enabled over suspend */ |
| 398 | unsigned char pmdown:1; /* waiting for timeout */ | ||
| 399 | 435 | ||
| 400 | int (*power_check)(struct snd_soc_dapm_widget *w); | 436 | int (*power_check)(struct snd_soc_dapm_widget *w); |
| 401 | 437 | ||
diff --git a/include/sound/soc.h b/include/sound/soc.h index 0d7718f9280d..65e9d03ed4f5 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 18 | #include <linux/notifier.h> | ||
| 18 | #include <linux/workqueue.h> | 19 | #include <linux/workqueue.h> |
| 19 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
| 20 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
| @@ -29,10 +30,10 @@ | |||
| 29 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ | 30 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ |
| 30 | ((unsigned long)&(struct soc_mixer_control) \ | 31 | ((unsigned long)&(struct soc_mixer_control) \ |
| 31 | {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \ | 32 | {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \ |
| 32 | .invert = xinvert}) | 33 | .platform_max = xmax, .invert = xinvert}) |
| 33 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ | 34 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ |
| 34 | ((unsigned long)&(struct soc_mixer_control) \ | 35 | ((unsigned long)&(struct soc_mixer_control) \ |
| 35 | {.reg = xreg, .max = xmax, .invert = xinvert}) | 36 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) |
| 36 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ | 37 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ |
| 37 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 38 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| 38 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 39 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
| @@ -52,14 +53,14 @@ | |||
| 52 | .put = snd_soc_put_volsw, \ | 53 | .put = snd_soc_put_volsw, \ |
| 53 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 54 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 54 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 55 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ |
| 55 | .max = xmax, .invert = xinvert} } | 56 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 56 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ | 57 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ |
| 57 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 58 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
| 58 | .info = snd_soc_info_volsw_2r, \ | 59 | .info = snd_soc_info_volsw_2r, \ |
| 59 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ | 60 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ |
| 60 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 61 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 61 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 62 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ |
| 62 | .max = xmax, .invert = xinvert} } | 63 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 63 | #define SOC_DOUBLE_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert, tlv_array) \ | 64 | #define SOC_DOUBLE_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert, tlv_array) \ |
| 64 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 65 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
| 65 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 66 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
| @@ -69,7 +70,7 @@ | |||
| 69 | .put = snd_soc_put_volsw, \ | 70 | .put = snd_soc_put_volsw, \ |
| 70 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 71 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 71 | {.reg = xreg, .shift = shift_left, .rshift = shift_right,\ | 72 | {.reg = xreg, .shift = shift_left, .rshift = shift_right,\ |
| 72 | .max = xmax, .invert = xinvert} } | 73 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 73 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ | 74 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ |
| 74 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 75 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
| 75 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 76 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
| @@ -79,7 +80,7 @@ | |||
| 79 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ | 80 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ |
| 80 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 81 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 81 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 82 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ |
| 82 | .max = xmax, .invert = xinvert} } | 83 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 83 | #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ | 84 | #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ |
| 84 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 85 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
| 85 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 86 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
| @@ -88,7 +89,8 @@ | |||
| 88 | .info = snd_soc_info_volsw_s8, .get = snd_soc_get_volsw_s8, \ | 89 | .info = snd_soc_info_volsw_s8, .get = snd_soc_get_volsw_s8, \ |
| 89 | .put = snd_soc_put_volsw_s8, \ | 90 | .put = snd_soc_put_volsw_s8, \ |
| 90 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 91 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 91 | {.reg = xreg, .min = xmin, .max = xmax} } | 92 | {.reg = xreg, .min = xmin, .max = xmax, \ |
| 93 | .platform_max = xmax} } | ||
| 92 | #define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \ | 94 | #define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \ |
| 93 | { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ | 95 | { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ |
| 94 | .max = xmax, .texts = xtexts } | 96 | .max = xmax, .texts = xtexts } |
| @@ -125,7 +127,7 @@ | |||
| 125 | .get = xhandler_get, .put = xhandler_put, \ | 127 | .get = xhandler_get, .put = xhandler_put, \ |
| 126 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 128 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 127 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 129 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ |
| 128 | .max = xmax, .invert = xinvert} } | 130 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 129 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ | 131 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ |
| 130 | xhandler_get, xhandler_put, tlv_array) \ | 132 | xhandler_get, xhandler_put, tlv_array) \ |
| 131 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 133 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| @@ -145,7 +147,7 @@ | |||
| 145 | .get = xhandler_get, .put = xhandler_put, \ | 147 | .get = xhandler_get, .put = xhandler_put, \ |
| 146 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 148 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 147 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 149 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ |
| 148 | .max = xmax, .invert = xinvert} } | 150 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 149 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ | 151 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ |
| 150 | xhandler_get, xhandler_put, tlv_array) \ | 152 | xhandler_get, xhandler_put, tlv_array) \ |
| 151 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 153 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
| @@ -156,7 +158,7 @@ | |||
| 156 | .get = xhandler_get, .put = xhandler_put, \ | 158 | .get = xhandler_get, .put = xhandler_put, \ |
| 157 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 159 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 158 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 160 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ |
| 159 | .max = xmax, .invert = xinvert} } | 161 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 160 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ | 162 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ |
| 161 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 163 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| 162 | .info = snd_soc_info_bool_ext, \ | 164 | .info = snd_soc_info_bool_ext, \ |
| @@ -168,6 +170,38 @@ | |||
| 168 | .get = xhandler_get, .put = xhandler_put, \ | 170 | .get = xhandler_get, .put = xhandler_put, \ |
| 169 | .private_value = (unsigned long)&xenum } | 171 | .private_value = (unsigned long)&xenum } |
| 170 | 172 | ||
| 173 | #define SOC_DOUBLE_R_SX_TLV(xname, xreg_left, xreg_right, xshift,\ | ||
| 174 | xmin, xmax, tlv_array) \ | ||
| 175 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | ||
| 176 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | ||
| 177 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ | ||
| 178 | .tlv.p = (tlv_array), \ | ||
| 179 | .info = snd_soc_info_volsw_2r_sx, \ | ||
| 180 | .get = snd_soc_get_volsw_2r_sx, \ | ||
| 181 | .put = snd_soc_put_volsw_2r_sx, \ | ||
| 182 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
| 183 | {.reg = xreg_left, \ | ||
| 184 | .rreg = xreg_right, .shift = xshift, \ | ||
| 185 | .min = xmin, .max = xmax} } | ||
| 186 | |||
| 187 | |||
| 188 | /* | ||
| 189 | * Simplified versions of above macros, declaring a struct and calculating | ||
| 190 | * ARRAY_SIZE internally | ||
| 191 | */ | ||
| 192 | #define SOC_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xtexts) \ | ||
| 193 | struct soc_enum name = SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, \ | ||
| 194 | ARRAY_SIZE(xtexts), xtexts) | ||
| 195 | #define SOC_ENUM_SINGLE_DECL(name, xreg, xshift, xtexts) \ | ||
| 196 | SOC_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xtexts) | ||
| 197 | #define SOC_ENUM_SINGLE_EXT_DECL(name, xtexts) \ | ||
| 198 | struct soc_enum name = SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(xtexts), xtexts) | ||
| 199 | #define SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xmask, xtexts, xvalues) \ | ||
| 200 | struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, \ | ||
| 201 | ARRAY_SIZE(xtexts), xtexts, xvalues) | ||
| 202 | #define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \ | ||
| 203 | SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues) | ||
| 204 | |||
| 171 | /* | 205 | /* |
| 172 | * Bias levels | 206 | * Bias levels |
| 173 | * | 207 | * |
| @@ -195,6 +229,7 @@ struct snd_soc_dai_mode; | |||
| 195 | struct snd_soc_pcm_runtime; | 229 | struct snd_soc_pcm_runtime; |
| 196 | struct snd_soc_dai; | 230 | struct snd_soc_dai; |
| 197 | struct snd_soc_platform; | 231 | struct snd_soc_platform; |
| 232 | struct snd_soc_dai_link; | ||
| 198 | struct snd_soc_codec; | 233 | struct snd_soc_codec; |
| 199 | struct soc_enum; | 234 | struct soc_enum; |
| 200 | struct snd_soc_ac97_ops; | 235 | struct snd_soc_ac97_ops; |
| @@ -243,6 +278,10 @@ int snd_soc_jack_new(struct snd_soc_card *card, const char *id, int type, | |||
| 243 | void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); | 278 | void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); |
| 244 | int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, | 279 | int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, |
| 245 | struct snd_soc_jack_pin *pins); | 280 | struct snd_soc_jack_pin *pins); |
| 281 | void snd_soc_jack_notifier_register(struct snd_soc_jack *jack, | ||
| 282 | struct notifier_block *nb); | ||
| 283 | void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack, | ||
| 284 | struct notifier_block *nb); | ||
| 246 | #ifdef CONFIG_GPIOLIB | 285 | #ifdef CONFIG_GPIOLIB |
| 247 | int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, | 286 | int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, |
| 248 | struct snd_soc_jack_gpio *gpios); | 287 | struct snd_soc_jack_gpio *gpios); |
| @@ -253,6 +292,9 @@ void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, | |||
| 253 | /* codec register bit access */ | 292 | /* codec register bit access */ |
| 254 | int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, | 293 | int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, |
| 255 | unsigned int mask, unsigned int value); | 294 | unsigned int mask, unsigned int value); |
| 295 | int snd_soc_update_bits_locked(struct snd_soc_codec *codec, | ||
| 296 | unsigned short reg, unsigned int mask, | ||
| 297 | unsigned int value); | ||
| 256 | int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, | 298 | int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, |
| 257 | unsigned int mask, unsigned int value); | 299 | unsigned int mask, unsigned int value); |
| 258 | 300 | ||
| @@ -300,6 +342,14 @@ int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, | |||
| 300 | struct snd_ctl_elem_value *ucontrol); | 342 | struct snd_ctl_elem_value *ucontrol); |
| 301 | int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, | 343 | int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, |
| 302 | struct snd_ctl_elem_value *ucontrol); | 344 | struct snd_ctl_elem_value *ucontrol); |
| 345 | int snd_soc_limit_volume(struct snd_soc_codec *codec, | ||
| 346 | const char *name, int max); | ||
| 347 | int snd_soc_info_volsw_2r_sx(struct snd_kcontrol *kcontrol, | ||
| 348 | struct snd_ctl_elem_info *uinfo); | ||
| 349 | int snd_soc_get_volsw_2r_sx(struct snd_kcontrol *kcontrol, | ||
| 350 | struct snd_ctl_elem_value *ucontrol); | ||
| 351 | int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol, | ||
| 352 | struct snd_ctl_elem_value *ucontrol); | ||
| 303 | 353 | ||
| 304 | /** | 354 | /** |
| 305 | * struct snd_soc_jack_pin - Describes a pin to update based on jack detection | 355 | * struct snd_soc_jack_pin - Describes a pin to update based on jack detection |
| @@ -343,6 +393,7 @@ struct snd_soc_jack { | |||
| 343 | struct snd_soc_card *card; | 393 | struct snd_soc_card *card; |
| 344 | struct list_head pins; | 394 | struct list_head pins; |
| 345 | int status; | 395 | int status; |
| 396 | struct blocking_notifier_head notifier; | ||
| 346 | }; | 397 | }; |
| 347 | 398 | ||
| 348 | /* SoC PCM stream information */ | 399 | /* SoC PCM stream information */ |
| @@ -354,7 +405,8 @@ struct snd_soc_pcm_stream { | |||
| 354 | unsigned int rate_max; /* max rate */ | 405 | unsigned int rate_max; /* max rate */ |
| 355 | unsigned int channels_min; /* min channels */ | 406 | unsigned int channels_min; /* min channels */ |
| 356 | unsigned int channels_max; /* max channels */ | 407 | unsigned int channels_max; /* max channels */ |
| 357 | unsigned int active:1; /* stream is in use */ | 408 | unsigned int active; /* stream is in use */ |
| 409 | void *dma_data; /* used by platform code */ | ||
| 358 | }; | 410 | }; |
| 359 | 411 | ||
| 360 | /* SoC audio ops */ | 412 | /* SoC audio ops */ |
| @@ -386,7 +438,7 @@ struct snd_soc_codec { | |||
| 386 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ | 438 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ |
| 387 | unsigned int active; | 439 | unsigned int active; |
| 388 | unsigned int pcm_devs; | 440 | unsigned int pcm_devs; |
| 389 | void *private_data; | 441 | void *drvdata; |
| 390 | 442 | ||
| 391 | /* codec IO */ | 443 | /* codec IO */ |
| 392 | void *control_data; /* codec control (i2c/3wire) data */ | 444 | void *control_data; /* codec control (i2c/3wire) data */ |
| @@ -402,6 +454,10 @@ struct snd_soc_codec { | |||
| 402 | short reg_cache_size; | 454 | short reg_cache_size; |
| 403 | short reg_cache_step; | 455 | short reg_cache_step; |
| 404 | 456 | ||
| 457 | unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ | ||
| 458 | unsigned int cache_only:1; /* Suppress writes to hardware */ | ||
| 459 | unsigned int cache_sync:1; /* Cache needs to be synced to hardware */ | ||
| 460 | |||
| 405 | /* dapm */ | 461 | /* dapm */ |
| 406 | u32 pop_time; | 462 | u32 pop_time; |
| 407 | struct list_head dapm_widgets; | 463 | struct list_head dapm_widgets; |
| @@ -437,14 +493,21 @@ struct snd_soc_platform { | |||
| 437 | 493 | ||
| 438 | int (*probe)(struct platform_device *pdev); | 494 | int (*probe)(struct platform_device *pdev); |
| 439 | int (*remove)(struct platform_device *pdev); | 495 | int (*remove)(struct platform_device *pdev); |
| 440 | int (*suspend)(struct snd_soc_dai *dai); | 496 | int (*suspend)(struct snd_soc_dai_link *dai_link); |
| 441 | int (*resume)(struct snd_soc_dai *dai); | 497 | int (*resume)(struct snd_soc_dai_link *dai_link); |
| 442 | 498 | ||
| 443 | /* pcm creation and destruction */ | 499 | /* pcm creation and destruction */ |
| 444 | int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, | 500 | int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, |
| 445 | struct snd_pcm *); | 501 | struct snd_pcm *); |
| 446 | void (*pcm_free)(struct snd_pcm *); | 502 | void (*pcm_free)(struct snd_pcm *); |
| 447 | 503 | ||
| 504 | /* | ||
| 505 | * For platform caused delay reporting. | ||
| 506 | * Optional. | ||
| 507 | */ | ||
| 508 | snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, | ||
| 509 | struct snd_soc_dai *); | ||
| 510 | |||
| 448 | /* platform stream ops */ | 511 | /* platform stream ops */ |
| 449 | struct snd_pcm_ops *pcm_ops; | 512 | struct snd_pcm_ops *pcm_ops; |
| 450 | }; | 513 | }; |
| @@ -464,6 +527,9 @@ struct snd_soc_dai_link { | |||
| 464 | /* codec/machine specific init - e.g. add machine controls */ | 527 | /* codec/machine specific init - e.g. add machine controls */ |
| 465 | int (*init)(struct snd_soc_codec *codec); | 528 | int (*init)(struct snd_soc_codec *codec); |
| 466 | 529 | ||
| 530 | /* Keep DAI active over suspend */ | ||
| 531 | unsigned int ignore_suspend:1; | ||
| 532 | |||
| 467 | /* Symmetry requirements */ | 533 | /* Symmetry requirements */ |
| 468 | unsigned int symmetric_rates:1; | 534 | unsigned int symmetric_rates:1; |
| 469 | 535 | ||
| @@ -497,6 +563,8 @@ struct snd_soc_card { | |||
| 497 | int (*set_bias_level)(struct snd_soc_card *, | 563 | int (*set_bias_level)(struct snd_soc_card *, |
| 498 | enum snd_soc_bias_level level); | 564 | enum snd_soc_bias_level level); |
| 499 | 565 | ||
| 566 | long pmdown_time; | ||
| 567 | |||
| 500 | /* CPU <--> Codec DAI links */ | 568 | /* CPU <--> Codec DAI links */ |
| 501 | struct snd_soc_dai_link *dai_link; | 569 | struct snd_soc_dai_link *dai_link; |
| 502 | int num_links; | 570 | int num_links; |
| @@ -526,7 +594,7 @@ struct snd_soc_pcm_runtime { | |||
| 526 | 594 | ||
| 527 | /* mixer control */ | 595 | /* mixer control */ |
| 528 | struct soc_mixer_control { | 596 | struct soc_mixer_control { |
| 529 | int min, max; | 597 | int min, max, platform_max; |
| 530 | unsigned int reg, rreg, shift, rshift, invert; | 598 | unsigned int reg, rreg, shift, rshift, invert; |
| 531 | }; | 599 | }; |
| 532 | 600 | ||
| @@ -556,6 +624,17 @@ static inline unsigned int snd_soc_write(struct snd_soc_codec *codec, | |||
| 556 | return codec->write(codec, reg, val); | 624 | return codec->write(codec, reg, val); |
| 557 | } | 625 | } |
| 558 | 626 | ||
| 627 | static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec, | ||
| 628 | void *data) | ||
| 629 | { | ||
| 630 | codec->drvdata = data; | ||
| 631 | } | ||
| 632 | |||
| 633 | static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec) | ||
| 634 | { | ||
| 635 | return codec->drvdata; | ||
| 636 | } | ||
| 637 | |||
| 559 | #include <sound/soc-dai.h> | 638 | #include <sound/soc-dai.h> |
| 560 | 639 | ||
| 561 | #endif | 640 | #endif |
diff --git a/include/sound/tlv320aic3x.h b/include/sound/tlv320aic3x.h new file mode 100644 index 000000000000..b1a5f34e5cfa --- /dev/null +++ b/include/sound/tlv320aic3x.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* | ||
| 2 | * Platform data for Texas Instruments TLV320AIC3x codec | ||
| 3 | * | ||
| 4 | * Author: Jarkko Nikula <jhnikula@gmail.com> | ||
| 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 | #ifndef __TLV320AIC3x_H__ | ||
| 11 | #define __TLV320AIC3x_H__ | ||
| 12 | |||
| 13 | struct aic3x_pdata { | ||
| 14 | int gpio_reset; /* < 0 if not used */ | ||
| 15 | }; | ||
| 16 | |||
| 17 | #endif \ No newline at end of file | ||
diff --git a/include/sound/tlv320dac33-plat.h b/include/sound/tlv320dac33-plat.h index 5858d06a7ffa..6c6649656798 100644 --- a/include/sound/tlv320dac33-plat.h +++ b/include/sound/tlv320dac33-plat.h | |||
| @@ -15,6 +15,10 @@ | |||
| 15 | 15 | ||
| 16 | struct tlv320dac33_platform_data { | 16 | struct tlv320dac33_platform_data { |
| 17 | int power_gpio; | 17 | int power_gpio; |
| 18 | int mode1_latency; /* latency caused by the i2c writes in us */ | ||
| 19 | int auto_fifo_config; /* FIFO config based on the period size */ | ||
| 20 | int keep_bclk; /* Keep the BCLK running in FIFO modes */ | ||
| 21 | u8 burst_bclkdiv; | ||
| 18 | }; | 22 | }; |
| 19 | 23 | ||
| 20 | #endif /* __TLV320DAC33_PLAT_H */ | 24 | #endif /* __TLV320DAC33_PLAT_H */ |
diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h index e8c901e749d8..e29fde6b5cbe 100644 --- a/include/sound/tpa6130a2-plat.h +++ b/include/sound/tpa6130a2-plat.h | |||
| @@ -23,7 +23,13 @@ | |||
| 23 | #ifndef TPA6130A2_PLAT_H | 23 | #ifndef TPA6130A2_PLAT_H |
| 24 | #define TPA6130A2_PLAT_H | 24 | #define TPA6130A2_PLAT_H |
| 25 | 25 | ||
| 26 | enum tpa_model { | ||
| 27 | TPA6130A2, | ||
| 28 | TPA6140A2, | ||
| 29 | }; | ||
| 30 | |||
| 26 | struct tpa6130a2_platform_data { | 31 | struct tpa6130a2_platform_data { |
| 32 | enum tpa_model id; | ||
| 27 | int power_gpio; | 33 | int power_gpio; |
| 28 | }; | 34 | }; |
| 29 | 35 | ||
diff --git a/include/sound/uda134x.h b/include/sound/uda134x.h index 475ef8bb7dcd..e475659bd3be 100644 --- a/include/sound/uda134x.h +++ b/include/sound/uda134x.h | |||
| @@ -18,9 +18,22 @@ struct uda134x_platform_data { | |||
| 18 | struct l3_pins l3; | 18 | struct l3_pins l3; |
| 19 | void (*power) (int); | 19 | void (*power) (int); |
| 20 | int model; | 20 | int model; |
| 21 | /* | ||
| 22 | ALSA SOC usually puts the device in standby mode when it's not used | ||
| 23 | for sometime. If you unset is_powered_on_standby the driver will | ||
| 24 | turn off the ADC/DAC when this callback is invoked and turn it back | ||
| 25 | on when needed. Unfortunately this will result in a very light bump | ||
| 26 | (it can be audible only with good earphones). If this bothers you | ||
| 27 | set is_powered_on_standby, you will have slightly higher power | ||
| 28 | consumption. Please note that sending the L3 command for ADC is | ||
| 29 | enough to make the bump, so it doesn't make difference if you | ||
| 30 | completely take off power from the codec. | ||
| 31 | */ | ||
| 32 | int is_powered_on_standby; | ||
| 21 | #define UDA134X_UDA1340 1 | 33 | #define UDA134X_UDA1340 1 |
| 22 | #define UDA134X_UDA1341 2 | 34 | #define UDA134X_UDA1341 2 |
| 23 | #define UDA134X_UDA1344 3 | 35 | #define UDA134X_UDA1344 3 |
| 36 | #define UDA134X_UDA1345 4 | ||
| 24 | }; | 37 | }; |
| 25 | 38 | ||
| 26 | #endif /* _UDA134X_H */ | 39 | #endif /* _UDA134X_H */ |
diff --git a/include/sound/version.h b/include/sound/version.h index 22939142dd23..bf69a5b7e65f 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
| @@ -1,3 +1,3 @@ | |||
| 1 | /* include/version.h */ | 1 | /* include/version.h */ |
| 2 | #define CONFIG_SND_VERSION "1.0.21" | 2 | #define CONFIG_SND_VERSION "1.0.23" |
| 3 | #define CONFIG_SND_DATE "" | 3 | #define CONFIG_SND_DATE "" |
diff --git a/include/sound/wm2000.h b/include/sound/wm2000.h new file mode 100644 index 000000000000..aa388ca9ec64 --- /dev/null +++ b/include/sound/wm2000.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/wm2000.h -- Platform data for WM2000 | ||
| 3 | * | ||
| 4 | * Copyright 2010 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_WM2000_H | ||
| 12 | #define __LINUX_SND_WM2000_H | ||
| 13 | |||
| 14 | struct wm2000_platform_data { | ||
| 15 | /** Filename for system-specific image to download to device. */ | ||
| 16 | const char *download_file; | ||
| 17 | |||
| 18 | /** Divide MCLK by 2 for system clock? */ | ||
| 19 | unsigned int mclkdiv2:1; | ||
| 20 | |||
| 21 | /** Disable speech clarity enhancement, for use when an | ||
| 22 | * external algorithm is used. */ | ||
| 23 | unsigned int speech_enh_disable:1; | ||
| 24 | }; | ||
| 25 | |||
| 26 | #endif | ||
diff --git a/include/sound/wm8903.h b/include/sound/wm8903.h new file mode 100644 index 000000000000..b4a0db2307ef --- /dev/null +++ b/include/sound/wm8903.h | |||
| @@ -0,0 +1,249 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/wm8903.h -- Platform data for WM8903 | ||
| 3 | * | ||
| 4 | * Copyright 2010 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 | /* Used to enable configuration of a GPIO to all zeros */ | ||
| 15 | #define WM8903_GPIO_NO_CONFIG 0x8000 | ||
| 16 | |||
| 17 | /* | ||
| 18 | * R6 (0x06) - Mic Bias Control 0 | ||
| 19 | */ | ||
| 20 | #define WM8903_MICDET_HYST_ENA 0x0080 /* MICDET_HYST_ENA */ | ||
| 21 | #define WM8903_MICDET_HYST_ENA_MASK 0x0080 /* MICDET_HYST_ENA */ | ||
| 22 | #define WM8903_MICDET_HYST_ENA_SHIFT 7 /* MICDET_HYST_ENA */ | ||
| 23 | #define WM8903_MICDET_HYST_ENA_WIDTH 1 /* MICDET_HYST_ENA */ | ||
| 24 | #define WM8903_MICDET_THR_MASK 0x0070 /* MICDET_THR - [6:4] */ | ||
| 25 | #define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [6:4] */ | ||
| 26 | #define WM8903_MICDET_THR_WIDTH 3 /* MICDET_THR - [6:4] */ | ||
| 27 | #define WM8903_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */ | ||
| 28 | #define WM8903_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */ | ||
| 29 | #define WM8903_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */ | ||
| 30 | #define WM8903_MICDET_ENA 0x0002 /* MICDET_ENA */ | ||
| 31 | #define WM8903_MICDET_ENA_MASK 0x0002 /* MICDET_ENA */ | ||
| 32 | #define WM8903_MICDET_ENA_SHIFT 1 /* MICDET_ENA */ | ||
| 33 | #define WM8903_MICDET_ENA_WIDTH 1 /* MICDET_ENA */ | ||
| 34 | #define WM8903_MICBIAS_ENA 0x0001 /* MICBIAS_ENA */ | ||
| 35 | #define WM8903_MICBIAS_ENA_MASK 0x0001 /* MICBIAS_ENA */ | ||
| 36 | #define WM8903_MICBIAS_ENA_SHIFT 0 /* MICBIAS_ENA */ | ||
| 37 | #define WM8903_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */ | ||
| 38 | |||
| 39 | /* | ||
| 40 | * R116 (0x74) - GPIO Control 1 | ||
| 41 | */ | ||
| 42 | #define WM8903_GP1_FN_MASK 0x1F00 /* GP1_FN - [12:8] */ | ||
| 43 | #define WM8903_GP1_FN_SHIFT 8 /* GP1_FN - [12:8] */ | ||
| 44 | #define WM8903_GP1_FN_WIDTH 5 /* GP1_FN - [12:8] */ | ||
| 45 | #define WM8903_GP1_DIR 0x0080 /* GP1_DIR */ | ||
| 46 | #define WM8903_GP1_DIR_MASK 0x0080 /* GP1_DIR */ | ||
| 47 | #define WM8903_GP1_DIR_SHIFT 7 /* GP1_DIR */ | ||
| 48 | #define WM8903_GP1_DIR_WIDTH 1 /* GP1_DIR */ | ||
| 49 | #define WM8903_GP1_OP_CFG 0x0040 /* GP1_OP_CFG */ | ||
| 50 | #define WM8903_GP1_OP_CFG_MASK 0x0040 /* GP1_OP_CFG */ | ||
| 51 | #define WM8903_GP1_OP_CFG_SHIFT 6 /* GP1_OP_CFG */ | ||
| 52 | #define WM8903_GP1_OP_CFG_WIDTH 1 /* GP1_OP_CFG */ | ||
| 53 | #define WM8903_GP1_IP_CFG 0x0020 /* GP1_IP_CFG */ | ||
| 54 | #define WM8903_GP1_IP_CFG_MASK 0x0020 /* GP1_IP_CFG */ | ||
| 55 | #define WM8903_GP1_IP_CFG_SHIFT 5 /* GP1_IP_CFG */ | ||
| 56 | #define WM8903_GP1_IP_CFG_WIDTH 1 /* GP1_IP_CFG */ | ||
| 57 | #define WM8903_GP1_LVL 0x0010 /* GP1_LVL */ | ||
| 58 | #define WM8903_GP1_LVL_MASK 0x0010 /* GP1_LVL */ | ||
| 59 | #define WM8903_GP1_LVL_SHIFT 4 /* GP1_LVL */ | ||
| 60 | #define WM8903_GP1_LVL_WIDTH 1 /* GP1_LVL */ | ||
| 61 | #define WM8903_GP1_PD 0x0008 /* GP1_PD */ | ||
| 62 | #define WM8903_GP1_PD_MASK 0x0008 /* GP1_PD */ | ||
| 63 | #define WM8903_GP1_PD_SHIFT 3 /* GP1_PD */ | ||
| 64 | #define WM8903_GP1_PD_WIDTH 1 /* GP1_PD */ | ||
| 65 | #define WM8903_GP1_PU 0x0004 /* GP1_PU */ | ||
| 66 | #define WM8903_GP1_PU_MASK 0x0004 /* GP1_PU */ | ||
| 67 | #define WM8903_GP1_PU_SHIFT 2 /* GP1_PU */ | ||
| 68 | #define WM8903_GP1_PU_WIDTH 1 /* GP1_PU */ | ||
| 69 | #define WM8903_GP1_INTMODE 0x0002 /* GP1_INTMODE */ | ||
| 70 | #define WM8903_GP1_INTMODE_MASK 0x0002 /* GP1_INTMODE */ | ||
| 71 | #define WM8903_GP1_INTMODE_SHIFT 1 /* GP1_INTMODE */ | ||
| 72 | #define WM8903_GP1_INTMODE_WIDTH 1 /* GP1_INTMODE */ | ||
| 73 | #define WM8903_GP1_DB 0x0001 /* GP1_DB */ | ||
| 74 | #define WM8903_GP1_DB_MASK 0x0001 /* GP1_DB */ | ||
| 75 | #define WM8903_GP1_DB_SHIFT 0 /* GP1_DB */ | ||
| 76 | #define WM8903_GP1_DB_WIDTH 1 /* GP1_DB */ | ||
| 77 | |||
| 78 | /* | ||
| 79 | * R117 (0x75) - GPIO Control 2 | ||
| 80 | */ | ||
| 81 | #define WM8903_GP2_FN_MASK 0x1F00 /* GP2_FN - [12:8] */ | ||
| 82 | #define WM8903_GP2_FN_SHIFT 8 /* GP2_FN - [12:8] */ | ||
| 83 | #define WM8903_GP2_FN_WIDTH 5 /* GP2_FN - [12:8] */ | ||
| 84 | #define WM8903_GP2_DIR 0x0080 /* GP2_DIR */ | ||
| 85 | #define WM8903_GP2_DIR_MASK 0x0080 /* GP2_DIR */ | ||
| 86 | #define WM8903_GP2_DIR_SHIFT 7 /* GP2_DIR */ | ||
| 87 | #define WM8903_GP2_DIR_WIDTH 1 /* GP2_DIR */ | ||
| 88 | #define WM8903_GP2_OP_CFG 0x0040 /* GP2_OP_CFG */ | ||
| 89 | #define WM8903_GP2_OP_CFG_MASK 0x0040 /* GP2_OP_CFG */ | ||
| 90 | #define WM8903_GP2_OP_CFG_SHIFT 6 /* GP2_OP_CFG */ | ||
| 91 | #define WM8903_GP2_OP_CFG_WIDTH 1 /* GP2_OP_CFG */ | ||
| 92 | #define WM8903_GP2_IP_CFG 0x0020 /* GP2_IP_CFG */ | ||
| 93 | #define WM8903_GP2_IP_CFG_MASK 0x0020 /* GP2_IP_CFG */ | ||
| 94 | #define WM8903_GP2_IP_CFG_SHIFT 5 /* GP2_IP_CFG */ | ||
| 95 | #define WM8903_GP2_IP_CFG_WIDTH 1 /* GP2_IP_CFG */ | ||
| 96 | #define WM8903_GP2_LVL 0x0010 /* GP2_LVL */ | ||
| 97 | #define WM8903_GP2_LVL_MASK 0x0010 /* GP2_LVL */ | ||
| 98 | #define WM8903_GP2_LVL_SHIFT 4 /* GP2_LVL */ | ||
| 99 | #define WM8903_GP2_LVL_WIDTH 1 /* GP2_LVL */ | ||
| 100 | #define WM8903_GP2_PD 0x0008 /* GP2_PD */ | ||
| 101 | #define WM8903_GP2_PD_MASK 0x0008 /* GP2_PD */ | ||
| 102 | #define WM8903_GP2_PD_SHIFT 3 /* GP2_PD */ | ||
| 103 | #define WM8903_GP2_PD_WIDTH 1 /* GP2_PD */ | ||
| 104 | #define WM8903_GP2_PU 0x0004 /* GP2_PU */ | ||
| 105 | #define WM8903_GP2_PU_MASK 0x0004 /* GP2_PU */ | ||
| 106 | #define WM8903_GP2_PU_SHIFT 2 /* GP2_PU */ | ||
| 107 | #define WM8903_GP2_PU_WIDTH 1 /* GP2_PU */ | ||
| 108 | #define WM8903_GP2_INTMODE 0x0002 /* GP2_INTMODE */ | ||
| 109 | #define WM8903_GP2_INTMODE_MASK 0x0002 /* GP2_INTMODE */ | ||
| 110 | #define WM8903_GP2_INTMODE_SHIFT 1 /* GP2_INTMODE */ | ||
| 111 | #define WM8903_GP2_INTMODE_WIDTH 1 /* GP2_INTMODE */ | ||
| 112 | #define WM8903_GP2_DB 0x0001 /* GP2_DB */ | ||
| 113 | #define WM8903_GP2_DB_MASK 0x0001 /* GP2_DB */ | ||
| 114 | #define WM8903_GP2_DB_SHIFT 0 /* GP2_DB */ | ||
| 115 | #define WM8903_GP2_DB_WIDTH 1 /* GP2_DB */ | ||
| 116 | |||
| 117 | /* | ||
| 118 | * R118 (0x76) - GPIO Control 3 | ||
| 119 | */ | ||
| 120 | #define WM8903_GP3_FN_MASK 0x1F00 /* GP3_FN - [12:8] */ | ||
| 121 | #define WM8903_GP3_FN_SHIFT 8 /* GP3_FN - [12:8] */ | ||
| 122 | #define WM8903_GP3_FN_WIDTH 5 /* GP3_FN - [12:8] */ | ||
| 123 | #define WM8903_GP3_DIR 0x0080 /* GP3_DIR */ | ||
| 124 | #define WM8903_GP3_DIR_MASK 0x0080 /* GP3_DIR */ | ||
| 125 | #define WM8903_GP3_DIR_SHIFT 7 /* GP3_DIR */ | ||
| 126 | #define WM8903_GP3_DIR_WIDTH 1 /* GP3_DIR */ | ||
| 127 | #define WM8903_GP3_OP_CFG 0x0040 /* GP3_OP_CFG */ | ||
| 128 | #define WM8903_GP3_OP_CFG_MASK 0x0040 /* GP3_OP_CFG */ | ||
| 129 | #define WM8903_GP3_OP_CFG_SHIFT 6 /* GP3_OP_CFG */ | ||
| 130 | #define WM8903_GP3_OP_CFG_WIDTH 1 /* GP3_OP_CFG */ | ||
| 131 | #define WM8903_GP3_IP_CFG 0x0020 /* GP3_IP_CFG */ | ||
| 132 | #define WM8903_GP3_IP_CFG_MASK 0x0020 /* GP3_IP_CFG */ | ||
| 133 | #define WM8903_GP3_IP_CFG_SHIFT 5 /* GP3_IP_CFG */ | ||
| 134 | #define WM8903_GP3_IP_CFG_WIDTH 1 /* GP3_IP_CFG */ | ||
| 135 | #define WM8903_GP3_LVL 0x0010 /* GP3_LVL */ | ||
| 136 | #define WM8903_GP3_LVL_MASK 0x0010 /* GP3_LVL */ | ||
| 137 | #define WM8903_GP3_LVL_SHIFT 4 /* GP3_LVL */ | ||
| 138 | #define WM8903_GP3_LVL_WIDTH 1 /* GP3_LVL */ | ||
| 139 | #define WM8903_GP3_PD 0x0008 /* GP3_PD */ | ||
| 140 | #define WM8903_GP3_PD_MASK 0x0008 /* GP3_PD */ | ||
| 141 | #define WM8903_GP3_PD_SHIFT 3 /* GP3_PD */ | ||
| 142 | #define WM8903_GP3_PD_WIDTH 1 /* GP3_PD */ | ||
| 143 | #define WM8903_GP3_PU 0x0004 /* GP3_PU */ | ||
| 144 | #define WM8903_GP3_PU_MASK 0x0004 /* GP3_PU */ | ||
| 145 | #define WM8903_GP3_PU_SHIFT 2 /* GP3_PU */ | ||
| 146 | #define WM8903_GP3_PU_WIDTH 1 /* GP3_PU */ | ||
| 147 | #define WM8903_GP3_INTMODE 0x0002 /* GP3_INTMODE */ | ||
| 148 | #define WM8903_GP3_INTMODE_MASK 0x0002 /* GP3_INTMODE */ | ||
| 149 | #define WM8903_GP3_INTMODE_SHIFT 1 /* GP3_INTMODE */ | ||
| 150 | #define WM8903_GP3_INTMODE_WIDTH 1 /* GP3_INTMODE */ | ||
| 151 | #define WM8903_GP3_DB 0x0001 /* GP3_DB */ | ||
| 152 | #define WM8903_GP3_DB_MASK 0x0001 /* GP3_DB */ | ||
| 153 | #define WM8903_GP3_DB_SHIFT 0 /* GP3_DB */ | ||
| 154 | #define WM8903_GP3_DB_WIDTH 1 /* GP3_DB */ | ||
| 155 | |||
| 156 | /* | ||
| 157 | * R119 (0x77) - GPIO Control 4 | ||
| 158 | */ | ||
| 159 | #define WM8903_GP4_FN_MASK 0x1F00 /* GP4_FN - [12:8] */ | ||
| 160 | #define WM8903_GP4_FN_SHIFT 8 /* GP4_FN - [12:8] */ | ||
| 161 | #define WM8903_GP4_FN_WIDTH 5 /* GP4_FN - [12:8] */ | ||
| 162 | #define WM8903_GP4_DIR 0x0080 /* GP4_DIR */ | ||
| 163 | #define WM8903_GP4_DIR_MASK 0x0080 /* GP4_DIR */ | ||
| 164 | #define WM8903_GP4_DIR_SHIFT 7 /* GP4_DIR */ | ||
| 165 | #define WM8903_GP4_DIR_WIDTH 1 /* GP4_DIR */ | ||
| 166 | #define WM8903_GP4_OP_CFG 0x0040 /* GP4_OP_CFG */ | ||
| 167 | #define WM8903_GP4_OP_CFG_MASK 0x0040 /* GP4_OP_CFG */ | ||
| 168 | #define WM8903_GP4_OP_CFG_SHIFT 6 /* GP4_OP_CFG */ | ||
| 169 | #define WM8903_GP4_OP_CFG_WIDTH 1 /* GP4_OP_CFG */ | ||
| 170 | #define WM8903_GP4_IP_CFG 0x0020 /* GP4_IP_CFG */ | ||
| 171 | #define WM8903_GP4_IP_CFG_MASK 0x0020 /* GP4_IP_CFG */ | ||
| 172 | #define WM8903_GP4_IP_CFG_SHIFT 5 /* GP4_IP_CFG */ | ||
| 173 | #define WM8903_GP4_IP_CFG_WIDTH 1 /* GP4_IP_CFG */ | ||
| 174 | #define WM8903_GP4_LVL 0x0010 /* GP4_LVL */ | ||
| 175 | #define WM8903_GP4_LVL_MASK 0x0010 /* GP4_LVL */ | ||
| 176 | #define WM8903_GP4_LVL_SHIFT 4 /* GP4_LVL */ | ||
| 177 | #define WM8903_GP4_LVL_WIDTH 1 /* GP4_LVL */ | ||
| 178 | #define WM8903_GP4_PD 0x0008 /* GP4_PD */ | ||
| 179 | #define WM8903_GP4_PD_MASK 0x0008 /* GP4_PD */ | ||
| 180 | #define WM8903_GP4_PD_SHIFT 3 /* GP4_PD */ | ||
| 181 | #define WM8903_GP4_PD_WIDTH 1 /* GP4_PD */ | ||
| 182 | #define WM8903_GP4_PU 0x0004 /* GP4_PU */ | ||
| 183 | #define WM8903_GP4_PU_MASK 0x0004 /* GP4_PU */ | ||
| 184 | #define WM8903_GP4_PU_SHIFT 2 /* GP4_PU */ | ||
| 185 | #define WM8903_GP4_PU_WIDTH 1 /* GP4_PU */ | ||
| 186 | #define WM8903_GP4_INTMODE 0x0002 /* GP4_INTMODE */ | ||
| 187 | #define WM8903_GP4_INTMODE_MASK 0x0002 /* GP4_INTMODE */ | ||
| 188 | #define WM8903_GP4_INTMODE_SHIFT 1 /* GP4_INTMODE */ | ||
| 189 | #define WM8903_GP4_INTMODE_WIDTH 1 /* GP4_INTMODE */ | ||
| 190 | #define WM8903_GP4_DB 0x0001 /* GP4_DB */ | ||
| 191 | #define WM8903_GP4_DB_MASK 0x0001 /* GP4_DB */ | ||
| 192 | #define WM8903_GP4_DB_SHIFT 0 /* GP4_DB */ | ||
| 193 | #define WM8903_GP4_DB_WIDTH 1 /* GP4_DB */ | ||
| 194 | |||
| 195 | /* | ||
| 196 | * R120 (0x78) - GPIO Control 5 | ||
| 197 | */ | ||
| 198 | #define WM8903_GP5_FN_MASK 0x1F00 /* GP5_FN - [12:8] */ | ||
| 199 | #define WM8903_GP5_FN_SHIFT 8 /* GP5_FN - [12:8] */ | ||
| 200 | #define WM8903_GP5_FN_WIDTH 5 /* GP5_FN - [12:8] */ | ||
| 201 | #define WM8903_GP5_DIR 0x0080 /* GP5_DIR */ | ||
| 202 | #define WM8903_GP5_DIR_MASK 0x0080 /* GP5_DIR */ | ||
| 203 | #define WM8903_GP5_DIR_SHIFT 7 /* GP5_DIR */ | ||
| 204 | #define WM8903_GP5_DIR_WIDTH 1 /* GP5_DIR */ | ||
| 205 | #define WM8903_GP5_OP_CFG 0x0040 /* GP5_OP_CFG */ | ||
| 206 | #define WM8903_GP5_OP_CFG_MASK 0x0040 /* GP5_OP_CFG */ | ||
| 207 | #define WM8903_GP5_OP_CFG_SHIFT 6 /* GP5_OP_CFG */ | ||
| 208 | #define WM8903_GP5_OP_CFG_WIDTH 1 /* GP5_OP_CFG */ | ||
| 209 | #define WM8903_GP5_IP_CFG 0x0020 /* GP5_IP_CFG */ | ||
| 210 | #define WM8903_GP5_IP_CFG_MASK 0x0020 /* GP5_IP_CFG */ | ||
| 211 | #define WM8903_GP5_IP_CFG_SHIFT 5 /* GP5_IP_CFG */ | ||
| 212 | #define WM8903_GP5_IP_CFG_WIDTH 1 /* GP5_IP_CFG */ | ||
| 213 | #define WM8903_GP5_LVL 0x0010 /* GP5_LVL */ | ||
| 214 | #define WM8903_GP5_LVL_MASK 0x0010 /* GP5_LVL */ | ||
| 215 | #define WM8903_GP5_LVL_SHIFT 4 /* GP5_LVL */ | ||
| 216 | #define WM8903_GP5_LVL_WIDTH 1 /* GP5_LVL */ | ||
| 217 | #define WM8903_GP5_PD 0x0008 /* GP5_PD */ | ||
| 218 | #define WM8903_GP5_PD_MASK 0x0008 /* GP5_PD */ | ||
| 219 | #define WM8903_GP5_PD_SHIFT 3 /* GP5_PD */ | ||
| 220 | #define WM8903_GP5_PD_WIDTH 1 /* GP5_PD */ | ||
| 221 | #define WM8903_GP5_PU 0x0004 /* GP5_PU */ | ||
| 222 | #define WM8903_GP5_PU_MASK 0x0004 /* GP5_PU */ | ||
| 223 | #define WM8903_GP5_PU_SHIFT 2 /* GP5_PU */ | ||
| 224 | #define WM8903_GP5_PU_WIDTH 1 /* GP5_PU */ | ||
| 225 | #define WM8903_GP5_INTMODE 0x0002 /* GP5_INTMODE */ | ||
| 226 | #define WM8903_GP5_INTMODE_MASK 0x0002 /* GP5_INTMODE */ | ||
| 227 | #define WM8903_GP5_INTMODE_SHIFT 1 /* GP5_INTMODE */ | ||
| 228 | #define WM8903_GP5_INTMODE_WIDTH 1 /* GP5_INTMODE */ | ||
| 229 | #define WM8903_GP5_DB 0x0001 /* GP5_DB */ | ||
| 230 | #define WM8903_GP5_DB_MASK 0x0001 /* GP5_DB */ | ||
| 231 | #define WM8903_GP5_DB_SHIFT 0 /* GP5_DB */ | ||
| 232 | #define WM8903_GP5_DB_WIDTH 1 /* GP5_DB */ | ||
| 233 | |||
| 234 | struct wm8903_platform_data { | ||
| 235 | bool irq_active_low; /* Set if IRQ active low, default high */ | ||
| 236 | |||
| 237 | /* Default register value for R6 (Mic bias), used to configure | ||
| 238 | * microphone detection. In conjunction with gpio_cfg this | ||
| 239 | * can be used to route the microphone status signals out onto | ||
| 240 | * the GPIOs for use with snd_soc_jack_add_gpios(). | ||
| 241 | */ | ||
| 242 | u16 micdet_cfg; | ||
| 243 | |||
| 244 | int micdet_delay; /* Delay after microphone detection (ms) */ | ||
| 245 | |||
| 246 | u32 gpio_cfg[5]; /* Default register values for GPIO pin mux */ | ||
| 247 | }; | ||
| 248 | |||
| 249 | #endif | ||
diff --git a/include/sound/wm8904.h b/include/sound/wm8904.h new file mode 100644 index 000000000000..898be3a8db9a --- /dev/null +++ b/include/sound/wm8904.h | |||
| @@ -0,0 +1,163 @@ | |||
| 1 | /* | ||
| 2 | * Platform data for WM8904 | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
| 5 | * | ||
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __MFD_WM8994_PDATA_H__ | ||
| 16 | #define __MFD_WM8994_PDATA_H__ | ||
| 17 | |||
| 18 | /* Used to enable configuration of a GPIO to all zeros */ | ||
| 19 | #define WM8904_GPIO_NO_CONFIG 0x8000 | ||
| 20 | |||
| 21 | /* | ||
| 22 | * R6 (0x06) - Mic Bias Control 0 | ||
| 23 | */ | ||
| 24 | #define WM8904_MICDET_THR_MASK 0x0070 /* MICDET_THR - [6:4] */ | ||
| 25 | #define WM8904_MICDET_THR_SHIFT 4 /* MICDET_THR - [6:4] */ | ||
| 26 | #define WM8904_MICDET_THR_WIDTH 3 /* MICDET_THR - [6:4] */ | ||
| 27 | #define WM8904_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */ | ||
| 28 | #define WM8904_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */ | ||
| 29 | #define WM8904_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */ | ||
| 30 | #define WM8904_MICDET_ENA 0x0002 /* MICDET_ENA */ | ||
| 31 | #define WM8904_MICDET_ENA_MASK 0x0002 /* MICDET_ENA */ | ||
| 32 | #define WM8904_MICDET_ENA_SHIFT 1 /* MICDET_ENA */ | ||
| 33 | #define WM8904_MICDET_ENA_WIDTH 1 /* MICDET_ENA */ | ||
| 34 | #define WM8904_MICBIAS_ENA 0x0001 /* MICBIAS_ENA */ | ||
| 35 | #define WM8904_MICBIAS_ENA_MASK 0x0001 /* MICBIAS_ENA */ | ||
| 36 | #define WM8904_MICBIAS_ENA_SHIFT 0 /* MICBIAS_ENA */ | ||
| 37 | #define WM8904_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */ | ||
| 38 | |||
| 39 | /* | ||
| 40 | * R7 (0x07) - Mic Bias Control 1 | ||
| 41 | */ | ||
| 42 | #define WM8904_MIC_DET_FILTER_ENA 0x8000 /* MIC_DET_FILTER_ENA */ | ||
| 43 | #define WM8904_MIC_DET_FILTER_ENA_MASK 0x8000 /* MIC_DET_FILTER_ENA */ | ||
| 44 | #define WM8904_MIC_DET_FILTER_ENA_SHIFT 15 /* MIC_DET_FILTER_ENA */ | ||
| 45 | #define WM8904_MIC_DET_FILTER_ENA_WIDTH 1 /* MIC_DET_FILTER_ENA */ | ||
| 46 | #define WM8904_MIC_SHORT_FILTER_ENA 0x4000 /* MIC_SHORT_FILTER_ENA */ | ||
| 47 | #define WM8904_MIC_SHORT_FILTER_ENA_MASK 0x4000 /* MIC_SHORT_FILTER_ENA */ | ||
| 48 | #define WM8904_MIC_SHORT_FILTER_ENA_SHIFT 14 /* MIC_SHORT_FILTER_ENA */ | ||
| 49 | #define WM8904_MIC_SHORT_FILTER_ENA_WIDTH 1 /* MIC_SHORT_FILTER_ENA */ | ||
| 50 | #define WM8904_MICBIAS_SEL_MASK 0x0007 /* MICBIAS_SEL - [2:0] */ | ||
| 51 | #define WM8904_MICBIAS_SEL_SHIFT 0 /* MICBIAS_SEL - [2:0] */ | ||
| 52 | #define WM8904_MICBIAS_SEL_WIDTH 3 /* MICBIAS_SEL - [2:0] */ | ||
| 53 | |||
| 54 | |||
| 55 | /* | ||
| 56 | * R121 (0x79) - GPIO Control 1 | ||
| 57 | */ | ||
| 58 | #define WM8904_GPIO1_PU 0x0020 /* GPIO1_PU */ | ||
| 59 | #define WM8904_GPIO1_PU_MASK 0x0020 /* GPIO1_PU */ | ||
| 60 | #define WM8904_GPIO1_PU_SHIFT 5 /* GPIO1_PU */ | ||
| 61 | #define WM8904_GPIO1_PU_WIDTH 1 /* GPIO1_PU */ | ||
| 62 | #define WM8904_GPIO1_PD 0x0010 /* GPIO1_PD */ | ||
| 63 | #define WM8904_GPIO1_PD_MASK 0x0010 /* GPIO1_PD */ | ||
| 64 | #define WM8904_GPIO1_PD_SHIFT 4 /* GPIO1_PD */ | ||
| 65 | #define WM8904_GPIO1_PD_WIDTH 1 /* GPIO1_PD */ | ||
| 66 | #define WM8904_GPIO1_SEL_MASK 0x000F /* GPIO1_SEL - [3:0] */ | ||
| 67 | #define WM8904_GPIO1_SEL_SHIFT 0 /* GPIO1_SEL - [3:0] */ | ||
| 68 | #define WM8904_GPIO1_SEL_WIDTH 4 /* GPIO1_SEL - [3:0] */ | ||
| 69 | |||
| 70 | /* | ||
| 71 | * R122 (0x7A) - GPIO Control 2 | ||
| 72 | */ | ||
| 73 | #define WM8904_GPIO2_PU 0x0020 /* GPIO2_PU */ | ||
| 74 | #define WM8904_GPIO2_PU_MASK 0x0020 /* GPIO2_PU */ | ||
| 75 | #define WM8904_GPIO2_PU_SHIFT 5 /* GPIO2_PU */ | ||
| 76 | #define WM8904_GPIO2_PU_WIDTH 1 /* GPIO2_PU */ | ||
| 77 | #define WM8904_GPIO2_PD 0x0010 /* GPIO2_PD */ | ||
| 78 | #define WM8904_GPIO2_PD_MASK 0x0010 /* GPIO2_PD */ | ||
| 79 | #define WM8904_GPIO2_PD_SHIFT 4 /* GPIO2_PD */ | ||
| 80 | #define WM8904_GPIO2_PD_WIDTH 1 /* GPIO2_PD */ | ||
| 81 | #define WM8904_GPIO2_SEL_MASK 0x000F /* GPIO2_SEL - [3:0] */ | ||
| 82 | #define WM8904_GPIO2_SEL_SHIFT 0 /* GPIO2_SEL - [3:0] */ | ||
| 83 | #define WM8904_GPIO2_SEL_WIDTH 4 /* GPIO2_SEL - [3:0] */ | ||
| 84 | |||
| 85 | /* | ||
| 86 | * R123 (0x7B) - GPIO Control 3 | ||
| 87 | */ | ||
| 88 | #define WM8904_GPIO3_PU 0x0020 /* GPIO3_PU */ | ||
| 89 | #define WM8904_GPIO3_PU_MASK 0x0020 /* GPIO3_PU */ | ||
| 90 | #define WM8904_GPIO3_PU_SHIFT 5 /* GPIO3_PU */ | ||
| 91 | #define WM8904_GPIO3_PU_WIDTH 1 /* GPIO3_PU */ | ||
| 92 | #define WM8904_GPIO3_PD 0x0010 /* GPIO3_PD */ | ||
| 93 | #define WM8904_GPIO3_PD_MASK 0x0010 /* GPIO3_PD */ | ||
| 94 | #define WM8904_GPIO3_PD_SHIFT 4 /* GPIO3_PD */ | ||
| 95 | #define WM8904_GPIO3_PD_WIDTH 1 /* GPIO3_PD */ | ||
| 96 | #define WM8904_GPIO3_SEL_MASK 0x000F /* GPIO3_SEL - [3:0] */ | ||
| 97 | #define WM8904_GPIO3_SEL_SHIFT 0 /* GPIO3_SEL - [3:0] */ | ||
| 98 | #define WM8904_GPIO3_SEL_WIDTH 4 /* GPIO3_SEL - [3:0] */ | ||
| 99 | |||
| 100 | /* | ||
| 101 | * R124 (0x7C) - GPIO Control 4 | ||
| 102 | */ | ||
| 103 | #define WM8904_GPI7_ENA 0x0200 /* GPI7_ENA */ | ||
| 104 | #define WM8904_GPI7_ENA_MASK 0x0200 /* GPI7_ENA */ | ||
| 105 | #define WM8904_GPI7_ENA_SHIFT 9 /* GPI7_ENA */ | ||
| 106 | #define WM8904_GPI7_ENA_WIDTH 1 /* GPI7_ENA */ | ||
| 107 | #define WM8904_GPI8_ENA 0x0100 /* GPI8_ENA */ | ||
| 108 | #define WM8904_GPI8_ENA_MASK 0x0100 /* GPI8_ENA */ | ||
| 109 | #define WM8904_GPI8_ENA_SHIFT 8 /* GPI8_ENA */ | ||
| 110 | #define WM8904_GPI8_ENA_WIDTH 1 /* GPI8_ENA */ | ||
| 111 | #define WM8904_GPIO_BCLK_MODE_ENA 0x0080 /* GPIO_BCLK_MODE_ENA */ | ||
| 112 | #define WM8904_GPIO_BCLK_MODE_ENA_MASK 0x0080 /* GPIO_BCLK_MODE_ENA */ | ||
| 113 | #define WM8904_GPIO_BCLK_MODE_ENA_SHIFT 7 /* GPIO_BCLK_MODE_ENA */ | ||
| 114 | #define WM8904_GPIO_BCLK_MODE_ENA_WIDTH 1 /* GPIO_BCLK_MODE_ENA */ | ||
| 115 | #define WM8904_GPIO_BCLK_SEL_MASK 0x000F /* GPIO_BCLK_SEL - [3:0] */ | ||
| 116 | #define WM8904_GPIO_BCLK_SEL_SHIFT 0 /* GPIO_BCLK_SEL - [3:0] */ | ||
| 117 | #define WM8904_GPIO_BCLK_SEL_WIDTH 4 /* GPIO_BCLK_SEL - [3:0] */ | ||
| 118 | |||
| 119 | #define WM8904_MIC_REGS 2 | ||
| 120 | #define WM8904_GPIO_REGS 4 | ||
| 121 | #define WM8904_DRC_REGS 4 | ||
| 122 | #define WM8904_EQ_REGS 25 | ||
| 123 | |||
| 124 | /** | ||
| 125 | * DRC configurations are specified with a label and a set of register | ||
| 126 | * values to write (the enable bits will be ignored). At runtime an | ||
| 127 | * enumerated control will be presented for each DRC block allowing | ||
| 128 | * the user to choose the configration to use. | ||
| 129 | * | ||
| 130 | * Configurations may be generated by hand or by using the DRC control | ||
| 131 | * panel provided by the WISCE - see http://www.wolfsonmicro.com/wisce/ | ||
| 132 | * for details. | ||
| 133 | */ | ||
| 134 | struct wm8904_drc_cfg { | ||
| 135 | const char *name; | ||
| 136 | u16 regs[WM8904_DRC_REGS]; | ||
| 137 | }; | ||
| 138 | |||
| 139 | /** | ||
| 140 | * ReTune Mobile configurations are specified with a label, sample | ||
| 141 | * rate and set of values to write (the enable bits will be ignored). | ||
| 142 | * | ||
| 143 | * Configurations are expected to be generated using the ReTune Mobile | ||
| 144 | * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/ | ||
| 145 | */ | ||
| 146 | struct wm8904_retune_mobile_cfg { | ||
| 147 | const char *name; | ||
| 148 | unsigned int rate; | ||
| 149 | u16 regs[WM8904_EQ_REGS]; | ||
| 150 | }; | ||
| 151 | |||
| 152 | struct wm8904_pdata { | ||
| 153 | int num_drc_cfgs; | ||
| 154 | struct wm8904_drc_cfg *drc_cfgs; | ||
| 155 | |||
| 156 | int num_retune_mobile_cfgs; | ||
| 157 | struct wm8904_retune_mobile_cfg *retune_mobile_cfgs; | ||
| 158 | |||
| 159 | u32 gpio_cfg[WM8904_GPIO_REGS]; | ||
| 160 | u32 mic_cfg[WM8904_MIC_REGS]; | ||
| 161 | }; | ||
| 162 | |||
| 163 | #endif | ||
diff --git a/include/sound/wm8955.h b/include/sound/wm8955.h new file mode 100644 index 000000000000..5074ef499f40 --- /dev/null +++ b/include/sound/wm8955.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* | ||
| 2 | * Platform data for WM8955 | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
| 5 | * | ||
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __WM8955_PDATA_H__ | ||
| 16 | #define __WM8955_PDATA_H__ | ||
| 17 | |||
| 18 | struct wm8955_pdata { | ||
| 19 | /* Configure LOUT2/ROUT2 to drive a speaker */ | ||
| 20 | unsigned int out2_speaker:1; | ||
| 21 | |||
| 22 | /* Configure MONOIN+/- in differential mode */ | ||
| 23 | unsigned int monoin_diff:1; | ||
| 24 | }; | ||
| 25 | |||
| 26 | #endif | ||
diff --git a/include/sound/wm8960.h b/include/sound/wm8960.h new file mode 100644 index 000000000000..74e9a95529c5 --- /dev/null +++ b/include/sound/wm8960.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * wm8960.h -- WM8960 Soc Audio driver platform data | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _WM8960_PDATA_H | ||
| 10 | #define _WM8960_PDATA_H | ||
| 11 | |||
| 12 | #define WM8960_DRES_400R 0 | ||
| 13 | #define WM8960_DRES_200R 1 | ||
| 14 | #define WM8960_DRES_600R 2 | ||
| 15 | #define WM8960_DRES_150R 3 | ||
| 16 | #define WM8960_DRES_MAX 3 | ||
| 17 | |||
| 18 | struct wm8960_data { | ||
| 19 | bool capless; /* Headphone outputs configured in capless mode */ | ||
| 20 | |||
| 21 | int dres; /* Discharge resistance for headphone outputs */ | ||
| 22 | }; | ||
| 23 | |||
| 24 | #endif | ||
diff --git a/include/sound/wm9090.h b/include/sound/wm9090.h new file mode 100644 index 000000000000..3718928cde1a --- /dev/null +++ b/include/sound/wm9090.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/wm9090.h -- Platform data for WM9090 | ||
| 3 | * | ||
| 4 | * Copyright 2009, 2010 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_WM9090_H | ||
| 12 | #define __LINUX_SND_WM9090_H | ||
| 13 | |||
| 14 | struct wm9090_platform_data { | ||
| 15 | /* Line inputs 1 & 2 can optionally be differential */ | ||
| 16 | unsigned int lin1_diff:1; | ||
| 17 | unsigned int lin2_diff:1; | ||
| 18 | |||
| 19 | /* AGC configuration. This is intended to protect the speaker | ||
| 20 | * against overdriving and will therefore depend on the | ||
| 21 | * hardware setup with incorrect runtime configuration | ||
| 22 | * potentially causing hardware damage. | ||
| 23 | */ | ||
| 24 | unsigned int agc_ena:1; | ||
| 25 | u16 agc[3]; | ||
| 26 | }; | ||
| 27 | |||
| 28 | #endif | ||
