mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] bus: ocp2scp: SYNC2 value should be changed to 0x6
@ 2014-05-14  8:49 Kishon Vijay Abraham I
  0 siblings, 0 replies; only message in thread
From: Kishon Vijay Abraham I @ 2014-05-14  8:49 UTC (permalink / raw)
  To: arnd, tony, balbi, linux-kernel; +Cc: kishon

Read path of OCP2SCP is not working properly due to low reset value
of SYNC2 parameter in OCP2SCP. So changed the SYNC2 value to 0x6.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/bus/omap-ocp2scp.c |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/bus/omap-ocp2scp.c b/drivers/bus/omap-ocp2scp.c
index 5511f98..0a974b2 100644
--- a/drivers/bus/omap-ocp2scp.c
+++ b/drivers/bus/omap-ocp2scp.c
@@ -16,6 +16,7 @@
  *
  */
 
+#include <linux/io.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/err.h>
@@ -23,6 +24,9 @@
 #include <linux/of.h>
 #include <linux/of_platform.h>
 
+#define	OCP2SCP_TIMING	0x18
+#define	SYNC2_MASK	0xf
+
 static int ocp2scp_remove_devices(struct device *dev, void *c)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -35,6 +39,9 @@ static int ocp2scp_remove_devices(struct device *dev, void *c)
 static int omap_ocp2scp_probe(struct platform_device *pdev)
 {
 	int ret;
+	u32 reg;
+	void __iomem *regs;
+	struct resource *res;
 	struct device_node *np = pdev->dev.of_node;
 
 	if (np) {
@@ -46,8 +53,24 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
 		}
 	}
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	regs = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(regs))
+		return PTR_ERR(regs);
+
 	pm_runtime_enable(&pdev->dev);
 
+	/*
+	 * Read path of OCP2SCP is not working properly due to low reset value
+	 * of SYNC2 parameter in OCP2SCP. Suggested reset value is 0x6.
+	 */
+	pm_runtime_get_sync(&pdev->dev);
+	reg = readl(regs + OCP2SCP_TIMING);
+	reg &= ~(SYNC2_MASK);
+	reg |= 0x6;
+	writel(reg, regs + OCP2SCP_TIMING);
+	pm_runtime_put_sync(&pdev->dev);
+
 	return 0;
 
 err0:
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-05-14  8:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-14  8:49 [PATCH] bus: ocp2scp: SYNC2 value should be changed to 0x6 Kishon Vijay Abraham I

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®