From patchwork Wed Apr 29 14:50:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 20728 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3TErQqc007448 for ; Wed, 29 Apr 2009 14:53:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751407AbZD2OxZ (ORCPT ); Wed, 29 Apr 2009 10:53:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751631AbZD2OxZ (ORCPT ); Wed, 29 Apr 2009 10:53:25 -0400 Received: from rv-out-0506.google.com ([209.85.198.231]:24878 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751407AbZD2OxY (ORCPT ); Wed, 29 Apr 2009 10:53:24 -0400 Received: by rv-out-0506.google.com with SMTP id f9so926960rvb.1 for ; Wed, 29 Apr 2009 07:53:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=Ik00NWKdrhWhn6dH9K8W3CLanxluEf92yQjQQd5yuuk=; b=t3ZqZNZHyKRXX6Bwhe/Xzw8NCgnTqsF4tSDQU1ucO4f6zc8kH9Z0BbELpjn9dOIdYm Nh+hFwCDsvw0HMnxhj09wdkPT/B/p3/A05uNeIgB10WLRsJ8GNVgmgER8ccjsXCeZI9h 9Vww7EMHC6p4dzNzMJWmQbeyaR2EviKwgiLK8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=Rk4/A1kx8rH0iL1xgrT1NS/Snfbr00wz09C5/T8+VUSrXRpJNCATqxeAAqUFsN986i aYRCaO4+ua6IseECzg/gZ8LGluH0DKgVCnSMZ5ENAkJd9VARcmXB9f+cbBY1nG+SO5Uv COJ2sScMgm7hH3hKFjMawqw8+MFCqfPEhB3IE= Received: by 10.114.53.18 with SMTP id b18mr308618waa.6.1241016803995; Wed, 29 Apr 2009 07:53:23 -0700 (PDT) Received: from rx1.opensource.se (210-227-008-067.jp.fiberbit.net [210.227.8.67]) by mx.google.com with ESMTPS id j39sm1494002waf.10.2009.04.29.07.53.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 29 Apr 2009 07:53:23 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: johnstul@us.ibm.com, Magnus Damm , lethal@linux-sh.org Date: Wed, 29 Apr 2009 23:50:37 +0900 Message-Id: <20090429145037.16210.25996.sendpatchset@rx1.opensource.se> Subject: [PATCH] clocksource: sh_cmt 16-bit fixes Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm This patch contains various fixes for 16-bit cmt hardware. With this applied periodic clockevents work fine on sh7203. Signed-off-by: Magnus Damm --- drivers/clocksource/sh_cmt.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/drivers/clocksource/sh_cmt.c +++ work/drivers/clocksource/sh_cmt.c 2009-04-21 21:58:39.000000000 +0900 @@ -153,16 +153,18 @@ static int sh_cmt_enable(struct sh_cmt_p pr_err("sh_cmt: cannot enable clock \"%s\"\n", cfg->clk); return ret; } - *rate = clk_get_rate(p->clk) / 8; /* make sure channel is disabled */ sh_cmt_start_stop_ch(p, 0); /* configure channel, periodic mode and maximum timeout */ - if (p->width == 16) - sh_cmt_write(p, CMCSR, 0); - else + if (p->width == 16) { + *rate = clk_get_rate(p->clk) / 512; + sh_cmt_write(p, CMCSR, 0x43); + } else { + *rate = clk_get_rate(p->clk) / 8; sh_cmt_write(p, CMCSR, 0x01a4); + } sh_cmt_write(p, CMCOR, 0xffffffff); sh_cmt_write(p, CMCNT, 0); @@ -545,7 +547,7 @@ static int sh_cmt_setup(struct sh_cmt_pr if (resource_size(res) == 6) { p->width = 16; p->overflow_bit = 0x80; - p->clear_bits = ~0xc0; + p->clear_bits = ~0x80; } else { p->width = 32; p->overflow_bit = 0x8000;