Commit 37f3965d authored by Daniel Mack's avatar Daniel Mack Committed by Greg Kroah-Hartman

sc16is7xx: Always use falling edge IRQ

The driver currently only uses IRQF_TRIGGER_FALLING if the probing
happened without a device-tree setup. The device however will always
generate falling edges on its IRQ line, so let's use that flag in
all cases.
Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
Link: https://lore.kernel.org/r/20200521091152.404404-4-daniel@zonque.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4dd31f1f
...@@ -1176,7 +1176,7 @@ static int sc16is7xx_gpio_direction_output(struct gpio_chip *chip, ...@@ -1176,7 +1176,7 @@ static int sc16is7xx_gpio_direction_output(struct gpio_chip *chip,
static int sc16is7xx_probe(struct device *dev, static int sc16is7xx_probe(struct device *dev,
const struct sc16is7xx_devtype *devtype, const struct sc16is7xx_devtype *devtype,
struct regmap *regmap, int irq, unsigned long flags) struct regmap *regmap, int irq)
{ {
struct sched_param sched_param = { .sched_priority = MAX_RT_PRIO / 2 }; struct sched_param sched_param = { .sched_priority = MAX_RT_PRIO / 2 };
unsigned long freq = 0, *pfreq = dev_get_platdata(dev); unsigned long freq = 0, *pfreq = dev_get_platdata(dev);
...@@ -1304,7 +1304,7 @@ static int sc16is7xx_probe(struct device *dev, ...@@ -1304,7 +1304,7 @@ static int sc16is7xx_probe(struct device *dev,
/* Setup interrupt */ /* Setup interrupt */
ret = devm_request_irq(dev, irq, sc16is7xx_irq, ret = devm_request_irq(dev, irq, sc16is7xx_irq,
flags, dev_name(dev), s); IRQF_TRIGGER_FALLING, dev_name(dev), s);
if (!ret) if (!ret)
return 0; return 0;
...@@ -1378,7 +1378,6 @@ static struct regmap_config regcfg = { ...@@ -1378,7 +1378,6 @@ static struct regmap_config regcfg = {
static int sc16is7xx_spi_probe(struct spi_device *spi) static int sc16is7xx_spi_probe(struct spi_device *spi)
{ {
const struct sc16is7xx_devtype *devtype; const struct sc16is7xx_devtype *devtype;
unsigned long flags = 0;
struct regmap *regmap; struct regmap *regmap;
int ret; int ret;
...@@ -1399,14 +1398,13 @@ static int sc16is7xx_spi_probe(struct spi_device *spi) ...@@ -1399,14 +1398,13 @@ static int sc16is7xx_spi_probe(struct spi_device *spi)
const struct spi_device_id *id_entry = spi_get_device_id(spi); const struct spi_device_id *id_entry = spi_get_device_id(spi);
devtype = (struct sc16is7xx_devtype *)id_entry->driver_data; devtype = (struct sc16is7xx_devtype *)id_entry->driver_data;
flags = IRQF_TRIGGER_FALLING;
} }
regcfg.max_register = (0xf << SC16IS7XX_REG_SHIFT) | regcfg.max_register = (0xf << SC16IS7XX_REG_SHIFT) |
(devtype->nr_uart - 1); (devtype->nr_uart - 1);
regmap = devm_regmap_init_spi(spi, &regcfg); regmap = devm_regmap_init_spi(spi, &regcfg);
return sc16is7xx_probe(&spi->dev, devtype, regmap, spi->irq, flags); return sc16is7xx_probe(&spi->dev, devtype, regmap, spi->irq);
} }
static int sc16is7xx_spi_remove(struct spi_device *spi) static int sc16is7xx_spi_remove(struct spi_device *spi)
...@@ -1445,7 +1443,6 @@ static int sc16is7xx_i2c_probe(struct i2c_client *i2c, ...@@ -1445,7 +1443,6 @@ static int sc16is7xx_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id) const struct i2c_device_id *id)
{ {
const struct sc16is7xx_devtype *devtype; const struct sc16is7xx_devtype *devtype;
unsigned long flags = 0;
struct regmap *regmap; struct regmap *regmap;
if (i2c->dev.of_node) { if (i2c->dev.of_node) {
...@@ -1454,14 +1451,13 @@ static int sc16is7xx_i2c_probe(struct i2c_client *i2c, ...@@ -1454,14 +1451,13 @@ static int sc16is7xx_i2c_probe(struct i2c_client *i2c,
return -ENODEV; return -ENODEV;
} else { } else {
devtype = (struct sc16is7xx_devtype *)id->driver_data; devtype = (struct sc16is7xx_devtype *)id->driver_data;
flags = IRQF_TRIGGER_FALLING;
} }
regcfg.max_register = (0xf << SC16IS7XX_REG_SHIFT) | regcfg.max_register = (0xf << SC16IS7XX_REG_SHIFT) |
(devtype->nr_uart - 1); (devtype->nr_uart - 1);
regmap = devm_regmap_init_i2c(i2c, &regcfg); regmap = devm_regmap_init_i2c(i2c, &regcfg);
return sc16is7xx_probe(&i2c->dev, devtype, regmap, i2c->irq, flags); return sc16is7xx_probe(&i2c->dev, devtype, regmap, i2c->irq);
} }
static int sc16is7xx_i2c_remove(struct i2c_client *client) static int sc16is7xx_i2c_remove(struct i2c_client *client)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment