Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp117609yba; Wed, 3 Apr 2019 05:43:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/7KSSYlCpSG8WtIiB20BRttYqEWXsOAq1VKjwpo0qIcPKi//dQ66W9yltUoXrUEZSoUwN X-Received: by 2002:a65:5c42:: with SMTP id v2mr13140813pgr.360.1554295400486; Wed, 03 Apr 2019 05:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554295400; cv=none; d=google.com; s=arc-20160816; b=a4TYZSaY4MayeHvUr7zEm4FxpDAINLk0QRc4KIovw87cCS4NxZk8qEN0xYxoNKsQO7 lfkyOHdboRLgskE25FDaYXmCvDWIsZEcS8ByGxb45h3gt1p1XRZd7vHA5PxhQrXRD9Rc 3GIyIbLJpH/pVM9fkEOPspsS2QQmtR1QzKMaqpjeU7AVmuodCAR+YSlgSTECvWs2TQ5y iHVTb0+xZrUdaKDYqHmKETAn9X8f0AI1BHrHGNaXllJ1TavMmGUF7cscSUqaJcYNfJsi k8E0e1TIbLNg2thU960LhrYcVQbCUsfofmeP+MKnfQIik/6QsnHE6bG0zpM5jTn72ErE Owbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=aMI+Xg5dm6KCQeyH1RMzAZW3XmV49Ix8N/K9pPqRWgQ=; b=RFwb/igcthMCdxJu3wBx0hL9iSR+3nUhflk2iiGZ/+xTvx93YyMCu17j62F9VcpYwh GpcfhYmG/BQ49ZVPIoTdaRbqKPD6stCevoRrlj04k10xDQ1SxRD/8kY3VxjwDf4k4Z/z /LxV2WixO0tULKa32NU/l/986IlcWH1bdZRak350Pv3fyEmFJzg3JLPlJC1tXhy8f9oS CvfyuMpU2qo5IH/Pd7fYVmhuN8HLVlFKiVQZns1kl9SN501Equ/SurkrO6Kftu25bgvs sRqyliB36KZQ9dDYlRNTSnec5VSQTZUJFiCfCRhzGDUVbHxTHHTnCxJ1k3c1u4CTeePu wr6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si434198plk.125.2019.04.03.05.43.05; Wed, 03 Apr 2019 05:43:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726892AbfDCMk7 (ORCPT + 99 others); Wed, 3 Apr 2019 08:40:59 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If switching GPIOs does not sleep, then we can support atomic transfers. Signed-off-by: Wolfram Sang --- 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; -- 2.11.0