Commit a1a4a161 authored by andrzej zaborowski's avatar andrzej zaborowski Committed by Tony Lindgren

Get TSC2101 and TSC2102 drivers in sync with new ALSA struct naming

Update the TSC2101/2102 drivers to use the new ALSA type names. This
makes the TSC2102 driver build again - TSC2101 is still broken though.
Contains also minor formatting fix in TSC2101 code.
Signed-off-by: default avatarAndrzej Zaborowski <balrog@zabor.org>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 68a3cb6b
...@@ -699,7 +699,8 @@ void snd_omap_init_mixer(void) ...@@ -699,7 +699,8 @@ void snd_omap_init_mixer(void)
FN_OUT(0); FN_OUT(0);
} }
static int __pcm_playback_target_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int __pcm_playback_target_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
static char *texts[PLAYBACK_TARGET_COUNT] = { static char *texts[PLAYBACK_TARGET_COUNT] = {
"Loudspeaker", "Headphone", "Cellphone" "Loudspeaker", "Headphone", "Cellphone"
...@@ -716,13 +717,15 @@ static int __pcm_playback_target_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf ...@@ -716,13 +717,15 @@ static int __pcm_playback_target_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf
return 0; return 0;
} }
static int __pcm_playback_target_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __pcm_playback_target_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
ucontrol->value.integer.value[0] = current_playback_target; ucontrol->value.integer.value[0] = current_playback_target;
return 0; return 0;
} }
static int __pcm_playback_target_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __pcm_playback_target_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
int retVal; int retVal;
int curVal; int curVal;
...@@ -749,7 +752,8 @@ static int __pcm_playback_target_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu ...@@ -749,7 +752,8 @@ static int __pcm_playback_target_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu
return retVal; return retVal;
} }
static int __pcm_playback_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int __pcm_playback_volume_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2; uinfo->count = 2;
...@@ -762,7 +766,8 @@ static int __pcm_playback_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf ...@@ -762,7 +766,8 @@ static int __pcm_playback_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf
* Alsa mixer interface function for getting the volume read from the DGC in a * Alsa mixer interface function for getting the volume read from the DGC in a
* 0 -100 alsa mixer format. * 0 -100 alsa mixer format.
*/ */
static int __pcm_playback_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __pcm_playback_volume_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
u16 volL; u16 volL;
u16 volR; u16 volR;
...@@ -786,13 +791,15 @@ static int __pcm_playback_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu ...@@ -786,13 +791,15 @@ static int __pcm_playback_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu
return 0; return 0;
} }
static int __pcm_playback_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __pcm_playback_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
return set_mixer_volume_as_dac_gain_control_volume(ucontrol->value.integer.value[0], return set_mixer_volume_as_dac_gain_control_volume(ucontrol->value.integer.value[0],
ucontrol->value.integer.value[1]); ucontrol->value.integer.value[1]);
} }
static int __pcm_playback_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int __pcm_playback_switch_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 2; uinfo->count = 2;
...@@ -806,7 +813,8 @@ static int __pcm_playback_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf ...@@ -806,7 +813,8 @@ static int __pcm_playback_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf
* When DGC_DALMU is 0, left channel is not muted. * When DGC_DALMU is 0, left channel is not muted.
* Same logic apply also for the right channel. * Same logic apply also for the right channel.
*/ */
static int __pcm_playback_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __pcm_playback_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
u16 val = omap_tsc2101_audio_read(TSC2101_DAC_GAIN_CTRL); u16 val = omap_tsc2101_audio_read(TSC2101_DAC_GAIN_CTRL);
...@@ -815,13 +823,15 @@ static int __pcm_playback_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu ...@@ -815,13 +823,15 @@ static int __pcm_playback_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu
return 0; return 0;
} }
static int __pcm_playback_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __pcm_playback_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
return dac_gain_control_unmute(ucontrol->value.integer.value[0], return dac_gain_control_unmute(ucontrol->value.integer.value[0],
ucontrol->value.integer.value[1]); ucontrol->value.integer.value[1]);
} }
static int __headset_playback_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int __headset_playback_volume_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1; uinfo->count = 1;
...@@ -830,7 +840,8 @@ static int __headset_playback_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem ...@@ -830,7 +840,8 @@ static int __headset_playback_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem
return 0; return 0;
} }
static int __headset_playback_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __headset_playback_volume_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
u16 val; u16 val;
u16 vol; u16 vol;
...@@ -847,12 +858,14 @@ static int __headset_playback_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_ ...@@ -847,12 +858,14 @@ static int __headset_playback_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_
return 0; return 0;
} }
static int __headset_playback_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __headset_playback_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
return set_mixer_volume_as_headset_gain_control_volume(ucontrol->value.integer.value[0]); return set_mixer_volume_as_headset_gain_control_volume(ucontrol->value.integer.value[0]);
} }
static int __headset_playback_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int __headset_playback_switch_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -864,14 +877,16 @@ static int __headset_playback_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem ...@@ -864,14 +877,16 @@ static int __headset_playback_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem
/* When HGC_ADMUT_HED (bit 15) is 1, the headset is muted. /* When HGC_ADMUT_HED (bit 15) is 1, the headset is muted.
* When HGC_ADMUT_HED is 0, headset is not muted. * When HGC_ADMUT_HED is 0, headset is not muted.
*/ */
static int __headset_playback_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __headset_playback_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
u16 val = omap_tsc2101_audio_read(TSC2101_HEADSET_GAIN_CTRL); u16 val = omap_tsc2101_audio_read(TSC2101_HEADSET_GAIN_CTRL);
ucontrol->value.integer.value[0] = IS_UNMUTED(15, val); ucontrol->value.integer.value[0] = IS_UNMUTED(15, val);
return 0; return 0;
} }
static int __headset_playback_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __headset_playback_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
// mute/unmute headset // mute/unmute headset
return adc_pga_unmute_control(ucontrol->value.integer.value[0], return adc_pga_unmute_control(ucontrol->value.integer.value[0],
...@@ -879,7 +894,8 @@ static int __headset_playback_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_ ...@@ -879,7 +894,8 @@ static int __headset_playback_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_
15); 15);
} }
static int __handset_playback_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int __handset_playback_volume_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1; uinfo->count = 1;
...@@ -888,7 +904,8 @@ static int __handset_playback_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem ...@@ -888,7 +904,8 @@ static int __handset_playback_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem
return 0; return 0;
} }
static int __handset_playback_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __handset_playback_volume_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
u16 val; u16 val;
u16 vol; u16 vol;
...@@ -904,12 +921,14 @@ static int __handset_playback_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_ ...@@ -904,12 +921,14 @@ static int __handset_playback_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_
return 0; return 0;
} }
static int __handset_playback_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __handset_playback_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
return set_mixer_volume_as_handset_gain_control_volume(ucontrol->value.integer.value[0]); return set_mixer_volume_as_handset_gain_control_volume(ucontrol->value.integer.value[0]);
} }
static int __handset_playback_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int __handset_playback_switch_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -921,14 +940,16 @@ static int __handset_playback_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem ...@@ -921,14 +940,16 @@ static int __handset_playback_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem
/* When HNGC_ADMUT_HND (bit 15) is 1, the handset is muted. /* When HNGC_ADMUT_HND (bit 15) is 1, the handset is muted.
* When HNGC_ADMUT_HND is 0, handset is not muted. * When HNGC_ADMUT_HND is 0, handset is not muted.
*/ */
static int __handset_playback_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __handset_playback_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
u16 val = omap_tsc2101_audio_read(TSC2101_HANDSET_GAIN_CTRL); u16 val = omap_tsc2101_audio_read(TSC2101_HANDSET_GAIN_CTRL);
ucontrol->value.integer.value[0] = IS_UNMUTED(15, val); ucontrol->value.integer.value[0] = IS_UNMUTED(15, val);
return 0; return 0;
} }
static int __handset_playback_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __handset_playback_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
// handset mute/unmute // handset mute/unmute
return adc_pga_unmute_control(ucontrol->value.integer.value[0], return adc_pga_unmute_control(ucontrol->value.integer.value[0],
...@@ -936,7 +957,8 @@ static int __handset_playback_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_ ...@@ -936,7 +957,8 @@ static int __handset_playback_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_
15); 15);
} }
static int __cellphone_input_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int __cellphone_input_switch_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -948,21 +970,24 @@ static int __cellphone_input_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_ ...@@ -948,21 +970,24 @@ static int __cellphone_input_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_
/* When BGC_MUT_CP (bit 15) = 1, power down cellphone input pga. /* When BGC_MUT_CP (bit 15) = 1, power down cellphone input pga.
* When BGC_MUT_CP = 0, power up cellphone input pga. * When BGC_MUT_CP = 0, power up cellphone input pga.
*/ */
static int __cellphone_input_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __cellphone_input_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
u16 val = omap_tsc2101_audio_read(TSC2101_BUZZER_GAIN_CTRL); u16 val = omap_tsc2101_audio_read(TSC2101_BUZZER_GAIN_CTRL);
ucontrol->value.integer.value[0] = IS_UNMUTED(15, val); ucontrol->value.integer.value[0] = IS_UNMUTED(15, val);
return 0; return 0;
} }
static int __cellphone_input_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __cellphone_input_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
return adc_pga_unmute_control(ucontrol->value.integer.value[0], return adc_pga_unmute_control(ucontrol->value.integer.value[0],
TSC2101_BUZZER_GAIN_CTRL, TSC2101_BUZZER_GAIN_CTRL,
15); 15);
} }
static int __buzzer_input_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) static int __buzzer_input_switch_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -974,21 +999,23 @@ static int __buzzer_input_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf ...@@ -974,21 +999,23 @@ static int __buzzer_input_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf
/* When BGC_MUT_BU (bit 6) = 1, power down cellphone input pga. /* When BGC_MUT_BU (bit 6) = 1, power down cellphone input pga.
* When BGC_MUT_BU = 0, power up cellphone input pga. * When BGC_MUT_BU = 0, power up cellphone input pga.
*/ */
static int __buzzer_input_switch_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __buzzer_input_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
u16 val = omap_tsc2101_audio_read(TSC2101_BUZZER_GAIN_CTRL); u16 val = omap_tsc2101_audio_read(TSC2101_BUZZER_GAIN_CTRL);
ucontrol->value.integer.value[0] = IS_UNMUTED(6, val); ucontrol->value.integer.value[0] = IS_UNMUTED(6, val);
return 0; return 0;
} }
static int __buzzer_input_switch_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) static int __buzzer_input_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ {
return adc_pga_unmute_control(ucontrol->value.integer.value[0], return adc_pga_unmute_control(ucontrol->value.integer.value[0],
TSC2101_BUZZER_GAIN_CTRL, TSC2101_BUZZER_GAIN_CTRL,
6); 6);
} }
static snd_kcontrol_new_t tsc2101_control[] __devinitdata = { static struct snd_kcontrol_new tsc2101_control[] __devinitdata = {
{ {
.name = "Target Playback Route", .name = "Target Playback Route",
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
......
/* /*
* sound/arm/omap/omap-alsa-tsc2101-mixer.c * sound/arm/omap/omap-alsa-tsc2101-mixer.h
* *
* Alsa Driver for TSC2101 codec for OMAP platform boards. * Alsa Driver for TSC2101 codec for OMAP platform boards.
* *
......
/* /*
* arch/arm/mach-omap1/omap-alsa-tsc2101.c * sound/arm/omap/omap-alsa-tsc2101.c
* *
* Alsa codec Driver for TSC2101 chip for OMAP platform boards. * Alsa codec Driver for TSC2101 chip for OMAP platform boards.
* Code obtained from oss omap drivers * Code obtained from oss omap drivers
...@@ -59,7 +59,7 @@ static unsigned int rates[] = { ...@@ -59,7 +59,7 @@ static unsigned int rates[] = {
29400, 32000, 44100, 48000, 29400, 32000, 44100, 48000,
}; };
static snd_pcm_hw_constraint_list_t tsc2101_hw_constraints_rates = { static struct snd_pcm_hw_constraint_list tsc2101_hw_constraints_rates = {
.count = ARRAY_SIZE(rates), .count = ARRAY_SIZE(rates),
.list = rates, .list = rates,
.mask = 0, .mask = 0,
...@@ -93,7 +93,7 @@ static const struct tsc2101_samplerate_reg_info ...@@ -93,7 +93,7 @@ static const struct tsc2101_samplerate_reg_info
{48000, 0, 0}, {48000, 0, 0},
}; };
static snd_pcm_hardware_t tsc2101_snd_omap_alsa_playback = { static struct snd_pcm_hardware tsc2101_snd_omap_alsa_playback = {
.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID), SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
#ifdef CONFIG_MACH_OMAP_H6300 #ifdef CONFIG_MACH_OMAP_H6300
......
/* /*
* arch/arc/mach-omap1/omap-alsa-tsc2101.h * sound/arm/omap/omap-alsa-tsc2101.h
* *
* Alsa Driver for TSC2101 codec for OMAP platform boards. * Alsa Driver for TSC2101 codec for OMAP platform boards.
* *
......
...@@ -99,8 +99,8 @@ void snd_omap_init_mixer(void) ...@@ -99,8 +99,8 @@ void snd_omap_init_mixer(void)
FN_OUT(0); FN_OUT(0);
} }
static int __pcm_playback_volume_info( static int __pcm_playback_volume_info(struct snd_kcontrol *kcontrol,
snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2; uinfo->count = 2;
...@@ -109,8 +109,8 @@ static int __pcm_playback_volume_info( ...@@ -109,8 +109,8 @@ static int __pcm_playback_volume_info(
return 0; return 0;
} }
static int __pcm_playback_volume_get( static int __pcm_playback_volume_get(struct snd_kcontrol *kcontrol,
snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
ucontrol->value.integer.value[0] = vol[0]; /* L */ ucontrol->value.integer.value[0] = vol[0]; /* L */
ucontrol->value.integer.value[1] = vol[1]; /* R */ ucontrol->value.integer.value[1] = vol[1]; /* R */
...@@ -118,8 +118,8 @@ static int __pcm_playback_volume_get( ...@@ -118,8 +118,8 @@ static int __pcm_playback_volume_get(
return 0; return 0;
} }
static int __pcm_playback_volume_put( static int __pcm_playback_volume_put(struct snd_kcontrol *kcontrol,
snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
set_dac_gain_stereo( set_dac_gain_stereo(
ucontrol->value.integer.value[0], /* L */ ucontrol->value.integer.value[0], /* L */
...@@ -127,8 +127,8 @@ static int __pcm_playback_volume_put( ...@@ -127,8 +127,8 @@ static int __pcm_playback_volume_put(
return 1; return 1;
} }
static int __pcm_playback_switch_info( static int __pcm_playback_switch_info(struct snd_kcontrol *kcontrol,
snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 2; uinfo->count = 2;
...@@ -137,8 +137,8 @@ static int __pcm_playback_switch_info( ...@@ -137,8 +137,8 @@ static int __pcm_playback_switch_info(
return 0; return 0;
} }
static int __pcm_playback_switch_get( static int __pcm_playback_switch_get(struct snd_kcontrol *kcontrol,
snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
ucontrol->value.integer.value[0] = !mute[0]; /* L */ ucontrol->value.integer.value[0] = !mute[0]; /* L */
ucontrol->value.integer.value[1] = !mute[1]; /* R */ ucontrol->value.integer.value[1] = !mute[1]; /* R */
...@@ -146,8 +146,8 @@ static int __pcm_playback_switch_get( ...@@ -146,8 +146,8 @@ static int __pcm_playback_switch_get(
return 0; return 0;
} }
static int __pcm_playback_switch_put( static int __pcm_playback_switch_put(struct snd_kcontrol *kcontrol,
snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
mute[0] = (ucontrol->value.integer.value[0] == 0); /* L */ mute[0] = (ucontrol->value.integer.value[0] == 0); /* L */
mute[1] = (ucontrol->value.integer.value[1] == 0); /* R */ mute[1] = (ucontrol->value.integer.value[1] == 0); /* R */
...@@ -156,8 +156,8 @@ static int __pcm_playback_switch_put( ...@@ -156,8 +156,8 @@ static int __pcm_playback_switch_put(
return 1; return 1;
} }
static int __pcm_playback_deemphasis_info( static int __pcm_playback_deemphasis_info(struct snd_kcontrol *kcontrol,
snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -166,15 +166,15 @@ static int __pcm_playback_deemphasis_info( ...@@ -166,15 +166,15 @@ static int __pcm_playback_deemphasis_info(
return 0; return 0;
} }
static int __pcm_playback_deemphasis_get( static int __pcm_playback_deemphasis_get(struct snd_kcontrol *kcontrol,
snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
ucontrol->value.integer.value[0] = filter[0]; ucontrol->value.integer.value[0] = filter[0];
return 0; return 0;
} }
static int __pcm_playback_deemphasis_put( static int __pcm_playback_deemphasis_put(struct snd_kcontrol *kcontrol,
snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
filter[0] = (ucontrol->value.integer.value[0] > 0); filter[0] = (ucontrol->value.integer.value[0] > 0);
...@@ -182,8 +182,8 @@ static int __pcm_playback_deemphasis_put( ...@@ -182,8 +182,8 @@ static int __pcm_playback_deemphasis_put(
return 1; return 1;
} }
static int __pcm_playback_bassboost_info( static int __pcm_playback_bassboost_info(struct snd_kcontrol *kcontrol,
snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -192,15 +192,15 @@ static int __pcm_playback_bassboost_info( ...@@ -192,15 +192,15 @@ static int __pcm_playback_bassboost_info(
return 0; return 0;
} }
static int __pcm_playback_bassboost_get( static int __pcm_playback_bassboost_get(struct snd_kcontrol *kcontrol,
snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
ucontrol->value.integer.value[0] = filter[1]; ucontrol->value.integer.value[0] = filter[1];
return 0; return 0;
} }
static int __pcm_playback_bassboost_put( static int __pcm_playback_bassboost_put(struct snd_kcontrol *kcontrol,
snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
filter[1] = (ucontrol->value.integer.value[0] > 0); filter[1] = (ucontrol->value.integer.value[0] > 0);
...@@ -208,7 +208,7 @@ static int __pcm_playback_bassboost_put( ...@@ -208,7 +208,7 @@ static int __pcm_playback_bassboost_put(
return 1; return 1;
} }
static snd_kcontrol_new_t tsc2102_control[] __devinitdata = { static struct snd_kcontrol_new tsc2102_controls[] __devinitdata = {
{ {
.name = "Master Playback Volume", .name = "Master Playback Volume",
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
...@@ -271,9 +271,9 @@ int snd_omap_mixer(struct snd_card_omap_codec *tsc2102) ...@@ -271,9 +271,9 @@ int snd_omap_mixer(struct snd_card_omap_codec *tsc2102)
if (!tsc2102) if (!tsc2102)
return -EINVAL; return -EINVAL;
for (i = 0; i < ARRAY_SIZE(tsc2102_control); i ++) { for (i = 0; i < ARRAY_SIZE(tsc2102_controls); i ++) {
err = snd_ctl_add(tsc2102->card, err = snd_ctl_add(tsc2102->card,
snd_ctl_new1(&tsc2102_control[i], snd_ctl_new1(&tsc2102_controls[i],
tsc2102->card)); tsc2102->card));
if (err < 0) if (err < 0)
......
...@@ -38,13 +38,13 @@ static unsigned int rates[] = { ...@@ -38,13 +38,13 @@ static unsigned int rates[] = {
16000, 22050, 24000, 29400, 32000, 44100, 48000, 16000, 22050, 24000, 29400, 32000, 44100, 48000,
}; };
static snd_pcm_hw_constraint_list_t tsc2102_hw_constraints_rates = { static struct snd_pcm_hw_constraint_list tsc2102_hw_constraints_rates = {
.count = ARRAY_SIZE(rates), .count = ARRAY_SIZE(rates),
.list = rates, .list = rates,
.mask = 0, .mask = 0,
}; };
static snd_pcm_hardware_t tsc2102_snd_omap_alsa_playback = { static struct snd_pcm_hardware tsc2102_snd_omap_alsa_playback = {
.info = SNDRV_PCM_INFO_INTERLEAVED | .info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID, SNDRV_PCM_INFO_MMAP_VALID,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment