linux/drivers/power/supply/isp1704_charger.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * ISP1704 USB Charger Detection driver
 *
 * Copyright (C) 2010 Nokia Corporation
 * Copyright (C) 2012 - 2013 Pali Rohár <[email protected]>
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/device.h>
#include <linux/sysfs.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/delay.h>
#include <linux/of.h>

#include <linux/gpio/consumer.h>
#include <linux/usb/otg.h>
#include <linux/usb/ulpi.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>

/* Vendor specific Power Control register */
#define ISP1704_PWR_CTRL
#define ISP1704_PWR_CTRL_SWCTRL
#define ISP1704_PWR_CTRL_DET_COMP
#define ISP1704_PWR_CTRL_BVALID_RISE
#define ISP1704_PWR_CTRL_BVALID_FALL
#define ISP1704_PWR_CTRL_DP_WKPU_EN
#define ISP1704_PWR_CTRL_VDAT_DET
#define ISP1704_PWR_CTRL_DPVSRC_EN
#define ISP1704_PWR_CTRL_HWDETECT

#define NXP_VENDOR_ID

static u16 isp170x_id[] =;

struct isp1704_charger {};

static inline int isp1704_read(struct isp1704_charger *isp, u32 reg)
{}

static inline int isp1704_write(struct isp1704_charger *isp, u32 reg, u32 val)
{}

static void isp1704_charger_set_power(struct isp1704_charger *isp, bool on)
{}

/*
 * Determine is the charging port DCP (dedicated charger) or CDP (Host/HUB
 * chargers).
 *
 * REVISIT: The method is defined in Battery Charging Specification and is
 * applicable to any ULPI transceiver. Nothing isp170x specific here.
 */
static inline int isp1704_charger_type(struct isp1704_charger *isp)
{}

/*
 * ISP1704 detects PS/2 adapters as charger. To make sure the detected charger
 * is actually a dedicated charger, the following steps need to be taken.
 */
static inline int isp1704_charger_verify(struct isp1704_charger *isp)
{}

static inline int isp1704_charger_detect(struct isp1704_charger *isp)
{}

static inline int isp1704_charger_detect_dcp(struct isp1704_charger *isp)
{}

static void isp1704_charger_work(struct work_struct *data)
{}

static int isp1704_notifier_call(struct notifier_block *nb,
		unsigned long val, void *v)
{}

static int isp1704_charger_get_property(struct power_supply *psy,
				enum power_supply_property psp,
				union power_supply_propval *val)
{}

static enum power_supply_property power_props[] =;

static inline int isp1704_test_ulpi(struct isp1704_charger *isp)
{}

static int isp1704_charger_probe(struct platform_device *pdev)
{}

static void isp1704_charger_remove(struct platform_device *pdev)
{}

#ifdef CONFIG_OF
static const struct of_device_id omap_isp1704_of_match[] =;
MODULE_DEVICE_TABLE(of, omap_isp1704_of_match);
#endif

static struct platform_driver isp1704_charger_driver =;

module_platform_driver();

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