Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191884
b: refs/heads/master
c: 3d98f88
h: refs/heads/master
v: v3
  • Loading branch information
Marek Vasut authored and Eric Miao committed May 11, 2010
1 parent 3f05621 commit ba01b63
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: addff0faecfc5e73e8a742687255cef847e260db
refs/heads/master: 3d98f8816adafce2933599902fd9a5c0ccedd822
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-pxa/include/mach/vpac270.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@
#define GPIO12_VPAC270_CF_RDY 12
#define GPIO16_VPAC270_CF_RESET 16

#define GPIO41_VPAC270_UDC_DETECT 41
#endif
78 changes: 78 additions & 0 deletions trunk/arch/arm/mach-pxa/vpac270.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/input.h>
#include <linux/gpio.h>
#include <linux/sysdev.h>
#include <linux/usb/gpio_vbus.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
Expand All @@ -28,6 +29,9 @@
#include <mach/vpac270.h>
#include <mach/mmc.h>
#include <mach/pxafb.h>
#include <mach/ohci.h>
#include <mach/pxa27x-udc.h>
#include <mach/udc.h>

#include "generic.h"
#include "devices.h"
Expand Down Expand Up @@ -105,6 +109,14 @@ static unsigned long vpac270_pin_config[] __initdata = {
GPIO12_GPIO, /* CF RDY */
GPIO16_GPIO, /* CF RESET */

/* UHC */
GPIO88_USBH1_PWR,
GPIO89_USBH1_PEN,
GPIO119_USBH2_PWR,
GPIO120_USBH2_PEN,

/* UDC */
GPIO41_GPIO,
};

/******************************************************************************
Expand Down Expand Up @@ -232,6 +244,70 @@ static void __init vpac270_leds_init(void)
static inline void vpac270_leds_init(void) {}
#endif

/******************************************************************************
* USB Host
******************************************************************************/
#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
static int vpac270_ohci_init(struct device *dev)
{
UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
return 0;
}

static struct pxaohci_platform_data vpac270_ohci_info = {
.port_mode = PMM_PERPORT_MODE,
.flags = ENABLE_PORT1 | ENABLE_PORT2 |
POWER_CONTROL_LOW | POWER_SENSE_LOW,
.init = vpac270_ohci_init,
};

static void __init vpac270_uhc_init(void)
{
pxa_set_ohci_info(&vpac270_ohci_info);
}
#else
static inline void vpac270_uhc_init(void) {}
#endif

/******************************************************************************
* USB Gadget
******************************************************************************/
#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = {
.gpio_vbus = GPIO41_VPAC270_UDC_DETECT,
.gpio_pullup = -1,
};

static struct platform_device vpac270_gpio_vbus = {
.name = "gpio-vbus",
.id = -1,
.dev = {
.platform_data = &vpac270_gpio_vbus_info,
},
};

static void vpac270_udc_command(int cmd)
{
if (cmd == PXA2XX_UDC_CMD_CONNECT)
UP2OCR |= UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE;
else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
UP2OCR &= ~(UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE);
}

static struct pxa2xx_udc_mach_info vpac270_udc_info __initdata = {
.udc_command = vpac270_udc_command,
.gpio_pullup = -1,
};

static void __init vpac270_udc_init(void)
{
pxa_set_udc_info(&vpac270_udc_info);
platform_device_register(&vpac270_gpio_vbus);
}
#else
static inline void vpac270_udc_init(void) {}
#endif

/******************************************************************************
* Framebuffer
******************************************************************************/
Expand Down Expand Up @@ -312,6 +388,8 @@ static void __init vpac270_init(void)
vpac270_nor_init();
vpac270_leds_init();
vpac270_keys_init();
vpac270_uhc_init();
vpac270_udc_init();
}

MACHINE_START(VPAC270, "Voipac PXA270")
Expand Down

0 comments on commit ba01b63

Please sign in to comment.