From patchwork Sat Jul 20 00:04:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2830726 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 F1F26C031A for ; Sat, 20 Jul 2013 00:04:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 383A1201F8 for ; Sat, 20 Jul 2013 00:04:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CBFD201EB for ; Sat, 20 Jul 2013 00:04:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752359Ab3GTAEy (ORCPT ); Fri, 19 Jul 2013 20:04:54 -0400 Received: from mail-ee0-f53.google.com ([74.125.83.53]:46771 "EHLO mail-ee0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751383Ab3GTAEy (ORCPT ); Fri, 19 Jul 2013 20:04:54 -0400 Received: by mail-ee0-f53.google.com with SMTP id c41so2679790eek.26 for ; Fri, 19 Jul 2013 17:04:52 -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:in-reply-to:references; bh=aLW89UNfaV10Ip7+/2CseUPfDmAh/lUguSaXeQei9zo=; b=ruDfqiWENlP6A3QYG5dPD23oau/75rVXBmBNle8qs4q2DfDBLu3M1D9wPmFlgVvqUf 7WzK/08eW2bghsAz3Mq1O/9kWm7FJhXOvpdniCWvg7nK3yWYIIikk4tNX+QmLZgsOCmA ICHIULPKaKc1sVA/hcudRoz+z2Wbf/G3qG6bkcM8Nkou/WiBhel8btc13PgXAXnkofg6 mO/V/HzeYaR19IQSPpIdIHjgPwW0JRfFo09J8oX9IAJCvrm4xtl4ChIfCAtHMJBsvcOZ txsSmHYPetoT/XVpY8SH0kP37MY/akLNVvyk/eH9tWDk++7WD59vTHwAlZk6RDvfwonR fc7Q== X-Received: by 10.15.10.8 with SMTP id f8mr18127061eet.110.1374278692834; Fri, 19 Jul 2013 17:04:52 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id bj46sm31186249eeb.13.2013.07.19.17.04.51 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Jul 2013 17:04:52 -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 , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Mark Brown , Thierry Reding , Tomasz Figa Subject: [PATCH v4 02/20] clocksource: samsung_pwm_timer: Correct definition of AUTORELOAD bit Date: Sat, 20 Jul 2013 02:04:15 +0200 Message-Id: <1374278673-25615-4-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1374278673-25615-1-git-send-email-tomasz.figa@gmail.com> References: <1374278673-25615-1-git-send-email-tomasz.figa@gmail.com> 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=-7.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 | 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 3fa5b07..e238fb0 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);