Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755101AbcCWLJo (ORCPT ); Wed, 23 Mar 2016 07:09:44 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:28393 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755023AbcCWLJe (ORCPT ); Wed, 23 Mar 2016 07:09:34 -0400 X-AuditID: cbfec7f5-f792a6d000001302-03-56f2796a8cf2 From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Kishon Vijay Abraham I , Inki Dae , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 1/3] phy: exynos-mipi-video: Drop support for direct access to PMU Date: Wed, 23 Mar 2016 12:09:16 +0100 Message-id: <1458731358-773-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1458731358-773-1-git-send-email-m.szyprowski@samsung.com> References: <1458731358-773-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjluLIzCtJLcpLzFFi42I5/e/4Zd2syk9hBpP/WFhsnLGe1WLS/Qks Fq9fGFpceNrDZnF51xw2ixnn9zFZrD1yl93i8Jt2VgcOj74tqxg9jt/YzuTxeZNcAHMUl01K ak5mWWqRvl0CV8a+NXfYC+5IVDQcucvYwLhapIuRk0NCwERiz+T1rBC2mMSFe+vZuhi5OIQE ljJKrF86kRnCaWKSWNTazARSxSZgKNH1tosNxBYRcJa4/eEbC0gRs8AkJok96+8wgiSEBUIk XryZwwxiswioSuxdMxnM5hVwk5j6bDMzxDo5if8vV4AN5RRwl9i8/BrQIA6gbW4SrRM4JzDy LmBkWMUomlqaXFCclJ5rpFecmFtcmpeul5yfu4kREkpfdzAuPWZ1iFGAg1GJh7fg3McwIdbE suLK3EOMEhzMSiK8SuWfwoR4UxIrq1KL8uOLSnNSiw8xSnOwKInzztz1PkRIID2xJDU7NbUg tQgmy8TBKdXAqGv7eumz1QX713xQv6o6//r8Mvtlfss+qK5+pTPhZfk21/q6zg/ml1bbdJ5c bP+cVae4sJqr4MoMnmmTZ3ot+jqjK3aCuO3N4AVMH9SkP/je9+rKfjFtd1f04cxAydjnLrMr /hsF84nN/lDWs9Tj5iGlxgj98y86pJiVesIyF6ovvF9c6qh3S4mlOCPRUIu5qDgRAEmvUHch AgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3060 Lines: 102 From: Sylwester Nawrocki There is no need to support access to the PMU through memory ioresource as now access through PMU regmap should only be used. Signed-off-by: Sylwester Nawrocki Signed-off-by: Marek Szyprowski --- drivers/phy/phy-exynos-mipi-video.c | 57 +++++++++---------------------------- 1 file changed, 13 insertions(+), 44 deletions(-) diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c index 2a54cab..d4f5d8e 100644 --- a/drivers/phy/phy-exynos-mipi-video.c +++ b/drivers/phy/phy-exynos-mipi-video.c @@ -22,9 +22,6 @@ #include #include -/* MIPI_PHYn_CONTROL reg. offset (for base address from ioremap): n = 0..1 */ -#define EXYNOS_MIPI_PHY_CONTROL(n) ((n) * 4) - enum exynos_mipi_phy_id { EXYNOS_MIPI_PHY_ID_CSIS0, EXYNOS_MIPI_PHY_ID_DSIM0, @@ -50,7 +47,6 @@ static int __set_phy_state(struct exynos_mipi_video_phy *state, enum exynos_mipi_phy_id id, unsigned int on) { const unsigned int offset = EXYNOS4_MIPI_PHY_CONTROL(id / 2); - void __iomem *addr; u32 val, reset; if (is_mipi_dsim_phy_id(id)) @@ -60,35 +56,17 @@ static int __set_phy_state(struct exynos_mipi_video_phy *state, spin_lock(&state->slock); - if (!IS_ERR(state->regmap)) { - regmap_read(state->regmap, offset, &val); - if (on) - val |= reset; - else - val &= ~reset; - regmap_write(state->regmap, offset, val); - if (on) - val |= EXYNOS4_MIPI_PHY_ENABLE; - else if (!(val & EXYNOS4_MIPI_PHY_RESET_MASK)) - val &= ~EXYNOS4_MIPI_PHY_ENABLE; - regmap_write(state->regmap, offset, val); - } else { - addr = state->regs + EXYNOS_MIPI_PHY_CONTROL(id / 2); - - val = readl(addr); - if (on) - val |= reset; - else - val &= ~reset; - writel(val, addr); - /* Clear ENABLE bit only if MRESETN, SRESETN bits are not set */ - if (on) - val |= EXYNOS4_MIPI_PHY_ENABLE; - else if (!(val & EXYNOS4_MIPI_PHY_RESET_MASK)) - val &= ~EXYNOS4_MIPI_PHY_ENABLE; - - writel(val, addr); - } + regmap_read(state->regmap, offset, &val); + if (on) + val |= reset; + else + val &= ~reset; + regmap_write(state->regmap, offset, val); + if (on) + val |= EXYNOS4_MIPI_PHY_ENABLE; + else if (!(val & EXYNOS4_MIPI_PHY_RESET_MASK)) + val &= ~EXYNOS4_MIPI_PHY_ENABLE; + regmap_write(state->regmap, offset, val); spin_unlock(&state->slock); return 0; @@ -142,17 +120,8 @@ static int exynos_mipi_video_phy_probe(struct platform_device *pdev) return -ENOMEM; state->regmap = syscon_regmap_lookup_by_phandle(dev->of_node, "syscon"); - if (IS_ERR(state->regmap)) { - struct resource *res; - - dev_info(dev, "regmap lookup failed: %ld\n", - PTR_ERR(state->regmap)); - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - state->regs = devm_ioremap_resource(dev, res); - if (IS_ERR(state->regs)) - return PTR_ERR(state->regs); - } + if (IS_ERR(state->regmap)) + return PTR_ERR(state->regmap); dev_set_drvdata(dev, state); spin_lock_init(&state->slock); -- 1.9.2