linux/drivers/mfd/max14577.c

// SPDX-License-Identifier: GPL-2.0+
//
// max14577.c - mfd core driver for the Maxim 14577/77836
//
// Copyright (C) 2014 Samsung Electronics
// Chanwoo Choi <[email protected]>
// Krzysztof Kozlowski <[email protected]>
//
// This driver is based on max8997.c

#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/mfd/core.h>
#include <linux/mfd/max14577.h>
#include <linux/mfd/max14577-private.h>

/*
 * Table of valid charger currents for different Maxim chipsets.
 * It is placed here because it is used by both charger and regulator driver.
 */
const struct maxim_charger_current maxim_charger_currents[] =;
EXPORT_SYMBOL_GPL();

/*
 * maxim_charger_calc_reg_current - Calculate register value for current
 * @limits:	constraints for charger, matching the MBCICHWRC register
 * @min_ua:	minimal requested current, micro Amps
 * @max_ua:	maximum requested current, micro Amps
 * @dst:	destination to store calculated register value
 *
 * Calculates the value of MBCICHWRC (Fast Battery Charge Current) register
 * for given current and stores it under pointed 'dst'. The stored value
 * combines low bit (MBCICHWRCL) and high bits (MBCICHWRCH). It is also
 * properly shifted.
 *
 * The calculated register value matches the current which:
 *  - is always between <limits.min, limits.max>;
 *  - is always less or equal to max_ua;
 *  - is the highest possible value;
 *  - may be lower than min_ua.
 *
 * On success returns 0. On error returns -EINVAL (requested min/max current
 * is outside of given charger limits) and 'dst' is not set.
 */
int maxim_charger_calc_reg_current(const struct maxim_charger_current *limits,
		unsigned int min_ua, unsigned int max_ua, u8 *dst)
{}
EXPORT_SYMBOL_GPL();

static const struct mfd_cell max14577_devs[] =;

static const struct mfd_cell max77836_devs[] =;

static const struct of_device_id max14577_dt_match[] =;

static bool max14577_muic_volatile_reg(struct device *dev, unsigned int reg)
{}

static bool max77836_muic_volatile_reg(struct device *dev, unsigned int reg)
{}

static const struct regmap_config max14577_muic_regmap_config =;

static const struct regmap_config max77836_pmic_regmap_config =;

static const struct regmap_irq max14577_irqs[] =;

static const struct regmap_irq_chip max14577_irq_chip =;

static const struct regmap_irq max77836_muic_irqs[] =;

static const struct regmap_irq_chip max77836_muic_irq_chip =;

static const struct regmap_irq max77836_pmic_irqs[] =;

static const struct regmap_irq_chip max77836_pmic_irq_chip =;

static void max14577_print_dev_type(struct max14577 *max14577)
{}

/*
 * Max77836 specific initialization code for driver probe.
 * Adds new I2C dummy device, regmap and regmap IRQ chip.
 * Unmasks Interrupt Source register.
 *
 * On success returns 0.
 * On failure returns errno and reverts any changes done so far (e.g. remove
 * I2C dummy device), except masking the INT SRC register.
 */
static int max77836_init(struct max14577 *max14577)
{}

/*
 * Max77836 specific de-initialization code for driver remove.
 */
static void max77836_remove(struct max14577 *max14577)
{}

static int max14577_i2c_probe(struct i2c_client *i2c)
{}

static void max14577_i2c_remove(struct i2c_client *i2c)
{}

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

static int max14577_suspend(struct device *dev)
{}

static int max14577_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(max14577_pm, max14577_suspend, max14577_resume);

static struct i2c_driver max14577_i2c_driver =;

static int __init max14577_i2c_init(void)
{}
module_init();

static void __exit max14577_i2c_exit(void)
{}
module_exit(max14577_i2c_exit);

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