#include <linux/devm-helpers.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/mfd/max77693.h>
#include <linux/mfd/max77693-common.h>
#include <linux/mfd/max77693-private.h>
#include <linux/extcon-provider.h>
#include <linux/regmap.h>
#include <linux/irqdomain.h>
#define DEV_NAME …
#define DELAY_MS_DEFAULT …
static struct max77693_reg_data default_init_data[] = …;
enum max77693_muic_adc_debounce_time { … };
struct max77693_muic_info { … };
enum max77693_muic_cable_group { … };
enum max77693_muic_charger_type { … };
struct max77693_muic_irq { … };
static struct max77693_muic_irq muic_irqs[] = …;
enum max77693_muic_acc_type { … };
static const unsigned int max77693_extcon_cable[] = …;
static int max77693_muic_set_debounce_time(struct max77693_muic_info *info,
enum max77693_muic_adc_debounce_time time)
{
int ret;
switch (time) {
case ADC_DEBOUNCE_TIME_5MS:
case ADC_DEBOUNCE_TIME_10MS:
case ADC_DEBOUNCE_TIME_25MS:
case ADC_DEBOUNCE_TIME_38_62MS:
ret = regmap_write(info->max77693->regmap_muic,
MAX77693_MUIC_REG_CTRL3,
time << MAX77693_CONTROL3_ADCDBSET_SHIFT);
if (ret) {
dev_err(info->dev, "failed to set ADC debounce time\n");
return ret;
}
break;
default:
dev_err(info->dev, "invalid ADC debounce time\n");
return -EINVAL;
}
return 0;
};
static int max77693_muic_set_path(struct max77693_muic_info *info,
u8 val, bool attached)
{ … }
static int max77693_muic_get_cable_type(struct max77693_muic_info *info,
enum max77693_muic_cable_group group, bool *attached)
{ … }
static int max77693_muic_dock_handler(struct max77693_muic_info *info,
int cable_type, bool attached)
{ … }
static int max77693_muic_dock_button_handler(struct max77693_muic_info *info,
int button_type, bool attached)
{ … }
static int max77693_muic_adc_ground_handler(struct max77693_muic_info *info)
{ … }
static int max77693_muic_jig_handler(struct max77693_muic_info *info,
int cable_type, bool attached)
{ … }
static int max77693_muic_adc_handler(struct max77693_muic_info *info)
{ … }
static int max77693_muic_chg_handler(struct max77693_muic_info *info)
{ … }
static void max77693_muic_irq_work(struct work_struct *work)
{ … }
static irqreturn_t max77693_muic_irq_handler(int irq, void *data)
{ … }
static const struct regmap_config max77693_muic_regmap_config = …;
static int max77693_muic_detect_accessory(struct max77693_muic_info *info)
{ … }
static void max77693_muic_detect_cable_wq(struct work_struct *work)
{ … }
static int max77693_muic_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id of_max77693_muic_dt_match[] = …;
MODULE_DEVICE_TABLE(of, of_max77693_muic_dt_match);
static struct platform_driver max77693_muic_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;