From e155e38830194f59fe26310421bba70f875cab25 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Wed, 3 Apr 2019 14:40:19 +0200 Subject: i2c: gpio: flag atomic capability if possible If switching GPIOs does not sleep, then we can support atomic transfers. Signed-off-by: Wolfram Sang Reviewed-by: Linus Walleij Reviewed-by Andy Shevchenko Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-gpio.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/i2c') diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index bba5c4627de3..9684a0ac2a6d 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c @@ -413,6 +413,8 @@ static int i2c_gpio_probe(struct platform_device *pdev) if (gpiod_cansleep(priv->sda) || gpiod_cansleep(priv->scl)) dev_warn(dev, "Slow GPIO pins might wreak havoc into I2C/SMBus bus timing"); + else + bit_data->can_do_atomic = true; bit_data->setsda = i2c_gpio_setsda_val; bit_data->setscl = i2c_gpio_setscl_val; -- cgit v1.2.3-58-ga151