linux/include/linux/mfd/88pm80x.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Marvell 88PM80x Interface
 *
 * Copyright (C) 2012 Marvell International Ltd.
 * Qiao Zhou <[email protected]>
 */

#ifndef __LINUX_MFD_88PM80X_H
#define __LINUX_MFD_88PM80X_H

#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/regmap.h>
#include <linux/atomic.h>

enum {};

enum {};
#define PM800_MAX_REGULATOR
#define PM800_NUM_BUCK
#define PM800_NUM_LDO

/* page 0 basic: slave adder 0x60 */

#define PM800_STATUS_1
#define PM800_ONKEY_STS1
#define PM800_EXTON_STS1
#define PM800_CHG_STS1
#define PM800_BAT_STS1
#define PM800_VBUS_STS1
#define PM800_LDO_PGOOD_STS1
#define PM800_BUCK_PGOOD_STS1

#define PM800_STATUS_2
#define PM800_RTC_ALARM_STS2

/* Wakeup Registers */
#define PM800_WAKEUP1

#define PM800_WAKEUP2
#define PM800_WAKEUP2_INV_INT
#define PM800_WAKEUP2_INT_CLEAR
#define PM800_WAKEUP2_INT_MASK

#define PM800_POWER_UP_LOG

/* Referance and low power registers */
#define PM800_LOW_POWER1
#define PM800_LOW_POWER2
#define PM800_LOW_POWER_CONFIG3
#define PM800_LOW_POWER_CONFIG4

/* GPIO register */
#define PM800_GPIO_0_1_CNTRL
#define PM800_GPIO0_VAL
#define PM800_GPIO0_GPIO_MODE(x)
#define PM800_GPIO1_VAL
#define PM800_GPIO1_GPIO_MODE(x)

#define PM800_GPIO_2_3_CNTRL
#define PM800_GPIO2_VAL
#define PM800_GPIO2_GPIO_MODE(x)
#define PM800_GPIO3_VAL
#define PM800_GPIO3_GPIO_MODE(x)
#define PM800_GPIO3_MODE_MASK
#define PM800_GPIO3_HEADSET_MODE

#define PM800_GPIO_4_CNTRL
#define PM800_GPIO4_VAL
#define PM800_GPIO4_GPIO_MODE(x)

#define PM800_HEADSET_CNTRL
#define PM800_HEADSET_DET_EN
#define PM800_HSDET_SLP
/* PWM register */
#define PM800_PWM1
#define PM800_PWM2
#define PM800_PWM3
#define PM800_PWM4

/* RTC Registers */
#define PM800_RTC_CONTROL
#define PM800_RTC_MISC1
#define PM800_RTC_MISC2
#define PM800_RTC_MISC3
#define PM800_RTC_MISC4
#define PM800_RTC_MISC5
/* bit definitions of RTC Register 1 (0xD0) */
#define PM800_ALARM1_EN
#define PM800_ALARM_WAKEUP
#define PM800_ALARM
#define PM800_RTC1_USE_XO

/* Regulator Control Registers: BUCK1,BUCK5,LDO1 have DVC */

/* buck registers */
#define PM800_SLEEP_BUCK1

/* BUCK Sleep Mode Register 1: BUCK[1..4] */
#define PM800_BUCK_SLP1
#define PM800_BUCK1_SLP1_SHIFT
#define PM800_BUCK1_SLP1_MASK

/* page 2 GPADC: slave adder 0x02 */
#define PM800_GPADC_MEAS_EN1
#define PM800_MEAS_EN1_VBAT
#define PM800_GPADC_MEAS_EN2
#define PM800_MEAS_EN2_RFTMP
#define PM800_MEAS_GP0_EN
#define PM800_MEAS_GP1_EN
#define PM800_MEAS_GP2_EN
#define PM800_MEAS_GP3_EN
#define PM800_MEAS_GP4_EN

#define PM800_GPADC_MISC_CONFIG1
#define PM800_GPADC_MISC_CONFIG2
#define PM800_GPADC_MISC_GPFSM_EN
#define PM800_GPADC_SLOW_MODE(x)

#define PM800_GPADC_MISC_CONFIG3
#define PM800_GPADC_MISC_CONFIG4

#define PM800_GPADC_PREBIAS1
#define PM800_GPADC0_GP_PREBIAS_TIME(x)
#define PM800_GPADC_PREBIAS2

#define PM800_GP_BIAS_ENA1
#define PM800_GPADC_GP_BIAS_EN0
#define PM800_GPADC_GP_BIAS_EN1
#define PM800_GPADC_GP_BIAS_EN2
#define PM800_GPADC_GP_BIAS_EN3

#define PM800_GP_BIAS_OUT1
#define PM800_BIAS_OUT_GP0
#define PM800_BIAS_OUT_GP1
#define PM800_BIAS_OUT_GP2
#define PM800_BIAS_OUT_GP3

#define PM800_GPADC0_LOW_TH
#define PM800_GPADC1_LOW_TH
#define PM800_GPADC2_LOW_TH
#define PM800_GPADC3_LOW_TH
#define PM800_GPADC4_LOW_TH

#define PM800_GPADC0_UPP_TH
#define PM800_GPADC1_UPP_TH
#define PM800_GPADC2_UPP_TH
#define PM800_GPADC3_UPP_TH
#define PM800_GPADC4_UPP_TH

#define PM800_VBBAT_MEAS1
#define PM800_VBBAT_MEAS2
#define PM800_VBAT_MEAS1
#define PM800_VBAT_MEAS2
#define PM800_VSYS_MEAS1
#define PM800_VSYS_MEAS2
#define PM800_VCHG_MEAS1
#define PM800_VCHG_MEAS2
#define PM800_TINT_MEAS1
#define PM800_TINT_MEAS2
#define PM800_PMOD_MEAS1
#define PM800_PMOD_MEAS2

#define PM800_GPADC0_MEAS1
#define PM800_GPADC0_MEAS2
#define PM800_GPADC1_MEAS1
#define PM800_GPADC1_MEAS2
#define PM800_GPADC2_MEAS1
#define PM800_GPADC2_MEAS2
#define PM800_GPADC3_MEAS1
#define PM800_GPADC3_MEAS2
#define PM800_GPADC4_MEAS1
#define PM800_GPADC4_MEAS2

#define PM800_GPADC4_AVG1
#define PM800_GPADC4_AVG2

/* 88PM805 Registers */
#define PM805_MAIN_POWERUP
#define PM805_INT_STATUS0

#define PM805_STATUS0_INT_CLEAR
#define PM805_STATUS0_INV_INT
#define PM800_STATUS0_INT_MASK

#define PM805_INT_STATUS1

#define PM805_INT1_HP1_SHRT
#define PM805_INT1_HP2_SHRT
#define PM805_INT1_MIC_CONFLICT
#define PM805_INT1_CLIP_FAULT
#define PM805_INT1_LDO_OFF
#define PM805_INT1_SRC_DPLL_LOCK

#define PM805_INT_STATUS2

#define PM805_INT2_MIC_DET
#define PM805_INT2_SHRT_BTN_DET
#define PM805_INT2_VOLM_BTN_DET
#define PM805_INT2_VOLP_BTN_DET
#define PM805_INT2_RAW_PLL_FAULT
#define PM805_INT2_FINE_PLL_FAULT

#define PM805_INT_MASK1
#define PM805_INT_MASK2
#define PM805_SHRT_BTN_DET

/* number of status and int reg in a row */
#define PM805_INT_REG_NUM

#define PM805_MIC_DET1
#define PM805_MIC_DET_EN_MIC_DET
#define PM805_MIC_DET2
#define PM805_MIC_DET_STATUS1

#define PM805_MIC_DET_STATUS3
#define PM805_AUTO_SEQ_STATUS1
#define PM805_AUTO_SEQ_STATUS2

#define PM805_ADC_SETTING1
#define PM805_ADC_SETTING2
#define PM805_ADC_SETTING3
#define PM805_ADC_GAIN1
#define PM805_ADC_GAIN2
#define PM805_DMIC_SETTING
#define PM805_DWS_SETTING
#define PM805_MIC_CONFLICT_STS

#define PM805_PDM_SETTING1
#define PM805_PDM_SETTING2
#define PM805_PDM_SETTING3
#define PM805_PDM_CONTROL1
#define PM805_PDM_CONTROL2
#define PM805_PDM_CONTROL3

#define PM805_HEADPHONE_SETTING
#define PM805_HEADPHONE_GAIN_A2A
#define PM805_HEADPHONE_SHORT_STATE
#define PM805_EARPHONE_SETTING
#define PM805_AUTO_SEQ_SETTING

struct pm80x_rtc_pdata {};

struct pm80x_subchip {};

struct pm80x_chip {};

struct pm80x_platform_data {};

extern const struct dev_pm_ops pm80x_pm_ops;
extern const struct regmap_config pm80x_regmap_config;

static inline int pm80x_request_irq(struct pm80x_chip *pm80x, int irq,
				     irq_handler_t handler, unsigned long flags,
				     const char *name, void *data)
{}

static inline void pm80x_free_irq(struct pm80x_chip *pm80x, int irq, void *data)
{}

#ifdef CONFIG_PM
static inline int pm80x_dev_suspend(struct device *dev)
{}

static inline int pm80x_dev_resume(struct device *dev)
{}
#endif

extern int pm80x_init(struct i2c_client *client);
extern int pm80x_deinit(void);
#endif /* __LINUX_MFD_88PM80X_H */