The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: <gregkh@linuxfoundation.org>
Cc: <kishon@ti.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 14/16] phy: exynos-mipi-video: Drop support for direct access to PMU
Date: Mon, 2 May 2016 09:53:05 +0530	[thread overview]
Message-ID: <1462162987-13023-15-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1462162987-13023-1-git-send-email-kishon@ti.com>

From: Sylwester Nawrocki <s.nawrocki@samsung.com>

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 <s.nawrocki@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 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 <linux/spinlock.h>
 #include <linux/mfd/syscon.h>
 
-/* 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.7.9.5

  parent reply	other threads:[~2016-05-02  4:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02  4:22 [GIT PULL] phy: for 4.7 Kishon Vijay Abraham I
2016-05-02  4:22 ` [PATCH 01/16] phy: rcar-gen2: add fallback binding Kishon Vijay Abraham I
2016-05-02  4:22 ` [PATCH 02/16] phy: rcar-gen3-usb2: " Kishon Vijay Abraham I
2016-05-02  4:22 ` [PATCH 03/16] phy: rcar-gen3-usb2, rcar-gen2: Use ARCH_RENESAS Kishon Vijay Abraham I
2016-05-02  4:22 ` [PATCH 04/16] phy: Rename phy-brcmstb-sata driver to phy-brcm-sata driver Kishon Vijay Abraham I
2016-05-02  4:22 ` [PATCH 05/16] phy: Add support for NS2 SATA3 PHY in Broadcom SATA3 PHY driver Kishon Vijay Abraham I
2016-05-02  4:22 ` [PATCH 06/16] dt-bindings: phy: bindings document for common " Kishon Vijay Abraham I
2016-05-02  4:22 ` [PATCH 07/16] phy: rcar-gen3-usb2: remove unnecesary struct rcar_gen3_data Kishon Vijay Abraham I
2016-05-02  4:22 ` [PATCH 08/16] phy: rcar-gen3-usb2: Add vbus-supply to handle VBUS on/off Kishon Vijay Abraham I
2016-05-02  4:23 ` [PATCH 09/16] phy: rcar-gen3-usb2: add extcon support Kishon Vijay Abraham I
2016-05-02  4:23 ` [PATCH 10/16] dt-bindings: phy-mt65xx-usb: add support for mt2701 platform Kishon Vijay Abraham I
2016-05-02  4:23 ` [PATCH 11/16] phy: phy-mt65xx-usb3: " Kishon Vijay Abraham I
2016-05-02  4:23 ` [PATCH 12/16] phy: rockhip-usb: Remove CLK_IS_ROOT Kishon Vijay Abraham I
2016-05-02  4:23 ` [PATCH 13/16] phy: bcm-ns-usb2: new driver for USB 2.0 PHY on Northstar Kishon Vijay Abraham I
2016-05-02  4:23 ` Kishon Vijay Abraham I [this message]
2016-05-02  4:23 ` [PATCH 15/16] phy: exynos-mipi-video: Rewrite handling of phy registers Kishon Vijay Abraham I
2016-05-02  4:23 ` [PATCH 16/16] phy: exynos-mipi-video: Add support for Exynos 5420 and 5433 SoCs Kishon Vijay Abraham I
2016-05-03 21:51 ` [GIT PULL] phy: for 4.7 Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462162987-13023-15-git-send-email-kishon@ti.com \
    --to=kishon@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox