X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=sound%2Fsoc%2Fcodecs%2Frt5640.h;h=e96e9915230f7eac7cfabb04ab3ca5c93e96b93a;hb=2ae05321496aa27767bc33a5cc19451b3db67919;hp=243f42633989775f6326d079c72ba23406518a53;hpb=96597f605d63ec328b9664404b419b28fe2eb5d1;p=firefly-linux-kernel-4.4.55.git diff --git a/sound/soc/codecs/rt5640.h b/sound/soc/codecs/rt5640.h index 243f42633989..e96e9915230f 100644 --- a/sound/soc/codecs/rt5640.h +++ b/sound/soc/codecs/rt5640.h @@ -12,6 +12,7 @@ #ifndef _RT5640_H #define _RT5640_H +#include #include /* Info */ @@ -177,6 +178,8 @@ #define RT5640_EQ_GN_HIP2 0xb2 #define RT5640_EQ_PRE_VOL 0xb3 #define RT5640_EQ_PST_VOL 0xb4 +/* General Control */ +#define RT5640_GEN_CTRL1 0xfa /* global definition */ #define RT5640_L_MUTE (0x1 << 15) @@ -2035,6 +2038,10 @@ enum { #define RT5640_HEADSET_DET BIT(1) #define RT5640_HEADPHO_DET BIT(2) +/* General Control1 (0xfa) */ +#define RT5640_M_MAMIX_L (0x1 << 13) +#define RT5640_M_MAMIX_R (0x1 << 12) + /* System Clock Source */ #define RT5640_SCLK_S_MCLK 0 #define RT5640_SCLK_S_PLL1 1 @@ -2083,7 +2090,9 @@ struct rt5640_priv { struct snd_soc_codec *codec; struct rt5640_platform_data pdata; struct regmap *regmap; - + struct clk *mclk; + struct work_struct work; + struct workqueue_struct *wq; int sysclk; int sysclk_src; int lrck[RT5640_AIFS]; @@ -2095,6 +2104,18 @@ struct rt5640_priv { int pll_out; bool hp_mute; + + struct delayed_work adc_poll_work; + struct iio_channel *chan; + int hp_det_adc_value; + bool hp_insert; + int hp_con_gpio; + bool hp_con_gpio_active_high; + struct delayed_work init_delayed_work; + struct delayed_work aux_det_work; + int aux_det_gpio; + int aux_det_irq; + struct snd_soc_jack hp_jack; }; int rt5640_dmic_enable(struct snd_soc_codec *codec,