From patchwork Wed May 1 15:32:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 2507871 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 8AFBADF230 for ; Wed, 1 May 2013 15:32:41 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXZ1K-0007CM-ST; Wed, 01 May 2013 15:32:39 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXZ1H-00064a-Av; Wed, 01 May 2013 15:32:35 +0000 Received: from mail-pb0-x233.google.com ([2607:f8b0:400e:c01::233]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXZ1F-000643-4S for linux-arm-kernel@lists.infradead.org; Wed, 01 May 2013 15:32:33 +0000 Received: by mail-pb0-f51.google.com with SMTP id rq13so776740pbb.38 for ; Wed, 01 May 2013 08:32:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:x-mailer:mime-version :content-transfer-encoding:x-gm-message-state; bh=5lgr7YjbocuZZZjARqbr4uM7HHaDaaA/87tNqmwiz4o=; b=mCCijUIuDsFRG4rfoR1nz3/KoiucPTkermW2mNj9rkCvfoYBaQih2KHOL6gntNH9J5 X7DMhW8DR2HAKaZzLYAp3lim8Xzq7TVRTJ3qKTzpOxC5oNUKxovYkiYD1bvBCincAb27 dapWPOgVMzM5LfjWxeBVIqteioKZ9QpGawDQbri5aGj+6GUyhoXxluL/EG5jdJ6kKNoz H8/NDdxySHlXcnd8mqItXpZkAcJ0G5Bnzx9GcRVL10wcMI8tUt5qayX/ZhoqcCgQbnOT 579sClRT0CS3S01pA1sI4Rx7caDT7TwGGAefgblyJM7bLNeThicZjss7xHX4YV8R5BPh ZhfQ== X-Received: by 10.68.179.35 with SMTP id dd3mr4492578pbc.197.1367422329591; Wed, 01 May 2013 08:32:09 -0700 (PDT) Received: from [192.168.0.102] (114-39-109-191.dynamic.hinet.net. [114.39.109.191]) by mx.google.com with ESMTPSA id cq1sm3392081pbc.13.2013.05.01.08.32.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 08:32:08 -0700 (PDT) Message-ID: <1367422325.8160.2.camel@phoenix> Subject: [RFT][PATCH 2/2] clk: wm831x: Fix wm831x_clkout_get_parent From: Axel Lin To: Mike Turquette Date: Wed, 01 May 2013 23:32:05 +0800 In-Reply-To: <1367422261.8160.1.camel@phoenix> References: <1367422261.8160.1.camel@phoenix> X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 X-Gm-Message-State: ALoCoQlD2bhU3GxX3tbY9+JDCAoXEMN87ZmOpEadMxOoLrdEW95KlgSEDVEfr3+8HS9A1pm15B5r X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130501_113233_268373_8BA0C98F X-CRM114-Status: GOOD ( 12.81 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Mark Brown , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@opensource.wolfsonmicro.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Current code looks strange because calling wm831x_clkout_set_parent() with 0 as parent parameter, wm831x_clkout_get_parent() will return 1. According to the datasheet: R16528 (4090h) Clock Control1 BIT 0: CLKOUT output source select 0 = FLL output 1 = 32.768kHz oscillator Thus fix the entry order in wm831x_clkout_parents[] to make it has the same meaning as the datasheet and make the return value of wm831x_clkout_get_parent() consistent with the parent pass to wm831x_clkout_set_parent(). Signed-off-by: Axel Lin --- drivers/clk/clk-wm831x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-wm831x.c b/drivers/clk/clk-wm831x.c index 4bdf0b0..58d08a6 100644 --- a/drivers/clk/clk-wm831x.c +++ b/drivers/clk/clk-wm831x.c @@ -299,8 +299,8 @@ static void wm831x_clkout_unprepare(struct clk_hw *hw) } static const char *wm831x_clkout_parents[] = { - "xtal", "fll", + "xtal", }; static u8 wm831x_clkout_get_parent(struct clk_hw *hw) @@ -318,9 +318,9 @@ static u8 wm831x_clkout_get_parent(struct clk_hw *hw) } if (ret & WM831X_CLKOUT_SRC) - return 0; - else return 1; + else + return 0; } static int wm831x_clkout_set_parent(struct clk_hw *hw, u8 parent)