aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ice1712/ice1724.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ice1712/ice1724.c')
-rw-r--r--sound/pci/ice1712/ice1724.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 1f05c59690a1..5a735eed317d 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -1975,7 +1975,7 @@ static inline int digital_route_shift(int idx)
1975 return idx * 3; 1975 return idx * 3;
1976} 1976}
1977 1977
1978static int get_route_val(struct snd_ice1712 *ice, int shift) 1978int snd_ice1724_get_route_val(struct snd_ice1712 *ice, int shift)
1979{ 1979{
1980 unsigned long val; 1980 unsigned long val;
1981 unsigned char eitem; 1981 unsigned char eitem;
@@ -1994,7 +1994,8 @@ static int get_route_val(struct snd_ice1712 *ice, int shift)
1994 return eitem; 1994 return eitem;
1995} 1995}
1996 1996
1997static int put_route_val(struct snd_ice1712 *ice, unsigned int val, int shift) 1997int snd_ice1724_put_route_val(struct snd_ice1712 *ice, unsigned int val,
1998 int shift)
1998{ 1999{
1999 unsigned int old_val, nval; 2000 unsigned int old_val, nval;
2000 int change; 2001 int change;
@@ -2022,7 +2023,7 @@ static int snd_vt1724_pro_route_analog_get(struct snd_kcontrol *kcontrol,
2022 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 2023 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
2023 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 2024 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
2024 ucontrol->value.enumerated.item[0] = 2025 ucontrol->value.enumerated.item[0] =
2025 get_route_val(ice, analog_route_shift(idx)); 2026 snd_ice1724_get_route_val(ice, analog_route_shift(idx));
2026 return 0; 2027 return 0;
2027} 2028}
2028 2029
@@ -2031,8 +2032,9 @@ static int snd_vt1724_pro_route_analog_put(struct snd_kcontrol *kcontrol,
2031{ 2032{
2032 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 2033 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
2033 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 2034 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
2034 return put_route_val(ice, ucontrol->value.enumerated.item[0], 2035 return snd_ice1724_put_route_val(ice,
2035 analog_route_shift(idx)); 2036 ucontrol->value.enumerated.item[0],
2037 analog_route_shift(idx));
2036} 2038}
2037 2039
2038static int snd_vt1724_pro_route_spdif_get(struct snd_kcontrol *kcontrol, 2040static int snd_vt1724_pro_route_spdif_get(struct snd_kcontrol *kcontrol,
@@ -2041,7 +2043,7 @@ static int snd_vt1724_pro_route_spdif_get(struct snd_kcontrol *kcontrol,
2041 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 2043 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
2042 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 2044 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
2043 ucontrol->value.enumerated.item[0] = 2045 ucontrol->value.enumerated.item[0] =
2044 get_route_val(ice, digital_route_shift(idx)); 2046 snd_ice1724_get_route_val(ice, digital_route_shift(idx));
2045 return 0; 2047 return 0;
2046} 2048}
2047 2049
@@ -2050,11 +2052,13 @@ static int snd_vt1724_pro_route_spdif_put(struct snd_kcontrol *kcontrol,
2050{ 2052{
2051 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); 2053 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
2052 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 2054 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
2053 return put_route_val(ice, ucontrol->value.enumerated.item[0], 2055 return snd_ice1724_put_route_val(ice,
2054 digital_route_shift(idx)); 2056 ucontrol->value.enumerated.item[0],
2057 digital_route_shift(idx));
2055} 2058}
2056 2059
2057static struct snd_kcontrol_new snd_vt1724_mixer_pro_analog_route __devinitdata = { 2060static struct snd_kcontrol_new snd_vt1724_mixer_pro_analog_route __devinitdata =
2061{
2058 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2062 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2059 .name = "H/W Playback Route", 2063 .name = "H/W Playback Route",
2060 .info = snd_vt1724_pro_route_info, 2064 .info = snd_vt1724_pro_route_info,
@@ -2291,9 +2295,12 @@ static int __devinit snd_vt1724_spdif_build_controls(struct snd_ice1712 *ice)
2291 if (snd_BUG_ON(!ice->pcm)) 2295 if (snd_BUG_ON(!ice->pcm))
2292 return -EIO; 2296 return -EIO;
2293 2297
2294 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_vt1724_mixer_pro_spdif_route, ice)); 2298 if (!ice->own_routing) {
2295 if (err < 0) 2299 err = snd_ctl_add(ice->card,
2296 return err; 2300 snd_ctl_new1(&snd_vt1724_mixer_pro_spdif_route, ice));
2301 if (err < 0)
2302 return err;
2303 }
2297 2304
2298 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_vt1724_spdif_switch, ice)); 2305 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_vt1724_spdif_switch, ice));
2299 if (err < 0) 2306 if (err < 0)
@@ -2340,7 +2347,7 @@ static int __devinit snd_vt1724_build_controls(struct snd_ice1712 *ice)
2340 if (err < 0) 2347 if (err < 0)
2341 return err; 2348 return err;
2342 2349
2343 if (ice->num_total_dacs > 0) { 2350 if (!ice->own_routing && ice->num_total_dacs > 0) {
2344 struct snd_kcontrol_new tmp = snd_vt1724_mixer_pro_analog_route; 2351 struct snd_kcontrol_new tmp = snd_vt1724_mixer_pro_analog_route;
2345 tmp.count = ice->num_total_dacs; 2352 tmp.count = ice->num_total_dacs;
2346 if (ice->vt1720 && tmp.count > 2) 2353 if (ice->vt1720 && tmp.count > 2)