diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2011-05-07 18:54:45 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-05-26 13:45:42 -0400 |
commit | 863dde5bfa3c48f459c6302daf64f94a11c7c1e5 (patch) | |
tree | b610b75d088d95c5d6d0fd1700244df38a32cb2b /drivers/mfd | |
parent | eac78a21017f5beefa75f88b966950cd89caac37 (diff) |
mfd: Provide ab8500-core enumerators for chip cuts
Since functionality in MFD cells may need to be adjusted according to
chip revision, let's enumerate them and keep track of them.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/ab8500-core.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 67d01c938284..fc0c1af1566e 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c | |||
@@ -254,8 +254,9 @@ static void ab8500_irq_sync_unlock(struct irq_data *data) | |||
254 | if (new == old) | 254 | if (new == old) |
255 | continue; | 255 | continue; |
256 | 256 | ||
257 | /* Interrupt register 12 does'nt exist prior to version 0x20 */ | 257 | /* Interrupt register 12 doesn't exist prior to version 2.0 */ |
258 | if (ab8500_irq_regoffset[i] == 11 && ab8500->chip_id < 0x20) | 258 | if (ab8500_irq_regoffset[i] == 11 && |
259 | ab8500->chip_id < AB8500_CUT2P0) | ||
259 | continue; | 260 | continue; |
260 | 261 | ||
261 | ab8500->oldmask[i] = new; | 262 | ab8500->oldmask[i] = new; |
@@ -307,8 +308,8 @@ static irqreturn_t ab8500_irq(int irq, void *dev) | |||
307 | int status; | 308 | int status; |
308 | u8 value; | 309 | u8 value; |
309 | 310 | ||
310 | /* Interrupt register 12 does'nt exist prior to version 0x20 */ | 311 | /* Interrupt register 12 doesn't exist prior to version 2.0 */ |
311 | if (regoffset == 11 && ab8500->chip_id < 0x20) | 312 | if (regoffset == 11 && ab8500->chip_id < AB8500_CUT2P0) |
312 | continue; | 313 | continue; |
313 | 314 | ||
314 | status = get_register_interruptible(ab8500, AB8500_INTERRUPT, | 315 | status = get_register_interruptible(ab8500, AB8500_INTERRUPT, |
@@ -724,17 +725,15 @@ int __devinit ab8500_init(struct ab8500 *ab8500) | |||
724 | if (ret < 0) | 725 | if (ret < 0) |
725 | return ret; | 726 | return ret; |
726 | 727 | ||
727 | /* | 728 | switch (value) { |
728 | * 0x0 - Early Drop | 729 | case AB8500_CUTEARLY: |
729 | * 0x10 - Cut 1.0 | 730 | case AB8500_CUT1P0: |
730 | * 0x11 - Cut 1.1 | 731 | case AB8500_CUT1P1: |
731 | * 0x20 - Cut 2.0 | 732 | case AB8500_CUT2P0: |
732 | * 0x30 - Cut 3.0 | 733 | case AB8500_CUT3P0: |
733 | */ | ||
734 | if (value == 0x0 || value == 0x10 || value == 0x11 || value == 0x20 || | ||
735 | value == 0x30) { | ||
736 | dev_info(ab8500->dev, "detected chip, revision: %#x\n", value); | 734 | dev_info(ab8500->dev, "detected chip, revision: %#x\n", value); |
737 | } else { | 735 | break; |
736 | default: | ||
738 | dev_err(ab8500->dev, "unknown chip, revision: %#x\n", value); | 737 | dev_err(ab8500->dev, "unknown chip, revision: %#x\n", value); |
739 | return -EINVAL; | 738 | return -EINVAL; |
740 | } | 739 | } |
@@ -763,8 +762,9 @@ int __devinit ab8500_init(struct ab8500 *ab8500) | |||
763 | 762 | ||
764 | /* Clear and mask all interrupts */ | 763 | /* Clear and mask all interrupts */ |
765 | for (i = 0; i < AB8500_NUM_IRQ_REGS; i++) { | 764 | for (i = 0; i < AB8500_NUM_IRQ_REGS; i++) { |
766 | /* Interrupt register 12 does'nt exist prior to version 0x20 */ | 765 | /* Interrupt register 12 doesn't exist prior to version 2.0 */ |
767 | if (ab8500_irq_regoffset[i] == 11 && ab8500->chip_id < 0x20) | 766 | if (ab8500_irq_regoffset[i] == 11 && |
767 | ab8500->chip_id < AB8500_CUT2P0) | ||
768 | continue; | 768 | continue; |
769 | 769 | ||
770 | get_register_interruptible(ab8500, AB8500_INTERRUPT, | 770 | get_register_interruptible(ab8500, AB8500_INTERRUPT, |