static inline void s5p_ehci_phy_init(int cmd, struct usb_hcd *hcd) { /* charge pump enable */ s3c_gpio_setpull(S5PV210_ETC2(6), S3C_GPIO_PULL_DOWN); s5p_gpio_set_drvstr(S5PV210_ETC2(6), S3C_GPIO_DRVSTR_2X); /* overcurrent flag */ s3c_gpio_setpull(S5PV210_ETC2(7), S3C_GPIO_PULL_DOWN); s5p_gpio_set_drvstr(S5PV210_ETC2(7), S3C_GPIO_DRVSTR_2X); /* FriendlyARM's version void __iomem *gpio_regs = (void __iomem *) 0xFE500000; u32 tmp; tmp = readl(gpio_regs + 0x648); tmp |= (1 << (6 * 2)) | (1 << (7 * 2)); writel(tmp, gpio_regs + 0x648); tmp = readl(gpio_regs + 0x64c); tmp |= (1 << (6 * 2)) | (1 << (7 * 2)); writel(tmp, gpio_regs + 0x64c); */ if (!hcd) return; if (!hcd->regs || ((unsigned int) hcd->regs == 0xFFFFFFBF)) return; /* set AHB burst mode (INSNREG00) */ if (cmd == PHY_CMD_EHCI) /* INCR4/8/16 burst mode */ writel(0xF0000, hcd->regs + 0x90); else /* INCR4/8 bust mode */ writel(0x70000, hcd->regs + 0x90); }
static void __init mango210_usb_host_set(void) { int err; err = gpio_request(S5PV210_ETC2(7), "ETC2"); if (err) printk(KERN_ERR "#### failed to request ETC2 for USB host\n"); s3c_gpio_setpull(S5PV210_ETC2(7), S3C_GPIO_PULL_DOWN); gpio_free(S5PV210_ETC2(7)); }
.ngpio = S5PV210_GPIO_ETC0_NR, .label = "ETC0", }, }, { .base = S5PV210_ETC1_BASE, .config = &gpio_cfg_noint, .chip = { .base = S5PV210_ETC1(0), .ngpio = S5PV210_GPIO_ETC1_NR, .label = "ETC1", }, }, { .base = S5PV210_ETC2_BASE, .config = &gpio_cfg_noint, .chip = { .base = S5PV210_ETC2(0), .ngpio = S5PV210_GPIO_ETC2_NR, .label = "ETC2", }, }, { .base = S5PV210_ETC4_BASE, .config = &gpio_cfg_noint, .chip = { .base = S5PV210_ETC4(0), .ngpio = S5PV210_GPIO_ETC4_NR, .label = "ETC4", }, }, }; __init int s5pv210_gpiolib_init(void)