[alsa-devel] [asoc:for-next 16/17] sound/soc/codecs/rt5651.c:1874:20: error: redefinition of 'rt5651_irq'

kbuild test robot fengguang.wu at intel.com
Thu Oct 26 19:29:23 CEST 2017


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
head:   2708a8339e928912307fe5cd1ae66d959caa7279
commit: b16351eba5e00bd7957fb16b98a152e5425ceb74 [16/17] Merge remote-tracking branches 'asoc/topic/sgtl5000', 'asoc/topic/stm32', 'asoc/topic/tas571x', 'asoc/topic/tfa9879' and 'asoc/topic/ts3a277e' into asoc-next
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout b16351eba5e00bd7957fb16b98a152e5425ceb74
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All error/warnings (new ones prefixed by >>):

>> sound/soc/codecs/rt5651.c:1874:20: error: redefinition of 'rt5651_irq'
    static irqreturn_t rt5651_irq(int irq, void *data)
                       ^
   sound/soc/codecs/rt5651.c:1787:20: note: previous definition of 'rt5651_irq' was here
    static irqreturn_t rt5651_irq(int irq, void *data)
                       ^
>> sound/soc/codecs/rt5651.c:1884:12: error: redefinition of 'rt5651_jack_detect'
    static int rt5651_jack_detect(struct snd_soc_codec *codec, int jack_insert)
               ^
   sound/soc/codecs/rt5651.c:1797:12: note: previous definition of 'rt5651_jack_detect' was here
    static int rt5651_jack_detect(struct snd_soc_codec *codec, int jack_insert)
               ^
>> sound/soc/codecs/rt5651.c:1920:13: error: redefinition of 'rt5651_jack_detect_work'
    static void rt5651_jack_detect_work(struct work_struct *work)
                ^
   sound/soc/codecs/rt5651.c:1833:13: note: previous definition of 'rt5651_jack_detect_work' was here
    static void rt5651_jack_detect_work(struct work_struct *work)
                ^
>> sound/soc/codecs/rt5651.c:1949:5: error: redefinition of 'rt5651_set_jack_detect'
    int rt5651_set_jack_detect(struct snd_soc_codec *codec,
        ^
   sound/soc/codecs/rt5651.c:1862:5: note: previous definition of 'rt5651_set_jack_detect' was here
    int rt5651_set_jack_detect(struct snd_soc_codec *codec,
        ^
   In file included from include/linux/linkage.h:6:0,
                    from include/linux/kernel.h:6,
                    from include/linux/list.h:8,
                    from include/linux/module.h:9,
                    from sound/soc/codecs/rt5651.c:12:
>> include/linux/export.h:67:20: error: redefinition of '__kstrtab_rt5651_set_jack_detect'
     static const char __kstrtab_##sym[]    \
                       ^
   include/linux/export.h:100:25: note: in expansion of macro '___EXPORT_SYMBOL'
    #define __EXPORT_SYMBOL ___EXPORT_SYMBOL
                            ^
   include/linux/export.h:107:2: note: in expansion of macro '__EXPORT_SYMBOL'
     __EXPORT_SYMBOL(sym, "_gpl")
     ^
>> sound/soc/codecs/rt5651.c:1959:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    EXPORT_SYMBOL_GPL(rt5651_set_jack_detect);
    ^
   include/linux/export.h:67:20: note: previous definition of '__kstrtab_rt5651_set_jack_detect' was here
     static const char __kstrtab_##sym[]    \
                       ^
   include/linux/export.h:100:25: note: in expansion of macro '___EXPORT_SYMBOL'
    #define __EXPORT_SYMBOL ___EXPORT_SYMBOL
                            ^
   include/linux/export.h:107:2: note: in expansion of macro '__EXPORT_SYMBOL'
     __EXPORT_SYMBOL(sym, "_gpl")
     ^
   sound/soc/codecs/rt5651.c:1872:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    EXPORT_SYMBOL_GPL(rt5651_set_jack_detect);
    ^
   include/linux/export.h:70:36: error: redefinition of '__ksymtab_rt5651_set_jack_detect'
     static const struct kernel_symbol __ksymtab_##sym  \
                                       ^
   include/linux/export.h:100:25: note: in expansion of macro '___EXPORT_SYMBOL'
    #define __EXPORT_SYMBOL ___EXPORT_SYMBOL
                            ^
   include/linux/export.h:107:2: note: in expansion of macro '__EXPORT_SYMBOL'
     __EXPORT_SYMBOL(sym, "_gpl")
     ^
>> sound/soc/codecs/rt5651.c:1959:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    EXPORT_SYMBOL_GPL(rt5651_set_jack_detect);
    ^
   include/linux/export.h:70:36: note: previous definition of '__ksymtab_rt5651_set_jack_detect' was here
     static const struct kernel_symbol __ksymtab_##sym  \
                                       ^
   include/linux/export.h:100:25: note: in expansion of macro '___EXPORT_SYMBOL'
    #define __EXPORT_SYMBOL ___EXPORT_SYMBOL
                            ^
   include/linux/export.h:107:2: note: in expansion of macro '__EXPORT_SYMBOL'
     __EXPORT_SYMBOL(sym, "_gpl")
     ^
   sound/soc/codecs/rt5651.c:1872:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    EXPORT_SYMBOL_GPL(rt5651_set_jack_detect);
    ^
   sound/soc/codecs/rt5651.c:1833:13: warning: 'rt5651_jack_detect_work' defined but not used [-Wunused-function]
    static void rt5651_jack_detect_work(struct work_struct *work)
                ^
--
   sound/soc//codecs/rt5651.c:1874:20: error: redefinition of 'rt5651_irq'
    static irqreturn_t rt5651_irq(int irq, void *data)
                       ^
   sound/soc//codecs/rt5651.c:1787:20: note: previous definition of 'rt5651_irq' was here
    static irqreturn_t rt5651_irq(int irq, void *data)
                       ^
   sound/soc//codecs/rt5651.c:1884:12: error: redefinition of 'rt5651_jack_detect'
    static int rt5651_jack_detect(struct snd_soc_codec *codec, int jack_insert)
               ^
   sound/soc//codecs/rt5651.c:1797:12: note: previous definition of 'rt5651_jack_detect' was here
    static int rt5651_jack_detect(struct snd_soc_codec *codec, int jack_insert)
               ^
   sound/soc//codecs/rt5651.c:1920:13: error: redefinition of 'rt5651_jack_detect_work'
    static void rt5651_jack_detect_work(struct work_struct *work)
                ^
   sound/soc//codecs/rt5651.c:1833:13: note: previous definition of 'rt5651_jack_detect_work' was here
    static void rt5651_jack_detect_work(struct work_struct *work)
                ^
   sound/soc//codecs/rt5651.c:1949:5: error: redefinition of 'rt5651_set_jack_detect'
    int rt5651_set_jack_detect(struct snd_soc_codec *codec,
        ^
   sound/soc//codecs/rt5651.c:1862:5: note: previous definition of 'rt5651_set_jack_detect' was here
    int rt5651_set_jack_detect(struct snd_soc_codec *codec,
        ^
   In file included from include/linux/linkage.h:6:0,
                    from include/linux/kernel.h:6,
                    from include/linux/list.h:8,
                    from include/linux/module.h:9,
                    from sound/soc//codecs/rt5651.c:12:
>> include/linux/export.h:67:20: error: redefinition of '__kstrtab_rt5651_set_jack_detect'
     static const char __kstrtab_##sym[]    \
                       ^
   include/linux/export.h:100:25: note: in expansion of macro '___EXPORT_SYMBOL'
    #define __EXPORT_SYMBOL ___EXPORT_SYMBOL
                            ^
   include/linux/export.h:107:2: note: in expansion of macro '__EXPORT_SYMBOL'
     __EXPORT_SYMBOL(sym, "_gpl")
     ^
   sound/soc//codecs/rt5651.c:1959:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    EXPORT_SYMBOL_GPL(rt5651_set_jack_detect);
    ^
   include/linux/export.h:67:20: note: previous definition of '__kstrtab_rt5651_set_jack_detect' was here
     static const char __kstrtab_##sym[]    \
                       ^
   include/linux/export.h:100:25: note: in expansion of macro '___EXPORT_SYMBOL'
    #define __EXPORT_SYMBOL ___EXPORT_SYMBOL
                            ^
   include/linux/export.h:107:2: note: in expansion of macro '__EXPORT_SYMBOL'
     __EXPORT_SYMBOL(sym, "_gpl")
     ^
   sound/soc//codecs/rt5651.c:1872:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    EXPORT_SYMBOL_GPL(rt5651_set_jack_detect);
    ^
   include/linux/export.h:70:36: error: redefinition of '__ksymtab_rt5651_set_jack_detect'
     static const struct kernel_symbol __ksymtab_##sym  \
                                       ^
   include/linux/export.h:100:25: note: in expansion of macro '___EXPORT_SYMBOL'
    #define __EXPORT_SYMBOL ___EXPORT_SYMBOL
                            ^
   include/linux/export.h:107:2: note: in expansion of macro '__EXPORT_SYMBOL'
     __EXPORT_SYMBOL(sym, "_gpl")
     ^
   sound/soc//codecs/rt5651.c:1959:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    EXPORT_SYMBOL_GPL(rt5651_set_jack_detect);
    ^
   include/linux/export.h:70:36: note: previous definition of '__ksymtab_rt5651_set_jack_detect' was here
     static const struct kernel_symbol __ksymtab_##sym  \
                                       ^
   include/linux/export.h:100:25: note: in expansion of macro '___EXPORT_SYMBOL'
    #define __EXPORT_SYMBOL ___EXPORT_SYMBOL
                            ^
   include/linux/export.h:107:2: note: in expansion of macro '__EXPORT_SYMBOL'
     __EXPORT_SYMBOL(sym, "_gpl")
     ^
   sound/soc//codecs/rt5651.c:1872:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
    EXPORT_SYMBOL_GPL(rt5651_set_jack_detect);
    ^
   sound/soc//codecs/rt5651.c:1833:13: warning: 'rt5651_jack_detect_work' defined but not used [-Wunused-function]
    static void rt5651_jack_detect_work(struct work_struct *work)
                ^

vim +/rt5651_irq +1874 sound/soc/codecs/rt5651.c

b4435130 Carlo Caione 2017-10-20  1786  
80bbe4a3 Carlo Caione 2017-10-20 @1787  static irqreturn_t rt5651_irq(int irq, void *data)
80bbe4a3 Carlo Caione 2017-10-20  1788  {
80bbe4a3 Carlo Caione 2017-10-20  1789  	struct rt5651_priv *rt5651 = data;
80bbe4a3 Carlo Caione 2017-10-20  1790  
80bbe4a3 Carlo Caione 2017-10-20  1791  	queue_delayed_work(system_power_efficient_wq,
80bbe4a3 Carlo Caione 2017-10-20  1792  			   &rt5651->jack_detect_work, msecs_to_jiffies(250));
80bbe4a3 Carlo Caione 2017-10-20  1793  
80bbe4a3 Carlo Caione 2017-10-20  1794  	return IRQ_HANDLED;
80bbe4a3 Carlo Caione 2017-10-20  1795  }
80bbe4a3 Carlo Caione 2017-10-20  1796  
80bbe4a3 Carlo Caione 2017-10-20 @1797  static int rt5651_jack_detect(struct snd_soc_codec *codec, int jack_insert)
80bbe4a3 Carlo Caione 2017-10-20  1798  {
80bbe4a3 Carlo Caione 2017-10-20  1799  	struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
80bbe4a3 Carlo Caione 2017-10-20  1800  	int jack_type;
80bbe4a3 Carlo Caione 2017-10-20  1801  
80bbe4a3 Carlo Caione 2017-10-20  1802  	if (jack_insert) {
80bbe4a3 Carlo Caione 2017-10-20  1803  		snd_soc_dapm_force_enable_pin(dapm, "LDO");
80bbe4a3 Carlo Caione 2017-10-20  1804  		snd_soc_dapm_sync(dapm);
80bbe4a3 Carlo Caione 2017-10-20  1805  
80bbe4a3 Carlo Caione 2017-10-20  1806  		snd_soc_update_bits(codec, RT5651_MICBIAS,
80bbe4a3 Carlo Caione 2017-10-20  1807  				    RT5651_MIC1_OVCD_MASK |
80bbe4a3 Carlo Caione 2017-10-20  1808  				    RT5651_MIC1_OVTH_MASK |
80bbe4a3 Carlo Caione 2017-10-20  1809  				    RT5651_PWR_CLK12M_MASK |
80bbe4a3 Carlo Caione 2017-10-20  1810  				    RT5651_PWR_MB_MASK,
80bbe4a3 Carlo Caione 2017-10-20  1811  				    RT5651_MIC1_OVCD_EN |
80bbe4a3 Carlo Caione 2017-10-20  1812  				    RT5651_MIC1_OVTH_600UA |
b16351eb Mark Brown   2017-10-26  1813  				    RT5651_PWR_MB_PU |
b16351eb Mark Brown   2017-10-26  1814  				    RT5651_PWR_CLK12M_PU);
b16351eb Mark Brown   2017-10-26  1815  		msleep(100);
b16351eb Mark Brown   2017-10-26  1816  		if (snd_soc_read(codec, RT5651_IRQ_CTRL2) & RT5651_MB1_OC_CLR)
b16351eb Mark Brown   2017-10-26  1817  			jack_type = SND_JACK_HEADPHONE;
b16351eb Mark Brown   2017-10-26  1818  		else
b16351eb Mark Brown   2017-10-26  1819  			jack_type = SND_JACK_HEADSET;
b16351eb Mark Brown   2017-10-26  1820  		snd_soc_update_bits(codec, RT5651_IRQ_CTRL2,
b16351eb Mark Brown   2017-10-26  1821  				    RT5651_MB1_OC_CLR, 0);
b16351eb Mark Brown   2017-10-26  1822  	} else { /* jack out */
b16351eb Mark Brown   2017-10-26  1823  		jack_type = 0;
b16351eb Mark Brown   2017-10-26  1824  
b16351eb Mark Brown   2017-10-26  1825  		snd_soc_update_bits(codec, RT5651_MICBIAS,
b16351eb Mark Brown   2017-10-26  1826  				    RT5651_MIC1_OVCD_MASK,
b16351eb Mark Brown   2017-10-26  1827  				    RT5651_MIC1_OVCD_DIS);
b16351eb Mark Brown   2017-10-26  1828  	}
b16351eb Mark Brown   2017-10-26  1829  
b16351eb Mark Brown   2017-10-26  1830  	return jack_type;
b16351eb Mark Brown   2017-10-26  1831  }
b16351eb Mark Brown   2017-10-26  1832  
b16351eb Mark Brown   2017-10-26  1833  static void rt5651_jack_detect_work(struct work_struct *work)
b16351eb Mark Brown   2017-10-26  1834  {
b16351eb Mark Brown   2017-10-26  1835  	struct rt5651_priv *rt5651 =
b16351eb Mark Brown   2017-10-26  1836  		container_of(work, struct rt5651_priv, jack_detect_work.work);
b16351eb Mark Brown   2017-10-26  1837  
b16351eb Mark Brown   2017-10-26  1838  	int report, val = 0;
b16351eb Mark Brown   2017-10-26  1839  
b16351eb Mark Brown   2017-10-26  1840  	if (!rt5651->codec)
b16351eb Mark Brown   2017-10-26  1841  		return;
b16351eb Mark Brown   2017-10-26  1842  
b16351eb Mark Brown   2017-10-26  1843  	switch (rt5651->pdata.jd_src) {
b16351eb Mark Brown   2017-10-26  1844  	case RT5651_JD1_1:
b16351eb Mark Brown   2017-10-26  1845  		val = snd_soc_read(rt5651->codec, RT5651_INT_IRQ_ST) & 0x1000;
b16351eb Mark Brown   2017-10-26  1846  		break;
b16351eb Mark Brown   2017-10-26  1847  	case RT5651_JD1_2:
b16351eb Mark Brown   2017-10-26  1848  		val = snd_soc_read(rt5651->codec, RT5651_INT_IRQ_ST) & 0x2000;
b16351eb Mark Brown   2017-10-26  1849  		break;
b16351eb Mark Brown   2017-10-26  1850  	case RT5651_JD2:
b16351eb Mark Brown   2017-10-26  1851  		val = snd_soc_read(rt5651->codec, RT5651_INT_IRQ_ST) & 0x4000;
b16351eb Mark Brown   2017-10-26  1852  		break;
b16351eb Mark Brown   2017-10-26  1853  	default:
b16351eb Mark Brown   2017-10-26  1854  		break;
b16351eb Mark Brown   2017-10-26  1855  	}
b16351eb Mark Brown   2017-10-26  1856  
b16351eb Mark Brown   2017-10-26  1857  	report = rt5651_jack_detect(rt5651->codec, !val);
b16351eb Mark Brown   2017-10-26  1858  
b16351eb Mark Brown   2017-10-26  1859  	snd_soc_jack_report(rt5651->hp_jack, report, SND_JACK_HEADSET);
b16351eb Mark Brown   2017-10-26  1860  }
b16351eb Mark Brown   2017-10-26  1861  
b16351eb Mark Brown   2017-10-26  1862  int rt5651_set_jack_detect(struct snd_soc_codec *codec,
b16351eb Mark Brown   2017-10-26  1863  			   struct snd_soc_jack *hp_jack)
b16351eb Mark Brown   2017-10-26  1864  {
b16351eb Mark Brown   2017-10-26  1865  	struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec);
b16351eb Mark Brown   2017-10-26  1866  
b16351eb Mark Brown   2017-10-26  1867  	rt5651->hp_jack = hp_jack;
b16351eb Mark Brown   2017-10-26  1868  	rt5651_irq(0, rt5651);
3ae08dc0 Bard Liao    2015-12-23  1869  
3ae08dc0 Bard Liao    2015-12-23  1870  	return 0;
3ae08dc0 Bard Liao    2015-12-23  1871  }
b16351eb Mark Brown   2017-10-26  1872  EXPORT_SYMBOL_GPL(rt5651_set_jack_detect);
3ae08dc0 Bard Liao    2015-12-23  1873  
60d5a1a4 Carlo Caione 2017-10-20 @1874  static irqreturn_t rt5651_irq(int irq, void *data)
60d5a1a4 Carlo Caione 2017-10-20  1875  {
60d5a1a4 Carlo Caione 2017-10-20  1876  	struct rt5651_priv *rt5651 = data;
60d5a1a4 Carlo Caione 2017-10-20  1877  
60d5a1a4 Carlo Caione 2017-10-20  1878  	queue_delayed_work(system_power_efficient_wq,
60d5a1a4 Carlo Caione 2017-10-20  1879  			   &rt5651->jack_detect_work, msecs_to_jiffies(250));
60d5a1a4 Carlo Caione 2017-10-20  1880  
60d5a1a4 Carlo Caione 2017-10-20  1881  	return IRQ_HANDLED;
60d5a1a4 Carlo Caione 2017-10-20  1882  }
60d5a1a4 Carlo Caione 2017-10-20  1883  
60d5a1a4 Carlo Caione 2017-10-20 @1884  static int rt5651_jack_detect(struct snd_soc_codec *codec, int jack_insert)
60d5a1a4 Carlo Caione 2017-10-20  1885  {
60d5a1a4 Carlo Caione 2017-10-20  1886  	struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
60d5a1a4 Carlo Caione 2017-10-20  1887  	int jack_type;
60d5a1a4 Carlo Caione 2017-10-20  1888  
60d5a1a4 Carlo Caione 2017-10-20  1889  	if (jack_insert) {
60d5a1a4 Carlo Caione 2017-10-20  1890  		snd_soc_dapm_force_enable_pin(dapm, "LDO");
60d5a1a4 Carlo Caione 2017-10-20  1891  		snd_soc_dapm_sync(dapm);
60d5a1a4 Carlo Caione 2017-10-20  1892  
60d5a1a4 Carlo Caione 2017-10-20  1893  		snd_soc_update_bits(codec, RT5651_MICBIAS,
60d5a1a4 Carlo Caione 2017-10-20  1894  				    RT5651_MIC1_OVCD_MASK |
60d5a1a4 Carlo Caione 2017-10-20  1895  				    RT5651_MIC1_OVTH_MASK |
60d5a1a4 Carlo Caione 2017-10-20  1896  				    RT5651_PWR_CLK12M_MASK |
60d5a1a4 Carlo Caione 2017-10-20  1897  				    RT5651_PWR_MB_MASK,
60d5a1a4 Carlo Caione 2017-10-20  1898  				    RT5651_MIC1_OVCD_EN |
60d5a1a4 Carlo Caione 2017-10-20  1899  				    RT5651_MIC1_OVTH_600UA |
80bbe4a3 Carlo Caione 2017-10-20  1900  				    RT5651_PWR_MB_PU |
80bbe4a3 Carlo Caione 2017-10-20  1901  				    RT5651_PWR_CLK12M_PU);
80bbe4a3 Carlo Caione 2017-10-20  1902  		msleep(100);
80bbe4a3 Carlo Caione 2017-10-20  1903  		if (snd_soc_read(codec, RT5651_IRQ_CTRL2) & RT5651_MB1_OC_CLR)
80bbe4a3 Carlo Caione 2017-10-20  1904  			jack_type = SND_JACK_HEADPHONE;
80bbe4a3 Carlo Caione 2017-10-20  1905  		else
80bbe4a3 Carlo Caione 2017-10-20  1906  			jack_type = SND_JACK_HEADSET;
80bbe4a3 Carlo Caione 2017-10-20  1907  		snd_soc_update_bits(codec, RT5651_IRQ_CTRL2,
80bbe4a3 Carlo Caione 2017-10-20  1908  				    RT5651_MB1_OC_CLR, 0);
80bbe4a3 Carlo Caione 2017-10-20  1909  	} else { /* jack out */
80bbe4a3 Carlo Caione 2017-10-20  1910  		jack_type = 0;
80bbe4a3 Carlo Caione 2017-10-20  1911  
80bbe4a3 Carlo Caione 2017-10-20  1912  		snd_soc_update_bits(codec, RT5651_MICBIAS,
80bbe4a3 Carlo Caione 2017-10-20  1913  				    RT5651_MIC1_OVCD_MASK,
80bbe4a3 Carlo Caione 2017-10-20  1914  				    RT5651_MIC1_OVCD_DIS);
80bbe4a3 Carlo Caione 2017-10-20  1915  	}
80bbe4a3 Carlo Caione 2017-10-20  1916  
80bbe4a3 Carlo Caione 2017-10-20  1917  	return jack_type;
80bbe4a3 Carlo Caione 2017-10-20  1918  }
80bbe4a3 Carlo Caione 2017-10-20  1919  
80bbe4a3 Carlo Caione 2017-10-20 @1920  static void rt5651_jack_detect_work(struct work_struct *work)
80bbe4a3 Carlo Caione 2017-10-20  1921  {
80bbe4a3 Carlo Caione 2017-10-20  1922  	struct rt5651_priv *rt5651 =
80bbe4a3 Carlo Caione 2017-10-20  1923  		container_of(work, struct rt5651_priv, jack_detect_work.work);
80bbe4a3 Carlo Caione 2017-10-20  1924  
80bbe4a3 Carlo Caione 2017-10-20  1925  	int report, val = 0;
80bbe4a3 Carlo Caione 2017-10-20  1926  
80bbe4a3 Carlo Caione 2017-10-20  1927  	if (!rt5651->codec)
80bbe4a3 Carlo Caione 2017-10-20  1928  		return;
80bbe4a3 Carlo Caione 2017-10-20  1929  
80bbe4a3 Carlo Caione 2017-10-20  1930  	switch (rt5651->pdata.jd_src) {
80bbe4a3 Carlo Caione 2017-10-20  1931  	case RT5651_JD1_1:
80bbe4a3 Carlo Caione 2017-10-20  1932  		val = snd_soc_read(rt5651->codec, RT5651_INT_IRQ_ST) & 0x1000;
80bbe4a3 Carlo Caione 2017-10-20  1933  		break;
80bbe4a3 Carlo Caione 2017-10-20  1934  	case RT5651_JD1_2:
80bbe4a3 Carlo Caione 2017-10-20  1935  		val = snd_soc_read(rt5651->codec, RT5651_INT_IRQ_ST) & 0x2000;
80bbe4a3 Carlo Caione 2017-10-20  1936  		break;
80bbe4a3 Carlo Caione 2017-10-20  1937  	case RT5651_JD2:
80bbe4a3 Carlo Caione 2017-10-20  1938  		val = snd_soc_read(rt5651->codec, RT5651_INT_IRQ_ST) & 0x4000;
80bbe4a3 Carlo Caione 2017-10-20  1939  		break;
80bbe4a3 Carlo Caione 2017-10-20  1940  	default:
80bbe4a3 Carlo Caione 2017-10-20  1941  		break;
80bbe4a3 Carlo Caione 2017-10-20  1942  	}
80bbe4a3 Carlo Caione 2017-10-20  1943  
80bbe4a3 Carlo Caione 2017-10-20  1944  	report = rt5651_jack_detect(rt5651->codec, !val);
80bbe4a3 Carlo Caione 2017-10-20  1945  
80bbe4a3 Carlo Caione 2017-10-20  1946  	snd_soc_jack_report(rt5651->hp_jack, report, SND_JACK_HEADSET);
80bbe4a3 Carlo Caione 2017-10-20  1947  }
80bbe4a3 Carlo Caione 2017-10-20  1948  
80bbe4a3 Carlo Caione 2017-10-20 @1949  int rt5651_set_jack_detect(struct snd_soc_codec *codec,
80bbe4a3 Carlo Caione 2017-10-20  1950  			   struct snd_soc_jack *hp_jack)
80bbe4a3 Carlo Caione 2017-10-20  1951  {
80bbe4a3 Carlo Caione 2017-10-20  1952  	struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec);
80bbe4a3 Carlo Caione 2017-10-20  1953  
80bbe4a3 Carlo Caione 2017-10-20  1954  	rt5651->hp_jack = hp_jack;
80bbe4a3 Carlo Caione 2017-10-20  1955  	rt5651_irq(0, rt5651);
80bbe4a3 Carlo Caione 2017-10-20  1956  
80bbe4a3 Carlo Caione 2017-10-20  1957  	return 0;
80bbe4a3 Carlo Caione 2017-10-20  1958  }
80bbe4a3 Carlo Caione 2017-10-20 @1959  EXPORT_SYMBOL_GPL(rt5651_set_jack_detect);
80bbe4a3 Carlo Caione 2017-10-20  1960  

:::::: The code at line 1874 was first introduced by commit
:::::: 60d5a1a47b9a8381c08d2263b11ac9c757c87746 ASoC: rt5651: Enable jack detection on JD* pins

:::::: TO: Carlo Caione <carlo at endlessm.com>
:::::: CC: Mark Brown <broonie at kernel.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 51612 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20171027/5ce2c617/attachment-0001.bin>


More information about the Alsa-devel mailing list