diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-08-05 11:17:01 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-08-05 11:17:01 +0200 |
commit | e71981343ad29b5d929f82ac56c0b27b8ea0e540 (patch) | |
tree | 47135be4252faecbc0e5508658a58f8afd197fff /include | |
parent | 2603798070a80d76e7e6d2992ba4ec74addcec90 (diff) | |
parent | bda7d2a862e6b788bca2d02d38a07966a9c92e48 (diff) |
Merge branch 'topic/asoc' into for-linus
Diffstat (limited to 'include')
-rw-r--r-- | include/sound/sh_fsi.h | 49 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 2 | ||||
-rw-r--r-- | include/sound/soc.h | 21 | ||||
-rw-r--r-- | include/sound/tlv320dac33-plat.h | 2 | ||||
-rw-r--r-- | include/sound/uda134x.h | 12 |
5 files changed, 80 insertions, 6 deletions
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h index c0227361a87..9d51d6f3589 100644 --- a/include/sound/sh_fsi.h +++ b/include/sound/sh_fsi.h @@ -12,6 +12,9 @@ * published by the Free Software Foundation. */ +#define FSI_PORT_A 0 +#define FSI_PORT_B 1 + /* flags format * 0xABCDEEFF @@ -55,12 +58,14 @@ #define SH_FSI_GET_IFMT(x) ((x >> 8) & SH_FSI_FMT_MASK) #define SH_FSI_GET_OFMT(x) ((x >> 0) & SH_FSI_FMT_MASK) -#define SH_FSI_FMT_MONO (1 << 0) -#define SH_FSI_FMT_MONO_DELAY (1 << 1) -#define SH_FSI_FMT_PCM (1 << 2) -#define SH_FSI_FMT_I2S (1 << 3) -#define SH_FSI_FMT_TDM (1 << 4) -#define SH_FSI_FMT_TDM_DELAY (1 << 5) +#define SH_FSI_FMT_MONO 0 +#define SH_FSI_FMT_MONO_DELAY 1 +#define SH_FSI_FMT_PCM 2 +#define SH_FSI_FMT_I2S 3 +#define SH_FSI_FMT_TDM 4 +#define SH_FSI_FMT_TDM_DELAY 5 +#define SH_FSI_FMT_SPDIF 6 + #define SH_FSI_IFMT_TDM_CH(x) \ (SH_FSI_IFMT(TDM) | SH_FSI_SET_CH_I(x)) @@ -72,9 +77,41 @@ #define SH_FSI_OFMT_TDM_DELAY_CH(x) \ (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x)) + +/* + * set_rate return value + * + * see ACKMD/BPFMD on + * ACK_MD (FSI2) + * CKG1 (FSI) + * + * err: return value < 0 + * + * 0x-00000AB + * + * A: ACKMD value + * B: BPFMD value + */ + +#define SH_FSI_ACKMD_MASK (0xF << 0) +#define SH_FSI_ACKMD_512 (1 << 0) +#define SH_FSI_ACKMD_256 (2 << 0) +#define SH_FSI_ACKMD_128 (3 << 0) +#define SH_FSI_ACKMD_64 (4 << 0) +#define SH_FSI_ACKMD_32 (5 << 0) + +#define SH_FSI_BPFMD_MASK (0xF << 4) +#define SH_FSI_BPFMD_512 (1 << 4) +#define SH_FSI_BPFMD_256 (2 << 4) +#define SH_FSI_BPFMD_128 (3 << 4) +#define SH_FSI_BPFMD_64 (4 << 4) +#define SH_FSI_BPFMD_32 (5 << 4) +#define SH_FSI_BPFMD_16 (6 << 4) + struct sh_fsi_platform_info { unsigned long porta_flags; unsigned long portb_flags; + int (*set_rate)(int is_porta, int rate); /* for master mode */ }; extern struct snd_soc_dai fsi_soc_dai[2]; diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 66ff4c124db..c5d9987bc89 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -273,6 +273,8 @@ #define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ #define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ #define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ +#define SND_SOC_DAPM_PRE_POST_PMD \ + (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD) /* convenience event type detection */ #define SND_SOC_DAPM_EVENT_ON(e) \ diff --git a/include/sound/soc.h b/include/sound/soc.h index 697e7ffe39d..65e9d03ed4f 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -170,6 +170,21 @@ .get = xhandler_get, .put = xhandler_put, \ .private_value = (unsigned long)&xenum } +#define SOC_DOUBLE_R_SX_TLV(xname, xreg_left, xreg_right, xshift,\ + xmin, xmax, tlv_array) \ +{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ + .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ + SNDRV_CTL_ELEM_ACCESS_READWRITE, \ + .tlv.p = (tlv_array), \ + .info = snd_soc_info_volsw_2r_sx, \ + .get = snd_soc_get_volsw_2r_sx, \ + .put = snd_soc_put_volsw_2r_sx, \ + .private_value = (unsigned long)&(struct soc_mixer_control) \ + {.reg = xreg_left, \ + .rreg = xreg_right, .shift = xshift, \ + .min = xmin, .max = xmax} } + + /* * Simplified versions of above macros, declaring a struct and calculating * ARRAY_SIZE internally @@ -329,6 +344,12 @@ int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); int snd_soc_limit_volume(struct snd_soc_codec *codec, const char *name, int max); +int snd_soc_info_volsw_2r_sx(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo); +int snd_soc_get_volsw_2r_sx(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol); +int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol); /** * struct snd_soc_jack_pin - Describes a pin to update based on jack detection diff --git a/include/sound/tlv320dac33-plat.h b/include/sound/tlv320dac33-plat.h index 3f428d53195..6c664965679 100644 --- a/include/sound/tlv320dac33-plat.h +++ b/include/sound/tlv320dac33-plat.h @@ -15,6 +15,8 @@ struct tlv320dac33_platform_data { int power_gpio; + int mode1_latency; /* latency caused by the i2c writes in us */ + int auto_fifo_config; /* FIFO config based on the period size */ int keep_bclk; /* Keep the BCLK running in FIFO modes */ u8 burst_bclkdiv; }; diff --git a/include/sound/uda134x.h b/include/sound/uda134x.h index 509efb05017..e475659bd3b 100644 --- a/include/sound/uda134x.h +++ b/include/sound/uda134x.h @@ -18,6 +18,18 @@ struct uda134x_platform_data { struct l3_pins l3; void (*power) (int); int model; + /* + ALSA SOC usually puts the device in standby mode when it's not used + for sometime. If you unset is_powered_on_standby the driver will + turn off the ADC/DAC when this callback is invoked and turn it back + on when needed. Unfortunately this will result in a very light bump + (it can be audible only with good earphones). If this bothers you + set is_powered_on_standby, you will have slightly higher power + consumption. Please note that sending the L3 command for ADC is + enough to make the bump, so it doesn't make difference if you + completely take off power from the codec. + */ + int is_powered_on_standby; #define UDA134X_UDA1340 1 #define UDA134X_UDA1341 2 #define UDA134X_UDA1344 3 |