From patchwork Wed Apr 3 12:40:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10883615 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4BF81139A for ; Wed, 3 Apr 2019 12:41:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38E3C28895 for ; Wed, 3 Apr 2019 12:41:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D20628501; Wed, 3 Apr 2019 12:41:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3CDA289DD for ; Wed, 3 Apr 2019 12:41:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726585AbfDCMk6 (ORCPT ); Wed, 3 Apr 2019 08:40:58 -0400 Received: from sauhun.de ([88.99.104.3]:48360 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726724AbfDCMkm (ORCPT ); Wed, 3 Apr 2019 08:40:42 -0400 Received: from localhost (p54B3311F.dip0.t-ipconnect.de [84.179.49.31]) by pokefinder.org (Postfix) with ESMTPSA id 17FCD3E43D3; Wed, 3 Apr 2019 14:40:41 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peter Rosin , Stefan Lengfeld , linux-omap@vger.kernel.org, linux-tegra@vger.kernel.org, Linus Walleij , Andy Shevchenko , Wolfram Sang Subject: [PATCH 12/12] i2c: gpio: flag atomic capability if possible Date: Wed, 3 Apr 2019 14:40:19 +0200 Message-Id: <20190403124019.8947-13-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190403124019.8947-1-wsa+renesas@sang-engineering.com> References: <20190403124019.8947-1-wsa+renesas@sang-engineering.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If switching GPIOs does not sleep, then we can support atomic transfers. Signed-off-by: Wolfram Sang Reviewed-by: Linus Walleij --- drivers/i2c/busses/i2c-gpio.c | 2 ++ 1 file changed, 2 insertions(+) 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;