#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/power_supply.h>
#include <linux/notifier.h>
#include <linux/usb/phy.h>
#include <linux/iio/consumer.h>
#include <linux/mfd/da9150/core.h>
#include <linux/mfd/da9150/registers.h>
struct da9150_charger { … };
static inline int da9150_charger_supply_online(struct da9150_charger *charger,
struct power_supply *psy,
union power_supply_propval *val)
{ … }
static int da9150_charger_vbus_voltage_now(struct da9150_charger *charger,
union power_supply_propval *val)
{ … }
static int da9150_charger_ibus_current_avg(struct da9150_charger *charger,
union power_supply_propval *val)
{ … }
static int da9150_charger_tjunc_temp(struct da9150_charger *charger,
union power_supply_propval *val)
{ … }
static enum power_supply_property da9150_charger_props[] = …;
static int da9150_charger_get_prop(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static int da9150_charger_battery_status(struct da9150_charger *charger,
union power_supply_propval *val)
{ … }
static int da9150_charger_battery_health(struct da9150_charger *charger,
union power_supply_propval *val)
{ … }
static int da9150_charger_battery_present(struct da9150_charger *charger,
union power_supply_propval *val)
{ … }
static int da9150_charger_battery_charge_type(struct da9150_charger *charger,
union power_supply_propval *val)
{ … }
static int da9150_charger_battery_voltage_min(struct da9150_charger *charger,
union power_supply_propval *val)
{ … }
static int da9150_charger_battery_voltage_now(struct da9150_charger *charger,
union power_supply_propval *val)
{ … }
static int da9150_charger_battery_current_max(struct da9150_charger *charger,
union power_supply_propval *val)
{ … }
static int da9150_charger_battery_voltage_max(struct da9150_charger *charger,
union power_supply_propval *val)
{ … }
static enum power_supply_property da9150_charger_bat_props[] = …;
static int da9150_charger_battery_get_prop(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static irqreturn_t da9150_charger_chg_irq(int irq, void *data)
{ … }
static irqreturn_t da9150_charger_tjunc_irq(int irq, void *data)
{ … }
static irqreturn_t da9150_charger_vfault_irq(int irq, void *data)
{ … }
static irqreturn_t da9150_charger_vbus_irq(int irq, void *data)
{ … }
static void da9150_charger_otg_work(struct work_struct *data)
{ … }
static int da9150_charger_otg_ncb(struct notifier_block *nb, unsigned long val,
void *priv)
{ … }
static int da9150_charger_register_irq(struct platform_device *pdev,
irq_handler_t handler,
const char *irq_name)
{ … }
static void da9150_charger_unregister_irq(struct platform_device *pdev,
const char *irq_name)
{ … }
static const struct power_supply_desc usb_desc = …;
static const struct power_supply_desc battery_desc = …;
static int da9150_charger_probe(struct platform_device *pdev)
{ … }
static void da9150_charger_remove(struct platform_device *pdev)
{ … }
static struct platform_driver da9150_charger_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;