Skip to contentSkip to conversation

msm: board-msm8960: Add USB peripheral and OTG support

PATCH New Anji jonnala 2 participants 2 messages Mar 22, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 msm: board-msm8960: Add USB peripheral and OTG support

---
 arch/arm/mach-msm/board-msm8960.c               |   10 +++++
 arch/arm/mach-msm/devices-msm8960.c             |   47 +++++++++++++++++++++++
 arch/arm/mach-msm/include/mach/msm_iomap-8960.h |    2 +
 3 files changed, 59 insertions(+), 0 deletions(-)
arch/arm/mach-msm/board-msm8960.c +10 -0
index 052cb35..8ee373e 100644
@@ -27,9 +27,15 @@
 
 #include <mach/board.h>
 #include <mach/msm_iomap.h>
+#include <linux/usb/msm_hsusb.h>
 
 #include "devices.h"
 
+static struct msm_otg_platform_data msm_otg_pdata = {
+	.mode			= USB_PERIPHERAL,
+	.otg_control		= OTG_PHY_CONTROL,
+};
+
 static void __init msm8960_map_io(void)
 {
 	msm_map_msm8960_io();
@@ -59,6 +65,8 @@ static void __init msm8960_init_irq(void)
 
 static struct platform_device *sim_devices[] __initdata = {
 	&msm8960_device_uart_gsbi2,
+	&msm_device_otg,
+	&msm_device_hsusb,
 };
 
 static struct platform_device *rumi3_devices[] __initdata = {
@@ -68,6 +76,8 @@ static struct platform_device *rumi3_devices[] __initdata = {
 static void __init msm8960_sim_init(void)
 {
 	msm_clock_init(msm_clocks_8960, msm_num_clocks_8960);
+	msm_device_otg.dev.platform_data = &msm_otg_pdata;
+	msm_device_hsusb.dev.parent = &msm_device_otg.dev;
 	platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
 }
 
arch/arm/mach-msm/devices-msm8960.c +47 -0

59 lines not on this page · raw message

arch/arm/mach-msm/include/mach/msm_iomap-8960.h +2 -0
index 3c9d960..fd0d17e 100644
@@ -45,4 +45,6 @@
 #define MSM8960_TMR0_PHYS	0x0208A000
 #define MSM8960_TMR0_SIZE	SZ_4K
 
+#define MSM8960_HSUSB_PHYS	0x12500000
+#define MSM8960_HSUSB_SIZE	SZ_256K
 #endif
Signature · 3 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
1.7.1.1
#1 lore raw

PATCH 1/1 msm: board-msm8960: Add USB peripheral and OTG support

Hello.

Quoted 1 line · Anji jonnala

[...]

Quoted 4 lines
arch/arm/mach-msm/devices-msm8960.c +0 -0
index 894ff98..8baf4fa 100644

[...]

arch/arm/mach-msm/devices-msm8960.c struct platform_device msm8960_device_uart_gsbi5 = { · line 96

Quoted 8 lines
arch/arm/mach-msm/devices-msm8960.c +4 -0
@@ -89,6 +90,52 @@ struct platform_device msm8960_device_uart_gsbi5 = {
  	.resource	= resources_uart_gsbi5,
  };
 
+static struct resource resources_otg[] = {
+	{
+		.start	= MSM8960_HSUSB_PHYS,
+		.end	= MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
    You forgot "- 1".
Quoted 13 lines
arch/arm/mach-msm/devices-msm8960.c +13 -0
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.start	= USB1_HS_IRQ,
+		.end	= USB1_HS_IRQ,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+struct platform_device msm_device_otg = {
+	.name		= "msm_otg",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(resources_otg),

arch/arm/mach-msm/devices-msm8960.c struct platform_device msm8960_device_uart_gsbi5 = { · line 119

Quoted 10 lines
arch/arm/mach-msm/devices-msm8960.c +10 -0
+	.resource	= resources_otg,
+	.dev		= {
+		.coherent_dma_mask	= 0xffffffff,
+	},
+};
+
+static struct resource resources_hsusb[] = {
+	{
+		.start	= MSM8960_HSUSB_PHYS,
+		.end	= MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,

You forgot "- 1" here too.

WBR, Sergei