diff options
Diffstat (limited to 'sound/pci/cs46xx/cs46xx_lib.c')
-rw-r--r-- | sound/pci/cs46xx/cs46xx_lib.c | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 2c7bfc9fef61..8c44fefd15fc 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c | |||
@@ -2084,71 +2084,6 @@ static int snd_cs46xx_spdif_stream_put(struct snd_kcontrol *kcontrol, | |||
2084 | #endif /* CONFIG_SND_CS46XX_NEW_DSP */ | 2084 | #endif /* CONFIG_SND_CS46XX_NEW_DSP */ |
2085 | 2085 | ||
2086 | 2086 | ||
2087 | #ifdef CONFIG_SND_CS46XX_DEBUG_GPIO | ||
2088 | static int snd_cs46xx_egpio_select_info(struct snd_kcontrol *kcontrol, | ||
2089 | struct snd_ctl_elem_info *uinfo) | ||
2090 | { | ||
2091 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | ||
2092 | uinfo->count = 1; | ||
2093 | uinfo->value.integer.min = 0; | ||
2094 | uinfo->value.integer.max = 8; | ||
2095 | return 0; | ||
2096 | } | ||
2097 | |||
2098 | static int snd_cs46xx_egpio_select_get(struct snd_kcontrol *kcontrol, | ||
2099 | struct snd_ctl_elem_value *ucontrol) | ||
2100 | { | ||
2101 | struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); | ||
2102 | ucontrol->value.integer.value[0] = chip->current_gpio; | ||
2103 | |||
2104 | return 0; | ||
2105 | } | ||
2106 | |||
2107 | static int snd_cs46xx_egpio_select_put(struct snd_kcontrol *kcontrol, | ||
2108 | struct snd_ctl_elem_value *ucontrol) | ||
2109 | { | ||
2110 | struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); | ||
2111 | int change = (chip->current_gpio != ucontrol->value.integer.value[0]); | ||
2112 | chip->current_gpio = ucontrol->value.integer.value[0]; | ||
2113 | |||
2114 | return change; | ||
2115 | } | ||
2116 | |||
2117 | |||
2118 | static int snd_cs46xx_egpio_get(struct snd_kcontrol *kcontrol, | ||
2119 | struct snd_ctl_elem_value *ucontrol) | ||
2120 | { | ||
2121 | struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); | ||
2122 | int reg = kcontrol->private_value; | ||
2123 | |||
2124 | snd_printdd ("put: reg = %04x, gpio %02x\n",reg,chip->current_gpio); | ||
2125 | ucontrol->value.integer.value[0] = | ||
2126 | (snd_cs46xx_peekBA0(chip, reg) & (1 << chip->current_gpio)) ? 1 : 0; | ||
2127 | |||
2128 | return 0; | ||
2129 | } | ||
2130 | |||
2131 | static int snd_cs46xx_egpio_put(struct snd_kcontrol *kcontrol, | ||
2132 | struct snd_ctl_elem_value *ucontrol) | ||
2133 | { | ||
2134 | struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol); | ||
2135 | int reg = kcontrol->private_value; | ||
2136 | int val = snd_cs46xx_peekBA0(chip, reg); | ||
2137 | int oldval = val; | ||
2138 | snd_printdd ("put: reg = %04x, gpio %02x\n",reg,chip->current_gpio); | ||
2139 | |||
2140 | if (ucontrol->value.integer.value[0]) | ||
2141 | val |= (1 << chip->current_gpio); | ||
2142 | else | ||
2143 | val &= ~(1 << chip->current_gpio); | ||
2144 | |||
2145 | snd_cs46xx_pokeBA0(chip, reg,val); | ||
2146 | snd_printdd ("put: val %08x oldval %08x\n",val,oldval); | ||
2147 | |||
2148 | return (oldval != val); | ||
2149 | } | ||
2150 | #endif /* CONFIG_SND_CS46XX_DEBUG_GPIO */ | ||
2151 | |||
2152 | static struct snd_kcontrol_new snd_cs46xx_controls[] __devinitdata = { | 2087 | static struct snd_kcontrol_new snd_cs46xx_controls[] __devinitdata = { |
2153 | { | 2088 | { |
2154 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2089 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
@@ -2241,40 +2176,6 @@ static struct snd_kcontrol_new snd_cs46xx_controls[] __devinitdata = { | |||
2241 | }, | 2176 | }, |
2242 | 2177 | ||
2243 | #endif | 2178 | #endif |
2244 | #ifdef CONFIG_SND_CS46XX_DEBUG_GPIO | ||
2245 | { | ||
2246 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
2247 | .name = "EGPIO select", | ||
2248 | .info = snd_cs46xx_egpio_select_info, | ||
2249 | .get = snd_cs46xx_egpio_select_get, | ||
2250 | .put = snd_cs46xx_egpio_select_put, | ||
2251 | .private_value = 0, | ||
2252 | }, | ||
2253 | { | ||
2254 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
2255 | .name = "EGPIO Input/Output", | ||
2256 | .info = snd_mixer_boolean_info, | ||
2257 | .get = snd_cs46xx_egpio_get, | ||
2258 | .put = snd_cs46xx_egpio_put, | ||
2259 | .private_value = BA0_EGPIODR, | ||
2260 | }, | ||
2261 | { | ||
2262 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
2263 | .name = "EGPIO CMOS/Open drain", | ||
2264 | .info = snd_mixer_boolean_info, | ||
2265 | .get = snd_cs46xx_egpio_get, | ||
2266 | .put = snd_cs46xx_egpio_put, | ||
2267 | .private_value = BA0_EGPIOPTR, | ||
2268 | }, | ||
2269 | { | ||
2270 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
2271 | .name = "EGPIO On/Off", | ||
2272 | .info = snd_mixer_boolean_info, | ||
2273 | .get = snd_cs46xx_egpio_get, | ||
2274 | .put = snd_cs46xx_egpio_put, | ||
2275 | .private_value = BA0_EGPIOSR, | ||
2276 | }, | ||
2277 | #endif | ||
2278 | }; | 2179 | }; |
2279 | 2180 | ||
2280 | #ifdef CONFIG_SND_CS46XX_NEW_DSP | 2181 | #ifdef CONFIG_SND_CS46XX_NEW_DSP |