summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2016-07-20 12:50:47 +0200
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:52:08 +0900
commite0576fa2c31a737f7aff0a8bac62e9aa8c3b6310 (patch)
tree1527c032590ef17437b374fcdc73e4b5711981fd /drivers/phy
parent6554c1366184dba45541753ec5d735abf4a3b50f (diff)
phy: exynos-mipi-video: simplify check for coupled phy status
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> Change-Id: If375eab85e6ec680e856a9eeafdf24823e8adb6e
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-exynos-mipi-video.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c
index 0bf1be22a913..3f264142583d 100644
--- a/drivers/phy/phy-exynos-mipi-video.c
+++ b/drivers/phy/phy-exynos-mipi-video.c
@@ -67,14 +67,6 @@ struct exynos_mipi_phy {
} phys[EXYNOS_MIPI_PHYS_NUM];
};
-static int __is_running(const struct exynos_mipi_phy_desc *data,
- struct exynos_mipi_phy *state)
-{
- u32 val;
- regmap_read(state->regmaps[data->reset_map], data->reset_reg, &val);
- return val & data->reset_val;
-}
-
static int __set_phy_state(const struct exynos_mipi_phy_desc *data,
struct exynos_mipi_phy *state, unsigned int on)
{
@@ -84,7 +76,7 @@ static int __set_phy_state(const struct exynos_mipi_phy_desc *data,
/* PHY PMU disable */
if (!on && data->coupled_id >= 0 &&
- !__is_running(state->phys[data->coupled_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;