#include <linux/of.h>
#include <linux/input.h>
#include <linux/kthread.h>
#include <linux/io.h>
#include <linux/sched/clock.h>
#include <linux/workqueue.h>
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/irqdomain.h>
#include <linux/irq.h>
#include <linux/regmap.h>
#include <sound/soc.h>
#include <sound/jack.h>
#include <linux/mfd/mt6397/core.h>
#include "mt6359-accdet.h"
#include "mt6359.h"
#define REGISTER_VAL(x) …
#define ACCDET_PMIC_EINT_IRQ …
#define ACCDET_AP_GPIO_EINT …
#define ACCDET_PMIC_EINT0 …
#define ACCDET_PMIC_EINT1 …
#define ACCDET_PMIC_BI_EINT …
#define ACCDET_PMIC_GPIO_TRIG_EINT …
#define ACCDET_PMIC_INVERTER_TRIG_EINT …
#define ACCDET_PMIC_RSV_EINT …
#define ACCDET_THREE_KEY …
#define ACCDET_FOUR_KEY …
#define ACCDET_TRI_KEY_CDD …
#define ACCDET_RSV_KEY …
#define ACCDET_ANALOG_FASTDISCHARGE …
#define ACCDET_DIGITAL_FASTDISCHARGE …
#define ACCDET_AD_FASTDISCHRAGE …
static struct platform_driver mt6359_accdet_driver;
static const struct snd_soc_component_driver mt6359_accdet_soc_driver;
static void accdet_set_debounce(struct mt6359_accdet *priv, int state,
unsigned int debounce);
static unsigned int adjust_eint_analog_setting(struct mt6359_accdet *priv);
static void config_digital_init_by_mode(struct mt6359_accdet *priv);
static void config_eint_init_by_mode(struct mt6359_accdet *priv);
static inline void mt6359_accdet_init(struct mt6359_accdet *priv);
static unsigned int mt6359_accdet_jd_setting(struct mt6359_accdet *priv);
static void mt6359_accdet_recover_jd_setting(struct mt6359_accdet *priv);
static void mt6359_accdet_jack_report(struct mt6359_accdet *priv);
static void recover_eint_analog_setting(struct mt6359_accdet *priv);
static void recover_eint_digital_setting(struct mt6359_accdet *priv);
static void recover_eint_setting(struct mt6359_accdet *priv);
static unsigned int adjust_eint_analog_setting(struct mt6359_accdet *priv)
{ … }
static unsigned int adjust_eint_digital_setting(struct mt6359_accdet *priv)
{ … }
static unsigned int mt6359_accdet_jd_setting(struct mt6359_accdet *priv)
{ … }
static void recover_eint_analog_setting(struct mt6359_accdet *priv)
{ … }
static void recover_eint_digital_setting(struct mt6359_accdet *priv)
{ … }
static void recover_eint_setting(struct mt6359_accdet *priv)
{ … }
static void mt6359_accdet_recover_jd_setting(struct mt6359_accdet *priv)
{ … }
static void accdet_set_debounce(struct mt6359_accdet *priv, int state,
unsigned int debounce)
{ … }
static void mt6359_accdet_jack_report(struct mt6359_accdet *priv)
{ … }
static unsigned int check_button(struct mt6359_accdet *priv, unsigned int v)
{ … }
static void is_key_pressed(struct mt6359_accdet *priv, bool pressed)
{ … }
static inline void check_jack_btn_type(struct mt6359_accdet *priv)
{ … }
static void mt6359_accdet_work(struct work_struct *work)
{ … }
static void mt6359_accdet_jd_work(struct work_struct *work)
{ … }
static irqreturn_t mt6359_accdet_irq(int irq, void *data)
{ … }
static int mt6359_accdet_parse_dt(struct mt6359_accdet *priv)
{ … }
static void config_digital_init_by_mode(struct mt6359_accdet *priv)
{ … }
static void config_eint_init_by_mode(struct mt6359_accdet *priv)
{ … }
static void mt6359_accdet_init(struct mt6359_accdet *priv)
{ … }
int mt6359_accdet_enable_jack_detect(struct snd_soc_component *component,
struct snd_soc_jack *jack)
{ … }
EXPORT_SYMBOL_GPL(…);
static int mt6359_accdet_probe(struct platform_device *pdev)
{ … }
static struct platform_driver mt6359_accdet_driver = …;
module_platform_driver(…) …
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;