public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] SDTI fixes
@ 2009-01-09  7:52 Jouni Hogander
  2009-01-09  7:52 ` [PATCH 1/2] SDTI: Fix sdti to use right clocks from clockfw Jouni Hogander
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jouni Hogander @ 2009-01-09  7:52 UTC (permalink / raw)
  To: linux-omap

These patches fixes the problem with sdti-console, where it stops to
work after PM is initialized.

arch/arm/mach-omap2/clockdomains.h |    6 +++-
arch/arm/mach-omap2/pm34xx.c       |   12 +++++++--
drivers/misc/sti/sdti.c            |   48 ++++++++++++++++++++++++++++---------
3 files changed, 52 insertions(+), 14 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] SDTI: Fix sdti to use right clocks from clockfw
  2009-01-09  7:52 [PATCH 0/2] SDTI fixes Jouni Hogander
@ 2009-01-09  7:52 ` Jouni Hogander
  2009-01-09  7:52 ` [PATCH 2/2] OMAP3: PM: Emu_pwrdm is switched off by hardware even when sdti is in use Jouni Hogander
  2009-01-09 12:14 ` [PATCH 0/2] SDTI fixes Tony Lindgren
  2 siblings, 0 replies; 4+ messages in thread
From: Jouni Hogander @ 2009-01-09  7:52 UTC (permalink / raw)
  To: linux-omap

SDTI uses pclk and pclkx2 instead of emu_per_alwon_ck. This patch
fixes sdti to use those clocks.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
---
 drivers/misc/sti/sdti.c |   47 +++++++++++++++++++++++++++++++++++++----------
 1 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/drivers/misc/sti/sdti.c b/drivers/misc/sti/sdti.c
index 92ce57b..8c27504 100644
--- a/drivers/misc/sti/sdti.c
+++ b/drivers/misc/sti/sdti.c
@@ -34,7 +34,7 @@
 #define SDTI_SYSCONFIG_SOFTRESET	(1 << 1)
 #define SDTI_SYSCONFIG_AUTOIDLE		(1 << 0)
 
-static struct clk *sdti_ck;
+static struct clk *sdti_fck, *sdti_ick;
 void __iomem *sti_base, *sti_channel_base;
 static DEFINE_SPINLOCK(sdti_lock);
 
@@ -70,14 +70,30 @@ static void omap_sdti_reset(void)
 static int __init omap_sdti_init(void)
 {
 	char buf[64];
-	int i;
+	int i, ret = 0;
 
-	sdti_ck = clk_get(NULL, "emu_per_alwon_ck");
-	if (IS_ERR(sdti_ck)) {
-		printk(KERN_ERR "Cannot get clk emu_per_alwon_ck\n");
-		return PTR_ERR(sdti_ck);
+	sdti_fck = clk_get(NULL, "pclk_fck");
+	if (IS_ERR(sdti_fck)) {
+		printk(KERN_ERR "Cannot get clk pclk_fck\n");
+		ret = PTR_ERR(sdti_fck);
+		goto err0;
+	}
+	sdti_ick = clk_get(NULL, "pclkx2_fck");
+	if (IS_ERR(sdti_ick)) {
+		printk(KERN_ERR "Cannot get clk pclkx2_fck\n");
+		ret = PTR_ERR(sdti_ick);
+		goto err1;
+	}
+	ret = clk_enable(sdti_fck);
+	if (ret) {
+		printk(KERN_ERR "Cannot enable sdti_fck\n");
+		goto err2;
+	}
+	ret = clk_enable(sdti_ick);
+	if (ret) {
+		printk(KERN_ERR "Cannot enable sdti_ick\n");
+		goto err3;
 	}
-	clk_enable(sdti_ck);
 
 	omap_sdti_reset();
 	sti_writel(0xC5ACCE55, SDTI_LOCK_ACCESS);
@@ -107,14 +123,25 @@ static int __init omap_sdti_init(void)
 	printk(KERN_INFO "%s", buf);
 	sti_channel_write_trace(strlen(buf), 0xc3, buf, 239);
 
-	return 0;
+	return ret;
+
+err3:
+	clk_disable(sdti_fck);
+err2:
+	clk_put(sdti_ick);
+err1:
+	clk_put(sdti_fck);
+err0:
+	return ret;
 }
 
 static void omap_sdti_exit(void)
 {
 	sti_writel(0, SDTI_WINCTRL);
-	clk_disable(sdti_ck);
-	clk_put(sdti_ck);
+	clk_disable(sdti_fck);
+	clk_disable(sdti_ick);
+	clk_put(sdti_fck);
+	clk_put(sdti_ick);
 }
 
 static int __devinit omap_sdti_probe(struct platform_device *pdev)
-- 
1.6.0.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] OMAP3: PM: Emu_pwrdm is switched off by hardware even when sdti is in use
  2009-01-09  7:52 [PATCH 0/2] SDTI fixes Jouni Hogander
  2009-01-09  7:52 ` [PATCH 1/2] SDTI: Fix sdti to use right clocks from clockfw Jouni Hogander
@ 2009-01-09  7:52 ` Jouni Hogander
  2009-01-09 12:14 ` [PATCH 0/2] SDTI fixes Tony Lindgren
  2 siblings, 0 replies; 4+ messages in thread
From: Jouni Hogander @ 2009-01-09  7:52 UTC (permalink / raw)
  To: linux-omap

Using sdti doesn't keep emu_pwrdm on if hardware supervised pwrdm
transitions are used. This causes sdti stop to work when power
management is initialized and hardware supervised pwrdm control is
enabled. This patch disables hardware supervised pwrdm control for
emu_pwrdm. Now emu_pwrdm is switched off on boot by software when it
is not used.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
---
 arch/arm/mach-omap2/clockdomains.h |    6 +++++-
 arch/arm/mach-omap2/pm34xx.c       |   11 ++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/clockdomains.h b/arch/arm/mach-omap2/clockdomains.h
index bafa650..3d4eaca 100644
--- a/arch/arm/mach-omap2/clockdomains.h
+++ b/arch/arm/mach-omap2/clockdomains.h
@@ -251,10 +251,14 @@ static struct clockdomain per_clkdm = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
 
+/*
+ * Disable hw supervised mode for emu_clkdm, because emu_pwrdm is
+ * switched of even if sdti is in use
+ */
 static struct clockdomain emu_clkdm = {
 	.name		= "emu_clkdm",
 	.pwrdm		= { .name = "emu_pwrdm" },
-	.flags		= CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_SWSUP,
+	.flags		= /* CLKDM_CAN_ENABLE_AUTO |  */CLKDM_CAN_SWSUP,
 	.clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK,
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 1d54e96..43aac5f 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -605,9 +605,18 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm)
 	return set_pwrdm_state(pwrst->pwrdm, pwrst->next_state);
 }
 
+/*
+ * Enable hw supervised mode for all clockdomains if it's
+ * supported. Initiate sleep transition for other clockdomains, if
+ * they are not used
+ */
 static int __init clkdms_setup(struct clockdomain *clkdm)
 {
-	omap2_clkdm_allow_idle(clkdm);
+	if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO)
+		omap2_clkdm_allow_idle(clkdm);
+	else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP &&
+		 atomic_read(&clkdm->usecount) == 0)
+		omap2_clkdm_sleep(clkdm);
 	return 0;
 }
 
-- 
1.6.0.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] SDTI fixes
  2009-01-09  7:52 [PATCH 0/2] SDTI fixes Jouni Hogander
  2009-01-09  7:52 ` [PATCH 1/2] SDTI: Fix sdti to use right clocks from clockfw Jouni Hogander
  2009-01-09  7:52 ` [PATCH 2/2] OMAP3: PM: Emu_pwrdm is switched off by hardware even when sdti is in use Jouni Hogander
@ 2009-01-09 12:14 ` Tony Lindgren
  2 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2009-01-09 12:14 UTC (permalink / raw)
  To: Jouni Hogander; +Cc: linux-omap

* Jouni Hogander <jouni.hogander@nokia.com> [090109 09:53]:
> These patches fixes the problem with sdti-console, where it stops to
> work after PM is initialized.

Pushing to l-o tree.

Tony


> arch/arm/mach-omap2/clockdomains.h |    6 +++-
> arch/arm/mach-omap2/pm34xx.c       |   12 +++++++--
> drivers/misc/sti/sdti.c            |   48 ++++++++++++++++++++++++++++---------
> 3 files changed, 52 insertions(+), 14 deletions(-)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-09 12:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-09  7:52 [PATCH 0/2] SDTI fixes Jouni Hogander
2009-01-09  7:52 ` [PATCH 1/2] SDTI: Fix sdti to use right clocks from clockfw Jouni Hogander
2009-01-09  7:52 ` [PATCH 2/2] OMAP3: PM: Emu_pwrdm is switched off by hardware even when sdti is in use Jouni Hogander
2009-01-09 12:14 ` [PATCH 0/2] SDTI fixes Tony Lindgren

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