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: 2147581 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id BBEDF3FCF6 for ; Fri, 15 Feb 2013 13:14:36 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U6L54-0004CB-Pp; Fri, 15 Feb 2013 13:11:59 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U6Kr3-0007lJ-0h for linux-arm-kernel@lists.infradead.org; Fri, 15 Feb 2013 12:57:29 +0000 Received: by mail-wi0-f172.google.com with SMTP id ez12so1111781wid.5 for ; Fri, 15 Feb 2013 04:57:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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=gVYw7JvRsct1TUr+SwNRPxaOW2UU5n++/ZKcFlbFiwOQtSMEW+qTWTokE4ynBA9c0K oZ859AK7pB56a6MeZWtwyHde84xn5ihj0MlrB9XMb+T/m7pbnSMwVi6RSOz8ezi3NwhN jy2hebrXxhFOtg5/AAjzm1b1zYntT+RCe8VYsQsv/KF3Cj0ArF4xj8gNbK04drpqygcJ ByrPzwzaHCoX+wpyRvzHugClMWcvFwjUPgvgd1nCoqKDww/4oIPuRJdI2QxOOQ66JjPP RoGBHK55fURWFEmjzjg1w8TzNIkR5bS6/8j05Mk9iIRs/dnlgBiZl3+NMiyoWuP++pUP fa7A== 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 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: ALoCoQkhmtJhjZh4oWhAiIei2ZdQQ5pkElzYcZSlMEH0CCmZqT/CArnrCrsgi29IGqkh2YQDNm5s X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130215_075729_262719_E07F5FCF X-CRM114-Status: UNSURE ( 9.49 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.172 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Jonas Aaberg , Lee Jones , linus.walleij@stericsson.com, arnd@arndb.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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;