diff options
author | Adrian Knoth <adi@drcomp.erfurt.thur.de> | 2013-01-15 12:52:23 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-16 01:49:17 -0500 |
commit | 49ba4f94bddb7f5272c4596d505f94355cc3fbd2 (patch) | |
tree | e5d38934479250d7a6af0274fba55c28a84a3803 | |
parent | 4833c673dee69ac352cd03cc97823a210c5cffcb (diff) |
ALSA: hdsp - Remove obsolete settings functions
With HDSP_TOGGLE_SETTING in place, these functions are no longer
required. Removing them makes the code DRY and considerably shorter.
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/rme9652/hdsp.c | 339 |
1 files changed, 0 insertions, 339 deletions
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index ae796950da8f..94084cdb130c 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
@@ -1771,185 +1771,6 @@ static int snd_hdsp_put_toggle_setting(struct snd_kcontrol *kcontrol, | |||
1771 | return change; | 1771 | return change; |
1772 | } | 1772 | } |
1773 | 1773 | ||
1774 | |||
1775 | #define HDSP_SPDIF_OUT(xname, xindex) \ | ||
1776 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ | ||
1777 | .info = snd_hdsp_info_spdif_bits, \ | ||
1778 | .get = snd_hdsp_get_spdif_out, .put = snd_hdsp_put_spdif_out } | ||
1779 | |||
1780 | static int hdsp_spdif_out(struct hdsp *hdsp) | ||
1781 | { | ||
1782 | return (hdsp->control_register & HDSP_SPDIFOpticalOut) ? 1 : 0; | ||
1783 | } | ||
1784 | |||
1785 | static int hdsp_set_spdif_output(struct hdsp *hdsp, int out) | ||
1786 | { | ||
1787 | if (out) | ||
1788 | hdsp->control_register |= HDSP_SPDIFOpticalOut; | ||
1789 | else | ||
1790 | hdsp->control_register &= ~HDSP_SPDIFOpticalOut; | ||
1791 | hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register); | ||
1792 | return 0; | ||
1793 | } | ||
1794 | |||
1795 | #define snd_hdsp_info_spdif_bits snd_ctl_boolean_mono_info | ||
1796 | |||
1797 | static int snd_hdsp_get_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
1798 | { | ||
1799 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
1800 | |||
1801 | ucontrol->value.integer.value[0] = hdsp_spdif_out(hdsp); | ||
1802 | return 0; | ||
1803 | } | ||
1804 | |||
1805 | static int snd_hdsp_put_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
1806 | { | ||
1807 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
1808 | int change; | ||
1809 | unsigned int val; | ||
1810 | |||
1811 | if (!snd_hdsp_use_is_exclusive(hdsp)) | ||
1812 | return -EBUSY; | ||
1813 | val = ucontrol->value.integer.value[0] & 1; | ||
1814 | spin_lock_irq(&hdsp->lock); | ||
1815 | change = (int)val != hdsp_spdif_out(hdsp); | ||
1816 | hdsp_set_spdif_output(hdsp, val); | ||
1817 | spin_unlock_irq(&hdsp->lock); | ||
1818 | return change; | ||
1819 | } | ||
1820 | |||
1821 | #define HDSP_SPDIF_PROFESSIONAL(xname, xindex) \ | ||
1822 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ | ||
1823 | .info = snd_hdsp_info_spdif_bits, \ | ||
1824 | .get = snd_hdsp_get_spdif_professional, .put = snd_hdsp_put_spdif_professional } | ||
1825 | |||
1826 | static int hdsp_spdif_professional(struct hdsp *hdsp) | ||
1827 | { | ||
1828 | return (hdsp->control_register & HDSP_SPDIFProfessional) ? 1 : 0; | ||
1829 | } | ||
1830 | |||
1831 | static int hdsp_set_spdif_professional(struct hdsp *hdsp, int val) | ||
1832 | { | ||
1833 | if (val) | ||
1834 | hdsp->control_register |= HDSP_SPDIFProfessional; | ||
1835 | else | ||
1836 | hdsp->control_register &= ~HDSP_SPDIFProfessional; | ||
1837 | hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register); | ||
1838 | return 0; | ||
1839 | } | ||
1840 | |||
1841 | static int snd_hdsp_get_spdif_professional(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
1842 | { | ||
1843 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
1844 | |||
1845 | ucontrol->value.integer.value[0] = hdsp_spdif_professional(hdsp); | ||
1846 | return 0; | ||
1847 | } | ||
1848 | |||
1849 | static int snd_hdsp_put_spdif_professional(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
1850 | { | ||
1851 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
1852 | int change; | ||
1853 | unsigned int val; | ||
1854 | |||
1855 | if (!snd_hdsp_use_is_exclusive(hdsp)) | ||
1856 | return -EBUSY; | ||
1857 | val = ucontrol->value.integer.value[0] & 1; | ||
1858 | spin_lock_irq(&hdsp->lock); | ||
1859 | change = (int)val != hdsp_spdif_professional(hdsp); | ||
1860 | hdsp_set_spdif_professional(hdsp, val); | ||
1861 | spin_unlock_irq(&hdsp->lock); | ||
1862 | return change; | ||
1863 | } | ||
1864 | |||
1865 | #define HDSP_SPDIF_EMPHASIS(xname, xindex) \ | ||
1866 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ | ||
1867 | .info = snd_hdsp_info_spdif_bits, \ | ||
1868 | .get = snd_hdsp_get_spdif_emphasis, .put = snd_hdsp_put_spdif_emphasis } | ||
1869 | |||
1870 | static int hdsp_spdif_emphasis(struct hdsp *hdsp) | ||
1871 | { | ||
1872 | return (hdsp->control_register & HDSP_SPDIFEmphasis) ? 1 : 0; | ||
1873 | } | ||
1874 | |||
1875 | static int hdsp_set_spdif_emphasis(struct hdsp *hdsp, int val) | ||
1876 | { | ||
1877 | if (val) | ||
1878 | hdsp->control_register |= HDSP_SPDIFEmphasis; | ||
1879 | else | ||
1880 | hdsp->control_register &= ~HDSP_SPDIFEmphasis; | ||
1881 | hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register); | ||
1882 | return 0; | ||
1883 | } | ||
1884 | |||
1885 | static int snd_hdsp_get_spdif_emphasis(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
1886 | { | ||
1887 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
1888 | |||
1889 | ucontrol->value.integer.value[0] = hdsp_spdif_emphasis(hdsp); | ||
1890 | return 0; | ||
1891 | } | ||
1892 | |||
1893 | static int snd_hdsp_put_spdif_emphasis(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
1894 | { | ||
1895 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
1896 | int change; | ||
1897 | unsigned int val; | ||
1898 | |||
1899 | if (!snd_hdsp_use_is_exclusive(hdsp)) | ||
1900 | return -EBUSY; | ||
1901 | val = ucontrol->value.integer.value[0] & 1; | ||
1902 | spin_lock_irq(&hdsp->lock); | ||
1903 | change = (int)val != hdsp_spdif_emphasis(hdsp); | ||
1904 | hdsp_set_spdif_emphasis(hdsp, val); | ||
1905 | spin_unlock_irq(&hdsp->lock); | ||
1906 | return change; | ||
1907 | } | ||
1908 | |||
1909 | #define HDSP_SPDIF_NON_AUDIO(xname, xindex) \ | ||
1910 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ | ||
1911 | .info = snd_hdsp_info_spdif_bits, \ | ||
1912 | .get = snd_hdsp_get_spdif_nonaudio, .put = snd_hdsp_put_spdif_nonaudio } | ||
1913 | |||
1914 | static int hdsp_spdif_nonaudio(struct hdsp *hdsp) | ||
1915 | { | ||
1916 | return (hdsp->control_register & HDSP_SPDIFNonAudio) ? 1 : 0; | ||
1917 | } | ||
1918 | |||
1919 | static int hdsp_set_spdif_nonaudio(struct hdsp *hdsp, int val) | ||
1920 | { | ||
1921 | if (val) | ||
1922 | hdsp->control_register |= HDSP_SPDIFNonAudio; | ||
1923 | else | ||
1924 | hdsp->control_register &= ~HDSP_SPDIFNonAudio; | ||
1925 | hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register); | ||
1926 | return 0; | ||
1927 | } | ||
1928 | |||
1929 | static int snd_hdsp_get_spdif_nonaudio(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
1930 | { | ||
1931 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
1932 | |||
1933 | ucontrol->value.integer.value[0] = hdsp_spdif_nonaudio(hdsp); | ||
1934 | return 0; | ||
1935 | } | ||
1936 | |||
1937 | static int snd_hdsp_put_spdif_nonaudio(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
1938 | { | ||
1939 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
1940 | int change; | ||
1941 | unsigned int val; | ||
1942 | |||
1943 | if (!snd_hdsp_use_is_exclusive(hdsp)) | ||
1944 | return -EBUSY; | ||
1945 | val = ucontrol->value.integer.value[0] & 1; | ||
1946 | spin_lock_irq(&hdsp->lock); | ||
1947 | change = (int)val != hdsp_spdif_nonaudio(hdsp); | ||
1948 | hdsp_set_spdif_nonaudio(hdsp, val); | ||
1949 | spin_unlock_irq(&hdsp->lock); | ||
1950 | return change; | ||
1951 | } | ||
1952 | |||
1953 | #define HDSP_SPDIF_SAMPLE_RATE(xname, xindex) \ | 1774 | #define HDSP_SPDIF_SAMPLE_RATE(xname, xindex) \ |
1954 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 1775 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
1955 | .name = xname, \ | 1776 | .name = xname, \ |
@@ -2549,114 +2370,6 @@ static int snd_hdsp_put_phone_gain(struct snd_kcontrol *kcontrol, struct snd_ctl | |||
2549 | return change; | 2370 | return change; |
2550 | } | 2371 | } |
2551 | 2372 | ||
2552 | #define HDSP_XLR_BREAKOUT_CABLE(xname, xindex) \ | ||
2553 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | ||
2554 | .name = xname, \ | ||
2555 | .index = xindex, \ | ||
2556 | .info = snd_hdsp_info_xlr_breakout_cable, \ | ||
2557 | .get = snd_hdsp_get_xlr_breakout_cable, \ | ||
2558 | .put = snd_hdsp_put_xlr_breakout_cable \ | ||
2559 | } | ||
2560 | |||
2561 | static int hdsp_xlr_breakout_cable(struct hdsp *hdsp) | ||
2562 | { | ||
2563 | if (hdsp->control_register & HDSP_XLRBreakoutCable) | ||
2564 | return 1; | ||
2565 | return 0; | ||
2566 | } | ||
2567 | |||
2568 | static int hdsp_set_xlr_breakout_cable(struct hdsp *hdsp, int mode) | ||
2569 | { | ||
2570 | if (mode) | ||
2571 | hdsp->control_register |= HDSP_XLRBreakoutCable; | ||
2572 | else | ||
2573 | hdsp->control_register &= ~HDSP_XLRBreakoutCable; | ||
2574 | hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register); | ||
2575 | return 0; | ||
2576 | } | ||
2577 | |||
2578 | #define snd_hdsp_info_xlr_breakout_cable snd_ctl_boolean_mono_info | ||
2579 | |||
2580 | static int snd_hdsp_get_xlr_breakout_cable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
2581 | { | ||
2582 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
2583 | |||
2584 | ucontrol->value.enumerated.item[0] = hdsp_xlr_breakout_cable(hdsp); | ||
2585 | return 0; | ||
2586 | } | ||
2587 | |||
2588 | static int snd_hdsp_put_xlr_breakout_cable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
2589 | { | ||
2590 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
2591 | int change; | ||
2592 | int val; | ||
2593 | |||
2594 | if (!snd_hdsp_use_is_exclusive(hdsp)) | ||
2595 | return -EBUSY; | ||
2596 | val = ucontrol->value.integer.value[0] & 1; | ||
2597 | spin_lock_irq(&hdsp->lock); | ||
2598 | change = (int)val != hdsp_xlr_breakout_cable(hdsp); | ||
2599 | hdsp_set_xlr_breakout_cable(hdsp, val); | ||
2600 | spin_unlock_irq(&hdsp->lock); | ||
2601 | return change; | ||
2602 | } | ||
2603 | |||
2604 | /* (De)activates old RME Analog Extension Board | ||
2605 | These are connected to the internal ADAT connector | ||
2606 | Switching this on desactivates external ADAT | ||
2607 | */ | ||
2608 | #define HDSP_AEB(xname, xindex) \ | ||
2609 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | ||
2610 | .name = xname, \ | ||
2611 | .index = xindex, \ | ||
2612 | .info = snd_hdsp_info_aeb, \ | ||
2613 | .get = snd_hdsp_get_aeb, \ | ||
2614 | .put = snd_hdsp_put_aeb \ | ||
2615 | } | ||
2616 | |||
2617 | static int hdsp_aeb(struct hdsp *hdsp) | ||
2618 | { | ||
2619 | if (hdsp->control_register & HDSP_AnalogExtensionBoard) | ||
2620 | return 1; | ||
2621 | return 0; | ||
2622 | } | ||
2623 | |||
2624 | static int hdsp_set_aeb(struct hdsp *hdsp, int mode) | ||
2625 | { | ||
2626 | if (mode) | ||
2627 | hdsp->control_register |= HDSP_AnalogExtensionBoard; | ||
2628 | else | ||
2629 | hdsp->control_register &= ~HDSP_AnalogExtensionBoard; | ||
2630 | hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register); | ||
2631 | return 0; | ||
2632 | } | ||
2633 | |||
2634 | #define snd_hdsp_info_aeb snd_ctl_boolean_mono_info | ||
2635 | |||
2636 | static int snd_hdsp_get_aeb(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
2637 | { | ||
2638 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
2639 | |||
2640 | ucontrol->value.enumerated.item[0] = hdsp_aeb(hdsp); | ||
2641 | return 0; | ||
2642 | } | ||
2643 | |||
2644 | static int snd_hdsp_put_aeb(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
2645 | { | ||
2646 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
2647 | int change; | ||
2648 | int val; | ||
2649 | |||
2650 | if (!snd_hdsp_use_is_exclusive(hdsp)) | ||
2651 | return -EBUSY; | ||
2652 | val = ucontrol->value.integer.value[0] & 1; | ||
2653 | spin_lock_irq(&hdsp->lock); | ||
2654 | change = (int)val != hdsp_aeb(hdsp); | ||
2655 | hdsp_set_aeb(hdsp, val); | ||
2656 | spin_unlock_irq(&hdsp->lock); | ||
2657 | return change; | ||
2658 | } | ||
2659 | |||
2660 | #define HDSP_PREF_SYNC_REF(xname, xindex) \ | 2373 | #define HDSP_PREF_SYNC_REF(xname, xindex) \ |
2661 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 2374 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
2662 | .name = xname, \ | 2375 | .name = xname, \ |
@@ -2845,58 +2558,6 @@ static int snd_hdsp_get_autosync_ref(struct snd_kcontrol *kcontrol, struct snd_c | |||
2845 | return 0; | 2558 | return 0; |
2846 | } | 2559 | } |
2847 | 2560 | ||
2848 | #define HDSP_LINE_OUT(xname, xindex) \ | ||
2849 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | ||
2850 | .name = xname, \ | ||
2851 | .index = xindex, \ | ||
2852 | .info = snd_hdsp_info_line_out, \ | ||
2853 | .get = snd_hdsp_get_line_out, \ | ||
2854 | .put = snd_hdsp_put_line_out \ | ||
2855 | } | ||
2856 | |||
2857 | static int hdsp_line_out(struct hdsp *hdsp) | ||
2858 | { | ||
2859 | return (hdsp->control_register & HDSP_LineOut) ? 1 : 0; | ||
2860 | } | ||
2861 | |||
2862 | static int hdsp_set_line_output(struct hdsp *hdsp, int out) | ||
2863 | { | ||
2864 | if (out) | ||
2865 | hdsp->control_register |= HDSP_LineOut; | ||
2866 | else | ||
2867 | hdsp->control_register &= ~HDSP_LineOut; | ||
2868 | hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register); | ||
2869 | return 0; | ||
2870 | } | ||
2871 | |||
2872 | #define snd_hdsp_info_line_out snd_ctl_boolean_mono_info | ||
2873 | |||
2874 | static int snd_hdsp_get_line_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
2875 | { | ||
2876 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
2877 | |||
2878 | spin_lock_irq(&hdsp->lock); | ||
2879 | ucontrol->value.integer.value[0] = hdsp_line_out(hdsp); | ||
2880 | spin_unlock_irq(&hdsp->lock); | ||
2881 | return 0; | ||
2882 | } | ||
2883 | |||
2884 | static int snd_hdsp_put_line_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | ||
2885 | { | ||
2886 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); | ||
2887 | int change; | ||
2888 | unsigned int val; | ||
2889 | |||
2890 | if (!snd_hdsp_use_is_exclusive(hdsp)) | ||
2891 | return -EBUSY; | ||
2892 | val = ucontrol->value.integer.value[0] & 1; | ||
2893 | spin_lock_irq(&hdsp->lock); | ||
2894 | change = (int)val != hdsp_line_out(hdsp); | ||
2895 | hdsp_set_line_output(hdsp, val); | ||
2896 | spin_unlock_irq(&hdsp->lock); | ||
2897 | return change; | ||
2898 | } | ||
2899 | |||
2900 | #define HDSP_PRECISE_POINTER(xname, xindex) \ | 2561 | #define HDSP_PRECISE_POINTER(xname, xindex) \ |
2901 | { .iface = SNDRV_CTL_ELEM_IFACE_CARD, \ | 2562 | { .iface = SNDRV_CTL_ELEM_IFACE_CARD, \ |
2902 | .name = xname, \ | 2563 | .name = xname, \ |