diff options
author | Harry Butterworth <heb1001@gmail.com> | 2011-06-11 05:41:13 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-06-14 01:34:03 -0400 |
commit | b028b81835d7503d68b230446cd5e39d14ff5b9f (patch) | |
tree | 62873fdf6c3c8002eed541b1e637554514d1a826 /sound/pci/ctxfi/cthw20k1.c | |
parent | 55309216baeb9d7f951520cf8e8bf2337cd17bad (diff) |
ALSA: ctxfi: Implement a combined capabilities query method to replace multiple have_x query methods.
Signed-off-by: Harry Butterworth <heb1001@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ctxfi/cthw20k1.c')
-rw-r--r-- | sound/pci/ctxfi/cthw20k1.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c index 9a85a84b23ab..1ff692a9d016 100644 --- a/sound/pci/ctxfi/cthw20k1.c +++ b/sound/pci/ctxfi/cthw20k1.c | |||
@@ -1777,25 +1777,17 @@ static int hw_adc_init(struct hw *hw, const struct adc_conf *info) | |||
1777 | return adc_init_SBx(hw, info->input, info->mic20db); | 1777 | return adc_init_SBx(hw, info->input, info->mic20db); |
1778 | } | 1778 | } |
1779 | 1779 | ||
1780 | static int hw_have_digit_io_switch(struct hw *hw) | 1780 | static struct capabilities hw_capabilities(struct hw *hw) |
1781 | { | 1781 | { |
1782 | /* SB073x and Vista compatible cards have no digit IO switch */ | 1782 | struct capabilities cap; |
1783 | return !(hw->model == CTSB073X || hw->model == CTUAA); | ||
1784 | } | ||
1785 | |||
1786 | static int hw_have_dedicated_mic(struct hw *hw) | ||
1787 | { | ||
1788 | return 0; | ||
1789 | } | ||
1790 | 1783 | ||
1791 | static int hw_have_output_switch(struct hw *hw) | 1784 | /* SB073x and Vista compatible cards have no digit IO switch */ |
1792 | { | 1785 | cap.digit_io_switch = !(hw->model == CTSB073X || hw->model == CTUAA); |
1793 | return 0; | 1786 | cap.dedicated_mic = 0; |
1794 | } | 1787 | cap.output_switch = 0; |
1788 | cap.mic_source_switch = 0; | ||
1795 | 1789 | ||
1796 | static int hw_have_mic_source_switch(struct hw *hw) | 1790 | return cap; |
1797 | { | ||
1798 | return 0; | ||
1799 | } | 1791 | } |
1800 | 1792 | ||
1801 | #define CTLBITS(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) | 1793 | #define CTLBITS(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) |
@@ -2187,10 +2179,7 @@ static struct hw ct20k1_preset __devinitdata = { | |||
2187 | .pll_init = hw_pll_init, | 2179 | .pll_init = hw_pll_init, |
2188 | .is_adc_source_selected = hw_is_adc_input_selected, | 2180 | .is_adc_source_selected = hw_is_adc_input_selected, |
2189 | .select_adc_source = hw_adc_input_select, | 2181 | .select_adc_source = hw_adc_input_select, |
2190 | .have_digit_io_switch = hw_have_digit_io_switch, | 2182 | .capabilities = hw_capabilities, |
2191 | .have_dedicated_mic = hw_have_dedicated_mic, | ||
2192 | .have_output_switch = hw_have_output_switch, | ||
2193 | .have_mic_source_switch = hw_have_mic_source_switch, | ||
2194 | #ifdef CONFIG_PM | 2183 | #ifdef CONFIG_PM |
2195 | .suspend = hw_suspend, | 2184 | .suspend = hw_suspend, |
2196 | .resume = hw_resume, | 2185 | .resume = hw_resume, |