7#ifndef ZEPHYR_INCLUDE_DRIVERS_MFD_ITE_IT8801_H_
8#define ZEPHYR_INCLUDE_DRIVERS_MFD_ITE_IT8801_H_
18#define IT8801_REG_GISR 0xf9
19#define IT8801_REG_MASK_GISR_GKSIIS BIT(6)
21#define IT8801_REG_GIECR 0xfb
22#define IT8801_REG_MASK_GKSIIE BIT(3)
23#define IT8801_REG_MASK_GGPIOIE BIT(2)
28#define IT8801_REG_LBVIDR 0xfe
29#define IT8801_REG_HBVIDR 0xff
45#define IT8801_REG_SMBCR 0xfa
46#define IT8801_REG_MASK_ARE BIT(4)
51#define IT8801_GPIOAFS_FUN1 0x0
52#define IT8801_GPIOAFS_FUN2 0x01
53#define IT8801_GPIOAFS_FUN3 0x02
56#define IT8801_GPIODIR BIT(5)
58#define IT8801_GPIOIOT_OD BIT(4)
59#define IT8801_GPIOIOT_INT_FALL BIT(4)
60#define IT8801_GPIOIOT_INT_RISE BIT(3)
62#define IT8801_GPIOPOL BIT(2)
64#define IT8801_GPIOPDE BIT(1)
66#define IT8801_GPIOPUE BIT(0)
72#define IT8801_REG_MASK_KSOSDIC BIT(7)
73#define IT8801_REG_MASK_KSE BIT(6)
74#define IT8801_REG_MASK_AKSOSC BIT(5)
79#define PWM_IT8801_FREQ 32895
81#define PWM_IT8801_PUSH_PULL BIT(8)
83#define IT8801_REG_PWMODDSR 0x5f
85#define IT8801_PWMMCR_MCR_MASK GENMASK(1, 0)
86#define IT8801_PWMMCR_MCR_OFF 0
87#define IT8801_PWMMCR_MCR_BLINKING 1
88#define IT8801_PWMMCR_MCR_BREATHING 2
89#define IT8801_PWMMCR_MCR_ON 3
94#define IT8801_DT_INST_MFDCTRL(inst, idx) DT_INST_PHANDLE_BY_IDX(inst, mfdctrl, idx)
96#define IT8801_DT_INST_MFDCTRL_LEN(inst) DT_INST_PROP_LEN_OR(inst, mfdctrl, 0)
98#define IT8801_DEV_MFD(idx, inst) \
99 DEVICE_DT_GET(DT_PHANDLE(IT8801_DT_INST_MFDCTRL(inst, idx), altctrls))
100#define IT8801_DEV_MFD_PIN(idx, inst) DT_PHA(IT8801_DT_INST_MFDCTRL(inst, idx), altctrls, pin)
101#define IT8801_DEV_MFD_FUNC(idx, inst) DT_PHA(IT8801_DT_INST_MFDCTRL(inst, idx), altctrls, alt_func)
103#define IT8801_DT_MFD_ITEMS_FUNC(idx, inst) \
105 .gpiocr = IT8801_DEV_MFD(idx, inst), \
106 .pin = IT8801_DEV_MFD_PIN(idx, inst), \
107 .alt_func = IT8801_DEV_MFD_FUNC(idx, inst), \
110#define IT8801_DT_MFD_ITEMS_LIST(inst) \
111 {LISTIFY(IT8801_DT_INST_MFDCTRL_LEN(inst), \
112 IT8801_DT_MFD_ITEMS_FUNC, (,), \
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
static const struct it8801_vendor_id_t it8801_id_verify[]
Definition mfd_ite_it8801.h:36
void(* it8801_callback_handler_t)(const struct device *dev)
Definition mfd_ite_it8801.h:122
#define IT8801_REG_LBVIDR
Definition mfd_ite_it8801.h:28
int mfd_it8801_configure_pins(const struct i2c_dt_spec *i2c_dev, const struct device *dev, uint8_t pin, uint8_t func)
void mfd_it8801_register_interrupt_callback(const struct device *mfd, struct it8801_mfd_callback *callback)
#define IT8801_REG_HBVIDR
Definition mfd_ite_it8801.h:29
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:411
Complete I2C DT information.
Definition i2c.h:77
Definition mfd_ite_it8801.h:124
it8801_callback_handler_t cb
Definition mfd_ite_it8801.h:126
const struct device * dev
Definition mfd_ite_it8801.h:127
sys_snode_t node
Definition mfd_ite_it8801.h:125
Definition mfd_ite_it8801.h:31
uint8_t reg
Definition mfd_ite_it8801.h:33
uint8_t chip_id
Definition mfd_ite_it8801.h:32