linux/drivers/extcon/extcon-sm5502.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * extcon-sm5502.c - Silicon Mitus SM5502 extcon drvier 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/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-sm5502.h"

#define DELAY_MS_DEFAULT

struct muic_irq {};

struct reg_data {};

struct sm5502_muic_info {};

struct sm5502_type {};

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

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

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

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

/* List of supported interrupt for SM5502 */
static struct muic_irq sm5502_muic_irqs[] =;

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

static const struct regmap_irq_chip sm5502_muic_irq_chip =;

/* List of supported interrupt for SM5504 */
static struct muic_irq sm5504_muic_irqs[] =;

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

static const struct regmap_irq_chip sm5504_muic_irq_chip =;

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

static const struct regmap_config sm5502_muic_regmap_config =;

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

/* Return cable type of attached or detached accessories */
static unsigned int sm5502_muic_get_cable_type(struct sm5502_muic_info *info)
{}

static int sm5502_muic_cable_handler(struct sm5502_muic_info *info,
				     bool attached)
{}

static void sm5502_muic_irq_work(struct work_struct *work)
{}

/*
 * Sets irq_attach or irq_detach in sm5502_muic_info and returns 0.
 * Returns -ESRCH if irq_type does not match registered IRQ for this dev type.
 */
static int sm5502_parse_irq(struct sm5502_muic_info *info, int irq_type)
{}

static int sm5504_parse_irq(struct sm5502_muic_info *info, int irq_type)
{}

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

static void sm5502_muic_detect_cable_wq(struct work_struct *work)
{}

static void sm5502_init_dev_type(struct sm5502_muic_info *info)
{}

static int sm5022_muic_i2c_probe(struct i2c_client *i2c)
{}

static const struct sm5502_type sm5502_data =;

static const struct sm5502_type sm5504_data =;

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

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

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

static SIMPLE_DEV_PM_OPS(sm5502_muic_pm_ops,
			 sm5502_muic_suspend, sm5502_muic_resume);

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

static struct i2c_driver sm5502_muic_i2c_driver =;

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

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