From patchwork Tue Jun 18 17:41:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2744491 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9219B9F8E1 for ; Tue, 18 Jun 2013 17:42:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8770920565 for ; Tue, 18 Jun 2013 17:42:13 +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 5641D2013F for ; Tue, 18 Jun 2013 17:42:12 +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 1Uozuz-0001oe-8n; Tue, 18 Jun 2013 17:42:09 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uozuw-0007Gj-PY; Tue, 18 Jun 2013 17:42:06 +0000 Received: from mail-bk0-x232.google.com ([2a00:1450:4008:c01::232]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uozuu-0007Fy-8f for linux-arm-kernel@lists.infradead.org; Tue, 18 Jun 2013 17:42:04 +0000 Received: by mail-bk0-f50.google.com with SMTP id ik8so1944118bkc.9 for ; Tue, 18 Jun 2013 10:41:42 -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:x-mailer; bh=P0E0d4A3zKHRkcnCvD6c+2vAPF4ey+GkIwq76IT0Iv4=; b=lOoNNQqeTifZsBPz+LRFPFWPT+wGdV2tyufvOKKc+GJz4j4yJwoTU4o+4ETx6n+lSy QzmbmL8RsdXozJJjgzYfIw+DuRqrk4/R5aoHsnE3KYPVGgnT8aXN3sJBkfNuLiNiZjJ6 kTU6RbeXwe1i/LtgRQtPIM7gUBDvoU4SyOUcXEF0GVucPh8MnsZa9QivY+Dm9cjKHMEG cJhkIwhmkWYMm85J6nCPyutpLUHituFnfaSf4pGwjxSVLeOVj5OH4BMofRyKwzj35Vsm yqEFuHeuVt5GQmORPv7RtfQpP/j7cmTNvkyTc0YHmFAF+V4REheW7529jE57Dz83CYGG zDNw== X-Received: by 10.204.60.142 with SMTP id p14mr2792157bkh.11.1371577301958; Tue, 18 Jun 2013 10:41:41 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id hh3sm6472621bkc.5.2013.06.18.10.41.39 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Jun 2013 10:41:40 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH] clocksource: samsung_pwm: Correct definition of AUTORELOAD bit Date: Tue, 18 Jun 2013 19:41:07 +0200 Message-Id: <1371577267-2860-1-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.2.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130618_134204_468020_E8248CF8 X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: -2.0 (--) Cc: Kukjin Kim , Arnd Bergmann , Tomasz Figa , John Stultz , Olof Johansson , Thomas Gleixner , 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: , MIME-Version: 1.0 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.3 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 (logically channel 5 in TCON register) has its autoreload bit located at different position. This patch fixes the driver to account for this. This fixes a problem with clocksource hanging after it overflows because it is not reloaded any more. Signed-off-by: Tomasz Figa --- drivers/clocksource/samsung_pwm_timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c index 2977043..6af178f 100644 --- a/drivers/clocksource/samsung_pwm_timer.c +++ b/drivers/clocksource/samsung_pwm_timer.c @@ -47,7 +47,8 @@ #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) \ + + (((chan) < 5) ? 3 : 2))) DEFINE_SPINLOCK(samsung_pwm_lock); EXPORT_SYMBOL(samsung_pwm_lock);