From patchwork Tue Jun 23 14:09:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Fernandez X-Patchwork-Id: 6661661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 826199F380 for ; Tue, 23 Jun 2015 14:13:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9E94204FC for ; Tue, 23 Jun 2015 14:13:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA104203F7 for ; Tue, 23 Jun 2015 14:13:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z7OuQ-0007tx-1i; Tue, 23 Jun 2015 14:10:42 +0000 Received: from mail-wg0-f42.google.com ([74.125.82.42]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z7OuF-0007gS-Ru for linux-arm-kernel@lists.infradead.org; Tue, 23 Jun 2015 14:10:32 +0000 Received: by wguu7 with SMTP id u7so10781803wgu.3 for ; Tue, 23 Jun 2015 07:10:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Bod9NvPCHa5GN5PsQczaCZOTMQKoZEZiegbj0LaSlq0=; b=leyyLnBR57yceB0pcPn/9cDR+/qxkMInqgtaH4qdFCo5/b395HYMY9jEwRbF8XxjS+ S1U0XLfJ9SFFiwJ8tVoZ9Dr1URW2MUmGIPSMHfwpSkgMmSqzTrDm5xq0JaC0qzjc+6gR NS8bXqYe6npKdHdoDPpEV/kbZJSBbcVDXxpfnu9rhD3HI1BNDfoCoTowycE+vr49YdxA Eto/Ce6N9Y3iWuyO681+srBwlH/DeHgWWw+jn9k5ujjSPB3wOj2Nd1NflZBXdMYmt/Dw OBbI4JVdzpEUKmzhG3Eux3KgvsLD+EWwnD2cMR/4E67MHq2bVw4RVgxmlmEGVa5423mq og+Q== X-Gm-Message-State: ALoCoQkTDFEsLr04EFaFoE15gQsVt6L/74hQJ3cv/0BwNa4I3aO/3UXYU24s7oKCC/9yRpzhGxKH X-Received: by 10.194.192.98 with SMTP id hf2mr62370933wjc.23.1435068609780; Tue, 23 Jun 2015 07:10:09 -0700 (PDT) Received: from lmenx315.lme.st.com (LPuteaux-656-1-48-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id lk5sm22556790wic.24.2015.06.23.07.10.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jun 2015 07:10:09 -0700 (PDT) From: Gabriel Fernandez To: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Srinivas Kandagatla , Maxime Coquelin , Patrice Chotard , Russell King , Michael Turquette , Stephen Boyd , Gabriel Fernandez , Peter Griffin , Pankaj Dev , Olivier Bideau , Javier Martinez Canillas , Geert Uytterhoeven , Fabian Frederick Subject: [PATCH 1/9] drivers: clk: st: Incorrect clocks status Date: Tue, 23 Jun 2015 16:09:19 +0200 Message-Id: <1435068567-30995-2-git-send-email-gabriel.fernandez@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435068567-30995-1-git-send-email-gabriel.fernandez@linaro.org> References: <1435068567-30995-1-git-send-email-gabriel.fernandez@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150623_071032_079810_EC3DF8EC X-CRM114-Status: GOOD ( 16.85 ) X-Spam-Score: -2.6 (--) Cc: devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@stlinux.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 In the clk_summary output, the h/w status of DivMux is incorrect (Parent and Enable status), since the clk_mux_ops.get_parent() returns -ERRCODE when clock is OFF. Signed-off-by: Pankaj Dev Signed-off-by: Gabriel Fernandez --- drivers/clk/st/clkgen-mux.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/clk/st/clkgen-mux.c b/drivers/clk/st/clkgen-mux.c index 4fbe6e0..c94b56b 100644 --- a/drivers/clk/st/clkgen-mux.c +++ b/drivers/clk/st/clkgen-mux.c @@ -128,7 +128,7 @@ static int clkgena_divmux_is_enabled(struct clk_hw *hw) __clk_hw_set_clk(mux_hw, hw); - return (s8)clk_mux_ops.get_parent(mux_hw) > 0; + return ((s8)clk_mux_ops.get_parent(mux_hw) >= 0); } static u8 clkgena_divmux_get_parent(struct clk_hw *hw) @@ -138,11 +138,13 @@ static u8 clkgena_divmux_get_parent(struct clk_hw *hw) __clk_hw_set_clk(mux_hw, hw); - genamux->muxsel = clk_mux_ops.get_parent(mux_hw); - if ((s8)genamux->muxsel < 0) { - pr_debug("%s: %s: Invalid parent, setting to default.\n", - __func__, __clk_get_name(hw->clk)); - genamux->muxsel = 0; + if (genamux->muxsel == CKGAX_CLKOPSRC_SWITCH_OFF) { + genamux->muxsel = clk_mux_ops.get_parent(mux_hw); + if ((s8)genamux->muxsel < 0) { + pr_debug("%s: %s: Invalid parent, setting to default.\n", + __func__, __clk_get_name(hw->clk)); + genamux->muxsel = 0; + } } return genamux->muxsel; @@ -254,6 +256,7 @@ static struct clk *clk_register_genamux(const char *name, } else { genamux->mux.reg = reg + muxdata->mux_offset; } + genamux->muxsel = CKGAX_CLKOPSRC_SWITCH_OFF; for (i = 0; i < NUM_INPUTS; i++) { /*