From patchwork Fri Feb 15 12:56:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14888 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1314023E01 for ; Fri, 15 Feb 2013 12:57:29 +0000 (UTC) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by fiordland.canonical.com (Postfix) with ESMTP id C3AA8A18025 for ; Fri, 15 Feb 2013 12:57:28 +0000 (UTC) Received: by mail-vb0-f44.google.com with SMTP id fr13so2172869vbb.3 for ; Fri, 15 Feb 2013 04:57:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=kkeB+3X3+4jiE66Y09YuGerplnKJ3c4VZG8ysd/+jeE=; b=ZyhOG7Y80tjMofd1V14Dl83tcYU8H7a1gcmyKLj0I6sXvEeFF7mq0c+l0ZceYdEMHV konHv9pfUwHqPlzMDFAE4HjL16v3F+PlH1htBwscGlizHa9Eh6kvtP4YNzJsOqpAHV9a 2PhVLNg2ehp1LtbEkiV599YknVpflKKLkyaN2/2DXu7cjKMfgSD7Idqo2+yBcF1V1ok/ TWHMrhQ2Mt01Wtt0IRdNEZkXM77pNuWnNK2YuFwrxk4VNb44w7uLDHR8SAqpL1FpAKQe zq7mcBNfLfeKu/+dF3qDM2tIuF7ksI6grf4OMQhu+lgCEr8PYPusuZteqO+t6q1CHGA7 qJlg== X-Received: by 10.221.0.79 with SMTP id nl15mr2923192vcb.41.1360933048268; Fri, 15 Feb 2013 04:57:28 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.221.4.5 with SMTP id oa5csp11354vcb; Fri, 15 Feb 2013 04:57:27 -0800 (PST) X-Received: by 10.180.73.238 with SMTP id o14mr2491010wiv.32.1360933046722; Fri, 15 Feb 2013 04:57:26 -0800 (PST) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by mx.google.com with ESMTPS id fw8si1052940wib.51.2013.02.15.04.57.26 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:57:26 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.181 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.181; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.181 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f181.google.com with SMTP id hm6so1118533wib.2 for ; Fri, 15 Feb 2013 04:57:26 -0800 (PST) X-Received: by 10.194.242.69 with SMTP id wo5mr4117451wjc.10.1360933046324; Fri, 15 Feb 2013 04:57:26 -0800 (PST) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id j4sm2852410wiz.10.2013.02.15.04.57.24 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:57:25 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sameo@linux.intel.com Cc: arnd@arndb.de, linus.walleij@stericsson.com, Jonas Aaberg , Lee Jones Subject: [PATCH 03/35] mfd: ab8500-gpadc: Reread on failure Date: Fri, 15 Feb 2013 12:56:34 +0000 Message-Id: <1360933026-30325-4-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> References: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmIW6HiVmUdL4Kofvn1PgMvjhe+t+g9qir4J718SoO7hCJ7pWS/ZclyZrnrOuiA5tTdofR7 From: Jonas Aaberg Reread the gpadc once upon failure. Signed-off-by: Jonas Aaberg Signed-off-by: Lee Jones Reviewed-by: Mattias WALLIN --- drivers/mfd/ab8500-gpadc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c index 34c1d04..1b48ac1 100644 --- a/drivers/mfd/ab8500-gpadc.c +++ b/drivers/mfd/ab8500-gpadc.c @@ -259,6 +259,11 @@ int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 channel) int voltage; ad_value = ab8500_gpadc_read_raw(gpadc, channel); + + /* On failure retry a second time */ + if (ad_value < 0) + ad_value = ab8500_gpadc_read_raw(gpadc, channel); + if (ad_value < 0) { dev_err(gpadc->dev, "GPADC raw value failed ch: %d\n", channel); return ad_value;