linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: anarsoul@gmail.com (Vasily Khoruzhick)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] ARM: PXA: Zipit Z2: Add USB host and device support
Date: Sun, 28 Oct 2012 18:35:52 +0300	[thread overview]
Message-ID: <1351438555-4668-2-git-send-email-anarsoul@gmail.com> (raw)
In-Reply-To: <1351438555-4668-1-git-send-email-anarsoul@gmail.com>

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 arch/arm/mach-pxa/z2.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index c97485f..ce90fa9 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -41,6 +41,9 @@
 #include <linux/platform_data/mmc-pxamci.h>
 #include <linux/platform_data/keypad-pxa27x.h>
 #include <mach/pm.h>
+#include <mach/pxa27x-udc.h>
+#include <mach/udc.h>
+#include <linux/platform_data/usb-ohci-pxa27x.h>
 
 #include "generic.h"
 #include "devices.h"
@@ -680,6 +683,52 @@ static void __init z2_pmic_init(void)
 static inline void z2_pmic_init(void) {}
 #endif
 
+/******************************************************************************
+ * USB Switch
+ ******************************************************************************/
+static struct platform_device z2_usb_switch = {
+	.name		= "z2-usb-switch",
+	.id		= -1,
+};
+
+static void __init z2_usb_switch_init(void)
+{
+	platform_device_register(&z2_usb_switch);
+}
+
+/******************************************************************************
+ * USB Gadget
+ ******************************************************************************/
+#if defined(CONFIG_USB_GADGET_PXA27X) \
+	|| defined(CONFIG_USB_GADGET_PXA27X_MODULE)
+static int z2_udc_is_connected(void)
+{
+	return 1;
+}
+
+static struct pxa2xx_udc_mach_info z2_udc_info __initdata = {
+	.udc_is_connected	= z2_udc_is_connected,
+	.gpio_pullup		= -1,
+};
+
+static void __init z2_udc_init(void)
+{
+	pxa_set_udc_info(&z2_udc_info);
+}
+#else
+static inline void z2_udc_init(void) {}
+#endif
+
+/******************************************************************************
+ * USB Host (OHCI)
+ ******************************************************************************/
+static struct pxaohci_platform_data z2_ohci_platform_data = {
+	.port_mode	= PMM_PERPORT_MODE,
+	.flags		= ENABLE_PORT2 | NO_OC_PROTECTION,
+	.power_on_delay	= 10,
+	.power_budget	= 500,
+};
+
 #ifdef CONFIG_PM
 static void z2_power_off(void)
 {
@@ -705,10 +754,12 @@ static void __init z2_init(void)
 	pxa_set_ffuart_info(NULL);
 	pxa_set_btuart_info(NULL);
 	pxa_set_stuart_info(NULL);
+	pxa_set_ohci_info(&z2_ohci_platform_data);
 
 	z2_lcd_init();
 	z2_mmc_init();
 	z2_mkp_init();
+	z2_udc_init();
 	z2_i2c_init();
 	z2_spi_init();
 	z2_nor_init();
@@ -716,6 +767,7 @@ static void __init z2_init(void)
 	z2_leds_init();
 	z2_keys_init();
 	z2_pmic_init();
+	z2_usb_switch_init();
 
 	pm_power_off = z2_power_off;
 }
-- 
1.7.12.4

  reply	other threads:[~2012-10-28 15:35 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-28 15:35 [PATCH 1/5] ARM: PXA: Add z2-usb-switch driver Vasily Khoruzhick
2012-10-28 15:35 ` Vasily Khoruzhick [this message]
2012-10-28 21:59   ` [PATCH 2/5] ARM: PXA: Zipit Z2: Add USB host and device support Marek Vasut
2012-10-28 22:38     ` Vasily Khoruzhick
2012-10-28 22:43       ` Marek Vasut
2012-10-28 22:58       ` Daniel Mack
2012-10-29  9:33         ` Vasily Khoruzhick
2012-10-29  9:42           ` Daniel Mack
2012-10-29 10:07             ` Vasily Khoruzhick
2012-10-29 10:22               ` Marek Vasut
2012-10-29 10:26                 ` Vasily Khoruzhick
2012-10-29 10:44               ` Daniel Mack
2012-10-29 10:52                 ` Vasily Khoruzhick
2012-10-29 11:00                   ` Daniel Mack
2012-10-29 11:12                     ` Vasily Khoruzhick
2012-10-29 11:14                       ` Daniel Mack
2012-10-30 20:01                         ` Vasily Khoruzhick
2012-10-30 20:05                           ` Daniel Mack
2012-10-30 21:20                             ` Vasily Khoruzhick
2012-10-31 14:00                             ` Haojian Zhuang
2012-10-31 15:31                             ` Haojian Zhuang
2012-11-02 20:52                               ` Vasily Khoruzhick
2012-11-02 21:29                               ` Vasily Khoruzhick
2012-11-05 17:31                                 ` Vasily Khoruzhick
2012-12-04  8:30                                   ` Haojian Zhuang
2012-10-29 10:48               ` Daniel Mack
2012-10-28 15:35 ` [PATCH 3/5] ARM: PXA: Zipit Z2: Fix oops in z2_power_off Vasily Khoruzhick
2012-10-28 15:35 ` [PATCH 4/5] ARM: PXA: Zipit Z2: Change active_state of power button Vasily Khoruzhick
2012-10-28 22:01   ` Marek Vasut
2012-10-28 22:31     ` mark at engine12.com
2012-10-28 15:35 ` [PATCH 5/5] ARM: PXA: Zipit Z2: Fix backlight PWM device number Vasily Khoruzhick
2012-10-28 22:01   ` Marek Vasut
2012-10-28 22:23     ` Vasily Khoruzhick
2012-10-28 22:39       ` Marek Vasut
2012-10-28 15:39 ` [PATCH 1/5] ARM: PXA: Add z2-usb-switch driver Vasily Khoruzhick
2012-10-28 15:42   ` [PATCH v2 " Vasily Khoruzhick
2012-10-28 17:03     ` Marko Katić
2012-10-28 18:12       ` Vasily Khoruzhick
2012-10-28 21:57     ` Marek Vasut
2012-10-28 22:27       ` Vasily Khoruzhick
2012-10-28 22:38         ` Marek Vasut
2012-10-28 22:45           ` Vasily Khoruzhick
2012-10-28 22:48             ` Marek Vasut

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=1351438555-4668-2-git-send-email-anarsoul@gmail.com \
    --to=anarsoul@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).