diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-21 21:28:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-21 21:28:52 -0500 |
commit | 0703c680f62cb210fecf24684cc1c6a70c26c899 (patch) | |
tree | 3ba1f520d41a5bb64c0cd9b62ca456ac378b85ef | |
parent | e6f67b8c05f5e129e126f4409ddac6f25f58ffcb (diff) | |
parent | fa860403e61cf5201e2f03b726aa53c30ae9a659 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
mfd: Include linux/io.h to jz4740-adc
mfd: Use request_threaded_irq for twl4030-irq instead of irq_set_chained_handler
mfd: Base interrupt for twl4030-irq must be one-shot
mfd: Handle tps65910 clear-mask correctly
mfd: add #ifdef CONFIG_DEBUG_FS guard for ab8500_debug_resources
mfd: Fix twl-core oops while calling twl_i2c_* for unbound driver
mfd: include linux/module.h for ab5500-debugfs
mfd: Update wm8994 active device checks for WM1811
mfd: Set tps6586x bits if new value is different from the old one
mfd: Set da903x bits if new value is different from the old one
mfd: Set adp5520 bits if new value is different from the old one
mfd: Add missed free_irq in da903x_remove
-rw-r--r-- | drivers/mfd/ab5500-debugfs.c | 2 | ||||
-rw-r--r-- | drivers/mfd/ab8500-core.c | 2 | ||||
-rw-r--r-- | drivers/mfd/adp5520.c | 2 | ||||
-rw-r--r-- | drivers/mfd/da903x.c | 3 | ||||
-rw-r--r-- | drivers/mfd/jz4740-adc.c | 1 | ||||
-rw-r--r-- | drivers/mfd/tps6586x.c | 2 | ||||
-rw-r--r-- | drivers/mfd/tps65910.c | 2 | ||||
-rw-r--r-- | drivers/mfd/twl-core.c | 16 | ||||
-rw-r--r-- | drivers/mfd/twl4030-irq.c | 18 | ||||
-rw-r--r-- | drivers/mfd/wm8994-core.c | 1 |
10 files changed, 29 insertions, 20 deletions
diff --git a/drivers/mfd/ab5500-debugfs.c b/drivers/mfd/ab5500-debugfs.c index 43c0ebb81956..b7b2d3483fd4 100644 --- a/drivers/mfd/ab5500-debugfs.c +++ b/drivers/mfd/ab5500-debugfs.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Debugfs support for the AB5500 MFD driver | 4 | * Debugfs support for the AB5500 MFD driver |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <linux/export.h> | 7 | #include <linux/module.h> |
8 | #include <linux/debugfs.h> | 8 | #include <linux/debugfs.h> |
9 | #include <linux/seq_file.h> | 9 | #include <linux/seq_file.h> |
10 | #include <linux/mfd/ab5500/ab5500.h> | 10 | #include <linux/mfd/ab5500/ab5500.h> |
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 1e9173804ede..d3d572b2317b 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c | |||
@@ -620,6 +620,7 @@ static struct resource __devinitdata ab8500_fg_resources[] = { | |||
620 | 620 | ||
621 | static struct resource __devinitdata ab8500_chargalg_resources[] = {}; | 621 | static struct resource __devinitdata ab8500_chargalg_resources[] = {}; |
622 | 622 | ||
623 | #ifdef CONFIG_DEBUG_FS | ||
623 | static struct resource __devinitdata ab8500_debug_resources[] = { | 624 | static struct resource __devinitdata ab8500_debug_resources[] = { |
624 | { | 625 | { |
625 | .name = "IRQ_FIRST", | 626 | .name = "IRQ_FIRST", |
@@ -634,6 +635,7 @@ static struct resource __devinitdata ab8500_debug_resources[] = { | |||
634 | .flags = IORESOURCE_IRQ, | 635 | .flags = IORESOURCE_IRQ, |
635 | }, | 636 | }, |
636 | }; | 637 | }; |
638 | #endif | ||
637 | 639 | ||
638 | static struct resource __devinitdata ab8500_usb_resources[] = { | 640 | static struct resource __devinitdata ab8500_usb_resources[] = { |
639 | { | 641 | { |
diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c index f1d88483112c..8d816cce8322 100644 --- a/drivers/mfd/adp5520.c +++ b/drivers/mfd/adp5520.c | |||
@@ -109,7 +109,7 @@ int adp5520_set_bits(struct device *dev, int reg, uint8_t bit_mask) | |||
109 | 109 | ||
110 | ret = __adp5520_read(chip->client, reg, ®_val); | 110 | ret = __adp5520_read(chip->client, reg, ®_val); |
111 | 111 | ||
112 | if (!ret && ((reg_val & bit_mask) == 0)) { | 112 | if (!ret && ((reg_val & bit_mask) != bit_mask)) { |
113 | reg_val |= bit_mask; | 113 | reg_val |= bit_mask; |
114 | ret = __adp5520_write(chip->client, reg, reg_val); | 114 | ret = __adp5520_write(chip->client, reg, reg_val); |
115 | } | 115 | } |
diff --git a/drivers/mfd/da903x.c b/drivers/mfd/da903x.c index 1b79c37fd599..1924b857a0fb 100644 --- a/drivers/mfd/da903x.c +++ b/drivers/mfd/da903x.c | |||
@@ -182,7 +182,7 @@ int da903x_set_bits(struct device *dev, int reg, uint8_t bit_mask) | |||
182 | if (ret) | 182 | if (ret) |
183 | goto out; | 183 | goto out; |
184 | 184 | ||
185 | if ((reg_val & bit_mask) == 0) { | 185 | if ((reg_val & bit_mask) != bit_mask) { |
186 | reg_val |= bit_mask; | 186 | reg_val |= bit_mask; |
187 | ret = __da903x_write(chip->client, reg, reg_val); | 187 | ret = __da903x_write(chip->client, reg, reg_val); |
188 | } | 188 | } |
@@ -549,6 +549,7 @@ static int __devexit da903x_remove(struct i2c_client *client) | |||
549 | struct da903x_chip *chip = i2c_get_clientdata(client); | 549 | struct da903x_chip *chip = i2c_get_clientdata(client); |
550 | 550 | ||
551 | da903x_remove_subdevs(chip); | 551 | da903x_remove_subdevs(chip); |
552 | free_irq(client->irq, chip); | ||
552 | kfree(chip); | 553 | kfree(chip); |
553 | return 0; | 554 | return 0; |
554 | } | 555 | } |
diff --git a/drivers/mfd/jz4740-adc.c b/drivers/mfd/jz4740-adc.c index 1e9ee533eacb..ef39528088f2 100644 --- a/drivers/mfd/jz4740-adc.c +++ b/drivers/mfd/jz4740-adc.c | |||
@@ -16,6 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <linux/err.h> | 18 | #include <linux/err.h> |
19 | #include <linux/io.h> | ||
19 | #include <linux/irq.h> | 20 | #include <linux/irq.h> |
20 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
21 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c index bba26d96c240..a5ddf31b60ca 100644 --- a/drivers/mfd/tps6586x.c +++ b/drivers/mfd/tps6586x.c | |||
@@ -197,7 +197,7 @@ int tps6586x_set_bits(struct device *dev, int reg, uint8_t bit_mask) | |||
197 | if (ret) | 197 | if (ret) |
198 | goto out; | 198 | goto out; |
199 | 199 | ||
200 | if ((reg_val & bit_mask) == 0) { | 200 | if ((reg_val & bit_mask) != bit_mask) { |
201 | reg_val |= bit_mask; | 201 | reg_val |= bit_mask; |
202 | ret = __tps6586x_write(to_i2c_client(dev), reg, reg_val); | 202 | ret = __tps6586x_write(to_i2c_client(dev), reg, reg_val); |
203 | } | 203 | } |
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c index 6f5b8cf2f652..c1da84bc1573 100644 --- a/drivers/mfd/tps65910.c +++ b/drivers/mfd/tps65910.c | |||
@@ -120,7 +120,7 @@ int tps65910_clear_bits(struct tps65910 *tps65910, u8 reg, u8 mask) | |||
120 | goto out; | 120 | goto out; |
121 | } | 121 | } |
122 | 122 | ||
123 | data &= mask; | 123 | data &= ~mask; |
124 | err = tps65910_i2c_write(tps65910, reg, 1, &data); | 124 | err = tps65910_i2c_write(tps65910, reg, 1, &data); |
125 | if (err) | 125 | if (err) |
126 | dev_err(tps65910->dev, "write to reg %x failed\n", reg); | 126 | dev_err(tps65910->dev, "write to reg %x failed\n", reg); |
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index bfbd66021afd..61e70cfaa774 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c | |||
@@ -363,13 +363,13 @@ int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes) | |||
363 | pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no); | 363 | pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no); |
364 | return -EPERM; | 364 | return -EPERM; |
365 | } | 365 | } |
366 | sid = twl_map[mod_no].sid; | ||
367 | twl = &twl_modules[sid]; | ||
368 | |||
369 | if (unlikely(!inuse)) { | 366 | if (unlikely(!inuse)) { |
370 | pr_err("%s: client %d is not initialized\n", DRIVER_NAME, sid); | 367 | pr_err("%s: not initialized\n", DRIVER_NAME); |
371 | return -EPERM; | 368 | return -EPERM; |
372 | } | 369 | } |
370 | sid = twl_map[mod_no].sid; | ||
371 | twl = &twl_modules[sid]; | ||
372 | |||
373 | mutex_lock(&twl->xfer_lock); | 373 | mutex_lock(&twl->xfer_lock); |
374 | /* | 374 | /* |
375 | * [MSG1]: fill the register address data | 375 | * [MSG1]: fill the register address data |
@@ -420,13 +420,13 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes) | |||
420 | pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no); | 420 | pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no); |
421 | return -EPERM; | 421 | return -EPERM; |
422 | } | 422 | } |
423 | sid = twl_map[mod_no].sid; | ||
424 | twl = &twl_modules[sid]; | ||
425 | |||
426 | if (unlikely(!inuse)) { | 423 | if (unlikely(!inuse)) { |
427 | pr_err("%s: client %d is not initialized\n", DRIVER_NAME, sid); | 424 | pr_err("%s: not initialized\n", DRIVER_NAME); |
428 | return -EPERM; | 425 | return -EPERM; |
429 | } | 426 | } |
427 | sid = twl_map[mod_no].sid; | ||
428 | twl = &twl_modules[sid]; | ||
429 | |||
430 | mutex_lock(&twl->xfer_lock); | 430 | mutex_lock(&twl->xfer_lock); |
431 | /* [MSG1] fill the register address data */ | 431 | /* [MSG1] fill the register address data */ |
432 | msg = &twl->xfer_msg[0]; | 432 | msg = &twl->xfer_msg[0]; |
diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c index f062c8cc6c38..29f11e0765fe 100644 --- a/drivers/mfd/twl4030-irq.c +++ b/drivers/mfd/twl4030-irq.c | |||
@@ -432,6 +432,7 @@ struct sih_agent { | |||
432 | u32 edge_change; | 432 | u32 edge_change; |
433 | 433 | ||
434 | struct mutex irq_lock; | 434 | struct mutex irq_lock; |
435 | char *irq_name; | ||
435 | }; | 436 | }; |
436 | 437 | ||
437 | /*----------------------------------------------------------------------*/ | 438 | /*----------------------------------------------------------------------*/ |
@@ -589,7 +590,7 @@ static inline int sih_read_isr(const struct sih *sih) | |||
589 | * Generic handler for SIH interrupts ... we "know" this is called | 590 | * Generic handler for SIH interrupts ... we "know" this is called |
590 | * in task context, with IRQs enabled. | 591 | * in task context, with IRQs enabled. |
591 | */ | 592 | */ |
592 | static void handle_twl4030_sih(unsigned irq, struct irq_desc *desc) | 593 | static irqreturn_t handle_twl4030_sih(int irq, void *data) |
593 | { | 594 | { |
594 | struct sih_agent *agent = irq_get_handler_data(irq); | 595 | struct sih_agent *agent = irq_get_handler_data(irq); |
595 | const struct sih *sih = agent->sih; | 596 | const struct sih *sih = agent->sih; |
@@ -602,7 +603,7 @@ static void handle_twl4030_sih(unsigned irq, struct irq_desc *desc) | |||
602 | pr_err("twl4030: %s SIH, read ISR error %d\n", | 603 | pr_err("twl4030: %s SIH, read ISR error %d\n", |
603 | sih->name, isr); | 604 | sih->name, isr); |
604 | /* REVISIT: recover; eventually mask it all, etc */ | 605 | /* REVISIT: recover; eventually mask it all, etc */ |
605 | return; | 606 | return IRQ_HANDLED; |
606 | } | 607 | } |
607 | 608 | ||
608 | while (isr) { | 609 | while (isr) { |
@@ -616,6 +617,7 @@ static void handle_twl4030_sih(unsigned irq, struct irq_desc *desc) | |||
616 | pr_err("twl4030: %s SIH, invalid ISR bit %d\n", | 617 | pr_err("twl4030: %s SIH, invalid ISR bit %d\n", |
617 | sih->name, irq); | 618 | sih->name, irq); |
618 | } | 619 | } |
620 | return IRQ_HANDLED; | ||
619 | } | 621 | } |
620 | 622 | ||
621 | static unsigned twl4030_irq_next; | 623 | static unsigned twl4030_irq_next; |
@@ -668,18 +670,19 @@ int twl4030_sih_setup(int module) | |||
668 | activate_irq(irq); | 670 | activate_irq(irq); |
669 | } | 671 | } |
670 | 672 | ||
671 | status = irq_base; | ||
672 | twl4030_irq_next += i; | 673 | twl4030_irq_next += i; |
673 | 674 | ||
674 | /* replace generic PIH handler (handle_simple_irq) */ | 675 | /* replace generic PIH handler (handle_simple_irq) */ |
675 | irq = sih_mod + twl4030_irq_base; | 676 | irq = sih_mod + twl4030_irq_base; |
676 | irq_set_handler_data(irq, agent); | 677 | irq_set_handler_data(irq, agent); |
677 | irq_set_chained_handler(irq, handle_twl4030_sih); | 678 | agent->irq_name = kasprintf(GFP_KERNEL, "twl4030_%s", sih->name); |
679 | status = request_threaded_irq(irq, NULL, handle_twl4030_sih, 0, | ||
680 | agent->irq_name ?: sih->name, NULL); | ||
678 | 681 | ||
679 | pr_info("twl4030: %s (irq %d) chaining IRQs %d..%d\n", sih->name, | 682 | pr_info("twl4030: %s (irq %d) chaining IRQs %d..%d\n", sih->name, |
680 | irq, irq_base, twl4030_irq_next - 1); | 683 | irq, irq_base, twl4030_irq_next - 1); |
681 | 684 | ||
682 | return status; | 685 | return status < 0 ? status : irq_base; |
683 | } | 686 | } |
684 | 687 | ||
685 | /* FIXME need a call to reverse twl4030_sih_setup() ... */ | 688 | /* FIXME need a call to reverse twl4030_sih_setup() ... */ |
@@ -733,8 +736,9 @@ int twl4030_init_irq(int irq_num, unsigned irq_base, unsigned irq_end) | |||
733 | } | 736 | } |
734 | 737 | ||
735 | /* install an irq handler to demultiplex the TWL4030 interrupt */ | 738 | /* install an irq handler to demultiplex the TWL4030 interrupt */ |
736 | status = request_threaded_irq(irq_num, NULL, handle_twl4030_pih, 0, | 739 | status = request_threaded_irq(irq_num, NULL, handle_twl4030_pih, |
737 | "TWL4030-PIH", NULL); | 740 | IRQF_ONESHOT, |
741 | "TWL4030-PIH", NULL); | ||
738 | if (status < 0) { | 742 | if (status < 0) { |
739 | pr_err("twl4030: could not claim irq%d: %d\n", irq_num, status); | 743 | pr_err("twl4030: could not claim irq%d: %d\n", irq_num, status); |
740 | goto fail_rqirq; | 744 | goto fail_rqirq; |
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 5d6ba132837e..61894fced8ea 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c | |||
@@ -239,6 +239,7 @@ static int wm8994_suspend(struct device *dev) | |||
239 | 239 | ||
240 | switch (wm8994->type) { | 240 | switch (wm8994->type) { |
241 | case WM8958: | 241 | case WM8958: |
242 | case WM1811: | ||
242 | ret = wm8994_reg_read(wm8994, WM8958_MIC_DETECT_1); | 243 | ret = wm8994_reg_read(wm8994, WM8958_MIC_DETECT_1); |
243 | if (ret < 0) { | 244 | if (ret < 0) { |
244 | dev_err(dev, "Failed to read power status: %d\n", ret); | 245 | dev_err(dev, "Failed to read power status: %d\n", ret); |