linux/include/linux/mfd/88pm860x.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Marvell 88PM860x Interface
 *
 * Copyright (C) 2009 Marvell International Ltd.
 * 	Haojian Zhuang <[email protected]>
 */

#ifndef __LINUX_MFD_88PM860X_H
#define __LINUX_MFD_88PM860X_H

#include <linux/interrupt.h>

#define MFD_NAME_SIZE

enum {};

enum {};


/* 8606 Registers */
#define PM8606_DCM_BOOST
#define PM8606_PWM

#define PM8607_MISC2

/* Power Up Log Register */
#define PM8607_POWER_UP_LOG

/* Charger Control Registers */
#define PM8607_CCNT
#define PM8607_CHG_CTRL1
#define PM8607_CHG_CTRL2
#define PM8607_CHG_CTRL3
#define PM8607_CHG_CTRL4
#define PM8607_CHG_CTRL5
#define PM8607_CHG_CTRL6
#define PM8607_CHG_CTRL7

/* Backlight Registers */
#define PM8606_WLED1A
#define PM8606_WLED1B
#define PM8606_WLED2A
#define PM8606_WLED2B
#define PM8606_WLED3A
#define PM8606_WLED3B

/* LED Registers */
#define PM8606_RGB2A
#define PM8606_RGB2B
#define PM8606_RGB2C
#define PM8606_RGB2D
#define PM8606_RGB1A
#define PM8606_RGB1B
#define PM8606_RGB1C
#define PM8606_RGB1D

#define PM8606_PREREGULATORA
#define PM8606_PREREGULATORB
#define PM8606_VIBRATORA
#define PM8606_VIBRATORB
#define PM8606_VCHG
#define PM8606_VSYS
#define PM8606_MISC
#define PM8606_CHIP_ID
#define PM8606_STATUS
#define PM8606_FLAGS
#define PM8606_PROTECTA
#define PM8606_PROTECTB
#define PM8606_PROTECTC

/* Bit definitions of PM8606 registers */
#define PM8606_DCM_500MA
#define PM8606_DCM_750MA
#define PM8606_DCM_1000MA
#define PM8606_DCM_1250MA
#define PM8606_DCM_250MV
#define PM8606_DCM_300MV
#define PM8606_DCM_350MV
#define PM8606_DCM_400MV

#define PM8606_PWM_31200HZ
#define PM8606_PWM_15600HZ
#define PM8606_PWM_7800HZ
#define PM8606_PWM_3900HZ
#define PM8606_PWM_1950HZ
#define PM8606_PWM_976HZ
#define PM8606_PWM_488HZ
#define PM8606_PWM_244HZ
#define PM8606_PWM_FREQ_MASK

#define PM8606_WLED_ON
#define PM8606_WLED_CURRENT(x)

#define PM8606_LED_CURRENT(x)

#define PM8606_VSYS_EN

#define PM8606_MISC_OSC_EN

enum {};

/* 8607 chip ID is 0x40 or 0x50 */
#define PM8607_VERSION_MASK

/* Interrupt Registers */
#define PM8607_STATUS_1
#define PM8607_STATUS_2
#define PM8607_INT_STATUS1
#define PM8607_INT_STATUS2
#define PM8607_INT_STATUS3
#define PM8607_INT_MASK_1
#define PM8607_INT_MASK_2
#define PM8607_INT_MASK_3

/* Regulator Control Registers */
#define PM8607_LDO1
#define PM8607_LDO2
#define PM8607_LDO3
#define PM8607_LDO4
#define PM8607_LDO5
#define PM8607_LDO6
#define PM8607_LDO7
#define PM8607_LDO8
#define PM8607_LDO9
#define PM8607_LDO10
#define PM8607_LDO12
#define PM8607_LDO14
#define PM8607_SLEEP_MODE1
#define PM8607_SLEEP_MODE2
#define PM8607_SLEEP_MODE3
#define PM8607_SLEEP_MODE4
#define PM8607_GO
#define PM8607_SLEEP_BUCK1
#define PM8607_SLEEP_BUCK2
#define PM8607_SLEEP_BUCK3
#define PM8607_BUCK1
#define PM8607_BUCK2
#define PM8607_BUCK3
#define PM8607_BUCK_CONTROLS
#define PM8607_SUPPLIES_EN11
#define PM8607_SUPPLIES_EN12
#define PM8607_GROUP1
#define PM8607_GROUP2
#define PM8607_GROUP3
#define PM8607_GROUP4
#define PM8607_GROUP5
#define PM8607_GROUP6
#define PM8607_SUPPLIES_EN21
#define PM8607_SUPPLIES_EN22

/* Vibrator Control Registers */
#define PM8607_VIBRATOR_SET
#define PM8607_VIBRATOR_PWM

/* GPADC Registers */
#define PM8607_GP_BIAS1
#define PM8607_MEAS_EN1
#define PM8607_MEAS_EN2
#define PM8607_MEAS_EN3
#define PM8607_MEAS_OFF_TIME1
#define PM8607_MEAS_OFF_TIME2
#define PM8607_TSI_PREBIAS
#define PM8607_PD_PREBIAS
#define PM8607_GPADC_MISC1

/* bit definitions of  MEAS_EN1*/
#define PM8607_MEAS_EN1_VBAT
#define PM8607_MEAS_EN1_VCHG
#define PM8607_MEAS_EN1_VSYS
#define PM8607_MEAS_EN1_TINT
#define PM8607_MEAS_EN1_RFTMP
#define PM8607_MEAS_EN1_TBAT
#define PM8607_MEAS_EN1_GPADC2
#define PM8607_MEAS_EN1_GPADC3

/* Battery Monitor Registers */
#define PM8607_GP_BIAS2
#define PM8607_VBAT_LOWTH
#define PM8607_VCHG_LOWTH
#define PM8607_VSYS_LOWTH
#define PM8607_TINT_LOWTH
#define PM8607_GPADC0_LOWTH
#define PM8607_GPADC1_LOWTH
#define PM8607_GPADC2_LOWTH
#define PM8607_GPADC3_LOWTH
#define PM8607_VBAT_HIGHTH
#define PM8607_VCHG_HIGHTH
#define PM8607_VSYS_HIGHTH
#define PM8607_TINT_HIGHTH
#define PM8607_GPADC0_HIGHTH
#define PM8607_GPADC1_HIGHTH
#define PM8607_GPADC2_HIGHTH
#define PM8607_GPADC3_HIGHTH
#define PM8607_IBAT_MEAS1
#define PM8607_IBAT_MEAS2
#define PM8607_VBAT_MEAS1
#define PM8607_VBAT_MEAS2
#define PM8607_VCHG_MEAS1
#define PM8607_VCHG_MEAS2
#define PM8607_VSYS_MEAS1
#define PM8607_VSYS_MEAS2
#define PM8607_TINT_MEAS1
#define PM8607_TINT_MEAS2
#define PM8607_GPADC0_MEAS1
#define PM8607_GPADC0_MEAS2
#define PM8607_GPADC1_MEAS1
#define PM8607_GPADC1_MEAS2
#define PM8607_GPADC2_MEAS1
#define PM8607_GPADC2_MEAS2
#define PM8607_GPADC3_MEAS1
#define PM8607_GPADC3_MEAS2
#define PM8607_CCNT_MEAS1
#define PM8607_CCNT_MEAS2
#define PM8607_VBAT_AVG
#define PM8607_VCHG_AVG
#define PM8607_VSYS_AVG
#define PM8607_VBAT_MIN
#define PM8607_VCHG_MIN
#define PM8607_VSYS_MIN
#define PM8607_VBAT_MAX
#define PM8607_VCHG_MAX
#define PM8607_VSYS_MAX

#define PM8607_GPADC_MISC2
#define PM8607_GPADC0_GP_BIAS_A0
#define PM8607_GPADC1_GP_BIAS_A1
#define PM8607_GPADC2_GP_BIAS_A2
#define PM8607_GPADC3_GP_BIAS_A3
#define PM8607_GPADC2_GP_BIAS_OUT2

/* RTC Control Registers */
#define PM8607_RTC1
#define PM8607_RTC_COUNTER1
#define PM8607_RTC_COUNTER2
#define PM8607_RTC_COUNTER3
#define PM8607_RTC_COUNTER4
#define PM8607_RTC_EXPIRE1
#define PM8607_RTC_EXPIRE2
#define PM8607_RTC_EXPIRE3
#define PM8607_RTC_EXPIRE4
#define PM8607_RTC_TRIM1
#define PM8607_RTC_TRIM2
#define PM8607_RTC_TRIM3
#define PM8607_RTC_TRIM4
#define PM8607_RTC_MISC1
#define PM8607_RTC_MISC2
#define PM8607_RTC_MISC3

/* Misc Registers */
#define PM8607_CHIP_ID
#define PM8607_B0_MISC1
#define PM8607_LDO1
#define PM8607_DVC3
#define PM8607_A1_MISC1

/* bit definitions of Status Query Interface */
#define PM8607_STATUS_CC
#define PM8607_STATUS_PEN
#define PM8607_STATUS_HEADSET
#define PM8607_STATUS_HOOK
#define PM8607_STATUS_MICIN
#define PM8607_STATUS_ONKEY
#define PM8607_STATUS_EXTON
#define PM8607_STATUS_CHG
#define PM8607_STATUS_BAT
#define PM8607_STATUS_VBUS
#define PM8607_STATUS_OV

/* bit definitions of BUCK3 */
#define PM8607_BUCK3_DOUBLE

/* bit definitions of Misc1 */
#define PM8607_A1_MISC1_PI2C
#define PM8607_B0_MISC1_INV_INT
#define PM8607_B0_MISC1_INT_CLEAR
#define PM8607_B0_MISC1_INT_MASK
#define PM8607_B0_MISC1_PI2C
#define PM8607_B0_MISC1_RESET

/* bits definitions of GPADC */
#define PM8607_GPADC_EN
#define PM8607_GPADC_PREBIAS_MASK
#define PM8607_GPADC_SLOT_CYCLE_MASK
#define PM8607_GPADC_OFF_SCALE_MASK
#define PM8607_GPADC_SW_CAL_MASK

#define PM8607_PD_PREBIAS_MASK
#define PM8607_PD_PRECHG_MASK

#define PM8606_REF_GP_OSC_OFF
#define PM8606_REF_GP_OSC_ON
#define PM8606_REF_GP_OSC_UNKNOWN

/* Clients of reference group and 8MHz oscillator in 88PM8606 */
enum pm8606_ref_gp_and_osc_clients {};

/* Interrupt Number in 88PM8607 */
enum {};

enum {};

struct pm860x_chip {};

enum {};

struct pm860x_backlight_pdata {};

struct pm860x_led_pdata {};

struct pm860x_rtc_pdata {};

struct pm860x_touch_pdata {};

struct pm860x_power_pdata {};

struct pm860x_platform_data {};

extern int pm8606_osc_enable(struct pm860x_chip *, unsigned short);
extern int pm8606_osc_disable(struct pm860x_chip *, unsigned short);

extern int pm860x_reg_read(struct i2c_client *, int);
extern int pm860x_reg_write(struct i2c_client *, int, unsigned char);
extern int pm860x_bulk_read(struct i2c_client *, int, int, unsigned char *);
extern int pm860x_bulk_write(struct i2c_client *, int, int, unsigned char *);
extern int pm860x_set_bits(struct i2c_client *, int, unsigned char,
			   unsigned char);
extern int pm860x_page_reg_write(struct i2c_client *, int, unsigned char);
extern int pm860x_page_bulk_read(struct i2c_client *, int, int,
				 unsigned char *);
#endif /* __LINUX_MFD_88PM860X_H */