linux/drivers/power/supply/max14577_charger.c

// SPDX-License-Identifier: GPL-2.0+
//
// max14577_charger.c - Battery charger driver for the Maxim 14577/77836
//
// Copyright (C) 2013,2014 Samsung Electronics
// Krzysztof Kozlowski <[email protected]>

#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/mfd/max14577-private.h>
#include <linux/mfd/max14577.h>

struct max14577_charger {};

/*
 * Helper function for mapping values of STATUS2/CHGTYP register on max14577
 * and max77836 chipsets to enum maxim_muic_charger_type.
 */
static enum max14577_muic_charger_type maxim_get_charger_type(
		enum maxim_device_type dev_type, u8 val) {}

static int max14577_get_charger_state(struct max14577_charger *chg, int *val)
{}

/*
 * Supported charge types:
 *  - POWER_SUPPLY_CHARGE_TYPE_NONE
 *  - POWER_SUPPLY_CHARGE_TYPE_FAST
 */
static int max14577_get_charge_type(struct max14577_charger *chg, int *val)
{}

static int max14577_get_online(struct max14577_charger *chg, int *val)
{}

/*
 * Supported health statuses:
 *  - POWER_SUPPLY_HEALTH_DEAD
 *  - POWER_SUPPLY_HEALTH_OVERVOLTAGE
 *  - POWER_SUPPLY_HEALTH_GOOD
 */
static int max14577_get_battery_health(struct max14577_charger *chg, int *val)
{}

/*
 * Always returns 1.
 * The max14577 chip doesn't report any status of battery presence.
 * Lets assume that it will always be used with some battery.
 */
static int max14577_get_present(struct max14577_charger *chg, int *val)
{}

static int max14577_set_fast_charge_timer(struct max14577_charger *chg,
		unsigned long hours)
{}

static int max14577_init_constant_voltage(struct max14577_charger *chg,
		unsigned int uvolt)
{}

static int max14577_init_eoc(struct max14577_charger *chg,
		unsigned int uamp)
{}

static int max14577_init_fast_charge(struct max14577_charger *chg,
		unsigned int uamp)
{}

/*
 * Sets charger registers to proper and safe default values.
 * Some of these values are equal to defaults in MAX14577E
 * data sheet but there are minor differences.
 */
static int max14577_charger_reg_init(struct max14577_charger *chg)
{}

/* Support property from charger */
static enum power_supply_property max14577_charger_props[] =;

static const char * const model_names[] =;
static const char *manufacturer =;

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

static const struct power_supply_desc max14577_charger_desc =;

#ifdef CONFIG_OF
static struct max14577_charger_platform_data *max14577_charger_dt_init(
		struct platform_device *pdev)
{}
#else /* CONFIG_OF */
static struct max14577_charger_platform_data *max14577_charger_dt_init(
		struct platform_device *pdev)
{
	return NULL;
}
#endif /* CONFIG_OF */

static ssize_t show_fast_charge_timer(struct device *dev,
		struct device_attribute *attr, char *buf)
{}

static ssize_t store_fast_charge_timer(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t count)
{}

static DEVICE_ATTR(fast_charge_timer, S_IRUGO | S_IWUSR,
		show_fast_charge_timer, store_fast_charge_timer);

static int max14577_charger_probe(struct platform_device *pdev)
{}

static void max14577_charger_remove(struct platform_device *pdev)
{}

static const struct platform_device_id max14577_charger_id[] =;
MODULE_DEVICE_TABLE(platform, max14577_charger_id);

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

static struct platform_driver max14577_charger_driver =;
module_platform_driver();

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