diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c index fdca1fd..bda844b 100644 --- a/arch/arm/mach-pxa/ezx.c +++ b/arch/arm/mach-pxa/ezx.c @@ -850,18 +850,18 @@ static void ezx_udc_command(int cmd) /* FIXME: This cant work anymore, sorry :( */ // unsigned int tmp; // ezx_pcap_read(PCAP_REG_BUSCTRL, &tmp); -// switch (cmd) { + switch (cmd) { // case PXA2XX_UDC_CMD_DISCONNECT: // if (machine_is_ezx_a780() || machine_is_ezx_e680()) // tmp &= ~PCAP_BUSCTRL_USB_PU; // break; -// case PXA2XX_UDC_CMD_CONNECT: + case PXA2XX_UDC_CMD_CONNECT: // /* temp. set UP2OCR here until we have a transceiver driver */ -// UP2OCR = UP2OCR_SEOS(2); + UP2OCR = UP2OCR_SEOS(2); // if (machine_is_ezx_a780() || machine_is_ezx_e680()) // tmp |= PCAP_BUSCTRL_USB_PU; -// break; -// } + break; + } // ezx_pcap_write(PCAP_REG_BUSCTRL, tmp); } @@ -994,17 +994,10 @@ static struct mtd_partition gen2_partitions[] = { EZX_MTD_PART(bootloader, 0x00000000, 393216, MTD_WRITEABLE), EZX_MTD_PART(bootloader setup, 0x00060000, 131072, 0), EZX_MTD_PART(linux loader, 0x00080000, 131072, 0), - EZX_MTD_PART(kernel, 0x000a0000, 1048576, 0), - EZX_MTD_PART(resourcefs, 0x001a0000, 9437184, 0), - EZX_MTD_PART(userfs db, 0x00aa0000, 6291456, 0), - EZX_MTD_PART(userfs general, 0x010a0000, 8388608, 0), - EZX_MTD_PART(secure setup, 0x018a0000, 131072, 0), - EZX_MTD_PART(tcmd data, 0x018c0000, 131072, 0), - EZX_MTD_PART(logo, 0x018e0000, 131072, 0), - EZX_MTD_PART(fota, 0x01900000, 917504, 0), - EZX_MTD_PART(languagefs, 0x019e0000, 12582912, 0), - EZX_MTD_PART(setup, 0x025e0000, 131072, 0), - EZX_MTD_PART(rootfs, 0x02600000, 27262976, 0), + EZX_MTD_PART(gen-blob, 0x000a0000, 131072, 0), + EZX_MTD_PART(gen-blob config, 0x000c0000, 131072, 0), + EZX_MTD_PART(kernel, 0x000e0000, 2097152, 0), + EZX_MTD_PART(root, 0x002e0000, 64094208, 0), }; static struct flash_platform_data gen2_flash_data = { @@ -1024,6 +1017,25 @@ static struct platform_device gen2_flash_device = { .resource = &gen2_flash_resource, .num_resources = 1, }; + +static struct regulator_init_data eoc_regulator_data = { + .constraints = { + .max_uA = 1300000, + .valid_modes_mask = REGULATOR_MODE_NORMAL, + .valid_ops_mask = REGULATOR_CHANGE_CURRENT + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS + | REGULATOR_CHANGE_DRMS, + }, +}; + +static struct platform_device eoc_regulator_device = { + .name = "eoc-regulator", + .id = -1, + .dev = { + .platform_data = &eoc_regulator_data, + }, +}; #endif #ifdef CONFIG_MACH_EZX_A780 @@ -1472,6 +1484,7 @@ static struct platform_device *a1200_devices[] __initdata = { &a1200_gpio_keys, &gen2_flash_device, &gen2_bp_device, + &eoc_regulator_device, }; static void __init a1200_init(void) @@ -1724,6 +1737,7 @@ static struct platform_device *a910_devices[] __initdata = { &a910_gpio_keys, &gen2_flash_device, &gen2_bp_device, + &eoc_regulator_device, }; static void __init a910_init(void) @@ -1859,6 +1873,7 @@ static struct platform_device *e6_devices[] __initdata = { &e6_gpio_keys, &gen2_flash_device, &gen2_bp_device, + &eoc_regulator_device, &ezx_usb20_device, }; @@ -1932,6 +1947,9 @@ static struct pcap_subdev e2_pcap_subdevs[] = { }, { .name = "pcap-audio", .id = -1, + }, { + .name = "pcap-battery", + .id = -1, }, }; @@ -1957,13 +1975,19 @@ static struct spi_board_info e2_spi_boardinfo[] __initdata = { }; static struct i2c_board_info __initdata e2_i2c_board_info[] = { - { I2C_BOARD_INFO("radio-tea5764", 0x10) }, + { + I2C_BOARD_INFO("tea5767", 0x81), + I2C_BOARD_INFO("ezx-eoc", 0x17), + }, }; static struct platform_device *e2_devices[] __initdata = { &gen2_flash_device, &gen2_bp_device, + &eoc_regulator_device, &ezx_usb20_device, + &e6_gpio_keys, + &ezx_rfkill_bluetooth_device, }; static void __init e2_init(void) diff --git a/drivers/char/ts0710.h b/drivers/char/ts0710.h index 5b676d4..47a0adf 100644 --- a/drivers/char/ts0710.h +++ b/drivers/char/ts0710.h @@ -299,7 +299,6 @@ typedef struct { #define valid_dlci(x) ( (x>0) && (x0) && (xread_wait); diff --git a/drivers/char/ts0710_mux_usb.c b/drivers/char/ts0710_mux_usb.c index c810f76..3ce0179 100644 --- a/drivers/char/ts0710_mux_usb.c +++ b/drivers/char/ts0710_mux_usb.c @@ -268,6 +268,10 @@ static int usb_ipc_open(struct tty_struct *tty, struct file *file) { int index; + /* dont try to open nonconnected device */ + if (!bvd_ipc->ipc_dev) + return -ENODEV; + /* initialize the pointer in case something fails */ tty->driver_data = NULL; diff --git a/drivers/i2c/chips/ezx-eoc.c b/drivers/i2c/chips/ezx-eoc.c index f225e67..7fcee39 100644 --- a/drivers/i2c/chips/ezx-eoc.c +++ b/drivers/i2c/chips/ezx-eoc.c @@ -21,6 +21,10 @@ #include #include +static int eoc_charger_enable(struct regulator_dev *rdev); +static int eoc_charger_disable(struct regulator_dev *rdev); +static int eoc_set_current_limit(struct regulator_dev *rdev, + int min_uA, int max_uA); static int sense_reg, power0_reg; static int eoc_charger_enable(struct regulator_dev *rdev); @@ -110,6 +114,15 @@ static void eoc_work(struct work_struct *_eoc) "connected" : "disconnected" ); + if (sense_reg & EOC_IRQ_VBUS) { + eoc_charger_enable(NULL); + eoc_set_current_limit(NULL,300000,300000); + + } else { + eoc_set_current_limit(NULL,0,0); + eoc_charger_disable(NULL); + } + break; case EOC_IRQ_VBUS_OV: printk("VBUS_OV "); @@ -261,7 +274,7 @@ static int __devinit eoc_probe(struct i2c_client *client, if (ret) goto ret; - power0_reg = 0xc00; /* hardware controlled, shared path */ + power0_reg = 0x400; /* software controlled, dual path */ eoc_reg_write(EOC_REG_POWER_CONTROL_0, power0_reg); if (ret) goto ret; @@ -308,6 +321,13 @@ static struct i2c_driver eoc_driver = { .id_table = eoc_id, }; +static ssize_t cable_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + return sprintf(buf, "%d\n", sense_reg & EOC_IRQ_VBUS); +} + +static DEVICE_ATTR(cable, 0444, cable_show, NULL); static int eoc_regulator_probe(struct platform_device *pdev) { struct regulator_dev *rdev; @@ -320,6 +340,8 @@ static int eoc_regulator_probe(struct platform_device *pdev) } #endif + device_create_file(&pdev->dev, &dev_attr_cable); + return 0; } diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index be86ae3..100880a 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1765,7 +1765,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub) #define PORT_RESET_TRIES 5 -#define SET_ADDRESS_TRIES 2 +#define SET_ADDRESS_TRIES 6 #define GET_DESCRIPTOR_TRIES 2 #define SET_CONFIG_TRIES (2 * (use_both_schemes + 1)) #define USE_NEW_SCHEME(i) ((i) / 2 == old_scheme_first) @@ -2602,6 +2602,9 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, if (retval >= 0) break; msleep(200); + + if (old_scheme_first) + hub_port_reset(hub, port1, udev, delay); } if (retval < 0) { dev_err(&udev->dev,