linux/drivers/extcon/extcon-ptn5150.c

// SPDX-License-Identifier: GPL-2.0+
//
// extcon-ptn5150.c - PTN5150 CC logic extcon driver to support USB detection
//
// Based on extcon-sm5502.c driver
// Copyright (c) 2018-2019 by Vijai Kumar K
// Author: Vijai Kumar K <[email protected]>
// Copyright (c) 2020 Krzysztof Kozlowski <[email protected]>

#include <linux/bitfield.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/extcon-provider.h>
#include <linux/gpio/consumer.h>
#include <linux/usb/role.h>

/* PTN5150 registers */
#define PTN5150_REG_DEVICE_ID
#define PTN5150_REG_CONTROL
#define PTN5150_REG_INT_STATUS
#define PTN5150_REG_CC_STATUS
#define PTN5150_REG_CON_DET
#define PTN5150_REG_VCONN_STATUS
#define PTN5150_REG_RESET
#define PTN5150_REG_INT_MASK
#define PTN5150_REG_INT_REG_STATUS
#define PTN5150_REG_END

#define PTN5150_DFP_ATTACHED
#define PTN5150_UFP_ATTACHED

/* Define PTN5150 MASK/SHIFT constant */
#define PTN5150_REG_DEVICE_ID_VERSION
#define PTN5150_REG_DEVICE_ID_VENDOR

#define PTN5150_REG_CC_PORT_ATTACHMENT
#define PTN5150_REG_CC_VBUS_DETECTION
#define PTN5150_REG_INT_CABLE_ATTACH_MASK
#define PTN5150_REG_INT_CABLE_DETACH_MASK

struct ptn5150_info {};

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

static const struct regmap_config ptn5150_regmap_config =;

static void ptn5150_check_state(struct ptn5150_info *info)
{}

static void ptn5150_irq_work(struct work_struct *work)
{}


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

static int ptn5150_init_dev_type(struct ptn5150_info *info)
{}

static void ptn5150_work_sync_and_put(void *data)
{}

static int ptn5150_i2c_probe(struct i2c_client *i2c)
{}

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

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

static struct i2c_driver ptn5150_i2c_driver =;
module_i2c_driver();

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