From patchwork Wed Jun 8 17:10:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 99511 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id AC888B6FCC for ; Thu, 9 Jun 2011 03:13:18 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4DBB42820A; Wed, 8 Jun 2011 19:13:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cie03ynGt16u; Wed, 8 Jun 2011 19:13:17 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E1B4D28211; Wed, 8 Jun 2011 19:13:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6A0FA28316 for ; Wed, 8 Jun 2011 19:13:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FabOdWUFSH2G for ; Wed, 8 Jun 2011 19:13:09 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from TX2EHSOBE009.bigfish.com (tx2ehsobe004.messaging.microsoft.com [65.55.88.14]) by theia.denx.de (Postfix) with ESMTPS id 4F25B28309 for ; Wed, 8 Jun 2011 19:13:07 +0200 (CEST) Received: from mail157-tx2-R.bigfish.com (10.9.14.244) by TX2EHSOBE009.bigfish.com (10.9.40.29) with Microsoft SMTP Server id 14.1.225.22; Wed, 8 Jun 2011 17:13:06 +0000 Received: from mail157-tx2 (localhost.localdomain [127.0.0.1]) by mail157-tx2-R.bigfish.com (Postfix) with ESMTP id 39DC5DB054C; Wed, 8 Jun 2011 17:13:06 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail157-tx2 (localhost.localdomain [127.0.0.1]) by mail157-tx2 (MessageSwitch) id 130755316472800_3358; Wed, 8 Jun 2011 17:12:44 +0000 (UTC) Received: from TX2EHSMHS027.bigfish.com (unknown [10.9.14.238]) by mail157-tx2.bigfish.com (Postfix) with ESMTP id A2D13FE006B; Wed, 8 Jun 2011 17:10:51 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS027.bigfish.com (10.9.99.127) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 8 Jun 2011 17:10:51 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.289.8; Wed, 8 Jun 2011 12:10:50 -0500 Received: from efes.am.freescale.net (efes.am.freescale.net [10.82.123.3]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p58HAnoN019340; Wed, 8 Jun 2011 12:10:49 -0500 (CDT) From: Timur Tabi To: , , Date: Wed, 8 Jun 2011 12:10:49 -0500 Message-ID: <1307553049-1001-1-git-send-email-timur@freescale.com> X-Mailer: git-send-email 1.7.3.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH] powerpc/p1022ds: set the clock-frequency property only if the clock is enabled X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The clock-frequency property in an audio codec's device tree node is set to the input clock frequency for that codec. On the Freescale P1022DS reference board, the input clock is enabled only if the hwconfig 'audclk' option is set. Therefore, the property should only be set in the device tree if the clock is actually enabled. Signed-off-by: Timur Tabi --- This patch fixes a real bug in the P1022DS, so please apply it to 2011.06. board/freescale/p1022ds/p1022ds.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/board/freescale/p1022ds/p1022ds.c b/board/freescale/p1022ds/p1022ds.c index 8ef627f..456d9b0 100644 --- a/board/freescale/p1022ds/p1022ds.c +++ b/board/freescale/p1022ds/p1022ds.c @@ -308,7 +308,8 @@ int board_eth_init(bd_t *bis) * ft_codec_setup - fix up the clock-frequency property of the codec node * * Update the clock-frequency property based on the value of the 'audclk' - * hwconfig option. If audclk is not specified, then default to 12.288MHz. + * hwconfig option. If audclk is not specified, then don't write anything + * to the device tree, because it means that the codec clock is disabled. */ static void ft_codec_setup(void *blob, const char *compatible) { @@ -317,12 +318,15 @@ static void ft_codec_setup(void *blob, const char *compatible) u32 freq; audclk = hwconfig_arg("audclk", &arglen); - if (audclk && (strncmp(audclk, "11", 2) == 0)) - freq = 11289600; - else - freq = 12288000; + if (audclk) { + if (strncmp(audclk, "11", 2) == 0) + freq = 11289600; + else + freq = 12288000; - do_fixup_by_compat_u32(blob, compatible, "clock-frequency", freq, 1); + do_fixup_by_compat_u32(blob, compatible, "clock-frequency", + freq, 1); + } } void ft_board_setup(void *blob, bd_t *bd)