linux/include/linux/mfd/max77620.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Defining registers address and its bit definitions of MAX77620 and MAX20024
 *
 * Copyright (C) 2016 NVIDIA CORPORATION. All rights reserved.
 */

#ifndef _MFD_MAX77620_H_
#define _MFD_MAX77620_H_

#include <linux/types.h>

/* GLOBAL, PMIC, GPIO, FPS, ONOFFC, CID Registers */
#define MAX77620_REG_CNFGGLBL1
#define MAX77620_REG_CNFGGLBL2
#define MAX77620_REG_CNFGGLBL3
#define MAX77620_REG_CNFG1_32K
#define MAX77620_REG_CNFGBBC
#define MAX77620_REG_IRQTOP
#define MAX77620_REG_INTLBT
#define MAX77620_REG_IRQSD
#define MAX77620_REG_IRQ_LVL2_L0_7
#define MAX77620_REG_IRQ_LVL2_L8
#define MAX77620_REG_IRQ_LVL2_GPIO
#define MAX77620_REG_ONOFFIRQ
#define MAX77620_REG_NVERC
#define MAX77620_REG_IRQTOPM
#define MAX77620_REG_INTENLBT
#define MAX77620_REG_IRQMASKSD
#define MAX77620_REG_IRQ_MSK_L0_7
#define MAX77620_REG_IRQ_MSK_L8
#define MAX77620_REG_ONOFFIRQM
#define MAX77620_REG_STATLBT
#define MAX77620_REG_STATSD
#define MAX77620_REG_ONOFFSTAT

/* SD and LDO Registers */
#define MAX77620_REG_SD0
#define MAX77620_REG_SD1
#define MAX77620_REG_SD2
#define MAX77620_REG_SD3
#define MAX77620_REG_SD4
#define MAX77620_REG_DVSSD0
#define MAX77620_REG_DVSSD1
#define MAX77620_REG_SD0_CFG
#define MAX77620_REG_SD1_CFG
#define MAX77620_REG_SD2_CFG
#define MAX77620_REG_SD3_CFG
#define MAX77620_REG_SD4_CFG
#define MAX77620_REG_SD_CFG2
#define MAX77620_REG_LDO0_CFG
#define MAX77620_REG_LDO0_CFG2
#define MAX77620_REG_LDO1_CFG
#define MAX77620_REG_LDO1_CFG2
#define MAX77620_REG_LDO2_CFG
#define MAX77620_REG_LDO2_CFG2
#define MAX77620_REG_LDO3_CFG
#define MAX77620_REG_LDO3_CFG2
#define MAX77620_REG_LDO4_CFG
#define MAX77620_REG_LDO4_CFG2
#define MAX77620_REG_LDO5_CFG
#define MAX77620_REG_LDO5_CFG2
#define MAX77620_REG_LDO6_CFG
#define MAX77620_REG_LDO6_CFG2
#define MAX77620_REG_LDO7_CFG
#define MAX77620_REG_LDO7_CFG2
#define MAX77620_REG_LDO8_CFG
#define MAX77620_REG_LDO8_CFG2
#define MAX77620_REG_LDO_CFG3

#define MAX77620_LDO_SLEW_RATE_MASK

/* LDO Configuration 3 */
#define MAX77620_TRACK4_MASK
#define MAX77620_TRACK4_SHIFT

/* Voltage */
#define MAX77620_SDX_VOLT_MASK
#define MAX77620_SD0_VOLT_MASK
#define MAX77620_SD1_VOLT_MASK
#define MAX77620_LDO_VOLT_MASK

#define MAX77620_REG_GPIO0
#define MAX77620_REG_GPIO1
#define MAX77620_REG_GPIO2
#define MAX77620_REG_GPIO3
#define MAX77620_REG_GPIO4
#define MAX77620_REG_GPIO5
#define MAX77620_REG_GPIO6
#define MAX77620_REG_GPIO7
#define MAX77620_REG_PUE_GPIO
#define MAX77620_REG_PDE_GPIO
#define MAX77620_REG_AME_GPIO
#define MAX77620_REG_ONOFFCNFG1
#define MAX77620_REG_ONOFFCNFG2

/* FPS Registers */
#define MAX77620_REG_FPS_CFG0
#define MAX77620_REG_FPS_CFG1
#define MAX77620_REG_FPS_CFG2
#define MAX77620_REG_FPS_LDO0
#define MAX77620_REG_FPS_LDO1
#define MAX77620_REG_FPS_LDO2
#define MAX77620_REG_FPS_LDO3
#define MAX77620_REG_FPS_LDO4
#define MAX77620_REG_FPS_LDO5
#define MAX77620_REG_FPS_LDO6
#define MAX77620_REG_FPS_LDO7
#define MAX77620_REG_FPS_LDO8
#define MAX77620_REG_FPS_SD0
#define MAX77620_REG_FPS_SD1
#define MAX77620_REG_FPS_SD2
#define MAX77620_REG_FPS_SD3
#define MAX77620_REG_FPS_SD4
#define MAX77620_REG_FPS_NONE

#define MAX77620_FPS_SRC_MASK
#define MAX77620_FPS_SRC_SHIFT
#define MAX77620_FPS_PU_PERIOD_MASK
#define MAX77620_FPS_PU_PERIOD_SHIFT
#define MAX77620_FPS_PD_PERIOD_MASK
#define MAX77620_FPS_PD_PERIOD_SHIFT
#define MAX77620_FPS_TIME_PERIOD_MASK
#define MAX77620_FPS_TIME_PERIOD_SHIFT
#define MAX77620_FPS_EN_SRC_MASK
#define MAX77620_FPS_EN_SRC_SHIFT
#define MAX77620_FPS_ENFPS_SW_MASK
#define MAX77620_FPS_ENFPS_SW

/* Minimum and maximum FPS period time (in microseconds) are
 * different for MAX77620 and Max20024.
 */
#define MAX77620_FPS_PERIOD_MIN_US
#define MAX20024_FPS_PERIOD_MIN_US

#define MAX20024_FPS_PERIOD_MAX_US
#define MAX77620_FPS_PERIOD_MAX_US

#define MAX77620_REG_FPS_GPIO1
#define MAX77620_REG_FPS_GPIO2
#define MAX77620_REG_FPS_GPIO3
#define MAX77620_REG_FPS_RSO
#define MAX77620_REG_CID0
#define MAX77620_REG_CID1
#define MAX77620_REG_CID2
#define MAX77620_REG_CID3
#define MAX77620_REG_CID4
#define MAX77620_REG_CID5

#define MAX77620_REG_DVSSD4
#define MAX20024_REG_MAX_ADD

#define MAX77620_CID_DIDM_MASK
#define MAX77620_CID_DIDM_SHIFT

/* CNCG2SD */
#define MAX77620_SD_CNF2_ROVS_EN_SD1
#define MAX77620_SD_CNF2_ROVS_EN_SD0

/* Device Identification Metal */
#define MAX77620_CID5_DIDM(n)
/* Device Indentification OTP */
#define MAX77620_CID5_DIDO(n)

/* SD CNFG1 */
#define MAX77620_SD_SR_MASK
#define MAX77620_SD_SR_SHIFT
#define MAX77620_SD_POWER_MODE_MASK
#define MAX77620_SD_POWER_MODE_SHIFT
#define MAX77620_SD_CFG1_ADE_MASK
#define MAX77620_SD_CFG1_ADE_DISABLE
#define MAX77620_SD_CFG1_ADE_ENABLE
#define MAX77620_SD_FPWM_MASK
#define MAX77620_SD_FPWM_SHIFT
#define MAX77620_SD_FSRADE_MASK
#define MAX77620_SD_FSRADE_SHIFT
#define MAX77620_SD_CFG1_FPWM_SD_MASK
#define MAX77620_SD_CFG1_FPWM_SD_SKIP
#define MAX77620_SD_CFG1_FPWM_SD_FPWM
#define MAX20024_SD_CFG1_MPOK_MASK
#define MAX77620_SD_CFG1_FSRADE_SD_MASK
#define MAX77620_SD_CFG1_FSRADE_SD_DISABLE
#define MAX77620_SD_CFG1_FSRADE_SD_ENABLE

/* LDO_CNFG2 */
#define MAX77620_LDO_POWER_MODE_MASK
#define MAX77620_LDO_POWER_MODE_SHIFT
#define MAX20024_LDO_CFG2_MPOK_MASK
#define MAX77620_LDO_CFG2_ADE_MASK
#define MAX77620_LDO_CFG2_ADE_DISABLE
#define MAX77620_LDO_CFG2_ADE_ENABLE
#define MAX77620_LDO_CFG2_SS_MASK
#define MAX77620_LDO_CFG2_SS_FAST
#define MAX77620_LDO_CFG2_SS_SLOW

#define MAX77620_IRQ_TOP_GLBL_MASK
#define MAX77620_IRQ_TOP_SD_MASK
#define MAX77620_IRQ_TOP_LDO_MASK
#define MAX77620_IRQ_TOP_GPIO_MASK
#define MAX77620_IRQ_TOP_RTC_MASK
#define MAX77620_IRQ_TOP_32K_MASK
#define MAX77620_IRQ_TOP_ONOFF_MASK

#define MAX77620_IRQ_LBM_MASK
#define MAX77620_IRQ_TJALRM1_MASK
#define MAX77620_IRQ_TJALRM2_MASK

#define MAX77620_PWR_I2C_ADDR
#define MAX77620_RTC_I2C_ADDR

#define MAX77620_CNFG_GPIO_DRV_MASK
#define MAX77620_CNFG_GPIO_DRV_PUSHPULL
#define MAX77620_CNFG_GPIO_DRV_OPENDRAIN
#define MAX77620_CNFG_GPIO_DIR_MASK
#define MAX77620_CNFG_GPIO_DIR_INPUT
#define MAX77620_CNFG_GPIO_DIR_OUTPUT
#define MAX77620_CNFG_GPIO_INPUT_VAL_MASK
#define MAX77620_CNFG_GPIO_OUTPUT_VAL_MASK
#define MAX77620_CNFG_GPIO_OUTPUT_VAL_HIGH
#define MAX77620_CNFG_GPIO_OUTPUT_VAL_LOW
#define MAX77620_CNFG_GPIO_INT_MASK
#define MAX77620_CNFG_GPIO_INT_FALLING
#define MAX77620_CNFG_GPIO_INT_RISING
#define MAX77620_CNFG_GPIO_DBNC_MASK
#define MAX77620_CNFG_GPIO_DBNC_None
#define MAX77620_CNFG_GPIO_DBNC_8ms
#define MAX77620_CNFG_GPIO_DBNC_16ms
#define MAX77620_CNFG_GPIO_DBNC_32ms

#define MAX77620_IRQ_LVL2_GPIO_EDGE0
#define MAX77620_IRQ_LVL2_GPIO_EDGE1
#define MAX77620_IRQ_LVL2_GPIO_EDGE2
#define MAX77620_IRQ_LVL2_GPIO_EDGE3
#define MAX77620_IRQ_LVL2_GPIO_EDGE4
#define MAX77620_IRQ_LVL2_GPIO_EDGE5
#define MAX77620_IRQ_LVL2_GPIO_EDGE6
#define MAX77620_IRQ_LVL2_GPIO_EDGE7

#define MAX77620_CNFG1_32K_OUT0_EN

#define MAX77620_ONOFFCNFG1_SFT_RST
#define MAX77620_ONOFFCNFG1_MRT_MASK
#define MAX77620_ONOFFCNFG1_MRT_SHIFT
#define MAX77620_ONOFFCNFG1_SLPEN
#define MAX77620_ONOFFCNFG1_PWR_OFF
#define MAX20024_ONOFFCNFG1_CLRSE

#define MAX77620_ONOFFCNFG2_SFT_RST_WK
#define MAX77620_ONOFFCNFG2_WD_RST_WK
#define MAX77620_ONOFFCNFG2_SLP_LPM_MSK
#define MAX77620_ONOFFCNFG2_WK_ALARM1
#define MAX77620_ONOFFCNFG2_WK_EN0

#define MAX77620_GLBLM_MASK

#define MAX77620_WDTC_MASK
#define MAX77620_WDTOFFC
#define MAX77620_WDTSLPC
#define MAX77620_WDTEN

#define MAX77620_TWD_MASK
#define MAX77620_TWD_2s
#define MAX77620_TWD_16s
#define MAX77620_TWD_64s
#define MAX77620_TWD_128s

#define MAX77620_CNFGGLBL1_LBDAC_EN
#define MAX77620_CNFGGLBL1_MPPLD
#define MAX77620_CNFGGLBL1_LBHYST
#define MAX77620_CNFGGLBL1_LBDAC
#define MAX77620_CNFGGLBL1_LBRSTEN

/* CNFG BBC registers */
#define MAX77620_CNFGBBC_ENABLE
#define MAX77620_CNFGBBC_CURRENT_MASK
#define MAX77620_CNFGBBC_CURRENT_SHIFT
#define MAX77620_CNFGBBC_VOLTAGE_MASK
#define MAX77620_CNFGBBC_VOLTAGE_SHIFT
#define MAX77620_CNFGBBC_LOW_CURRENT_DISABLE
#define MAX77620_CNFGBBC_RESISTOR_MASK
#define MAX77620_CNFGBBC_RESISTOR_SHIFT

#define MAX77620_FPS_COUNT

/* Interrupts */
enum {};

/* GPIOs */
enum {};

/* FPS Source */
enum max77620_fps_src {};

enum max77620_chip_id {};

struct max77620_chip {};

#endif /* _MFD_MAX77620_H_ */