From patchwork Mon Jul 22 20:54:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2831576 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F0F1C0319 for ; Mon, 22 Jul 2013 20:55:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E2A420237 for ; Mon, 22 Jul 2013 20:55:09 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 647EE2022A for ; Mon, 22 Jul 2013 20:55:08 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V1N8K-0003E9-HF; Mon, 22 Jul 2013 20:55:04 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V1N8H-00062d-UY; Mon, 22 Jul 2013 20:55:01 +0000 Received: from mail-bk0-x22d.google.com ([2a00:1450:4008:c01::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V1N8F-00061I-H9 for linux-arm-kernel@lists.infradead.org; Mon, 22 Jul 2013 20:55:00 +0000 Received: by mail-bk0-f45.google.com with SMTP id je9so2677728bkc.18 for ; Mon, 22 Jul 2013 13:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding:content-type; bh=1ntUwiAh90vT09YWjBcU/rPeeUhgUoDZOpKlsBr5fCg=; b=ivUNhgttXdNTi3/EcFGPFGW+0hwuG7PwH8FvUpMJYKj4yhRFUGNypwAnkx8iZt0Qve /u0E5d141d9srlV8JwTc4rgP7PRWyy/MZO3HH3SbnhufsRkbMkVSZ8+X3Y/d/g1zVa6W +/COzHh1eB585aDH8VNnQeGVYiDHRq1W94RMW9m/GcSamH96G5K7IqH6js71EDlNylzG 9XWdMpgB0Oj5FFUWkcydzTEqu2jS8Z7InNQ+lnrCBcV5QqcRQOAZwk5RW0BZKCTf9fYJ /Pr161C7cGqUR3ChyT7bChaSxy8iXce3sJ2634JneJ8yWg3WbVmuLLOF7Q0SWV4sPpuo susA== X-Received: by 10.205.13.71 with SMTP id pl7mr4170880bkb.108.1374526477754; Mon, 22 Jul 2013 13:54:37 -0700 (PDT) Received: from flatron.localnet (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id m6sm7435152bki.7.2013.07.22.13.54.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 13:54:36 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v5 02/20] clocksource: samsung_pwm_timer: Correct definition of AUTORELOAD bit Date: Mon, 22 Jul 2013 22:54:33 +0200 Message-ID: <3872385.JQ2jXzack4@flatron> User-Agent: KMail/4.10.5 (Linux/3.10.1-gentoo; KDE/4.10.5; x86_64; ; ) In-Reply-To: <1374278673-25615-4-git-send-email-tomasz.figa@gmail.com> References: <1374278673-25615-1-git-send-email-tomasz.figa@gmail.com> <1374278673-25615-4-git-send-email-tomasz.figa@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130722_165459_708285_D0DFE30D X-CRM114-Status: GOOD ( 10.86 ) X-Spam-Score: -2.0 (--) Cc: linux-pwm@vger.kernel.org, Kukjin Kim , Heiko =?ISO-8859-1?Q?St=FCbner?= , Arnd Bergmann , Mark Brown , Thierry Reding , Olof Johansson , Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP PWM channel 4 has its autoreload bit located at different position. This patch fixes the driver to account for that. This fixes a problem with the clocksource hanging after it overflows because it is not reloaded any more. Signed-off-by: Tomasz Figa --- drivers/clocksource/samsung_pwm_timer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Changes since v4: - made the new definition more readable. diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c index 3fa5b07..89947c3 100644 --- a/drivers/clocksource/samsung_pwm_timer.c +++ b/drivers/clocksource/samsung_pwm_timer.c @@ -47,7 +47,11 @@ #define TCON_START(chan) (1 << (4 * (chan) + 0)) #define TCON_MANUALUPDATE(chan) (1 << (4 * (chan) + 1)) #define TCON_INVERT(chan) (1 << (4 * (chan) + 2)) -#define TCON_AUTORELOAD(chan) (1 << (4 * (chan) + 3)) +#define _TCON_AUTORELOAD(chan) (1 << (4 * (chan) + 3)) +#define _TCON_AUTORELOAD4(chan) (1 << (4 * (chan) + 2)) +/* Position of autoreload bit of channel 4 (5 in TCON reg.) is different. */ +#define TCON_AUTORELOAD(chan) \ + ((chan < 5) ? _TCON_AUTORELOAD(chan) : _TCON_AUTORELOAD4(chan)) DEFINE_SPINLOCK(samsung_pwm_lock); EXPORT_SYMBOL(samsung_pwm_lock);