2 * Copyright 2013 Texas Instruments, Inc.
3 * Author: Dan Murphy <dmurphy@ti.com>
5 * Derived work from the pca953x.c driver
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #ifdef CONFIG_CMD_TCA642X
36 #define TCA642X_OUT_LOW 0
37 #define TCA642X_OUT_HIGH 1
38 #define TCA642X_POL_NORMAL 0
39 #define TCA642X_POL_INVERT 1
40 #define TCA642X_DIR_OUT 0
41 #define TCA642X_DIR_IN 1
43 /* Default to an address that hopefully won't corrupt other i2c devices */
44 #ifndef CONFIG_SYS_I2C_TCA642X_ADDR
45 #define CONFIG_SYS_I2C_TCA642X_ADDR (~0)
48 /* Default to an address that hopefully won't corrupt other i2c devices */
49 #ifndef CONFIG_SYS_I2C_TCA642X_BUS_NUM
50 #define CONFIG_SYS_I2C_TCA642X_BUS_NUM (0)
53 struct tca642x_bank_info {
57 uint8_t configuration_reg;
60 int tca642x_set_val(uchar chip, uint8_t gpio_bank,
61 uint8_t reg_bit, uint8_t data);
62 int tca642x_set_pol(uchar chip, uint8_t gpio_bank,
63 uint8_t reg_bit, uint8_t data);
64 int tca642x_set_dir(uchar chip, uint8_t gpio_bank,
65 uint8_t reg_bit, uint8_t data);
66 int tca642x_get_val(uchar chip, uint8_t gpio_bank);
67 int tca642x_set_inital_state(uchar chip, struct tca642x_bank_info init_data[]);
69 #endif /* __TCA642X_H_ */