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
This diff is collapsed.
/* /*
* 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