From patchwork Thu Oct 29 11:34:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Corna X-Patchwork-Id: 537815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B610514076E for ; Thu, 29 Oct 2015 23:41:53 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751254AbbJ2Mlw (ORCPT ); Thu, 29 Oct 2015 08:41:52 -0400 Received: from mo4.mail-out.ovh.net ([178.32.228.4]:60283 "EHLO mo4.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbbJ2Mlv (ORCPT ); Thu, 29 Oct 2015 08:41:51 -0400 Received: from mail170.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo4.mail-out.ovh.net (Postfix) with SMTP id 55C0CFFBD15 for ; Thu, 29 Oct 2015 13:02:59 +0100 (CET) Received: from localhost (HELO queueout) (127.0.0.1) by localhost with SMTP; 29 Oct 2015 14:02:59 +0200 Received: from poul.org (HELO thinkDebian.local) (nicola@corna.info@91.121.220.9) by ns0.ovh.net with SMTP; 29 Oct 2015 14:02:57 +0200 From: Nicola Corna To: Wolfram Sang , Stephen Warren , Lee Jones , Eric Anholt , Jonathan Cameron Cc: linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , linux-iio@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Nicola Corna Subject: [PATCH v2 2/5] i2c: add I2C_AQ_NO_CLK_STRETCH to i2c-algo-bit.c Date: Thu, 29 Oct 2015 12:34:24 +0100 Message-Id: <1446118467-26453-2-git-send-email-nicola@corna.info> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1446118467-26453-1-git-send-email-nicola@corna.info> References: <1445976718-7449-1-git-send-email-nicola@corna.info> <1446118467-26453-1-git-send-email-nicola@corna.info> X-Ovh-Tracer-Id: 777152411871634286 X-Ovh-Remote: 91.121.220.9 (poul.org) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekhedrudelucetufdoteggodftvfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekhedrudelucetufdoteggodftvfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Add I2C_AQ_NO_CLK_STRETCH to drivers/i2c/algos/i2c-algo-bit.c when getscl is not available. Signed-off-by: Nicola Corna --- drivers/i2c/algos/i2c-algo-bit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index 899bede..9d233bb 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c @@ -617,6 +617,10 @@ const struct i2c_algorithm i2c_bit_algo = { }; EXPORT_SYMBOL(i2c_bit_algo); +const struct i2c_adapter_quirks i2c_bit_quirk_no_clk_stretch = { + .flags = I2C_AQ_NO_CLK_STRETCH, +}; + /* * registering functions to load algorithms at runtime */ @@ -635,6 +639,8 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap, /* register new adapter to i2c module... */ adap->algo = &i2c_bit_algo; adap->retries = 3; + if (bit_adap->getscl == NULL) + adap->quirks = &i2c_bit_quirk_no_clk_stretch; ret = add_adapter(adap); if (ret < 0)