From patchwork Mon Nov 7 10:48:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 81032 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp946469qge; Mon, 7 Nov 2016 02:48:51 -0800 (PST) X-Received: by 10.98.41.3 with SMTP id p3mr12379997pfp.92.1478515731657; Mon, 07 Nov 2016 02:48:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e10si30557667pgn.206.2016.11.07.02.48.51; Mon, 07 Nov 2016 02:48:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751211AbcKGKsu (ORCPT + 4 others); Mon, 7 Nov 2016 05:48:50 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:11843 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751012AbcKGKst (ORCPT ); Mon, 7 Nov 2016 05:48:49 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OG9001WAQ19KI90@mailout1.w1.samsung.com>; Mon, 07 Nov 2016 10:48:45 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20161107104845eucas1p17c6892882f1b9e79df3eb8e993ed1cc0~EvjgEvGvM0858208582eucas1p1j; Mon, 7 Nov 2016 10:48:45 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 01.AE.28332.D0C50285; Mon, 7 Nov 2016 10:48:45 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20161107104844eucas1p2b5571119dff76e33d6ec038c359224f7~EvjffPLkE1652116521eucas1p2q; Mon, 7 Nov 2016 10:48:44 +0000 (GMT) X-AuditID: cbfec7f4-f791c6d000006eac-04-58205c0dea79 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 9F.17.10494.FEB50285; Mon, 7 Nov 2016 10:48:15 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OG9005KMQ136Z70@eusync3.samsung.com>; Mon, 07 Nov 2016 10:48:44 +0000 (GMT) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Kishon Vijay Abraham I , Krzysztof Kozlowski Subject: [PATCH RESEND] phy: exynos-mipi-video: simplify check for coupled phy status Date: Mon, 07 Nov 2016 11:48:32 +0100 Message-id: <1478515712-650-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsWy7djP87q8MQoRBjO38FlsnLGe1WLS/Qks Fhee9rBZnD+/gd3i8q45bBYzzu9jslh75C67xeE37awOHB6bVnWyefRtWcXocfzGdiaPz5vk AliiuGxSUnMyy1KL9O0SuDKeL5/KWNDIWzHt6Q6mBsZnXF2MnBwSAiYSk95/YoKwxSQu3FvP 1sXIxSEksJRR4sGav1DOZ0aJ5QtXM8N0vP60iBEisYxRorXlHCuE08AkMefFN7BZbAKGEl1v u9hAb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mHGCU4mJVEeDdEKUQI8aYk VlalFuXHF5XmpBYfYjQFWj6RWUo0OR8YO3kl8YYmhuaWhkbGFhbmRkZK4rxTP1wJFxJITyxJ zU5NLUgtgulj4uCUamDsFXvYv11l9lHuTFW5i+X+yyoqlhVHHTwYad1Tydq+qenq38XaUckz dlY46OaLOf9dpfHkkGmt5ubNwposc1ydOQIzSsQM0iU+WKxt3DP5P3PI3uu8u0x07C2k+t8U ephrefxLs+x9ue3517qTyULfL16ROHJwiUrvkR6BnnsmUr/rw06yvVZiKc5INNRiLipOBAB3 4596ZQIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161107104844eucas1p2b5571119dff76e33d6ec038c359224f7 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161107104844eucas1p2b5571119dff76e33d6ec038c359224f7 X-RootMTR: 20161107104844eucas1p2b5571119dff76e33d6ec038c359224f7 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org There is no need to access regmap of coupled phy to check its state - such information is already in the phy device itself, so use it directly. This let us to avoid possible access to registers of the device in the disabled power domain if the coupled phy is already disabled. Signed-off-by: Marek Szyprowski Acked-by: Sylwester Nawrocki --- drivers/phy/phy-exynos-mipi-video.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Javier Martinez Canillas diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c index 8b851f7..6bee04c 100644 --- a/drivers/phy/phy-exynos-mipi-video.c +++ b/drivers/phy/phy-exynos-mipi-video.c @@ -229,19 +229,6 @@ struct exynos_mipi_video_phy { spinlock_t slock; }; -static inline int __is_running(const struct exynos_mipi_phy_desc *data, - struct exynos_mipi_video_phy *state) -{ - u32 val; - int ret; - - ret = regmap_read(state->regmaps[data->resetn_map], data->resetn_reg, &val); - if (ret) - return 0; - - return val & data->resetn_val; -} - static int __set_phy_state(const struct exynos_mipi_phy_desc *data, struct exynos_mipi_video_phy *state, unsigned int on) { @@ -251,7 +238,7 @@ static int __set_phy_state(const struct exynos_mipi_phy_desc *data, /* disable in PMU sysreg */ if (!on && data->coupled_phy_id >= 0 && - !__is_running(state->phys[data->coupled_phy_id].data, state)) { + state->phys[data->coupled_phy_id].phy->power_count == 0) { regmap_read(state->regmaps[data->enable_map], data->enable_reg, &val); val &= ~data->enable_val;