linux/drivers/extcon/extcon-rt8973a.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * extcon-rt8973a.c - Richtek RT8973A extcon driver to support USB switches
 *
 * Copyright (c) 2014 Samsung Electronics Co., Ltd
 * Author: Chanwoo Choi <[email protected]>
 */

#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/irqdomain.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/extcon-provider.h>

#include "extcon-rt8973a.h"

#define DELAY_MS_DEFAULT

struct muic_irq {};

struct reg_data {};

struct rt8973a_muic_info {};

/* Default value of RT8973A register to bring up MUIC device. */
static struct reg_data rt8973a_reg_data[] =;

/* List of detectable cables */
static const unsigned int rt8973a_extcon_cable[] =;

/* Define OVP (Over Voltage Protection), OTP (Over Temperature Protection) */
enum rt8973a_event_type {};

/* Define supported accessory type */
enum rt8973a_muic_acc_type {};

/* List of supported interrupt for RT8973A */
static struct muic_irq rt8973a_muic_irqs[] =;

/* Define interrupt list of RT8973A to register regmap_irq */
static const struct regmap_irq rt8973a_irqs[] =;

static const struct regmap_irq_chip rt8973a_muic_irq_chip =;

/* Define regmap configuration of RT8973A for I2C communication  */
static bool rt8973a_muic_volatile_reg(struct device *dev, unsigned int reg)
{}

static const struct regmap_config rt8973a_muic_regmap_config =;

/* Change DM_CON/DP_CON/VBUSIN switch according to cable type */
static int rt8973a_muic_set_path(struct rt8973a_muic_info *info,
				unsigned int con_sw, bool attached)
{}

static int rt8973a_muic_get_cable_type(struct rt8973a_muic_info *info)
{}

static int rt8973a_muic_cable_handler(struct rt8973a_muic_info *info,
					enum rt8973a_event_type event)
{}

static void rt8973a_muic_irq_work(struct work_struct *work)
{}

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

static void rt8973a_muic_detect_cable_wq(struct work_struct *work)
{}

static void rt8973a_init_dev_type(struct rt8973a_muic_info *info)
{}

static int rt8973a_muic_i2c_probe(struct i2c_client *i2c)
{}

static void rt8973a_muic_i2c_remove(struct i2c_client *i2c)
{}

static const struct of_device_id rt8973a_dt_match[] =;
MODULE_DEVICE_TABLE(of, rt8973a_dt_match);

#ifdef CONFIG_PM_SLEEP
static int rt8973a_muic_suspend(struct device *dev)
{}

static int rt8973a_muic_resume(struct device *dev)
{}
#endif

static SIMPLE_DEV_PM_OPS(rt8973a_muic_pm_ops,
			 rt8973a_muic_suspend, rt8973a_muic_resume);

static const struct i2c_device_id rt8973a_i2c_id[] =;
MODULE_DEVICE_TABLE(i2c, rt8973a_i2c_id);

static struct i2c_driver rt8973a_muic_i2c_driver =;

static int __init rt8973a_muic_i2c_init(void)
{}
subsys_initcall(rt8973a_muic_i2c_init);

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