linux/drivers/regulator/da9121-regulator.h

/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * DA9121 Single-channel dual-phase 10A buck converter
 * DA9130 Single-channel dual-phase 10A buck converter (Automotive)
 * DA9217 Single-channel dual-phase  6A buck converter
 * DA9122 Dual-channel single-phase  5A buck converter
 * DA9131 Dual-channel single-phase  5A buck converter (Automotive)
 * DA9220 Dual-channel single-phase  3A buck converter
 * DA9132 Dual-channel single-phase  3A buck converter (Automotive)
 *
 * Copyright (C) 2020  Dialog Semiconductor
 *
 * Authors: Steve Twiss, Dialog Semiconductor
 *          Adam Ward, Dialog Semiconductor
 */

#ifndef __DA9121_REGISTERS_H__
#define __DA9121_REGISTERS_H__

/* Values for: DA9121_REG_BUCK_BUCKx_4 registers, fields CHx_y_MODE
 *             DA9121_REG_BUCK_BUCKx_7 registers, fields CHx_RIPPLE_CANCEL
 */
#include <dt-bindings/regulator/dlg,da9121-regulator.h>

enum da9121_variant {};

enum da9121_subvariant {};

/* Minimum, maximum and default polling millisecond periods are provided
 * here as an example. It is expected that any final implementation will
 * include a modification of these settings to match the required
 * application.
 */
#define DA9121_DEFAULT_POLLING_PERIOD_MS
#define DA9121_MAX_POLLING_PERIOD_MS
#define DA9121_MIN_POLLING_PERIOD_MS

/* Registers */

#define DA9121_REG_SYS_STATUS_0
#define DA9121_REG_SYS_STATUS_1
#define DA9121_REG_SYS_STATUS_2
#define DA9121_REG_SYS_EVENT_0
#define DA9121_REG_SYS_EVENT_1
#define DA9121_REG_SYS_EVENT_2
#define DA9121_REG_SYS_MASK_0
#define DA9121_REG_SYS_MASK_1
#define DA9121_REG_SYS_MASK_2
#define DA9121_REG_SYS_MASK_3
#define DA9121_REG_SYS_CONFIG_0
#define DA9121_REG_SYS_CONFIG_1
#define DA9121_REG_SYS_CONFIG_2
#define DA9121_REG_SYS_CONFIG_3
#define DA9121_REG_SYS_GPIO0_0
#define DA9121_REG_SYS_GPIO0_1
#define DA9121_REG_SYS_GPIO1_0
#define DA9121_REG_SYS_GPIO1_1
#define DA9121_REG_SYS_GPIO2_0
#define DA9121_REG_SYS_GPIO2_1
#define DA914x_REG_SYS_GPIO3_0
#define DA914x_REG_SYS_GPIO3_1
#define DA914x_REG_SYS_GPIO4_0
#define DA914x_REG_SYS_GPIO4_1
#define DA914x_REG_SYS_ADMUX1_0
#define DA914x_REG_SYS_ADMUX1_1
#define DA914x_REG_SYS_ADMUX2_0
#define DA914x_REG_SYS_ADMUX2_1
#define DA9121_REG_BUCK_BUCK1_0
#define DA9121_REG_BUCK_BUCK1_1
#define DA9121_REG_BUCK_BUCK1_2
#define DA9121_REG_BUCK_BUCK1_3
#define DA9121_REG_BUCK_BUCK1_4
#define DA9121_REG_BUCK_BUCK1_5
#define DA9121_REG_BUCK_BUCK1_6
#define DA9121_REG_BUCK_BUCK1_7
#define DA9xxx_REG_BUCK_BUCK2_0
#define DA9xxx_REG_BUCK_BUCK2_1
#define DA9xxx_REG_BUCK_BUCK2_2
#define DA9xxx_REG_BUCK_BUCK2_3
#define DA9xxx_REG_BUCK_BUCK2_4
#define DA9xxx_REG_BUCK_BUCK2_5
#define DA9xxx_REG_BUCK_BUCK2_6
#define DA9xxx_REG_BUCK_BUCK2_7
#define DA9121_REG_OTP_DEVICE_ID
#define DA9121_REG_OTP_VARIANT_ID
#define DA9121_REG_OTP_CUSTOMER_ID
#define DA9121_REG_OTP_CONFIG_ID

/* Register bits */

/* DA9121_REG_SYS_STATUS_0 */

#define DA9xxx_MASK_SYS_STATUS_0_SG
#define DA9121_MASK_SYS_STATUS_0_TEMP_CRIT
#define DA9121_MASK_SYS_STATUS_0_TEMP_WARN

/* DA9121_REG_SYS_STATUS_1 */

#define DA9xxx_MASK_SYS_STATUS_1_PG2
#define DA9xxx_MASK_SYS_STATUS_1_OV2
#define DA9xxx_MASK_SYS_STATUS_1_UV2
#define DA9xxx_MASK_SYS_STATUS_1_OC2
#define DA9121_MASK_SYS_STATUS_1_PG1
#define DA9121_MASK_SYS_STATUS_1_OV1
#define DA9121_MASK_SYS_STATUS_1_UV1
#define DA9121_MASK_SYS_STATUS_1_OC1

/* DA9121_REG_SYS_STATUS_2 */

#define DA9121_MASK_SYS_STATUS_2_GPIO2
#define DA9121_MASK_SYS_STATUS_2_GPIO1
#define DA9121_MASK_SYS_STATUS_2_GPIO0

/* DA9121_REG_SYS_EVENT_0 */

#define DA9xxx_MASK_SYS_EVENT_0_E_SG
#define DA9121_MASK_SYS_EVENT_0_E_TEMP_CRIT
#define DA9121_MASK_SYS_EVENT_0_E_TEMP_WARN

/* DA9121_REG_SYS_EVENT_1 */

#define DA9xxx_MASK_SYS_EVENT_1_E_PG2
#define DA9xxx_MASK_SYS_EVENT_1_E_OV2
#define DA9xxx_MASK_SYS_EVENT_1_E_UV2
#define DA9xxx_MASK_SYS_EVENT_1_E_OC2
#define DA9121_MASK_SYS_EVENT_1_E_PG1
#define DA9121_MASK_SYS_EVENT_1_E_OV1
#define DA9121_MASK_SYS_EVENT_1_E_UV1
#define DA9121_MASK_SYS_EVENT_1_E_OC1

/* DA9121_REG_SYS_EVENT_2 */

#define DA9121_MASK_SYS_EVENT_2_E_GPIO2
#define DA9121_MASK_SYS_EVENT_2_E_GPIO1
#define DA9121_MASK_SYS_EVENT_2_E_GPIO0

/* DA9121_REG_SYS_MASK_0 */

#define DA9xxx_MASK_SYS_MASK_0_M_SG
#define DA9121_MASK_SYS_MASK_0_M_TEMP_CRIT
#define DA9121_MASK_SYS_MASK_0_M_TEMP_WARN

/* DA9121_REG_SYS_MASK_1 */

#define DA9xxx_MASK_SYS_MASK_1_M_PG2
#define DA9xxx_MASK_SYS_MASK_1_M_OV2
#define DA9xxx_MASK_SYS_MASK_1_M_UV2
#define DA9xxx_MASK_SYS_MASK_1_M_OC2
#define DA9121_MASK_SYS_MASK_1_M_PG1
#define DA9121_MASK_SYS_MASK_1_M_OV1
#define DA9121_MASK_SYS_MASK_1_M_UV1
#define DA9121_MASK_SYS_MASK_1_M_OC1

/* DA9121_REG_SYS_MASK_2 */

#define DA9121_MASK_SYS_MASK_2_M_GPIO2
#define DA9121_MASK_SYS_MASK_2_M_GPIO1
#define DA9121_MASK_SYS_MASK_2_M_GPIO0

/* DA9122_REG_SYS_MASK_3 */

#define DA9121_MASK_SYS_MASK_3_M_VR_HOT
#define DA9xxx_MASK_SYS_MASK_3_M_SG_STAT
#define DA9xxx_MASK_SYS_MASK_3_M_PG2_STAT
#define DA9121_MASK_SYS_MASK_3_M_PG1_STAT

/* DA9121_REG_SYS_CONFIG_0 */

#define DA9121_MASK_SYS_CONFIG_0_CH1_DIS_DLY
#define DA9121_MASK_SYS_CONFIG_0_CH1_EN_DLY

/* DA9xxx_REG_SYS_CONFIG_1 */

#define DA9xxx_MASK_SYS_CONFIG_1_CH2_DIS_DLY
#define DA9xxx_MASK_SYS_CONFIG_1_CH2_EN_DLY

/* DA9121_REG_SYS_CONFIG_2 */

#define DA9121_MASK_SYS_CONFIG_2_OC_LATCHOFF
#define DA9121_MASK_SYS_CONFIG_2_OC_DVC_MASK
#define DA9121_MASK_SYS_CONFIG_2_PG_DVC_MASK

/* DA9121_REG_SYS_CONFIG_3 */

#define DA9121_MASK_SYS_CONFIG_3_OSC_TUNE
#define DA9121_MASK_SYS_CONFIG_3_I2C_TIMEOUT

/* DA9121_REG_SYS_GPIO0_0 */

#define DA9121_MASK_SYS_GPIO0_0_GPIO0_MODE
#define DA9121_MASK_SYS_GPIO0_0_GPIO0_OBUF

/* DA9121_REG_SYS_GPIO0_1 */

#define DA9121_MASK_SYS_GPIO0_1_GPIO0_DEB_FALL
#define DA9121_MASK_SYS_GPIO0_1_GPIO0_DEB_RISE
#define DA9121_MASK_SYS_GPIO0_1_GPIO0_DEB
#define DA9121_MASK_SYS_GPIO0_1_GPIO0_PUPD
#define DA9121_MASK_SYS_GPIO0_1_GPIO0_POL
#define DA9121_MASK_SYS_GPIO0_1_GPIO0_TRIG

/* DA9121_REG_SYS_GPIO1_0 */

#define DA9121_MASK_SYS_GPIO1_0_GPIO1_MODE
#define DA9121_MASK_SYS_GPIO1_0_GPIO1_OBUF

/* DA9121_REG_SYS_GPIO1_1 */

#define DA9121_MASK_SYS_GPIO1_1_GPIO1_DEB_FALL
#define DA9121_MASK_SYS_GPIO1_1_GPIO1_DEB_RISE
#define DA9121_MASK_SYS_GPIO1_1_GPIO1_DEB
#define DA9121_MASK_SYS_GPIO1_1_GPIO1_PUPD
#define DA9121_MASK_SYS_GPIO1_1_GPIO1_POL
#define DA9121_MASK_SYS_GPIO1_1_GPIO1_TRIG

/* DA9121_REG_SYS_GPIO2_0 */

#define DA9121_MASK_SYS_GPIO2_0_GPIO2_MODE
#define DA9121_MASK_SYS_GPIO2_0_GPIO2_OBUF

/* DA9121_REG_SYS_GPIO2_1 */

#define DA9121_MASK_SYS_GPIO2_1_GPIO2_DEB_FALL
#define DA9121_MASK_SYS_GPIO2_1_GPIO2_DEB_RISE
#define DA9121_MASK_SYS_GPIO2_1_GPIO2_DEB
#define DA9121_MASK_SYS_GPIO2_1_GPIO2_PUPD
#define DA9121_MASK_SYS_GPIO2_1_GPIO2_POL
#define DA9121_MASK_SYS_GPIO2_1_GPIO2_TRIG

/* DA9121_REG_BUCK_BUCK1_0 / DA9xxx_REG_BUCK_BUCK2_0 */

#define DA9121_MASK_BUCK_BUCKx_0_CHx_SR_DVC_DWN
#define DA9121_MASK_BUCK_BUCKx_0_CHx_SR_DVC_UP
#define DA9121_MASK_BUCK_BUCKx_0_CHx_EN

/* DA9121_REG_BUCK_BUCK1_1 / DA9xxx_REG_BUCK_BUCK2_1 */

#define DA9121_MASK_BUCK_BUCKx_1_CHx_SR_SHDN
#define DA9121_MASK_BUCK_BUCKx_1_CHx_SR_STARTUP
#define DA9121_MASK_BUCK_BUCKx_1_CHx_PD_DIS

/* DA9121_REG_BUCK_BUCK1_2 / DA9xxx_REG_BUCK_BUCK2_2 */

#define DA9121_MASK_BUCK_BUCKx_2_CHx_ILIM

/* DA9121_REG_BUCK_BUCK1_3 / DA9xxx_REG_BUCK_BUCK2_3 */

#define DA9121_MASK_BUCK_BUCKx_3_CHx_VMAX

/* DA9121_REG_BUCK_BUCK1_4 / DA9xxx_REG_BUCK_BUCK2_4 */

#define DA9121_MASK_BUCK_BUCKx_4_CHx_VSEL
#define DA9121_MASK_BUCK_BUCKx_4_CHx_B_MODE
#define DA9121_MASK_BUCK_BUCKx_4_CHx_A_MODE

/* DA9121_REG_BUCK_BUCK1_5 / DA9xxx_REG_BUCK_BUCK2_5 */

#define DA9121_MASK_BUCK_BUCKx_5_CHx_A_VOUT

/* DA9121_REG_BUCK_BUCK1_6 / DA9xxx_REG_BUCK_BUCK2_6 */

#define DA9121_MASK_BUCK_BUCKx_6_CHx_B_VOUT

/* DA9121_REG_BUCK_BUCK1_7 / DA9xxx_REG_BUCK_BUCK2_7 */

#define DA9xxx_MASK_BUCK_BUCKx_7_CHx_RIPPLE_CANCEL


/* DA9121_REG_OTP_DEVICE_ID */

#define DA9121_MASK_OTP_DEVICE_ID_DEV_ID

#define DA9121_DEVICE_ID
#define DA914x_DEVICE_ID

/* DA9121_REG_OTP_VARIANT_ID */

#define DA9121_SHIFT_OTP_VARIANT_ID_MRC
#define DA9121_MASK_OTP_VARIANT_ID_MRC
#define DA9121_SHIFT_OTP_VARIANT_ID_VRC
#define DA9121_MASK_OTP_VARIANT_ID_VRC

#define DA9121_VARIANT_MRC_BASE
#define DA9121_VARIANT_VRC
#define DA9220_VARIANT_VRC
#define DA9122_VARIANT_VRC
#define DA9217_VARIANT_VRC
#define DA9130_VARIANT_VRC
#define DA9131_VARIANT_VRC
#define DA9132_VARIANT_VRC

#define DA914x_VARIANT_MRC_BASE
#define DA9141_VARIANT_VRC
#define DA9142_VARIANT_VRC

/* DA9121_REG_OTP_CUSTOMER_ID */

#define DA9121_MASK_OTP_CUSTOMER_ID_CUST_ID

/* DA9121_REG_OTP_CONFIG_ID */

#define DA9121_MASK_OTP_CONFIG_ID_CONFIG_REV

#endif /* __DA9121_REGISTERS_H__ */