TPS68470_GPIO_MODE_MASK, 0x00);
}
+static int tps68470_enable_i2c_daisy_chain(struct gpio_chip *gc)
+{
+ int ret;
+
+ ret = tps68470_gpio_input(gc, 1);
+ if (ret)
+ return ret;
+
+ return tps68470_gpio_input(gc, 2);
+}
+
static const char *tps68470_names[TPS68470_N_GPIO] = {
"gpio.0", "gpio.1", "gpio.2", "gpio.3",
"gpio.4", "gpio.5", "gpio.6",
static int tps68470_gpio_probe(struct platform_device *pdev)
{
struct tps68470_gpio_data *tps68470_gpio;
+ int ret;
tps68470_gpio = devm_kzalloc(&pdev->dev, sizeof(*tps68470_gpio),
GFP_KERNEL);
tps68470_gpio->gc.base = -1;
tps68470_gpio->gc.parent = &pdev->dev;
- return devm_gpiochip_add_data(&pdev->dev, &tps68470_gpio->gc, tps68470_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &tps68470_gpio->gc, tps68470_gpio);
+ if (ret)
+ return ret;
+
+ if (device_property_present(&pdev->dev, "daisy-chain-enable"))
+ ret = tps68470_enable_i2c_daisy_chain(&tps68470_gpio->gc);
+
+ return ret;
}
static struct platform_driver tps68470_gpio_driver = {