Changeset 210 for GPL/branches/alsa-resync1/alsa-kernel/pci/cmipci.c
- Timestamp:
- Jul 13, 2007, 4:47:31 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/alsa-resync1/alsa-kernel/pci/cmipci.c
r206 r210 1002 1002 static struct snd_kcontrol_new snd_cmipci_spdif_default __devinitdata = 1003 1003 { 1004 SNDRV_CTL_ELEM_IFACE_PCM,0,0,1005 SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),0,0,0,1006 snd_cmipci_spdif_default_info,1007 snd_cmipci_spdif_default_get,1008 snd_cmipci_spdif_default_put,0 1004 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1005 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 1006 .info = snd_cmipci_spdif_default_info, 1007 .get = snd_cmipci_spdif_default_get, 1008 .put = snd_cmipci_spdif_default_put 1009 1009 }; 1010 1010 … … 1029 1029 static struct snd_kcontrol_new snd_cmipci_spdif_mask __devinitdata = 1030 1030 { 1031 SNDRV_CTL_ELEM_IFACE_MIXER,0,0,1032 SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),0,1033 SNDRV_CTL_ELEM_ACCESS_READ,0,1034 snd_cmipci_spdif_mask_info,1035 snd_cmipci_spdif_mask_get,0,0 1031 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1032 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1033 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK), 1034 .info = snd_cmipci_spdif_mask_info, 1035 .get = snd_cmipci_spdif_mask_get, 1036 1036 }; 1037 1037 … … 1076 1076 static struct snd_kcontrol_new snd_cmipci_spdif_stream __devinitdata = 1077 1077 { 1078 SNDRV_CTL_ELEM_IFACE_PCM,0,0,1079 SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),0,1080 SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,0,1081 snd_cmipci_spdif_stream_info,1082 snd_cmipci_spdif_stream_get,1083 snd_cmipci_spdif_stream_put,0 1078 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 1079 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1080 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 1081 .info = snd_cmipci_spdif_stream_info, 1082 .get = snd_cmipci_spdif_stream_get, 1083 .put = snd_cmipci_spdif_stream_put 1084 1084 }; 1085 1085 … … 1839 1839 1840 1840 #define CMIPCI_DOUBLE(xname, left_reg, right_reg, left_shift, right_shift, mask, invert, stereo) \ 1841 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \ 1842 0, 0, snd_cmipci_info_volume, \ 1843 snd_cmipci_get_volume, snd_cmipci_put_volume, \ 1844 0,\ 1845 COMPOSE_SB_REG(left_reg, right_reg, left_shift, right_shift, mask, invert, stereo), \ 1841 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 1842 .info = snd_cmipci_info_volume, \ 1843 .get = snd_cmipci_get_volume, .put = snd_cmipci_put_volume, \ 1844 .private_value = COMPOSE_SB_REG(left_reg, right_reg, left_shift, right_shift, mask, invert, stereo), \ 1846 1845 } 1847 1846 … … 1941 1940 */ 1942 1941 #define CMIPCI_SB_INPUT_SW(xname, left_shift, right_shift) \ 1943 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \ 1944 0, 0, snd_cmipci_info_input_sw, \ 1945 snd_cmipci_get_input_sw, snd_cmipci_put_input_sw, \ 1946 0, \ 1947 COMPOSE_SB_REG(SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, left_shift, right_shift, 1, 0, 1), \ 1942 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 1943 .info = snd_cmipci_info_input_sw, \ 1944 .get = snd_cmipci_get_input_sw, .put = snd_cmipci_put_input_sw, \ 1945 .private_value = COMPOSE_SB_REG(SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, left_shift, right_shift, 1, 0, 1), \ 1948 1946 } 1949 1947 static int snd_cmipci_info_input_sw(struct snd_kcontrol *kcontrol, … … 2006 2004 2007 2005 #define CMIPCI_MIXER_SW_STEREO(xname, reg, lshift, rshift, invert) \ 2008 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \ 2009 0, 0, snd_cmipci_info_native_mixer, \ 2010 snd_cmipci_get_native_mixer, snd_cmipci_put_native_mixer, \ 2011 0, \ 2012 COMPOSE_SB_REG(reg, reg, lshift, rshift, 1, invert, 1), \ 2006 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 2007 .info = snd_cmipci_info_native_mixer, \ 2008 .get = snd_cmipci_get_native_mixer, .put = snd_cmipci_put_native_mixer, \ 2009 .private_value = COMPOSE_SB_REG(reg, reg, lshift, rshift, 1, invert, 1), \ 2013 2010 } 2014 2011 2015 2012 #define CMIPCI_MIXER_SW_MONO(xname, reg, shift, invert) \ 2016 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \ 2017 0, 0, snd_cmipci_info_native_mixer, \ 2018 snd_cmipci_get_native_mixer, snd_cmipci_put_native_mixer, \ 2019 0, \ 2020 COMPOSE_SB_REG(reg, reg, shift, shift, 1, invert, 0), \ 2013 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 2014 .info = snd_cmipci_info_native_mixer, \ 2015 .get = snd_cmipci_get_native_mixer, .put = snd_cmipci_put_native_mixer, \ 2016 .private_value = COMPOSE_SB_REG(reg, reg, shift, shift, 1, invert, 0), \ 2021 2017 } 2022 2018 2023 2019 #define CMIPCI_MIXER_VOL_STEREO(xname, reg, lshift, rshift, mask) \ 2024 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \ 2025 0, 0, snd_cmipci_info_native_mixer, \ 2026 snd_cmipci_get_native_mixer, snd_cmipci_put_native_mixer, \ 2027 0, \ 2028 COMPOSE_SB_REG(reg, reg, lshift, rshift, mask, 0, 1), \ 2020 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 2021 .info = snd_cmipci_info_native_mixer, \ 2022 .get = snd_cmipci_get_native_mixer, .put = snd_cmipci_put_native_mixer, \ 2023 .private_value = COMPOSE_SB_REG(reg, reg, lshift, rshift, mask, 0, 1), \ 2029 2024 } 2030 2025 2031 2026 #define CMIPCI_MIXER_VOL_MONO(xname, reg, shift, mask) \ 2032 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \ 2033 0, 0, snd_cmipci_info_native_mixer, \ 2034 snd_cmipci_get_native_mixer, snd_cmipci_put_native_mixer, \ 2035 0, \ 2036 COMPOSE_SB_REG(reg, reg, shift, shift, mask, 0, 0), \ 2027 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 2028 .info = snd_cmipci_info_native_mixer, \ 2029 .get = snd_cmipci_get_native_mixer, .put = snd_cmipci_put_native_mixer, \ 2030 .private_value = COMPOSE_SB_REG(reg, reg, shift, shift, mask, 0, 0), \ 2037 2031 } 2038 2032 … … 2129 2123 //CMIPCI_MIXER_SW_MONO("PCM Playback Switch", CM_REG_MIXER1, CM_WSMUTE_SHIFT, 1), 2130 2124 { /* switch with sensitivity */ 2131 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2132 "PCM Playback Switch",0,0,0, 2133 snd_cmipci_info_native_mixer, 2134 snd_cmipci_get_native_mixer_sensitive, 2135 snd_cmipci_put_native_mixer_sensitive, 2136 0, 2137 COMPOSE_SB_REG(CM_REG_MIXER1, CM_REG_MIXER1, CM_WSMUTE_SHIFT, CM_WSMUTE_SHIFT, 1, 1, 0), 2125 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2126 .name = "PCM Playback Switch", 2127 .info = snd_cmipci_info_native_mixer, 2128 .get = snd_cmipci_get_native_mixer_sensitive, 2129 .put = snd_cmipci_put_native_mixer_sensitive, 2130 .private_value = COMPOSE_SB_REG(CM_REG_MIXER1, CM_REG_MIXER1, CM_WSMUTE_SHIFT, CM_WSMUTE_SHIFT, 1, 1, 0), 2138 2131 }, 2139 2132 CMIPCI_MIXER_SW_STEREO("PCM Capture Switch", CM_REG_MIXER1, CM_WAVEINL_SHIFT, CM_WAVEINR_SHIFT, 0), … … 2260 2253 } 2261 2254 2255 #ifdef TARGET_OS2 2262 2256 #define DEFINE_SWITCH_ARG(sname, xreg, xmask, xmask_on, xis_byte, xac3) \ 2263 2257 static struct cmipci_switch_args cmipci_switch_arg_##sname = { \ 2264 xreg, \ 2265 xmask, \ 2266 xmask_on, \ 2267 xis_byte, \ 2268 xac3, \ 2269 } 2258 xreg, \ 2259 xmask, \ 2260 xmask_on, \ 2261 xis_byte, \ 2262 xac3, \ 2263 } 2264 #else 2265 #define DEFINE_SWITCH_ARG(sname, xreg, xmask, xmask_on, xis_byte, xac3) \ 2266 static struct cmipci_switch_args cmipci_switch_arg_##sname = { \ 2267 .reg = xreg, \ 2268 .mask = xmask, \ 2269 .mask_on = xmask_on, \ 2270 .is_byte = xis_byte, \ 2271 .ac3_sensitive = xac3, \ 2272 } 2273 #endif 2270 2274 2271 2275 #define DEFINE_BIT_SWITCH_ARG(sname, xreg, xmask, xis_byte, xac3) \ … … 2305 2309 // safe to do so in this case) 2306 2310 #define DEFINE_SWITCH(sname, stype, sarg) \ 2307 { stype, 0, 0, \ 2308 sname, 0, 0, 0, \ 2309 snd_cmipci_uswitch_info, \ 2310 snd_cmipci_uswitch_get, \ 2311 snd_cmipci_uswitch_put, \ 2312 0, \ 2313 (unsigned long)&cmipci_switch_arg_##sarg,\ 2311 { .name = sname, \ 2312 .iface = stype, \ 2313 .info = snd_cmipci_uswitch_info, \ 2314 .get = snd_cmipci_uswitch_get, \ 2315 .put = snd_cmipci_uswitch_put, \ 2316 .private_value = (unsigned long)&cmipci_switch_arg_##sarg,\ 2314 2317 } 2315 2318 … … 2473 2476 #endif 2474 2477 // DEFINE_MIXER_SWITCH("IEC958 Output Switch", spdif_enable), 2475 { 2476 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2477 "IEC958 Output Switch",0,0, 0, 2478 snd_cmipci_uswitch_info, 2479 snd_cmipci_spdout_enable_get, 2480 snd_cmipci_spdout_enable_put,0 2478 { .name = "IEC958 Output Switch", 2479 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2480 .info = snd_cmipci_uswitch_info, 2481 .get = snd_cmipci_spdout_enable_get, 2482 .put = snd_cmipci_spdout_enable_put, 2481 2483 }, 2482 2484 DEFINE_MIXER_SWITCH("IEC958 In Valid", spdi_valid),
Note:
See TracChangeset
for help on using the changeset viewer.
