diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-07-23 09:42:26 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 09:57:45 -0400 |
commit | a5ce88909d3007caa7b65996a8f6784350beb2a6 (patch) | |
tree | e9882165ba7f7fe88dd8de817028edefadb0d496 /sound/pci/rme9652 | |
parent | b9ed4f2b68dc47b0c35c1a3ae8ae97c2517d5177 (diff) |
[ALSA] Clean up with common snd_ctl_boolean_*_info callbacks
Clean up codes using the new common snd_ctl_boolean_*_info() callbacks.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/rme9652')
-rw-r--r-- | sound/pci/rme9652/hdsp.c | 63 | ||||
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 70 | ||||
-rw-r--r-- | sound/pci/rme9652/rme9652.c | 27 |
3 files changed, 17 insertions, 143 deletions
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index 3b3ef657f73e..8f798f2fc040 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
@@ -1623,14 +1623,7 @@ static int hdsp_set_spdif_output(struct hdsp *hdsp, int out) | |||
1623 | return 0; | 1623 | return 0; |
1624 | } | 1624 | } |
1625 | 1625 | ||
1626 | static int snd_hdsp_info_spdif_bits(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 1626 | #define snd_hdsp_info_spdif_bits snd_ctl_boolean_mono_info |
1627 | { | ||
1628 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
1629 | uinfo->count = 1; | ||
1630 | uinfo->value.integer.min = 0; | ||
1631 | uinfo->value.integer.max = 1; | ||
1632 | return 0; | ||
1633 | } | ||
1634 | 1627 | ||
1635 | static int snd_hdsp_get_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 1628 | static int snd_hdsp_get_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1636 | { | 1629 | { |
@@ -2111,14 +2104,7 @@ static int snd_hdsp_put_clock_source(struct snd_kcontrol *kcontrol, struct snd_c | |||
2111 | return change; | 2104 | return change; |
2112 | } | 2105 | } |
2113 | 2106 | ||
2114 | static int snd_hdsp_info_clock_source_lock(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 2107 | #define snd_hdsp_info_clock_source_lock snd_ctl_boolean_mono_info |
2115 | { | ||
2116 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
2117 | uinfo->count = 1; | ||
2118 | uinfo->value.integer.min = 0; | ||
2119 | uinfo->value.integer.max = 1; | ||
2120 | return 0; | ||
2121 | } | ||
2122 | 2108 | ||
2123 | static int snd_hdsp_get_clock_source_lock(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 2109 | static int snd_hdsp_get_clock_source_lock(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2124 | { | 2110 | { |
@@ -2420,14 +2406,7 @@ static int hdsp_set_xlr_breakout_cable(struct hdsp *hdsp, int mode) | |||
2420 | return 0; | 2406 | return 0; |
2421 | } | 2407 | } |
2422 | 2408 | ||
2423 | static int snd_hdsp_info_xlr_breakout_cable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 2409 | #define snd_hdsp_info_xlr_breakout_cable snd_ctl_boolean_mono_info |
2424 | { | ||
2425 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
2426 | uinfo->count = 1; | ||
2427 | uinfo->value.integer.min = 0; | ||
2428 | uinfo->value.integer.max = 1; | ||
2429 | return 0; | ||
2430 | } | ||
2431 | 2410 | ||
2432 | static int snd_hdsp_get_xlr_breakout_cable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 2411 | static int snd_hdsp_get_xlr_breakout_cable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2433 | { | 2412 | { |
@@ -2483,14 +2462,7 @@ static int hdsp_set_aeb(struct hdsp *hdsp, int mode) | |||
2483 | return 0; | 2462 | return 0; |
2484 | } | 2463 | } |
2485 | 2464 | ||
2486 | static int snd_hdsp_info_aeb(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 2465 | #define snd_hdsp_info_aeb snd_ctl_boolean_mono_info |
2487 | { | ||
2488 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
2489 | uinfo->count = 1; | ||
2490 | uinfo->value.integer.min = 0; | ||
2491 | uinfo->value.integer.max = 1; | ||
2492 | return 0; | ||
2493 | } | ||
2494 | 2466 | ||
2495 | static int snd_hdsp_get_aeb(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 2467 | static int snd_hdsp_get_aeb(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2496 | { | 2468 | { |
@@ -2729,14 +2701,7 @@ static int hdsp_set_line_output(struct hdsp *hdsp, int out) | |||
2729 | return 0; | 2701 | return 0; |
2730 | } | 2702 | } |
2731 | 2703 | ||
2732 | static int snd_hdsp_info_line_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 2704 | #define snd_hdsp_info_line_out snd_ctl_boolean_mono_info |
2733 | { | ||
2734 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
2735 | uinfo->count = 1; | ||
2736 | uinfo->value.integer.min = 0; | ||
2737 | uinfo->value.integer.max = 1; | ||
2738 | return 0; | ||
2739 | } | ||
2740 | 2705 | ||
2741 | static int snd_hdsp_get_line_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 2706 | static int snd_hdsp_get_line_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2742 | { | 2707 | { |
@@ -2782,14 +2747,7 @@ static int hdsp_set_precise_pointer(struct hdsp *hdsp, int precise) | |||
2782 | return 0; | 2747 | return 0; |
2783 | } | 2748 | } |
2784 | 2749 | ||
2785 | static int snd_hdsp_info_precise_pointer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 2750 | #define snd_hdsp_info_precise_pointer snd_ctl_boolean_mono_info |
2786 | { | ||
2787 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
2788 | uinfo->count = 1; | ||
2789 | uinfo->value.integer.min = 0; | ||
2790 | uinfo->value.integer.max = 1; | ||
2791 | return 0; | ||
2792 | } | ||
2793 | 2751 | ||
2794 | static int snd_hdsp_get_precise_pointer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 2752 | static int snd_hdsp_get_precise_pointer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2795 | { | 2753 | { |
@@ -2835,14 +2793,7 @@ static int hdsp_set_use_midi_tasklet(struct hdsp *hdsp, int use_tasklet) | |||
2835 | return 0; | 2793 | return 0; |
2836 | } | 2794 | } |
2837 | 2795 | ||
2838 | static int snd_hdsp_info_use_midi_tasklet(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 2796 | #define snd_hdsp_info_use_midi_tasklet snd_ctl_boolean_mono_info |
2839 | { | ||
2840 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
2841 | uinfo->count = 1; | ||
2842 | uinfo->value.integer.min = 0; | ||
2843 | uinfo->value.integer.max = 1; | ||
2844 | return 0; | ||
2845 | } | ||
2846 | 2797 | ||
2847 | static int snd_hdsp_get_use_midi_tasklet(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 2798 | static int snd_hdsp_get_use_midi_tasklet(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2848 | { | 2799 | { |
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 143185e7e4dc..83ea4623e77c 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
@@ -1834,15 +1834,7 @@ static int hdspm_set_line_output(struct hdspm * hdspm, int out) | |||
1834 | return 0; | 1834 | return 0; |
1835 | } | 1835 | } |
1836 | 1836 | ||
1837 | static int snd_hdspm_info_line_out(struct snd_kcontrol *kcontrol, | 1837 | #define snd_hdspm_info_line_out snd_ctl_boolean_mono_info |
1838 | struct snd_ctl_elem_info *uinfo) | ||
1839 | { | ||
1840 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
1841 | uinfo->count = 1; | ||
1842 | uinfo->value.integer.min = 0; | ||
1843 | uinfo->value.integer.max = 1; | ||
1844 | return 0; | ||
1845 | } | ||
1846 | 1838 | ||
1847 | static int snd_hdspm_get_line_out(struct snd_kcontrol *kcontrol, | 1839 | static int snd_hdspm_get_line_out(struct snd_kcontrol *kcontrol, |
1848 | struct snd_ctl_elem_value *ucontrol) | 1840 | struct snd_ctl_elem_value *ucontrol) |
@@ -1897,15 +1889,7 @@ static int hdspm_set_tx_64(struct hdspm * hdspm, int out) | |||
1897 | return 0; | 1889 | return 0; |
1898 | } | 1890 | } |
1899 | 1891 | ||
1900 | static int snd_hdspm_info_tx_64(struct snd_kcontrol *kcontrol, | 1892 | #define snd_hdspm_info_tx_64 snd_ctl_boolean_mono_info |
1901 | struct snd_ctl_elem_info *uinfo) | ||
1902 | { | ||
1903 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
1904 | uinfo->count = 1; | ||
1905 | uinfo->value.integer.min = 0; | ||
1906 | uinfo->value.integer.max = 1; | ||
1907 | return 0; | ||
1908 | } | ||
1909 | 1893 | ||
1910 | static int snd_hdspm_get_tx_64(struct snd_kcontrol *kcontrol, | 1894 | static int snd_hdspm_get_tx_64(struct snd_kcontrol *kcontrol, |
1911 | struct snd_ctl_elem_value *ucontrol) | 1895 | struct snd_ctl_elem_value *ucontrol) |
@@ -1960,15 +1944,7 @@ static int hdspm_set_c_tms(struct hdspm * hdspm, int out) | |||
1960 | return 0; | 1944 | return 0; |
1961 | } | 1945 | } |
1962 | 1946 | ||
1963 | static int snd_hdspm_info_c_tms(struct snd_kcontrol *kcontrol, | 1947 | #define snd_hdspm_info_c_tms snd_ctl_boolean_mono_info |
1964 | struct snd_ctl_elem_info *uinfo) | ||
1965 | { | ||
1966 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
1967 | uinfo->count = 1; | ||
1968 | uinfo->value.integer.min = 0; | ||
1969 | uinfo->value.integer.max = 1; | ||
1970 | return 0; | ||
1971 | } | ||
1972 | 1948 | ||
1973 | static int snd_hdspm_get_c_tms(struct snd_kcontrol *kcontrol, | 1949 | static int snd_hdspm_get_c_tms(struct snd_kcontrol *kcontrol, |
1974 | struct snd_ctl_elem_value *ucontrol) | 1950 | struct snd_ctl_elem_value *ucontrol) |
@@ -2023,15 +1999,7 @@ static int hdspm_set_safe_mode(struct hdspm * hdspm, int out) | |||
2023 | return 0; | 1999 | return 0; |
2024 | } | 2000 | } |
2025 | 2001 | ||
2026 | static int snd_hdspm_info_safe_mode(struct snd_kcontrol *kcontrol, | 2002 | #define snd_hdspm_info_safe_mode snd_ctl_boolean_mono_info |
2027 | struct snd_ctl_elem_info *uinfo) | ||
2028 | { | ||
2029 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
2030 | uinfo->count = 1; | ||
2031 | uinfo->value.integer.min = 0; | ||
2032 | uinfo->value.integer.max = 1; | ||
2033 | return 0; | ||
2034 | } | ||
2035 | 2003 | ||
2036 | static int snd_hdspm_get_safe_mode(struct snd_kcontrol *kcontrol, | 2004 | static int snd_hdspm_get_safe_mode(struct snd_kcontrol *kcontrol, |
2037 | struct snd_ctl_elem_value *ucontrol) | 2005 | struct snd_ctl_elem_value *ucontrol) |
@@ -2086,15 +2054,7 @@ static int hdspm_set_emphasis(struct hdspm * hdspm, int emp) | |||
2086 | return 0; | 2054 | return 0; |
2087 | } | 2055 | } |
2088 | 2056 | ||
2089 | static int snd_hdspm_info_emphasis(struct snd_kcontrol *kcontrol, | 2057 | #define snd_hdspm_info_emphasis snd_ctl_boolean_mono_info |
2090 | struct snd_ctl_elem_info *uinfo) | ||
2091 | { | ||
2092 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
2093 | uinfo->count = 1; | ||
2094 | uinfo->value.integer.min = 0; | ||
2095 | uinfo->value.integer.max = 1; | ||
2096 | return 0; | ||
2097 | } | ||
2098 | 2058 | ||
2099 | static int snd_hdspm_get_emphasis(struct snd_kcontrol *kcontrol, | 2059 | static int snd_hdspm_get_emphasis(struct snd_kcontrol *kcontrol, |
2100 | struct snd_ctl_elem_value *ucontrol) | 2060 | struct snd_ctl_elem_value *ucontrol) |
@@ -2149,15 +2109,7 @@ static int hdspm_set_dolby(struct hdspm * hdspm, int dol) | |||
2149 | return 0; | 2109 | return 0; |
2150 | } | 2110 | } |
2151 | 2111 | ||
2152 | static int snd_hdspm_info_dolby(struct snd_kcontrol *kcontrol, | 2112 | #define snd_hdspm_info_dolby snd_ctl_boolean_mono_info |
2153 | struct snd_ctl_elem_info *uinfo) | ||
2154 | { | ||
2155 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
2156 | uinfo->count = 1; | ||
2157 | uinfo->value.integer.min = 0; | ||
2158 | uinfo->value.integer.max = 1; | ||
2159 | return 0; | ||
2160 | } | ||
2161 | 2113 | ||
2162 | static int snd_hdspm_get_dolby(struct snd_kcontrol *kcontrol, | 2114 | static int snd_hdspm_get_dolby(struct snd_kcontrol *kcontrol, |
2163 | struct snd_ctl_elem_value *ucontrol) | 2115 | struct snd_ctl_elem_value *ucontrol) |
@@ -2212,15 +2164,7 @@ static int hdspm_set_professional(struct hdspm * hdspm, int dol) | |||
2212 | return 0; | 2164 | return 0; |
2213 | } | 2165 | } |
2214 | 2166 | ||
2215 | static int snd_hdspm_info_professional(struct snd_kcontrol *kcontrol, | 2167 | #define snd_hdspm_info_professional snd_ctl_boolean_mono_info |
2216 | struct snd_ctl_elem_info *uinfo) | ||
2217 | { | ||
2218 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
2219 | uinfo->count = 1; | ||
2220 | uinfo->value.integer.min = 0; | ||
2221 | uinfo->value.integer.max = 1; | ||
2222 | return 0; | ||
2223 | } | ||
2224 | 2168 | ||
2225 | static int snd_hdspm_get_professional(struct snd_kcontrol *kcontrol, | 2169 | static int snd_hdspm_get_professional(struct snd_kcontrol *kcontrol, |
2226 | struct snd_ctl_elem_value *ucontrol) | 2170 | struct snd_ctl_elem_value *ucontrol) |
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c index 2de27405a0bd..34f96f12e5bf 100644 --- a/sound/pci/rme9652/rme9652.c +++ b/sound/pci/rme9652/rme9652.c | |||
@@ -1067,14 +1067,7 @@ static int rme9652_set_spdif_output(struct snd_rme9652 *rme9652, int out) | |||
1067 | return 0; | 1067 | return 0; |
1068 | } | 1068 | } |
1069 | 1069 | ||
1070 | static int snd_rme9652_info_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 1070 | #define snd_rme9652_info_spdif_out snd_ctl_boolean_mono_info |
1071 | { | ||
1072 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
1073 | uinfo->count = 1; | ||
1074 | uinfo->value.integer.min = 0; | ||
1075 | uinfo->value.integer.max = 1; | ||
1076 | return 0; | ||
1077 | } | ||
1078 | 1071 | ||
1079 | static int snd_rme9652_get_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 1072 | static int snd_rme9652_get_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1080 | { | 1073 | { |
@@ -1338,14 +1331,7 @@ static int snd_rme9652_put_thru(struct snd_kcontrol *kcontrol, struct snd_ctl_el | |||
1338 | .put = snd_rme9652_put_passthru, \ | 1331 | .put = snd_rme9652_put_passthru, \ |
1339 | .get = snd_rme9652_get_passthru } | 1332 | .get = snd_rme9652_get_passthru } |
1340 | 1333 | ||
1341 | static int snd_rme9652_info_passthru(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 1334 | #define snd_rme9652_info_passthru snd_ctl_boolean_mono_info |
1342 | { | ||
1343 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
1344 | uinfo->count = 1; | ||
1345 | uinfo->value.integer.min = 0; | ||
1346 | uinfo->value.integer.max = 1; | ||
1347 | return 0; | ||
1348 | } | ||
1349 | 1335 | ||
1350 | static int snd_rme9652_get_passthru(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 1336 | static int snd_rme9652_get_passthru(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1351 | { | 1337 | { |
@@ -1445,14 +1431,7 @@ static int snd_rme9652_get_adat_sync(struct snd_kcontrol *kcontrol, struct snd_c | |||
1445 | .info = snd_rme9652_info_tc_valid, \ | 1431 | .info = snd_rme9652_info_tc_valid, \ |
1446 | .get = snd_rme9652_get_tc_valid } | 1432 | .get = snd_rme9652_get_tc_valid } |
1447 | 1433 | ||
1448 | static int snd_rme9652_info_tc_valid(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 1434 | #define snd_rme9652_info_tc_valid snd_ctl_boolean_mono_info |
1449 | { | ||
1450 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
1451 | uinfo->count = 1; | ||
1452 | uinfo->value.integer.min = 0; | ||
1453 | uinfo->value.integer.max = 1; | ||
1454 | return 0; | ||
1455 | } | ||
1456 | 1435 | ||
1457 | static int snd_rme9652_get_tc_valid(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 1436 | static int snd_rme9652_get_tc_valid(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1458 | { | 1437 | { |