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: 2831575 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 5FBA69F243 for ; Mon, 22 Jul 2013 20:54:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80137201E5 for ; Mon, 22 Jul 2013 20:54:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 90AFC201F5 for ; Mon, 22 Jul 2013 20:54:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756904Ab3GVUyk (ORCPT ); Mon, 22 Jul 2013 16:54:40 -0400 Received: from mail-bk0-f43.google.com ([209.85.214.43]:48499 "EHLO mail-bk0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755913Ab3GVUyj (ORCPT ); Mon, 22 Jul 2013 16:54:39 -0400 Received: by mail-bk0-f43.google.com with SMTP id jm2so2677998bkc.2 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 Cc: linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org, Kukjin Kim , Arnd Bergmann , Olof Johansson , Sylwester Nawrocki , Heiko =?ISO-8859-1?Q?St=FCbner?= , Mark Brown , Thierry Reding 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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);