From patchwork Thu Sep 18 15:18:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 390840 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 57AAE140179 for ; Fri, 19 Sep 2014 01:19:19 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756813AbaIRPTQ (ORCPT ); Thu, 18 Sep 2014 11:19:16 -0400 Received: from bhuna.collabora.co.uk ([93.93.135.160]:40979 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756730AbaIRPTP (ORCPT ); Thu, 18 Sep 2014 11:19:15 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: javier) with ESMTPSA id 71FC4609FDA From: Javier Martinez Canillas To: Lee Jones Cc: Wolfram Sang , Dmitry Torokhov , Doug Anderson , Simon Glass , Bill Richardson , Andrew Bresticker , Derek Basehore , Gwendal Grignou , linux-i2c@vger.kernel.org, linux-input@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Javier Martinez Canillas Subject: [PATCH v4 2/5] i2c: i2c-cros-ec-tunnel: Set retries to 3 Date: Thu, 18 Sep 2014 17:18:55 +0200 Message-Id: <1411053538-17237-3-git-send-email-javier.martinez@collabora.co.uk> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411053538-17237-1-git-send-email-javier.martinez@collabora.co.uk> References: <1411053538-17237-1-git-send-email-javier.martinez@collabora.co.uk> Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Derek Basehore Since the i2c bus can get wedged on the EC sometimes, set the number of retries to 3. Since we un-wedge the bus immediately after the wedge happens, this is the correct fix since only one transfer will fail. Signed-off-by: Derek Basehore Reviewed-by: Doug Anderson Acked-by: Wolfram Sang Signed-off-by: Javier Martinez Canillas --- drivers/i2c/busses/i2c-cros-ec-tunnel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c index 3c15dcc..97e6369 100644 --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c @@ -16,6 +16,8 @@ #include #include +#define I2C_MAX_RETRIES 3 + /** * struct ec_i2c_device - Driver data for I2C tunnel * @@ -290,6 +292,7 @@ static int ec_i2c_probe(struct platform_device *pdev) bus->adap.algo_data = bus; bus->adap.dev.parent = &pdev->dev; bus->adap.dev.of_node = np; + bus->adap.retries = I2C_MAX_RETRIES; err = i2c_add_adapter(&bus->adap); if (err) {