From: Felipe Balbi <me@felipebalbi.com>
To: Tony Lindgren <tony@atomide.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>, linux-omap@vger.kernel.org
Subject: Re: [PATCH 0/7] twl4030 changes
Date: Fri, 28 Mar 2008 05:15:46 -0500 [thread overview]
Message-ID: <3917c3ef86c0fa62087f0c46bafe533a@felipebalbi.com> (raw)
In-Reply-To: <20080328074900.GD24896@atomide.com>
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
On Fri, 28 Mar 2008 09:49:00 +0200, Tony Lindgren <tony@atomide.com> wrote:
> * Felipe Balbi <felipe.balbi@nokia.com> [080327 19:20]:
>> Hi Tony,
>>
>> I'm resending this series cuz I changed a bit patch #5 to set
>> session bit on musb_platform_set_mode so musb core will really
>> go to a_host mode when we echo sysfs.
>>
>> Without this small change the sysfs interface will work only with
>> a few devices, most likely usb sticks.
>>
>> Below is a shortlog and diffstat of the changes.
>
> Pushing this series today.
Hi tony,
You missed the attached patch: Let board specific codee handle clock
initialization
--
Best Regards,
Felipe Balbi
http://felipebalbi.com
me@felipebalbi.com
[-- Attachment #2: 0001-USB-MUSB-Let-board-specific-code-handle-clock-initi.diff --]
[-- Type: text/x-diff, Size: 4523 bytes --]
From ad7a01e97dadbde2ef6c43b46182272ccc201683 Mon Sep 17 00:00:00 2001
From: Felipe Balbi <felipe.balbi@nokia.com>
Date: Tue, 18 Mar 2008 20:26:30 +0200
Subject: [PATCH 1/2] USB: MUSB: Let board specific code handle clock initialization
Instead of clk_get() in omap2430.c driver, we can let
musb_core.c do it by setting the clock id in
musb_platform_data structure.
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---
arch/arm/mach-omap2/board-2430sdp-usb.c | 27 +++++++++++++++++++++++++++
arch/arm/mach-omap2/board-3430sdp-usb.c | 29 +++++++++++++++++++++++++++--
drivers/usb/musb/omap2430.c | 8 --------
3 files changed, 54 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap2/board-2430sdp-usb.c b/arch/arm/mach-omap2/board-2430sdp-usb.c
index 908a0c0..7f4e017 100644
--- a/arch/arm/mach-omap2/board-2430sdp-usb.c
+++ b/arch/arm/mach-omap2/board-2430sdp-usb.c
@@ -13,9 +13,11 @@
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
+#include <linux/clk.h>
#include <linux/usb/musb.h>
#include <asm/arch/hardware.h>
+#include <asm/arch/pm.h>
#include <asm/arch/usb.h>
static struct resource musb_resources[] = {
@@ -34,6 +36,29 @@ static struct resource musb_resources[] = {
},
};
+static int usbhs_ick_on;
+
+static int musb_set_clock(struct clk *clk, int state)
+{
+ if (state) {
+ if (usbhs_ick_on > 0)
+ return -ENODEV;
+
+ omap2_block_sleep();
+ clk_enable(clk);
+ usbhs_ick_on = 1;
+ } else {
+ if (usbhs_ick_on == 0)
+ return -ENODEV;
+
+ clk_disable(clk);
+ usbhs_ick_on = 0;
+ omap2_allow_sleep();
+ }
+
+ return 0;
+}
+
static struct musb_hdrc_platform_data musb_plat = {
#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
@@ -43,6 +68,8 @@ static struct musb_hdrc_platform_data musb_plat = {
.mode = MUSB_PERIPHERAL,
#endif
.multipoint = 1,
+ .clock = "usbhs_ick",
+ .set_clock = musb_set_clock,
};
static u64 musb_dmamask = ~(u32)0;
diff --git a/arch/arm/mach-omap2/board-3430sdp-usb.c b/arch/arm/mach-omap2/board-3430sdp-usb.c
index 77088b4..81c9af7 100644
--- a/arch/arm/mach-omap2/board-3430sdp-usb.c
+++ b/arch/arm/mach-omap2/board-3430sdp-usb.c
@@ -16,11 +16,13 @@
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
+#include <linux/clk.h>
#include <asm/io.h>
#include <asm/arch/mux.h>
#include <linux/usb/musb.h>
#include <asm/arch/hardware.h>
+#include <asm/arch/pm.h>
#include <asm/arch/usb.h>
#ifdef CONFIG_USB_MUSB_SOC
@@ -40,6 +42,29 @@ static struct resource musb_resources[] = {
},
};
+static int hsotgusb_ick_on;
+
+static int musb_set_clock(struct clk *clk, int state)
+{
+ if (state) {
+ if (hsotgusb_ick_on > 0)
+ return -ENODEV;
+
+ omap2_block_sleep();
+ clk_enable(clk);
+ hsotgusb_ick_on = 1;
+ } else {
+ if (hsotgusb_ick_on == 0)
+ return -ENODEV;
+
+ clk_disable(clk);
+ hsotgusb_ick_on = 0;
+ omap2_allow_sleep();
+ }
+
+ return 0;
+}
+
static struct musb_hdrc_platform_data musb_plat = {
#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
@@ -49,8 +74,8 @@ static struct musb_hdrc_platform_data musb_plat = {
.mode = MUSB_PERIPHERAL,
#endif
.multipoint = 1,
- .clock = NULL,
- .set_clock = NULL,
+ .clock = "hsotgusb_ick",
+ .set_clock = musb_set_clock,
};
static u64 musb_dmamask = ~(u32)0;
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index caae81b..364d746 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -219,13 +219,7 @@ int __init musb_platform_init(struct musb *musb)
#if defined(CONFIG_ARCH_OMAP2430)
omap_cfg_reg(AE5_2430_USB0HS_STP);
- /* get the clock */
- musb->clock = clk_get((struct device *)musb->controller, "usbhs_ick");
-#else
- musb->clock = clk_get((struct device *)musb->controller, "hsotgusb_ick");
#endif
- if(IS_ERR(musb->clock))
- return PTR_ERR(musb->clock);
musb->xceiv = *xceiv;
musb_platform_resume(musb);
@@ -261,13 +255,11 @@ int musb_platform_suspend(struct musb *musb)
OTG_SYSCONFIG_REG |= AUTOIDLE; /* enable auto idle */
musb->xceiv.set_suspend(&musb->xceiv, 1);
- clk_disable(musb->clock);
return 0;
}
int musb_platform_resume(struct musb *musb)
{
- clk_enable(musb->clock);
musb->xceiv.set_suspend(&musb->xceiv, 0);
OTG_FORCESTDBY_REG &= ~ENABLEFORCE; /* disable MSTANDBY */
--
1.5.5.rc1.12.g660b9
next prev parent reply other threads:[~2008-03-28 10:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-27 17:16 [PATCH 0/7] twl4030 changes Felipe Balbi
2008-03-27 17:16 ` [PATCH 1/7] I2C: TWL4030: Move twl4030's headers under include/linux/i2c/ Felipe Balbi
2008-03-27 17:16 ` [PATCH 2/7] I2C: TWL4030: Move all *_*.c to *-*.c Felipe Balbi
2008-03-27 17:16 ` [PATCH 3/7] I2C: TWL4030: General cleanup in twl4030-core.c Felipe Balbi
2008-03-27 17:16 ` [PATCH 4/7] I2C: TWL4030: Cleanup twl4030-usb.c Felipe Balbi
2008-03-27 17:16 ` [PATCH 5/7] I2C: TWL4030: Make twl4030-usb.c initialize otg_transceiver Felipe Balbi
2008-03-27 17:16 ` [PATCH 6/7] I2C: TWL4030: Reorganize code in twl4030-usb.c Felipe Balbi
2008-03-27 17:16 ` [PATCH 7/7] USB: MUSB: Let board specific code handle clock initialization Felipe Balbi
2008-03-27 17:42 ` Felipe Balbi
2008-03-28 7:49 ` [PATCH 0/7] twl4030 changes Tony Lindgren
2008-03-28 10:15 ` Felipe Balbi [this message]
2008-03-28 10:17 ` Tony Lindgren
-- strict thread matches above, loose matches on Subject: below --
2008-03-19 13:42 [PATCH 0/7] TWL4030 Changes Felipe Balbi
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=3917c3ef86c0fa62087f0c46bafe533a@felipebalbi.com \
--to=me@felipebalbi.com \
--cc=felipe.balbi@nokia.com \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.com \
/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