#include <linux/delay.h>
#include <linux/i2c/tca6424.h>
#include <linux/ktime.h>
-#include "../drivers/gpio/soft_interrupt.h"
+#include "../drivers/gpio/expand_gpio_soft_interrupt.h"
#if 0
-#define TCA6424DEB
#define DBG(x...) printk(KERN_INFO x)
#else
#define DBG(x...)
#endif
-
-#if 0
#define DBGERR(x...) printk(KERN_INFO x)
-#else
-#define DBGERR(x...)
-#endif
+
struct tca6424_chip {
chip = container_of(gc, struct tca6424_chip, gpio_chip);
- #ifdef CONFIG_SOFT_INTERRUPT
+ #ifdef CONFIG_EXPAND_GPIO_SOFT_INTERRUPT
ret = wait_untill_input_reg_flash( );
if(ret<0)
+ {
return -1;
+ DBGERR("**********tca6424 get value error***************\n");
+ }
#endif
gpioPortNum = pin_num/8;
if((gpioPortNum>=TCA6424_PortNum)||(gpioPortPinNum>=portnum[gpioPortNum]))
return -1;
- #ifndef CONFIG_SOFT_INTERRUPT
+ #ifndef CONFIG_EXPAND_GPIO_SOFT_INTERRUPT
uint8_t reg_val;
ret = tca6424_read_reg(chip->client, Regaddr, ®_val);
if (ret < 0)
chip->client = client;
chip->names = pdata->names;
- #ifdef CONFIG_SOFT_INTERRUPT
+ #ifdef CONFIG_EXPAND_GPIO_SOFT_INTERRUPT
chip->expand = &expand_irq_data;
chip->expand->gpio_irq_start =pdata->gpio_irq_start;
chip->expand->irq_pin_num = pdata->irq_pin_num;
}
i2c_set_clientdata(client, chip);
- #ifdef CONFIG_SOFT_INTERRUPT
+ #ifdef CONFIG_EXPAND_GPIO_SOFT_INTERRUPT
expand_irq_init(chip,&chip->gtca6424_struct,tca6424_irq_read_inputreg);
#endif
return 0;