Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1453674 > unrolled thread

[PATCH] phy: exynos-mipi-video: simplify check for coupled phy status

Started byMarek Szyprowski <m.szyprowski@samsung.com>
First post2016-08-02 11:00 +0200
Last post2016-08-02 12:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] phy: exynos-mipi-video: simplify check for coupled phy status Marek Szyprowski <m.szyprowski@samsung.com> - 2016-08-02 11:00 +0200
    Re: [PATCH] phy: exynos-mipi-video: simplify check for coupled phy  status Sylwester Nawrocki <s.nawrocki@samsung.com> - 2016-08-02 11:20 +0200
    [PATCH] phy: exynos-mipi-video: simplify check for coupled phy status Marek Szyprowski <m.szyprowski@samsung.com> - 2016-08-02 12:30 +0200

#1453674 — [PATCH] phy: exynos-mipi-video: simplify check for coupled phy status

FromMarek Szyprowski <m.szyprowski@samsung.com>
Date2016-08-02 11:00 +0200
Subject[PATCH] phy: exynos-mipi-video: simplify check for coupled phy status
Message-ID<s1DIm-27j-13@gated-at.bofh.it>
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 <m.szyprowski@samsung.com>
---
 drivers/phy/phy-exynos-mipi-video.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c
index 8b851f7..e185234 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_id].phy->power_count == 0) {
 		regmap_read(state->regmaps[data->enable_map], data->enable_reg,
 			    &val);
 		val &= ~data->enable_val;
-- 
1.9.1

[toc] | [next] | [standalone]


#1453687 — Re: [PATCH] phy: exynos-mipi-video: simplify check for coupled phy status

FromSylwester Nawrocki <s.nawrocki@samsung.com>
Date2016-08-02 11:20 +0200
SubjectRe: [PATCH] phy: exynos-mipi-video: simplify check for coupled phy status
Message-ID<s1E1I-2tq-21@gated-at.bofh.it>
In reply to#1453674
On 08/02/2016 10:52 AM, Marek Szyprowski wrote:
> 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 <m.szyprowski@samsung.com>

Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

[toc] | [prev] | [next] | [standalone]


#1453726

FromMarek Szyprowski <m.szyprowski@samsung.com>
Date2016-08-02 12:30 +0200
Message-ID<s1F7r-36W-23@gated-at.bofh.it>
In reply to#1453674
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 <m.szyprowski@samsung.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/phy/phy-exynos-mipi-video.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

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;
-- 
1.9.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web