linux/include/linux/mfd/tps65217.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * linux/mfd/tps65217.h
 *
 * Functions to access TPS65217 power management chip.
 *
 * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/
 */

#ifndef __LINUX_MFD_TPS65217_H
#define __LINUX_MFD_TPS65217_H

#include <linux/i2c.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>

/* TPS chip id list */
#define TPS65217

/* I2C ID for TPS65217 part */
#define TPS65217_I2C_ID

/* All register addresses */
#define TPS65217_REG_CHIPID
#define TPS65217_REG_PPATH
#define TPS65217_REG_INT
#define TPS65217_REG_CHGCONFIG0
#define TPS65217_REG_CHGCONFIG1
#define TPS65217_REG_CHGCONFIG2
#define TPS65217_REG_CHGCONFIG3
#define TPS65217_REG_WLEDCTRL1
#define TPS65217_REG_WLEDCTRL2
#define TPS65217_REG_MUXCTRL
#define TPS65217_REG_STATUS
#define TPS65217_REG_PASSWORD
#define TPS65217_REG_PGOOD
#define TPS65217_REG_DEFPG
#define TPS65217_REG_DEFDCDC1
#define TPS65217_REG_DEFDCDC2
#define TPS65217_REG_DEFDCDC3
#define TPS65217_REG_DEFSLEW
#define TPS65217_REG_DEFLDO1
#define TPS65217_REG_DEFLDO2
#define TPS65217_REG_DEFLS1
#define TPS65217_REG_DEFLS2
#define TPS65217_REG_ENABLE
#define TPS65217_REG_DEFUVLO
#define TPS65217_REG_SEQ1
#define TPS65217_REG_SEQ2
#define TPS65217_REG_SEQ3
#define TPS65217_REG_SEQ4
#define TPS65217_REG_SEQ5
#define TPS65217_REG_SEQ6

#define TPS65217_REG_MAX

/* Register field definitions */
#define TPS65217_CHIPID_CHIP_MASK
#define TPS65217_CHIPID_REV_MASK

#define TPS65217_PPATH_ACSINK_ENABLE
#define TPS65217_PPATH_USBSINK_ENABLE
#define TPS65217_PPATH_AC_PW_ENABLE
#define TPS65217_PPATH_USB_PW_ENABLE
#define TPS65217_PPATH_AC_CURRENT_MASK
#define TPS65217_PPATH_USB_CURRENT_MASK

#define TPS65217_INT_PBM
#define TPS65217_INT_ACM
#define TPS65217_INT_USBM
#define TPS65217_INT_PBI
#define TPS65217_INT_ACI
#define TPS65217_INT_USBI
#define TPS65217_INT_SHIFT
#define TPS65217_INT_MASK

#define TPS65217_CHGCONFIG0_TREG
#define TPS65217_CHGCONFIG0_DPPM
#define TPS65217_CHGCONFIG0_TSUSP
#define TPS65217_CHGCONFIG0_TERMI
#define TPS65217_CHGCONFIG0_ACTIVE
#define TPS65217_CHGCONFIG0_CHGTOUT
#define TPS65217_CHGCONFIG0_PCHGTOUT
#define TPS65217_CHGCONFIG0_BATTEMP

#define TPS65217_CHGCONFIG1_TMR_MASK
#define TPS65217_CHGCONFIG1_TMR_ENABLE
#define TPS65217_CHGCONFIG1_NTC_TYPE
#define TPS65217_CHGCONFIG1_RESET
#define TPS65217_CHGCONFIG1_TERM
#define TPS65217_CHGCONFIG1_SUSP
#define TPS65217_CHGCONFIG1_CHG_EN

#define TPS65217_CHGCONFIG2_DYNTMR
#define TPS65217_CHGCONFIG2_VPREGHG
#define TPS65217_CHGCONFIG2_VOREG_MASK

#define TPS65217_CHGCONFIG3_ICHRG_MASK
#define TPS65217_CHGCONFIG3_DPPMTH_MASK
#define TPS65217_CHGCONFIG2_PCHRGT
#define TPS65217_CHGCONFIG2_TERMIF
#define TPS65217_CHGCONFIG2_TRANGE

#define TPS65217_WLEDCTRL1_ISINK_ENABLE
#define TPS65217_WLEDCTRL1_ISEL
#define TPS65217_WLEDCTRL1_FDIM_MASK

#define TPS65217_WLEDCTRL2_DUTY_MASK

#define TPS65217_MUXCTRL_MUX_MASK

#define TPS65217_STATUS_OFF
#define TPS65217_STATUS_ACPWR
#define TPS65217_STATUS_USBPWR
#define TPS65217_STATUS_PB

#define TPS65217_PASSWORD_REGS_UNLOCK

#define TPS65217_PGOOD_LDO3_PG
#define TPS65217_PGOOD_LDO4_PG
#define TPS65217_PGOOD_DC1_PG
#define TPS65217_PGOOD_DC2_PG
#define TPS65217_PGOOD_DC3_PG
#define TPS65217_PGOOD_LDO1_PG
#define TPS65217_PGOOD_LDO2_PG

#define TPS65217_DEFPG_LDO1PGM
#define TPS65217_DEFPG_LDO2PGM
#define TPS65217_DEFPG_PGDLY_MASK

#define TPS65217_DEFDCDCX_XADJX
#define TPS65217_DEFDCDCX_DCDC_MASK

#define TPS65217_DEFSLEW_GO
#define TPS65217_DEFSLEW_GODSBL
#define TPS65217_DEFSLEW_PFM_EN1
#define TPS65217_DEFSLEW_PFM_EN2
#define TPS65217_DEFSLEW_PFM_EN3
#define TPS65217_DEFSLEW_SLEW_MASK

#define TPS65217_DEFLDO1_LDO1_MASK

#define TPS65217_DEFLDO2_TRACK
#define TPS65217_DEFLDO2_LDO2_MASK

#define TPS65217_DEFLDO3_LDO3_EN
#define TPS65217_DEFLDO3_LDO3_MASK

#define TPS65217_DEFLDO4_LDO4_EN
#define TPS65217_DEFLDO4_LDO4_MASK

#define TPS65217_ENABLE_LS1_EN
#define TPS65217_ENABLE_LS2_EN
#define TPS65217_ENABLE_DC1_EN
#define TPS65217_ENABLE_DC2_EN
#define TPS65217_ENABLE_DC3_EN
#define TPS65217_ENABLE_LDO1_EN
#define TPS65217_ENABLE_LDO2_EN

#define TPS65217_DEFUVLO_UVLOHYS
#define TPS65217_DEFUVLO_UVLO_MASK

#define TPS65217_SEQ1_DC1_SEQ_MASK
#define TPS65217_SEQ1_DC2_SEQ_MASK

#define TPS65217_SEQ2_DC3_SEQ_MASK
#define TPS65217_SEQ2_LDO1_SEQ_MASK

#define TPS65217_SEQ3_LDO2_SEQ_MASK
#define TPS65217_SEQ3_LDO3_SEQ_MASK

#define TPS65217_SEQ4_LDO4_SEQ_MASK

#define TPS65217_SEQ5_DLY1_MASK
#define TPS65217_SEQ5_DLY2_MASK
#define TPS65217_SEQ5_DLY3_MASK
#define TPS65217_SEQ5_DLY4_MASK

#define TPS65217_SEQ6_DLY5_MASK
#define TPS65217_SEQ6_DLY6_MASK
#define TPS65217_SEQ6_SEQUP
#define TPS65217_SEQ6_SEQDWN
#define TPS65217_SEQ6_INSTDWN

#define TPS65217_MAX_REGISTER
#define TPS65217_PROTECT_NONE
#define TPS65217_PROTECT_L1
#define TPS65217_PROTECT_L2


enum tps65217_regulator_id {};

#define TPS65217_MAX_REG_ID

/* Number of step-down converters available */
#define TPS65217_NUM_DCDC
/* Number of LDO voltage regulators available */
#define TPS65217_NUM_LDO
/* Number of total regulators available */
#define TPS65217_NUM_REGULATOR

enum tps65217_bl_isel {};

enum tps65217_bl_fdim {};

struct tps65217_bl_pdata {};

/* Interrupt numbers */
#define TPS65217_IRQ_USB
#define TPS65217_IRQ_AC
#define TPS65217_IRQ_PB
#define TPS65217_NUM_IRQ

/**
 * struct tps65217_board - packages regulator init data
 * @tps65217_regulator_data: regulator initialization values
 *
 * Board data may be used to initialize regulator.
 */
struct tps65217_board {};

/**
 * struct tps65217 - tps65217 sub-driver chip access routines
 *
 * Device data may be used to access the TPS65217 chip
 */

struct tps65217 {};

static inline struct tps65217 *dev_to_tps65217(struct device *dev)
{}

int tps65217_reg_read(struct tps65217 *tps, unsigned int reg,
					unsigned int *val);
int tps65217_reg_write(struct tps65217 *tps, unsigned int reg,
			unsigned int val, unsigned int level);
int tps65217_set_bits(struct tps65217 *tps, unsigned int reg,
		unsigned int mask, unsigned int val, unsigned int level);
int tps65217_clear_bits(struct tps65217 *tps, unsigned int reg,
		unsigned int mask, unsigned int level);

#endif /*  __LINUX_MFD_TPS65217_H */