linux/include/linux/mfd/da903x.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LINUX_PMIC_DA903X_H
#define __LINUX_PMIC_DA903X_H

/* Unified sub device IDs for DA9030/DA9034/DA9035 */
enum {};

/*
 * DA9030/DA9034 LEDs sub-devices uses generic "struct led_info"
 * as the platform_data
 */

/* DA9030 flags for "struct led_info"
 */
#define DA9030_LED_RATE_ON
#define DA9030_LED_RATE_052S
#define DA9030_LED_DUTY_1_16
#define DA9030_LED_DUTY_1_8
#define DA9030_LED_DUTY_1_4
#define DA9030_LED_DUTY_1_2

#define DA9030_VIBRA_MODE_1P3V
#define DA9030_VIBRA_MODE_2P7V
#define DA9030_VIBRA_FREQ_1HZ
#define DA9030_VIBRA_FREQ_2HZ
#define DA9030_VIBRA_FREQ_4HZ
#define DA9030_VIBRA_FREQ_8HZ
#define DA9030_VIBRA_DUTY_ON
#define DA9030_VIBRA_DUTY_75P
#define DA9030_VIBRA_DUTY_50P
#define DA9030_VIBRA_DUTY_25P

/* DA9034 flags for "struct led_info" */
#define DA9034_LED_RAMP

/* DA9034 touch screen platform data */
struct da9034_touch_pdata {};

struct da9034_backlight_pdata {};

/* DA9030 battery charger data */
struct power_supply_info;

struct da9030_battery_info {};

struct da903x_subdev_info {};

struct da903x_platform_data {};

/* bit definitions for DA9030 events */
#define DA9030_EVENT_ONKEY
#define DA9030_EVENT_PWREN
#define DA9030_EVENT_EXTON
#define DA9030_EVENT_CHDET
#define DA9030_EVENT_TBAT
#define DA9030_EVENT_VBATMON
#define DA9030_EVENT_VBATMON_TXON
#define DA9030_EVENT_CHIOVER
#define DA9030_EVENT_TCTO
#define DA9030_EVENT_CCTO
#define DA9030_EVENT_ADC_READY
#define DA9030_EVENT_VBUS_4P4
#define DA9030_EVENT_VBUS_4P0
#define DA9030_EVENT_SESS_VALID
#define DA9030_EVENT_SRP_DETECT
#define DA9030_EVENT_WATCHDOG
#define DA9030_EVENT_LDO15
#define DA9030_EVENT_LDO16
#define DA9030_EVENT_LDO17
#define DA9030_EVENT_LDO18
#define DA9030_EVENT_LDO19
#define DA9030_EVENT_BUCK2

/* bit definitions for DA9034 events */
#define DA9034_EVENT_ONKEY
#define DA9034_EVENT_EXTON
#define DA9034_EVENT_CHDET
#define DA9034_EVENT_TBAT
#define DA9034_EVENT_VBATMON
#define DA9034_EVENT_REV_IOVER
#define DA9034_EVENT_CH_IOVER
#define DA9034_EVENT_CH_TCTO
#define DA9034_EVENT_CH_CCTO
#define DA9034_EVENT_USB_DEV
#define DA9034_EVENT_OTGCP_IOVER
#define DA9034_EVENT_VBUS_4P55
#define DA9034_EVENT_VBUS_3P8
#define DA9034_EVENT_SESS_1P8
#define DA9034_EVENT_SRP_READY
#define DA9034_EVENT_ADC_MAN
#define DA9034_EVENT_ADC_AUTO4
#define DA9034_EVENT_ADC_AUTO5
#define DA9034_EVENT_ADC_AUTO6
#define DA9034_EVENT_PEN_DOWN
#define DA9034_EVENT_TSI_READY
#define DA9034_EVENT_UART_TX
#define DA9034_EVENT_UART_RX
#define DA9034_EVENT_HEADSET
#define DA9034_EVENT_HOOKSWITCH
#define DA9034_EVENT_WATCHDOG

extern int da903x_register_notifier(struct device *dev,
		struct notifier_block *nb, unsigned int events);
extern int da903x_unregister_notifier(struct device *dev,
		struct notifier_block *nb, unsigned int events);

/* Status Query Interface */
#define DA9030_STATUS_ONKEY
#define DA9030_STATUS_PWREN1
#define DA9030_STATUS_EXTON
#define DA9030_STATUS_CHDET
#define DA9030_STATUS_TBAT
#define DA9030_STATUS_VBATMON
#define DA9030_STATUS_VBATMON_TXON
#define DA9030_STATUS_MCLKDET

#define DA9034_STATUS_ONKEY
#define DA9034_STATUS_EXTON
#define DA9034_STATUS_CHDET
#define DA9034_STATUS_TBAT
#define DA9034_STATUS_VBATMON
#define DA9034_STATUS_PEN_DOWN
#define DA9034_STATUS_MCLKDET
#define DA9034_STATUS_USB_DEV
#define DA9034_STATUS_HEADSET
#define DA9034_STATUS_HOOKSWITCH
#define DA9034_STATUS_REMCON
#define DA9034_STATUS_VBUS_VALID_4P55
#define DA9034_STATUS_VBUS_VALID_3P8
#define DA9034_STATUS_SESS_VALID_1P8
#define DA9034_STATUS_SRP_READY

extern int da903x_query_status(struct device *dev, unsigned int status);


/* NOTE: the functions below are not intended for use outside
 * of the DA903x sub-device drivers
 */
extern int da903x_write(struct device *dev, int reg, uint8_t val);
extern int da903x_writes(struct device *dev, int reg, int len, uint8_t *val);
extern int da903x_read(struct device *dev, int reg, uint8_t *val);
extern int da903x_reads(struct device *dev, int reg, int len, uint8_t *val);
extern int da903x_update(struct device *dev, int reg, uint8_t val, uint8_t mask);
extern int da903x_set_bits(struct device *dev, int reg, uint8_t bit_mask);
extern int da903x_clr_bits(struct device *dev, int reg, uint8_t bit_mask);
#endif /* __LINUX_PMIC_DA903X_H */