Message ID | 1445581797-19693-1-git-send-email-t-kristo@ti.com |
---|---|
State | Accepted |
Commit | 62c8c20af92ea312ecb22cec4e83082e5843076b |
Headers | show
Return-Path: <patchwork-forward+bncBDA2TOHIQEARBQNIU6YQKGQEHEKAR5I@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 2761822AA5 for <linaro@patches.linaro.org>; Fri, 23 Oct 2015 06:31:30 +0000 (UTC) Received: by wicfg8 with SMTP id fg8sf6228866wic.0 for <linaro@patches.linaro.org>; Thu, 22 Oct 2015 23:31:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :mime-version:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:cc:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=Lq/cgZiH0RhRsUr9wMolB9wsQ0gpjIJDtxzWxVfkwxE=; b=lsi6q3po4zwPFzGsUvkXx/wyi/2PyjYIOpSrIJR5k38vh5/wQIUJzYXWQZJ3T0kG4L GF3bw5NPM/Q/gcdYGj0NYN+B/HyjwTY/7fzlYLP0NN0+/HavMyrz6FU/DCJDVFiI4TIn 06kcpTUxYqf7ofHnd0i1vRMH09OM62s1oOygPd2Axtm2IijZ13YzKWVVV86+4cwjtUSD 3pryHRhWQdtfrrAMPBa1XTrxCnuXcS2/chcfUsb7kGTvFaGsbzX0trhG32bAUwyQAiZm nfcdT9omfQJvO1MUU89jYEgjF86rnPSiS5AB9Nm9XQ8s2CCBnHxGC9YTXuslj3t7MTVP DOfQ== X-Gm-Message-State: ALoCoQmdUDh/IN05eRmejKHRYYo4AkKZVpLqv5tP0lIPmK/WrLqCtMA2m/Btuk0MaCz5kZX3Yi4d X-Received: by 10.112.151.9 with SMTP id um9mr4506270lbb.19.1445581889206; Thu, 22 Oct 2015 23:31:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.218.208 with SMTP id r199ls424021lfg.2.gmail; Thu, 22 Oct 2015 23:31:29 -0700 (PDT) X-Received: by 10.25.170.11 with SMTP id t11mr6918656lfe.20.1445581889069; Thu, 22 Oct 2015 23:31:29 -0700 (PDT) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id 70si11801348lfw.5.2015.10.22.23.31.28 for <patchwork-forward@linaro.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Oct 2015 23:31:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by lffv3 with SMTP id v3so72449291lff.0 for <patchwork-forward@linaro.org>; Thu, 22 Oct 2015 23:31:28 -0700 (PDT) X-Received: by 10.112.159.136 with SMTP id xc8mr8618110lbb.76.1445581888896; Thu, 22 Oct 2015 23:31:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1008267lbq; Thu, 22 Oct 2015 23:31:28 -0700 (PDT) X-Received: by 10.51.17.34 with SMTP id gb2mr2388617igd.80.1445581887924; Thu, 22 Oct 2015 23:31:27 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id o18si1963213igs.37.2015.10.22.23.31.27 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Oct 2015 23:31:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZpVrn-00018g-QT; Fri, 23 Oct 2015 06:30:19 +0000 Received: from comal.ext.ti.com ([198.47.26.152]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZpVrk-0008Pp-5o for linux-arm-kernel@lists.infradead.org; Fri, 23 Oct 2015 06:30:17 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t9N6Tpvm006601; Fri, 23 Oct 2015 01:29:51 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9N6Tosb026746; Fri, 23 Oct 2015 01:29:51 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Fri, 23 Oct 2015 01:29:51 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t9N6Tl7f023245; Fri, 23 Oct 2015 01:29:48 -0500 From: Tero Kristo <t-kristo@ti.com> To: <a.zummo@towertech.it>, <alexandre.belloni@free-electrons.com> Subject: [PATCH] rtc: ds1307: Fix alarm programming for mcp794xx Date: Fri, 23 Oct 2015 09:29:57 +0300 Message-ID: <1445581797-19693-1-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151022_233017_056001_B5E1E70B X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.152 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [198.47.26.152 listed in wl.mailspike.net] 0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: <patchwork-forward.linaro.org> List-Unsubscribe: <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com>, <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Post: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: t-kristo@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 |
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index a705e64..188006c 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -718,9 +718,9 @@ static int mcp794xx_set_alarm(struct device *dev, struct rtc_wkalrm *t) regs[3] = bin2bcd(t->time.tm_sec); regs[4] = bin2bcd(t->time.tm_min); regs[5] = bin2bcd(t->time.tm_hour); - regs[6] = bin2bcd(t->time.tm_wday) + 1; + regs[6] = bin2bcd(t->time.tm_wday + 1); regs[7] = bin2bcd(t->time.tm_mday); - regs[8] = bin2bcd(t->time.tm_mon) + 1; + regs[8] = bin2bcd(t->time.tm_mon + 1); /* Clear the alarm 0 interrupt flag. */ regs[6] &= ~MCP794XX_BIT_ALMX_IF;
mcp794xx alarm registers must be written in BCD format. However, the alarm programming logic neglected this by adding one to the value after bin2bcd conversion has been already done, writing bad values to month register in case the alarm being set is in October. In this case, the alarm month value becomes 0x0a instead of the expected 0x10. Fix by moving the +1 addition within the bin2bcd call also. Fixes: 1d1945d261a2 ("drivers/rtc/rtc-ds1307.c: add alarm support for mcp7941x chips") Signed-off-by: Tero Kristo <t-kristo@ti.com> --- drivers/rtc/rtc-ds1307.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)