From patchwork Tue Jun 7 11:19:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 9160579 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 167B360572 for ; Tue, 7 Jun 2016 11:21:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0530D25EF7 for ; Tue, 7 Jun 2016 11:21:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDA5E281D2; Tue, 7 Jun 2016 11:21:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0ED825EF7 for ; Tue, 7 Jun 2016 11:21:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754729AbcFGLVL (ORCPT ); Tue, 7 Jun 2016 07:21:11 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:37613 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754635AbcFGLVG (ORCPT ); Tue, 7 Jun 2016 07:21:06 -0400 Received: by mail-wm0-f54.google.com with SMTP id k204so64392340wmk.0 for ; Tue, 07 Jun 2016 04:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qvfT1C0C1meyY4SB7mtDwH0ySMicYpuLn5zVn0jDJKs=; b=iWsefyAeXKPxkukNbUwr2B2f7pkwyeOfflyFbRU6crR7QSNi1Ho8Nwsdz83KM+dmJl I6W9WlMCyOyxZXxxWtYRZm8/UlwZKYVmx3jvyVkFftUBfWQwAC1H7VjHborXtes3Ijm/ HNRHfuF17h9h+x+bAI+/SkYh0hR2t8M8PnUeY= 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=qvfT1C0C1meyY4SB7mtDwH0ySMicYpuLn5zVn0jDJKs=; b=CcX/fT15X+5KqDSO1DVeDiIOdsnoW4cZUbx4fmNCIefpvQ9ejVz/e0sMTEE1pOLnGf TPzyviqGhFRYzi6VKOQHrFLysgAlbUVL0kx5Nck0buquSpgAIpARmAk80v8PbLXFqYl9 KXPKcJ8Sb7xcHcKbiBEYm9x99qOYC7zw3iCZyKUdehVqI4KcNqjp7ZGvGC+QQP183s6f v2jgxn2c//Y7kM+wW7YO9EE1VH1b6660Jg1LzdKgk1pdWtur5LPNWm4WUdQvCOIWyRaF Xgb99SmqhSCO8xOMt/lDY141BRF4d6jNkEHaVV9txMI/0Ie2mK4bEuL2dFTAp9PU3sh+ p2FA== X-Gm-Message-State: ALyK8tKzEwWcsLk/gd69VXP+egHsi9rJeEicBctVlnP0Kcc5dZDXiC5Dp8Sg+C6QdbkXaufk X-Received: by 10.194.117.35 with SMTP id kb3mr2388193wjb.136.1465298465322; Tue, 07 Jun 2016 04:21:05 -0700 (PDT) Received: from localhost.localdomain (host81-129-171-215.range81-129.btcentralplus.com. [81.129.171.215]) by smtp.gmail.com with ESMTPSA id t199sm14466371wmt.11.2016.06.07.04.21.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jun 2016 04:21:04 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, maxime.coquelin@st.com, patrice.chotard@st.com, mturquette@baylibre.com, sboyd@codeaurora.org, broonie@kernel.org, linux-clk@vger.kernel.org, linux-spi@vger.kernel.org, Lee Jones Subject: [PATCH 6/6] spi: st-ssc4: Remove 'no clocking' hack Date: Tue, 7 Jun 2016 12:19:30 +0100 Message-Id: <20160607111930.10375-7-lee.jones@linaro.org> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160607111930.10375-1-lee.jones@linaro.org> References: <20160607111930.10375-1-lee.jones@linaro.org> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Due to the newly upstreamed 'critical clocks' API we can now safely handle clocking in the SPI and I2C drivers without fear of catastrophically crippling the running platform. Signed-off-by: Lee Jones Acked-by: Mark Brown --- drivers/spi/spi-st-ssc4.c | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/drivers/spi/spi-st-ssc4.c b/drivers/spi/spi-st-ssc4.c index d5adf9f..a56eca0 100644 --- a/drivers/spi/spi-st-ssc4.c +++ b/drivers/spi/spi-st-ssc4.c @@ -68,32 +68,6 @@ struct spi_st { struct completion done; }; -static int spi_st_clk_enable(struct spi_st *spi_st) -{ - /* - * Current platforms use one of the core clocks for SPI and I2C. - * If we attempt to disable the clock, the system will hang. - * - * TODO: Remove this when platform supports power domains. - */ - return 0; - - return clk_prepare_enable(spi_st->clk); -} - -static void spi_st_clk_disable(struct spi_st *spi_st) -{ - /* - * Current platforms use one of the core clocks for SPI and I2C. - * If we attempt to disable the clock, the system will hang. - * - * TODO: Remove this when platform supports power domains. - */ - return; - - clk_disable_unprepare(spi_st->clk); -} - /* Load the TX FIFO */ static void ssc_write_tx_fifo(struct spi_st *spi_st) { @@ -349,7 +323,7 @@ static int spi_st_probe(struct platform_device *pdev) goto put_master; } - ret = spi_st_clk_enable(spi_st); + ret = clk_prepare_enable(spi_st->clk); if (ret) goto put_master; @@ -408,7 +382,7 @@ static int spi_st_probe(struct platform_device *pdev) return 0; clk_disable: - spi_st_clk_disable(spi_st); + clk_disable_unprepare(spi_st->clk); put_master: spi_master_put(master); return ret; @@ -419,7 +393,7 @@ static int spi_st_remove(struct platform_device *pdev) struct spi_master *master = platform_get_drvdata(pdev); struct spi_st *spi_st = spi_master_get_devdata(master); - spi_st_clk_disable(spi_st); + clk_disable_unprepare(spi_st->clk); pinctrl_pm_select_sleep_state(&pdev->dev); @@ -435,7 +409,7 @@ static int spi_st_runtime_suspend(struct device *dev) writel_relaxed(0, spi_st->base + SSC_IEN); pinctrl_pm_select_sleep_state(dev); - spi_st_clk_disable(spi_st); + clk_disable_unprepare(spi_st->clk); return 0; } @@ -446,7 +420,7 @@ static int spi_st_runtime_resume(struct device *dev) struct spi_st *spi_st = spi_master_get_devdata(master); int ret; - ret = spi_st_clk_enable(spi_st); + ret = clk_prepare_enable(spi_st->clk); pinctrl_pm_select_default_state(dev); return ret;