1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef _I2C_PCA9538_H_ 4 #define _I2C_PCA9538_H_ 5 6 #include <types.h> 7 #include <device/device.h> 8 9 /* Register layout */ 10 #define INPUT_REG 0x00 11 #define OUTPUT_REG 0x01 12 #define INPUT_INVERT_REG 0x02 13 #define IO_CONFIG_REG 0x03 14 15 /* Provide some functions to read input and write output values. */ 16 uint8_t pca9538_read_input(void); 17 void pca9538_set_output(uint8_t val); 18 /* 19 * Provide a way to get the right device structure for the I/O expander. 20 * The user of this driver has to provide this function if read/write of I/O 21 * values on the I/O expander is needed. 22 */ 23 struct device *pca9538_get_dev(void); 24 25 #endif /* _I2C_PCA9538_H_ */ 26