diff options
Diffstat (limited to 'drivers/i2c/chips')
-rw-r--r-- | drivers/i2c/chips/ds1337.c | 8 | ||||
-rw-r--r-- | drivers/i2c/chips/isp1301_omap.c | 2 | ||||
-rw-r--r-- | drivers/i2c/chips/m41t00.c | 1 | ||||
-rw-r--r-- | drivers/i2c/chips/tps65010.c | 21 |
4 files changed, 21 insertions, 11 deletions
diff --git a/drivers/i2c/chips/ds1337.c b/drivers/i2c/chips/ds1337.c index 93d483b8b77..ec17d6b684a 100644 --- a/drivers/i2c/chips/ds1337.c +++ b/drivers/i2c/chips/ds1337.c @@ -347,13 +347,19 @@ static void ds1337_init_client(struct i2c_client *client) if ((status & 0x80) || (control & 0x80)) { /* RTC not running */ - u8 buf[16]; + u8 buf[1+16]; /* First byte is interpreted as address */ struct i2c_msg msg[1]; dev_dbg(&client->dev, "%s: RTC not running!\n", __FUNCTION__); /* Initialize all, including STATUS and CONTROL to zero */ memset(buf, 0, sizeof(buf)); + + /* Write valid values in the date/time registers */ + buf[1+DS1337_REG_DAY] = 1; + buf[1+DS1337_REG_DATE] = 1; + buf[1+DS1337_REG_MONTH] = 1; + msg[0].addr = client->addr; msg[0].flags = 0; msg[0].len = sizeof(buf); diff --git a/drivers/i2c/chips/isp1301_omap.c b/drivers/i2c/chips/isp1301_omap.c index ccdf3e90862..9fafadb9251 100644 --- a/drivers/i2c/chips/isp1301_omap.c +++ b/drivers/i2c/chips/isp1301_omap.c @@ -27,7 +27,7 @@ #include <linux/slab.h> #include <linux/interrupt.h> #include <linux/platform_device.h> -#include <linux/usb_ch9.h> +#include <linux/usb/ch9.h> #include <linux/usb_gadget.h> #include <linux/usb.h> #include <linux/usb/otg.h> diff --git a/drivers/i2c/chips/m41t00.c b/drivers/i2c/chips/m41t00.c index 420377c8642..3fcb646e207 100644 --- a/drivers/i2c/chips/m41t00.c +++ b/drivers/i2c/chips/m41t00.c @@ -209,6 +209,7 @@ m41t00_set(void *arg) buf[m41t00_chip->hour] = (buf[m41t00_chip->hour] & ~0x3f) | (hour& 0x3f); buf[m41t00_chip->day] = (buf[m41t00_chip->day] & ~0x3f) | (day & 0x3f); buf[m41t00_chip->mon] = (buf[m41t00_chip->mon] & ~0x1f) | (mon & 0x1f); + buf[m41t00_chip->year] = year; if (i2c_master_send(save_client, wbuf, 9) < 0) dev_err(&save_client->dev, "m41t00_set: Write error\n"); diff --git a/drivers/i2c/chips/tps65010.c b/drivers/i2c/chips/tps65010.c index 60bef94cd25..4ee56def61f 100644 --- a/drivers/i2c/chips/tps65010.c +++ b/drivers/i2c/chips/tps65010.c @@ -82,7 +82,7 @@ struct tps65010 { struct i2c_client client; struct mutex lock; int irq; - struct work_struct work; + struct delayed_work work; struct dentry *file; unsigned charging:1; unsigned por:1; @@ -328,7 +328,7 @@ static void tps65010_interrupt(struct tps65010 *tps) { u8 tmp = 0, mask, poll; - /* IRQs won't trigger irqs for certain events, but we can get + /* IRQs won't trigger for certain events, but we can get * others by polling (normally, with external power applied). */ poll = 0; @@ -411,10 +411,11 @@ static void tps65010_interrupt(struct tps65010 *tps) } /* handle IRQs and polling using keventd for now */ -static void tps65010_work(void *_tps) +static void tps65010_work(struct work_struct *work) { - struct tps65010 *tps = _tps; + struct tps65010 *tps; + tps = container_of(work, struct tps65010, work.work); mutex_lock(&tps->lock); tps65010_interrupt(tps); @@ -452,7 +453,7 @@ static irqreturn_t tps65010_irq(int irq, void *_tps) disable_irq_nosync(irq); set_bit(FLAG_IRQ_ENABLE, &tps->flags); - (void) schedule_work(&tps->work); + (void) schedule_work(&tps->work.work); return IRQ_HANDLED; } @@ -465,13 +466,15 @@ static int __exit tps65010_detach_client(struct i2c_client *client) struct tps65010 *tps; tps = container_of(client, struct tps65010, client); + free_irq(tps->irq, tps); #ifdef CONFIG_ARM if (machine_is_omap_h2()) omap_free_gpio(58); if (machine_is_omap_osk()) omap_free_gpio(OMAP_MPUIO(1)); #endif - free_irq(tps->irq, tps); + cancel_delayed_work(&tps->work); + flush_scheduled_work(); debugfs_remove(tps->file); if (i2c_detach_client(client) == 0) kfree(tps); @@ -505,7 +508,7 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind) return 0; mutex_init(&tps->lock); - INIT_WORK(&tps->work, tps65010_work, tps); + INIT_DELAYED_WORK(&tps->work, tps65010_work); tps->irq = -1; tps->client.addr = address; tps->client.adapter = bus; @@ -620,7 +623,7 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind) (void) i2c_smbus_write_byte_data(&tps->client, TPS_MASK3, 0x0f | i2c_smbus_read_byte_data(&tps->client, TPS_MASK3)); - tps65010_work(tps); + tps65010_work(&tps->work.work); tps->file = debugfs_create_file(DRIVER_NAME, S_IRUGO, NULL, tps, DEBUG_FOPS); @@ -672,7 +675,7 @@ int tps65010_set_vbus_draw(unsigned mA) && test_and_set_bit( FLAG_VBUS_CHANGED, &the_tps->flags)) { /* gadget drivers call this in_irq() */ - (void) schedule_work(&the_tps->work); + (void) schedule_work(&the_tps->work.work); } local_irq_restore(flags); |