linux/drivers/mfd/max77620.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Maxim MAX77620 MFD Driver
 *
 * Copyright (C) 2016 NVIDIA CORPORATION. All rights reserved.
 *
 * Author:
 *	Laxman Dewangan <[email protected]>
 *	Chaitanya Bandi <[email protected]>
 *	Mallikarjun Kasoju <[email protected]>
 */

/****************** Teminology used in driver ********************
 * Here are some terminology used from datasheet for quick reference:
 * Flexible Power Sequence (FPS):
 * The Flexible Power Sequencer (FPS) allows each regulator to power up under
 * hardware or software control. Additionally, each regulator can power on
 * independently or among a group of other regulators with an adjustable
 * power-up and power-down delays (sequencing). GPIO1, GPIO2, and GPIO3 can
 * be programmed to be part of a sequence allowing external regulators to be
 * sequenced along with internal regulators. 32KHz clock can be programmed to
 * be part of a sequence.
 * There is 3 FPS confguration registers and all resources are configured to
 * any of these FPS or no FPS.
 */

#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/mfd/core.h>
#include <linux/mfd/max77620.h>
#include <linux/init.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/slab.h>

static struct max77620_chip *max77620_scratch;

static const struct resource gpio_resources[] =;

static const struct resource power_resources[] =;

static const struct resource rtc_resources[] =;

static const struct resource thermal_resources[] =;

static const struct regmap_irq max77620_top_irqs[] =;

static const struct mfd_cell max77620_children[] =;

static const struct mfd_cell max20024_children[] =;

static const struct mfd_cell max77663_children[] =;

static const struct regmap_range max77620_readable_ranges[] =;

static const struct regmap_access_table max77620_readable_table =;

static const struct regmap_range max20024_readable_ranges[] =;

static const struct regmap_access_table max20024_readable_table =;

static const struct regmap_range max77620_writable_ranges[] =;

static const struct regmap_access_table max77620_writable_table =;

static const struct regmap_range max77620_cacheable_ranges[] =;

static const struct regmap_access_table max77620_volatile_table =;

static const struct regmap_config max77620_regmap_config =;

static const struct regmap_config max20024_regmap_config =;

static const struct regmap_range max77663_readable_ranges[] =;

static const struct regmap_access_table max77663_readable_table =;

static const struct regmap_range max77663_writable_ranges[] =;

static const struct regmap_access_table max77663_writable_table =;

static const struct regmap_config max77663_regmap_config =;

/*
 * MAX77620 and MAX20024 has the following steps of the interrupt handling
 * for TOP interrupts:
 * 1. When interrupt occurs from PMIC, mask the PMIC interrupt by setting GLBLM.
 * 2. Read IRQTOP and service the interrupt.
 * 3. Once all interrupts has been checked and serviced, the interrupt service
 *    routine un-masks the hardware interrupt line by clearing GLBLM.
 */
static int max77620_irq_global_mask(void *irq_drv_data)
{}

static int max77620_irq_global_unmask(void *irq_drv_data)
{}

static struct regmap_irq_chip max77620_top_irq_chip =;

/* max77620_get_fps_period_reg_value:  Get FPS bit field value from
 *				       requested periods.
 * MAX77620 supports the FPS period of 40, 80, 160, 320, 540, 1280, 2560
 * and 5120 microseconds. MAX20024 supports the FPS period of 20, 40, 80,
 * 160, 320, 540, 1280 and 2560 microseconds.
 * The FPS register has 3 bits field to set the FPS period as
 * bits		max77620		max20024
 * 000		40			20
 * 001		80			40
 * :::
*/
static int max77620_get_fps_period_reg_value(struct max77620_chip *chip,
					     int tperiod)
{}

/* max77620_config_fps: Configure FPS configuration registers
 *			based on platform specific information.
 */
static int max77620_config_fps(struct max77620_chip *chip,
			       struct device_node *fps_np)
{}

static int max77620_initialise_fps(struct max77620_chip *chip)
{}

static int max77620_read_es_version(struct max77620_chip *chip)
{}

static void max77620_pm_power_off(void)
{}

static int max77620_probe(struct i2c_client *client)
{}

static int max77620_set_fps_period(struct max77620_chip *chip,
				   int fps_id, int time_period)
{}

static int max77620_i2c_suspend(struct device *dev)
{}

static int max77620_i2c_resume(struct device *dev)
{}

static const struct i2c_device_id max77620_id[] =;

static DEFINE_SIMPLE_DEV_PM_OPS(max77620_pm_ops,
				max77620_i2c_suspend, max77620_i2c_resume);

static struct i2c_driver max77620_driver =;
builtin_i2c_driver();