linux/drivers/extcon/extcon-max8997.c

// SPDX-License-Identifier: GPL-2.0+
//
// extcon-max8997.c - MAX8997 extcon driver to support MAX8997 MUIC
//
//  Copyright (C) 2012 Samsung Electronics
//  Donggeun Kim <[email protected]>

#include <linux/devm-helpers.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/kobject.h>
#include <linux/mfd/max8997.h>
#include <linux/mfd/max8997-private.h>
#include <linux/extcon-provider.h>
#include <linux/irqdomain.h>

#define DEV_NAME
#define DELAY_MS_DEFAULT

enum max8997_muic_adc_debounce_time {};

struct max8997_muic_irq {};

static struct max8997_muic_irq muic_irqs[] =;

/* Define supported cable type */
enum max8997_muic_acc_type {};

enum max8997_muic_cable_group {};

enum max8997_muic_usb_type {};

enum max8997_muic_charger_type {};

struct max8997_muic_info {};

static const unsigned int max8997_extcon_cable[] =;

/*
 * max8997_muic_set_debounce_time - Set the debounce time of ADC
 * @info: the instance including private data of max8997 MUIC
 * @time: the debounce time of ADC
 */
static int max8997_muic_set_debounce_time(struct max8997_muic_info *info,
		enum max8997_muic_adc_debounce_time time)
{
	int ret;

	switch (time) {
	case ADC_DEBOUNCE_TIME_0_5MS:
	case ADC_DEBOUNCE_TIME_10MS:
	case ADC_DEBOUNCE_TIME_25MS:
	case ADC_DEBOUNCE_TIME_38_62MS:
		ret = max8997_update_reg(info->muic,
					  MAX8997_MUIC_REG_CONTROL3,
					  time << CONTROL3_ADCDBSET_SHIFT,
					  CONTROL3_ADCDBSET_MASK);
		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;
};

/*
 * max8997_muic_set_path - Set hardware line according to attached cable
 * @info: the instance including private data of max8997 MUIC
 * @value: the path according to attached cable
 * @attached: the state of cable (true:attached, false:detached)
 *
 * The max8997 MUIC device share outside H/W line among a varity of cables,
 * so this function set internal path of H/W line according to the type of
 * attached cable.
 */
static int max8997_muic_set_path(struct max8997_muic_info *info,
		u8 val, bool attached)
{}

/*
 * max8997_muic_get_cable_type - Return cable type and check cable state
 * @info: the instance including private data of max8997 MUIC
 * @group: the path according to attached cable
 * @attached: store cable state and return
 *
 * This function check the cable state either attached or detached,
 * and then divide precise type of cable according to cable group.
 *	- MAX8997_CABLE_GROUP_ADC
 *	- MAX8997_CABLE_GROUP_CHG
 */
static int max8997_muic_get_cable_type(struct max8997_muic_info *info,
		enum max8997_muic_cable_group group, bool *attached)
{}

static int max8997_muic_handle_usb(struct max8997_muic_info *info,
			enum max8997_muic_usb_type usb_type, bool attached)
{}

static int max8997_muic_handle_dock(struct max8997_muic_info *info,
			int cable_type, bool attached)
{}

static int max8997_muic_handle_jig_uart(struct max8997_muic_info *info,
			bool attached)
{}

static int max8997_muic_adc_handler(struct max8997_muic_info *info)
{}

static int max8997_muic_chg_handler(struct max8997_muic_info *info)
{}

static void max8997_muic_irq_work(struct work_struct *work)
{}

static irqreturn_t max8997_muic_irq_handler(int irq, void *data)
{}

static int max8997_muic_detect_dev(struct max8997_muic_info *info)
{}

static void max8997_muic_detect_cable_wq(struct work_struct *work)
{}

static int max8997_muic_probe(struct platform_device *pdev)
{}

static struct platform_driver max8997_muic_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_ALIAS();