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: 50227 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ABDFD216E1 for ; Tue, 23 Jun 2015 14:10:21 +0000 (UTC) Received: by laer2 with SMTP id r2sf3252081lae.3 for ; Tue, 23 Jun 2015 07:10:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=7wKAL38jXXP+x0LDJeO+smcrcLN5OM+qQm45YuCuiZY=; b=kVoZCDVyHgiRRDR1mZYnkHq/iugTbrVhj58th2D72I2F3lWFGtWoMEJxP+gmun7/Lc WV4bsPpHjZBgyOgGZuIjPf24lY8j2NgMnaCveSHdMvvCooNci4NqLqYtE3xAQtOhfP3Y j5fqYfKXk8JSYdiY31q18/Yxp9+bB7qChV4wLuVhtSgwYSII8Kxn6P1AC5FkDef7gc9J mocf3UGbe5g4g03t8cyw/3mBJ3RjFwdtJpVlT1MjNb4ZsX6ZHLfo1aNeRFrLAlbXQGIg yhdVLIOFTi5kweWprhZYxkE0fu4tnudI1A855tx/qDsjA8smE33By1C8eC0MtqaSvGkp 3YSw== X-Gm-Message-State: ALoCoQnfNXhzq50MFUDXsBnVazGtLDUhugQ4FQRWxKK7Aj2j1vQRdLqt6MPmuS/RMHMiiEqUgf8w X-Received: by 10.113.11.3 with SMTP id ee3mr32366617lbd.9.1435068620441; Tue, 23 Jun 2015 07:10:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.130 with SMTP id b2ls56919laa.4.gmail; Tue, 23 Jun 2015 07:10:20 -0700 (PDT) X-Received: by 10.112.162.38 with SMTP id xx6mr35356250lbb.110.1435068620280; Tue, 23 Jun 2015 07:10:20 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id o3si370215laj.143.2015.06.23.07.10.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jun 2015 07:10:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by lagi2 with SMTP id i2so7422394lag.2 for ; Tue, 23 Jun 2015 07:10:20 -0700 (PDT) X-Received: by 10.152.4.163 with SMTP id l3mr2501502lal.35.1435068620058; Tue, 23 Jun 2015 07:10:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3103001lbb; Tue, 23 Jun 2015 07:10:18 -0700 (PDT) X-Received: by 10.68.94.2 with SMTP id cy2mr54790994pbb.56.1435068617950; Tue, 23 Jun 2015 07:10:17 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si34851916pat.213.2015.06.23.07.10.16; Tue, 23 Jun 2015 07:10:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933196AbbFWOKO (ORCPT + 7 others); Tue, 23 Jun 2015 10:10:14 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:38227 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754850AbbFWOKL (ORCPT ); Tue, 23 Jun 2015 10:10:11 -0400 Received: by wibdq8 with SMTP id dq8so18122072wib.1 for ; Tue, 23 Jun 2015 07:10:09 -0700 (PDT) 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 Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@stlinux.com, linux-clk@vger.kernel.org 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> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: gabriel.fernandez@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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++) { /*