From patchwork Sun Oct 28 15:35:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 1657861 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id CE956DFABE for ; Sun, 28 Oct 2012 15:38:56 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TSUue-0004Bt-7U; Sun, 28 Oct 2012 15:36:32 +0000 Received: from mail-la0-f49.google.com ([209.85.215.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TSUuR-0004AY-LL for linux-arm-kernel@lists.infradead.org; Sun, 28 Oct 2012 15:36:20 +0000 Received: by mail-la0-f49.google.com with SMTP id z14so3189662lag.36 for ; Sun, 28 Oct 2012 08:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=dBAWej7BQgcUG/7oMfxYe3Fwn6FdbFQd+W8QdQxn+4Y=; b=A8g+Yj7YuMnIoMRKMQQXsePr97/zd4zQt9FHAfs8fpY5+et61FUsDOgBF6QgmRqXTd z1ZsNHvZTkE2NJMdG+lr13/YNi/oXB5AgwBA3InF1hXWSUEqA/yxWN3+msaS3ew3SHC2 L+F/PJrIVed4fjksgLAGQ7Vz1rZ08fVkmKvHHta/Yr+r1Q00FXuTGeHJgfF5elvoM67B 5+7jlvYuqNfb7XXJYfCi0iPIIqgqTOE8pGnOzOE3YSxvAWVxFySHi0DVD3s9rlln+a1t nDhRveNBbVSgEtWd39pyHU75z44VW862tWtdogyC2MENqaXOQfqFZHdDA5DHlSVTTfkV P89Q== Received: by 10.152.47.97 with SMTP id c1mr24478195lan.37.1351438576709; Sun, 28 Oct 2012 08:36:16 -0700 (PDT) Received: from localhost.localdomain ([80.249.90.60]) by mx.google.com with ESMTPS id ft3sm2276824lbb.1.2012.10.28.08.36.14 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 28 Oct 2012 08:36:15 -0700 (PDT) From: Vasily Khoruzhick To: Eric Miao , Russell King , Haojian Zhuang , Marek Vasut , 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 Message-Id: <1351438555-4668-2-git-send-email-anarsoul@gmail.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1351438555-4668-1-git-send-email-anarsoul@gmail.com> References: <1351438555-4668-1-git-send-email-anarsoul@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (anarsoul[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Vasily Khoruzhick X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Signed-off-by: Vasily Khoruzhick --- 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 #include #include +#include +#include +#include #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; }