Skip to content
Snippets Groups Projects
Commit e7cce1e9 authored by Gianfranco Mariotti's avatar Gianfranco Mariotti
Browse files

[DRIVER] pca953x: add dts property gpio-base

parent a58c25ff
No related branches found
No related tags found
No related merge requests found
......@@ -949,6 +949,8 @@ static int pca953x_probe(struct i2c_client *client,
const struct i2c_device_id *i2c_id)
{
struct pca953x_platform_data *pdata;
struct device *dev = &client->dev;
struct device_node *np = dev->of_node;
struct pca953x_chip *chip;
int irq_base = 0;
int ret;
......@@ -967,9 +969,14 @@ static int pca953x_probe(struct i2c_client *client,
invert = pdata->invert;
chip->names = pdata->names;
} else {
int gpio_base;
struct gpio_desc *reset_gpio;
chip->gpio_start = -1;
if (of_property_read_u32(np, "gpio-base", &gpio_base) == 0) {
chip->gpio_start = gpio_base;
dev_info(&client->dev, "GPIO expander base number will be %d\n", gpio_base);
}
irq_base = 0;
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment