#include <linux/devm-helpers.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/mfd/max14577.h>
#include <linux/mfd/max14577-private.h>
#include <linux/extcon-provider.h>
#define DELAY_MS_DEFAULT …
enum max14577_muic_adc_debounce_time { … };
enum max14577_muic_status { … };
struct max14577_muic_irq { … };
static struct max14577_muic_irq max14577_muic_irqs[] = …;
static struct max14577_muic_irq max77836_muic_irqs[] = …;
struct max14577_muic_info { … };
enum max14577_muic_cable_group { … };
enum max14577_muic_acc_type { … };
static const unsigned int max14577_extcon_cable[] = …;
static int max14577_muic_set_debounce_time(struct max14577_muic_info *info,
enum max14577_muic_adc_debounce_time time)
{
u8 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 = max14577_update_reg(info->max14577->regmap,
MAX14577_MUIC_REG_CONTROL3,
CTRL3_ADCDBSET_MASK,
time << CTRL3_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 max14577_muic_set_path(struct max14577_muic_info *info,
u8 val, bool attached)
{ … }
static int max14577_muic_get_cable_type(struct max14577_muic_info *info,
enum max14577_muic_cable_group group, bool *attached)
{ … }
static int max14577_muic_jig_handler(struct max14577_muic_info *info,
int cable_type, bool attached)
{ … }
static int max14577_muic_adc_handler(struct max14577_muic_info *info)
{ … }
static int max14577_muic_chg_handler(struct max14577_muic_info *info)
{ … }
static void max14577_muic_irq_work(struct work_struct *work)
{ … }
static int max14577_parse_irq(struct max14577_muic_info *info, int irq_type)
{ … }
static int max77836_parse_irq(struct max14577_muic_info *info, int irq_type)
{ … }
static irqreturn_t max14577_muic_irq_handler(int irq, void *data)
{ … }
static int max14577_muic_detect_accessory(struct max14577_muic_info *info)
{ … }
static void max14577_muic_detect_cable_wq(struct work_struct *work)
{ … }
static int max14577_muic_probe(struct platform_device *pdev)
{ … }
static const struct platform_device_id max14577_muic_id[] = …;
MODULE_DEVICE_TABLE(platform, max14577_muic_id);
static const struct of_device_id of_max14577_muic_dt_match[] = …;
MODULE_DEVICE_TABLE(of, of_max14577_muic_dt_match);
static struct platform_driver max14577_muic_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;