From patchwork Thu May 28 12:06:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 26725 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 n4SC9k3Z009209 for ; Thu, 28 May 2009 12:09:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755000AbZE1MJ0 (ORCPT ); Thu, 28 May 2009 08:09:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755653AbZE1MJ0 (ORCPT ); Thu, 28 May 2009 08:09:26 -0400 Received: from rv-out-0506.google.com ([209.85.198.237]:20532 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755000AbZE1MJZ (ORCPT ); Thu, 28 May 2009 08:09:25 -0400 Received: by rv-out-0506.google.com with SMTP id f9so1648393rvb.1 for ; Thu, 28 May 2009 05:09:27 -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=przxo+mLX4rrRuT+SPUGroqt0pfn0BZTFrxqcbWEkSY=; b=qUeEvb59HkVFcKDNToNpgwMpe86pyzGA0/uWET8amZtICe/3+1N6tFMB1/Mb81cXkS GtNToGBGOixLi6KXnM+ifdvsYs8y8LrHCBGJ3eh/uEmMEE1kdU5JyQnhYITlzNhD0Uzu J93mv+JG9ymkNtXtqI3NW2sv71jaeZc5K79yk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=eaqSx2i/vewuv2AEORS+p8cg8BDP1RAynVEGSmGEnbIKO1i5VruQ4IKnCsPHf+tNlj IqvsTQhFD1BPl6h0GEHPtPXsyFG8Dna/urnPM8sXx0/U/PA5Rw5QJ9pdddemxLia09ol 8Iqwb+UR2AWU+kMG5a1xkLqlWqYAKrJWi7AuU= Received: by 10.141.71.6 with SMTP id y6mr615814rvk.273.1243512567636; Thu, 28 May 2009 05:09:27 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id b8sm6936309rvf.54.2009.05.28.05.09.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 28 May 2009 05:09:26 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Thu, 28 May 2009 21:06:17 +0900 Message-Id: <20090528120617.5901.52374.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: sh7785 pll configuration from mode pin Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm This patch modifies the sh7785 clock code to use the MODE4 value to switch between 72x and 36x PLL multiplication. Signed-off-by: Magnus Damm --- arch/sh/kernel/cpu/sh4a/clock-sh7785.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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/arch/sh/kernel/cpu/sh4a/clock-sh7785.c +++ work/arch/sh/kernel/cpu/sh4a/clock-sh7785.c 2009-05-28 16:42:18.000000000 +0900 @@ -16,6 +16,7 @@ #include #include #include +#include static unsigned int div2[] = { 1, 2, 4, 6, 8, 12, 16, 18, 24, 32, 36, 48 }; @@ -80,12 +81,11 @@ static struct clk_ops frqmr_clk_ops = { static unsigned long pll_recalc(struct clk *clk) { - /* - * XXX: PLL1 multiplier is locked for the default clock mode, - * when mode pin detection and configuration support is added, - * select the multiplier dynamically. - */ - return clk->parent->rate * 36; + int multiplier; + + multiplier = test_mode_pin(MODE_PIN_MODE4) ? 36 : 72; + + return clk->parent->rate * multiplier; } static struct clk_ops pll_clk_ops = {