#ifndef _RT5640_H
#define _RT5640_H
+#include <linux/clk.h>
#include <sound/rt5640.h>
/* Info */
#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)
#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
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];
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,