diff options
author | Thomas White <taw27@cam.ac.uk> | 2009-06-08 14:44:14 +0100 |
---|---|---|
committer | Thomas White <taw27@cam.ac.uk> | 2009-06-08 14:44:14 +0100 |
commit | 3a83621f0e6a52eff7402702b0774092cc7b0187 (patch) | |
tree | 0962d7359b5b15176a87d03b80be7ba70e252313 | |
parent | 6e278419626d23b3c15e4cb0ee3b56ce4ab99f87 (diff) | |
parent | 23b564c9d22cc5e442361e632626d5f131c40752 (diff) |
Merge branch 'andy-tracking' into drm-tracking
-rw-r--r-- | arch/arm/configs/gta01_moredrivers_defconfig | 12 | ||||
-rw-r--r-- | arch/arm/configs/gta02_moredrivers_defconfig | 2 | ||||
-rw-r--r-- | arch/arm/configs/gta02_packaging_defconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/mach-gta01.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c2442/mach-gta02.c | 12 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/udc.h | 1 | ||||
-rw-r--r-- | drivers/mfd/glamo/Kconfig | 22 | ||||
-rw-r--r-- | drivers/power/bq27000_battery.c | 12 | ||||
-rw-r--r-- | drivers/power/gta01_battery.c | 4 | ||||
-rw-r--r-- | drivers/power/pcf50633-charger.c | 3 | ||||
-rw-r--r-- | drivers/usb/gadget/s3c2410_udc.c | 28 | ||||
-rw-r--r-- | drivers/usb/gadget/u_ether.c | 8 |
12 files changed, 76 insertions, 31 deletions
diff --git a/arch/arm/configs/gta01_moredrivers_defconfig b/arch/arm/configs/gta01_moredrivers_defconfig index b60ebfba3b8..1f5883729dc 100644 --- a/arch/arm/configs/gta01_moredrivers_defconfig +++ b/arch/arm/configs/gta01_moredrivers_defconfig @@ -1610,7 +1610,7 @@ CONFIG_RTC_LIB=y CONFIG_RTC_CLASS=y CONFIG_RTC_HCTOSYS=y CONFIG_RTC_HCTOSYS_DEVICE="rtc0" -CONFIG_RTC_DEBUG=y +# CONFIG_RTC_DEBUG is not set # # RTC interfaces @@ -1699,15 +1699,7 @@ CONFIG_ANDROID_RAM_CONSOLE_ENABLE_VERBOSE=y # CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT is not set CONFIG_ANDROID_TIMED_GPIO=y CONFIG_ANDROID_LOW_MEMORY_KILLER=y -CONFIG_ANDROID_HAS_WAKELOCK=y -CONFIG_ANDROID_HAS_EARLYSUSPEND=y -CONFIG_ANDROID_WAKELOCK=y -CONFIG_ANDROID_USER_WAKELOCK=y -CONFIG_ANDROID_EARLYSUSPEND=y -# CONFIG_NO_USER_SPACE_SCREEN_ACCESS_CONTROL is not set -CONFIG_ANDROID_CONSOLE_EARLYSUSPEND=y -# CONFIG_ANDROID_FB_EARLYSUSPEND is not set -CONFIG_ANDROID_POWER_ALARM=y +# CONFIG_ANDROID_WAKELOCK is not set CONFIG_ANDROID_PARANOID_NETWORK=y # diff --git a/arch/arm/configs/gta02_moredrivers_defconfig b/arch/arm/configs/gta02_moredrivers_defconfig index 1dbbbf63ce8..8d06cd6c70b 100644 --- a/arch/arm/configs/gta02_moredrivers_defconfig +++ b/arch/arm/configs/gta02_moredrivers_defconfig @@ -1694,7 +1694,7 @@ CONFIG_RTC_LIB=y CONFIG_RTC_CLASS=y CONFIG_RTC_HCTOSYS=y CONFIG_RTC_HCTOSYS_DEVICE="rtc0" -CONFIG_RTC_DEBUG=y +# CONFIG_RTC_DEBUG is not set # # RTC interfaces diff --git a/arch/arm/configs/gta02_packaging_defconfig b/arch/arm/configs/gta02_packaging_defconfig index 237fd959510..dfdfb19a2f1 100644 --- a/arch/arm/configs/gta02_packaging_defconfig +++ b/arch/arm/configs/gta02_packaging_defconfig @@ -1697,7 +1697,7 @@ CONFIG_RTC_LIB=y CONFIG_RTC_CLASS=y CONFIG_RTC_HCTOSYS=y CONFIG_RTC_HCTOSYS_DEVICE="rtc0" -CONFIG_RTC_DEBUG=y +# CONFIG_RTC_DEBUG is not set # # RTC interfaces diff --git a/arch/arm/mach-s3c2410/mach-gta01.c b/arch/arm/mach-s3c2410/mach-gta01.c index bddba990a74..1fe3eef2257 100644 --- a/arch/arm/mach-s3c2410/mach-gta01.c +++ b/arch/arm/mach-s3c2410/mach-gta01.c @@ -775,7 +775,6 @@ static struct spi_board_info gta01_spi_board_info[] = { /* controller_data */ /* irq */ .max_speed_hz = 10 * 1000 * 1000, - .bus_num = 1, /* chip_select */ }, }; diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c index 072abd56759..e7a5f0a55a1 100644 --- a/arch/arm/mach-s3c2442/mach-gta02.c +++ b/arch/arm/mach-s3c2442/mach-gta02.c @@ -476,11 +476,22 @@ static void gta02_udc_vbus_draw(unsigned int ma) schedule_delayed_work(>a02_charger_work, GTA02_CHARGER_CONFIGURE_TIMEOUT); } + +static int gta02_udc_vbus_status(void) +{ + struct pcf50633 *pcf = gta02_pcf; + + if (!gta02_pcf) + return -ENODEV; + + return !!(pcf50633_mbc_get_status(pcf) & PCF50633_MBC_USB_ONLINE); +} #else /* !CONFIG_CHARGER_PCF50633 */ #define gta02_get_charger_online_status NULL #define gta02_get_charger_active_status NULL #define gta02_pmu_event_callback NULL #define gta02_udc_vbus_draw NULL +#define gta02_udc_vbus_status NULL #endif static struct platform_device gta01_pm_gps_dev = { @@ -954,6 +965,7 @@ static void gta02_udc_command(enum s3c2410_udc_cmd_e cmd) static struct s3c2410_udc_mach_info gta02_udc_cfg = { .vbus_draw = gta02_udc_vbus_draw, .udc_command = gta02_udc_command, + .get_vbus_status= gta02_udc_vbus_status, }; diff --git a/arch/arm/plat-s3c24xx/include/plat/udc.h b/arch/arm/plat-s3c24xx/include/plat/udc.h index 546bb4008f4..763aeba628e 100644 --- a/arch/arm/plat-s3c24xx/include/plat/udc.h +++ b/arch/arm/plat-s3c24xx/include/plat/udc.h @@ -27,6 +27,7 @@ enum s3c2410_udc_cmd_e { struct s3c2410_udc_mach_info { void (*udc_command)(enum s3c2410_udc_cmd_e); void (*vbus_draw)(unsigned int ma); + int (*get_vbus_status)(void); unsigned int vbus_pin; unsigned char vbus_pin_inverted; }; diff --git a/drivers/mfd/glamo/Kconfig b/drivers/mfd/glamo/Kconfig index eaa415df890..9c5b11b8372 100644 --- a/drivers/mfd/glamo/Kconfig +++ b/drivers/mfd/glamo/Kconfig @@ -33,18 +33,20 @@ config MFD_GLAMO_FB_XGLAMO_WORKAROUND config MFD_GLAMO_SPI_GPIO - tristate "Glamo GPIO SPI bitbang support" - depends on MFD_GLAMO - help - Enable a bitbanging SPI adapter driver for the Smedia Glamo. + tristate "Glamo GPIO SPI bitbang support" + depends on MFD_GLAMO + select SPI_BITBANG + + help + Enable a bitbanging SPI adapter driver for the Smedia Glamo. config MFD_GLAMO_SPI_FB - tristate "Glamo LCM control channel SPI support" - depends on MFD_GLAMO_FB - help - Enable a bitbanging SPI adapter driver for the Smedia Glamo LCM - control channel. This SPI interface is frequently used to - interconnect the LCM control interface. + tristate "Glamo LCM control channel SPI support" + depends on MFD_GLAMO_FB + help + Enable a bitbanging SPI adapter driver for the Smedia Glamo LCM + control channel. This SPI interface is frequently used to + interconnect the LCM control interface. config MFD_GLAMO_MCI tristate "Glamo S3C SD/MMC Card Interface support" diff --git a/drivers/power/bq27000_battery.c b/drivers/power/bq27000_battery.c index 9f0f1a96720..593cbe6f752 100644 --- a/drivers/power/bq27000_battery.c +++ b/drivers/power/bq27000_battery.c @@ -115,6 +115,7 @@ struct bq27000_bat_regs { int ai; int flags; int lmd; + int nac; int rsoc; int temp; int tte; @@ -170,9 +171,11 @@ static int hdq_read16(struct bq27000_device_info *di, int address) static void bq27000_battery_external_power_changed(struct power_supply *psy) { - struct bq27000_device_info *di = container_of(psy, struct bq27000_device_info, bat); + struct bq27000_device_info *di = + container_of(psy, struct bq27000_device_info, bat); dev_dbg(di->dev, "%s\n", __FUNCTION__); + cancel_delayed_work(&di->work); schedule_delayed_work(&di->work, 0); } @@ -269,6 +272,11 @@ use_bat: return di->regs.lmd; val->intval = (di->regs.lmd * 3570) / di->pdata->rsense_mohms; break; + case POWER_SUPPLY_PROP_CHARGE_NOW: + if (di->regs.nac < 0) + return di->regs.nac; + val->intval = (di->regs.nac * 3570) / di->pdata->rsense_mohms; + break; case POWER_SUPPLY_PROP_TEMP: if (di->regs.temp < 0) return di->regs.temp; @@ -321,6 +329,7 @@ static void bq27000_battery_work(struct work_struct *work) regs.ai = hdq_read16(di, BQ27000_AI_L); regs.flags = (di->pdata->hdq_read)(BQ27000_FLAGS); regs.lmd = hdq_read16(di, BQ27000_LMD_L); + regs.nac = hdq_read16(di, BQ27000_NAC_L); regs.rsoc = (di->pdata->hdq_read)(BQ27000_RSOC); regs.temp = hdq_read16(di, BQ27000_TEMP_L); regs.tte = hdq_read16(di, BQ27000_TTE_L); @@ -343,6 +352,7 @@ static enum power_supply_property bq27000_battery_props[] = { POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_CURRENT_NOW, POWER_SUPPLY_PROP_CHARGE_FULL, + POWER_SUPPLY_PROP_CHARGE_NOW, POWER_SUPPLY_PROP_TEMP, POWER_SUPPLY_PROP_TECHNOLOGY, POWER_SUPPLY_PROP_PRESENT, diff --git a/drivers/power/gta01_battery.c b/drivers/power/gta01_battery.c index 909f7fe16d9..81a0fe7387e 100644 --- a/drivers/power/gta01_battery.c +++ b/drivers/power/gta01_battery.c @@ -19,6 +19,7 @@ struct gta01_battery { }; static enum power_supply_property gta01_bat_props[] = { + POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_STATUS, POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_CURRENT_NOW, @@ -43,6 +44,9 @@ static int gta01_bat_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_CURRENT_NOW: val->intval = bat->pdata->get_current(); break; + case POWER_SUPPLY_PROP_PRESENT: + val->intval = 1; /* You must never run GTA01 without battery. */ + break; default: return -EINVAL; } diff --git a/drivers/power/pcf50633-charger.c b/drivers/power/pcf50633-charger.c index 8772604ae1a..1bdb9906201 100644 --- a/drivers/power/pcf50633-charger.c +++ b/drivers/power/pcf50633-charger.c @@ -114,6 +114,9 @@ int pcf50633_mbc_get_status(struct pcf50633 *pcf) struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev); int status = 0; + if (!mbc) + return 0; + if (mbc->usb_online) status |= PCF50633_MBC_USB_ONLINE; if (mbc->usb_active) diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index 1a185c1194e..c8dca979b04 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c @@ -74,6 +74,7 @@ static void __iomem *base_addr; static u64 rsrc_start; static u64 rsrc_len; static struct dentry *s3c2410_udc_debugfs_root; +static struct timer_list vbus_poll_timer; static inline u32 udc_read(u32 reg) { @@ -1526,6 +1527,20 @@ static irqreturn_t s3c2410_udc_vbus_irq(int irq, void *_dev) return IRQ_HANDLED; } +static void s3c2410_udc_vbus_poll(unsigned long _data) +{ + struct s3c2410_udc *data = (struct s3c2410_udc *)_data; + int v; + + dprintk(DEBUG_NORMAL, "%s()\n", __func__); + if (udc_info && udc_info->get_vbus_status) { + v = udc_info->get_vbus_status(); + if ((v > -1) && (v != data->vbus)) + s3c2410_udc_vbus_session(&data->gadget, v); + mod_timer(&vbus_poll_timer, jiffies + msecs_to_jiffies(900)); + } +} + static int s3c2410_vbus_draw(struct usb_gadget *_gadget, unsigned ma) { dprintk(DEBUG_NORMAL, "%s()\n", __func__); @@ -1683,6 +1698,11 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) goto register_error; } + if (udc_info && udc_info->get_vbus_status && !udc_info->vbus_pin) { + mod_timer(&vbus_poll_timer, jiffies + msecs_to_jiffies(50)); + return 0; /* just return, vbus change will enable udc */ + } + /* Enable udc */ s3c2410_udc_enable(udc); @@ -1713,6 +1733,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) if (driver->disconnect) driver->disconnect(&udc->gadget); + driver->unbind(&udc->gadget); device_del(&udc->gadget.dev); udc->driver = NULL; @@ -1899,6 +1920,11 @@ static int s3c2410_udc_probe(struct platform_device *pdev) } dev_dbg(dev, "got irq %i\n", irq); + } else if (udc_info && udc_info->get_vbus_status) { + udc->vbus = 0; + init_timer(&vbus_poll_timer); + vbus_poll_timer.function = s3c2410_udc_vbus_poll; + vbus_poll_timer.data = (unsigned long) udc; } else { udc->vbus = 1; } @@ -1947,6 +1973,8 @@ static int s3c2410_udc_remove(struct platform_device *pdev) if (udc_info && udc_info->vbus_pin > 0) { irq = gpio_to_irq(udc_info->vbus_pin); free_irq(irq, udc); + } else if (udc_info && udc_info->get_vbus_status) { + del_timer_sync(&vbus_poll_timer); } free_irq(IRQ_USBD, udc); diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index 96d65ca06ec..4007770f7ed 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c @@ -175,12 +175,6 @@ static void eth_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *p) strlcpy(p->bus_info, dev_name(&dev->gadget->dev), sizeof p->bus_info); } -static u32 eth_get_link(struct net_device *net) -{ - struct eth_dev *dev = netdev_priv(net); - return dev->gadget->speed != USB_SPEED_UNKNOWN; -} - /* REVISIT can also support: * - WOL (by tracking suspends and issuing remote wakeup) * - msglevel (implies updated messaging) @@ -189,7 +183,7 @@ static u32 eth_get_link(struct net_device *net) static struct ethtool_ops ops = { .get_drvinfo = eth_get_drvinfo, - .get_link = eth_get_link + .get_link = ethtool_op_get_link, }; static void defer_kevent(struct eth_dev *dev, int flag) |