linux/drivers/regulator/da9211-regulator.h

/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * da9211-regulator.h - Regulator definitions for DA9211/DA9212
 * /DA9213/DA9223/DA9214/DA9224/DA9215/DA9225
 * Copyright (C) 2015  Dialog Semiconductor Ltd.
 */

#ifndef __DA9211_REGISTERS_H__
#define __DA9211_REGISTERS_H__

/* Page selection */
#define DA9211_REG_PAGE_CON

/* System Control and Event Registers */
#define DA9211_REG_STATUS_A
#define DA9211_REG_STATUS_B
#define DA9211_REG_EVENT_A
#define DA9211_REG_EVENT_B
#define DA9211_REG_MASK_A
#define DA9211_REG_MASK_B
#define DA9211_REG_CONTROL_A

/* GPIO Control Registers */
#define DA9211_REG_GPIO_0_1
#define DA9211_REG_GPIO_2_3
#define DA9211_REG_GPIO_4

/* Regulator Registers */
#define DA9211_REG_BUCKA_CONT
#define DA9211_REG_BUCKB_CONT
#define DA9211_REG_BUCK_ILIM
#define DA9211_REG_BUCKA_CONF
#define DA9211_REG_BUCKB_CONF
#define DA9211_REG_BUCK_CONF
#define DA9211_REG_VBACKA_MAX
#define DA9211_REG_VBACKB_MAX
#define DA9211_REG_VBUCKA_A
#define DA9211_REG_VBUCKA_B
#define DA9211_REG_VBUCKB_A
#define DA9211_REG_VBUCKB_B

/* I2C Interface Settings */
#define DA9211_REG_INTERFACE

/* BUCK Phase Selection*/
#define DA9211_REG_CONFIG_E

/* Device ID */
#define DA9211_REG_DEVICE_ID

/*
 * Registers bits
 */
/* DA9211_REG_PAGE_CON (addr=0x00) */
#define DA9211_REG_PAGE_SHIFT
#define DA9211_REG_PAGE_MASK
/* On I2C registers 0x00 - 0xFF */
#define DA9211_REG_PAGE0
/* On I2C registers 0x100 - 0x1FF */
#define DA9211_REG_PAGE2
#define DA9211_PAGE_WRITE_MODE
#define DA9211_REPEAT_WRITE_MODE
#define DA9211_PAGE_REVERT

/* DA9211_REG_STATUS_A (addr=0x50) */
#define DA9211_GPI0
#define DA9211_GPI1
#define DA9211_GPI2
#define DA9211_GPI3
#define DA9211_GPI4

/* DA9211_REG_EVENT_A (addr=0x52) */
#define DA9211_E_GPI0
#define DA9211_E_GPI1
#define DA9211_E_GPI2
#define DA9211_E_GPI3
#define DA9211_E_GPI4
#define DA9211_E_UVLO_IO

/* DA9211_REG_EVENT_B (addr=0x53) */
#define DA9211_E_PWRGOOD_A
#define DA9211_E_PWRGOOD_B
#define DA9211_E_TEMP_WARN
#define DA9211_E_TEMP_CRIT
#define DA9211_E_OV_CURR_A
#define DA9211_E_OV_CURR_B

/* DA9211_REG_MASK_A (addr=0x54) */
#define DA9211_M_GPI0
#define DA9211_M_GPI1
#define DA9211_M_GPI2
#define DA9211_M_GPI3
#define DA9211_M_GPI4
#define DA9211_M_UVLO_IO

/* DA9211_REG_MASK_B (addr=0x55) */
#define DA9211_M_PWRGOOD_A
#define DA9211_M_PWRGOOD_B
#define DA9211_M_TEMP_WARN
#define DA9211_M_TEMP_CRIT
#define DA9211_M_OV_CURR_A
#define DA9211_M_OV_CURR_B

/* DA9211_REG_CONTROL_A (addr=0x56) */
#define DA9211_DEBOUNCING_SHIFT
#define DA9211_DEBOUNCING_MASK
#define DA9211_SLEW_RATE_SHIFT
#define DA9211_SLEW_RATE_A_MASK
#define DA9211_SLEW_RATE_B_SHIFT
#define DA9211_SLEW_RATE_B_MASK
#define DA9211_V_LOCK

/* DA9211_REG_GPIO_0_1 (addr=0x58) */
#define DA9211_GPIO0_PIN_SHIFT
#define DA9211_GPIO0_PIN_MASK
#define DA9211_GPIO0_PIN_GPI
#define DA9211_GPIO0_PIN_GPO_OD
#define DA9211_GPIO0_PIN_GPO
#define DA9211_GPIO0_TYPE
#define DA9211_GPIO0_TYPE_GPI
#define DA9211_GPIO0_TYPE_GPO
#define DA9211_GPIO0_MODE
#define DA9211_GPIO1_PIN_SHIFT
#define DA9211_GPIO1_PIN_MASK
#define DA9211_GPIO1_PIN_GPI
#define DA9211_GPIO1_PIN_VERROR
#define DA9211_GPIO1_PIN_GPO_OD
#define DA9211_GPIO1_PIN_GPO
#define DA9211_GPIO1_TYPE_SHIFT
#define DA9211_GPIO1_TYPE_GPI
#define DA9211_GPIO1_TYPE_GPO
#define DA9211_GPIO1_MODE

/* DA9211_REG_GPIO_2_3 (addr=0x59) */
#define DA9211_GPIO2_PIN_SHIFT
#define DA9211_GPIO2_PIN_MASK
#define DA9211_GPIO2_PIN_GPI
#define DA9211_GPIO5_PIN_BUCK_CLK
#define DA9211_GPIO2_PIN_GPO_OD
#define DA9211_GPIO2_PIN_GPO
#define DA9211_GPIO2_TYPE
#define DA9211_GPIO2_TYPE_GPI
#define DA9211_GPIO2_TYPE_GPO
#define DA9211_GPIO2_MODE
#define DA9211_GPIO3_PIN_SHIFT
#define DA9211_GPIO3_PIN_MASK
#define DA9211_GPIO3_PIN_GPI
#define DA9211_GPIO3_PIN_IERROR
#define DA9211_GPIO3_PIN_GPO_OD
#define DA9211_GPIO3_PIN_GPO
#define DA9211_GPIO3_TYPE_SHIFT
#define DA9211_GPIO3_TYPE_GPI
#define DA9211_GPIO3_TYPE_GPO
#define DA9211_GPIO3_MODE

/* DA9211_REG_GPIO_4 (addr=0x5A) */
#define DA9211_GPIO4_PIN_SHIFT
#define DA9211_GPIO4_PIN_MASK
#define DA9211_GPIO4_PIN_GPI
#define DA9211_GPIO4_PIN_GPO_OD
#define DA9211_GPIO4_PIN_GPO
#define DA9211_GPIO4_TYPE
#define DA9211_GPIO4_TYPE_GPI
#define DA9211_GPIO4_TYPE_GPO
#define DA9211_GPIO4_MODE

/* DA9211_REG_BUCKA_CONT (addr=0x5D) */
#define DA9211_BUCKA_EN
#define DA9211_BUCKA_GPI_SHIFT
#define DA9211_BUCKA_GPI_MASK
#define DA9211_BUCKA_GPI_OFF
#define DA9211_BUCKA_GPI_GPIO0
#define DA9211_BUCKA_GPI_GPIO1
#define DA9211_BUCKA_GPI_GPIO3
#define DA9211_BUCKA_PD_DIS
#define DA9211_VBUCKA_SEL
#define DA9211_VBUCKA_SEL_A
#define DA9211_VBUCKA_SEL_B
#define DA9211_VBUCKA_GPI_SHIFT
#define DA9211_VBUCKA_GPI_MASK
#define DA9211_VBUCKA_GPI_OFF
#define DA9211_VBUCKA_GPI_GPIO1
#define DA9211_VBUCKA_GPI_GPIO2
#define DA9211_VBUCKA_GPI_GPIO4

/* DA9211_REG_BUCKB_CONT (addr=0x5E) */
#define DA9211_BUCKB_EN
#define DA9211_BUCKB_GPI_SHIFT
#define DA9211_BUCKB_GPI_MASK
#define DA9211_BUCKB_GPI_OFF
#define DA9211_BUCKB_GPI_GPIO0
#define DA9211_BUCKB_GPI_GPIO1
#define DA9211_BUCKB_GPI_GPIO3
#define DA9211_BUCKB_PD_DIS
#define DA9211_VBUCKB_SEL
#define DA9211_VBUCKB_SEL_A
#define DA9211_VBUCKB_SEL_B
#define DA9211_VBUCKB_GPI_SHIFT
#define DA9211_VBUCKB_GPI_MASK
#define DA9211_VBUCKB_GPI_OFF
#define DA9211_VBUCKB_GPI_GPIO1
#define DA9211_VBUCKB_GPI_GPIO2
#define DA9211_VBUCKB_GPI_GPIO4

/* DA9211_REG_BUCK_ILIM (addr=0xD0) */
#define DA9211_BUCKA_ILIM_SHIFT
#define DA9211_BUCKA_ILIM_MASK
#define DA9211_BUCKB_ILIM_SHIFT
#define DA9211_BUCKB_ILIM_MASK

/* DA9211_REG_BUCKA_CONF (addr=0xD1) */
#define DA9211_BUCKA_MODE_SHIFT
#define DA9211_BUCKA_MODE_MASK
#define DA9211_BUCKA_MODE_MANUAL
#define DA9211_BUCKA_MODE_SLEEP
#define DA9211_BUCKA_MODE_SYNC
#define DA9211_BUCKA_MODE_AUTO
#define DA9211_BUCKA_UP_CTRL_SHIFT
#define DA9211_BUCKA_UP_CTRL_MASK
#define DA9211_BUCKA_DOWN_CTRL_SHIFT
#define DA9211_BUCKA_DOWN_CTRL_MASK

/* DA9211_REG_BUCKB_CONF (addr=0xD2) */
#define DA9211_BUCKB_MODE_SHIFT
#define DA9211_BUCKB_MODE_MASK
#define DA9211_BUCKB_MODE_MANUAL
#define DA9211_BUCKB_MODE_SLEEP
#define DA9211_BUCKB_MODE_SYNC
#define DA9211_BUCKB_MODE_AUTO
#define DA9211_BUCKB_UP_CTRL_SHIFT
#define DA9211_BUCKB_UP_CTRL_MASK
#define DA9211_BUCKB_DOWN_CTRL_SHIFT
#define DA9211_BUCKB_DOWN_CTRL_MASK

/* DA9211_REG_BUCK_CONF (addr=0xD3) */
#define DA9211_PHASE_SEL_A_SHIFT
#define DA9211_PHASE_SEL_A_MASK
#define DA9211_PHASE_SEL_B_SHIFT
#define DA9211_PHASE_SEL_B_MASK
#define DA9211_PH_SH_EN_A_SHIFT
#define DA9211_PH_SH_EN_A_MASK
#define DA9211_PH_SH_EN_B_SHIFT
#define DA9211_PH_SH_EN_B_MASK

/* DA9211_REG_VBUCKA_MAX (addr=0xD5) */
#define DA9211_VBUCKA_BASE_SHIFT
#define DA9211_VBUCKA_BASE_MASK

/* DA9211_REG_VBUCKB_MAX (addr=0xD6) */
#define DA9211_VBUCKB_BASE_SHIFT
#define DA9211_VBUCKB_BASE_MASK

/* DA9211_REG_VBUCKA/B_A/B (addr=0xD7/0xD8/0xD9/0xDA) */
#define DA9211_VBUCK_SHIFT
#define DA9211_VBUCK_MASK
#define DA9211_VBUCK_BIAS
#define DA9211_BUCK_SL

/* DA9211_REG_INTERFACE (addr=0x105) */
#define DA9211_IF_BASE_ADDR_SHIFT
#define DA9211_IF_BASE_ADDR_MASK

/* DA9211_REG_CONFIG_E (addr=0x147) */
#define DA9211_SLAVE_SEL

#endif	/* __DA9211_REGISTERS_H__ */