Commit 863dde5b authored by Linus Walleij's avatar Linus Walleij Committed by Samuel Ortiz

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: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent eac78a21
...@@ -254,8 +254,9 @@ static void ab8500_irq_sync_unlock(struct irq_data *data) ...@@ -254,8 +254,9 @@ static void ab8500_irq_sync_unlock(struct irq_data *data)
if (new == old) if (new == old)
continue; continue;
/* Interrupt register 12 does'nt exist prior to version 0x20 */ /* Interrupt register 12 doesn't exist prior to version 2.0 */
if (ab8500_irq_regoffset[i] == 11 && ab8500->chip_id < 0x20) if (ab8500_irq_regoffset[i] == 11 &&
ab8500->chip_id < AB8500_CUT2P0)
continue; continue;
ab8500->oldmask[i] = new; ab8500->oldmask[i] = new;
...@@ -307,8 +308,8 @@ static irqreturn_t ab8500_irq(int irq, void *dev) ...@@ -307,8 +308,8 @@ static irqreturn_t ab8500_irq(int irq, void *dev)
int status; int status;
u8 value; u8 value;
/* Interrupt register 12 does'nt exist prior to version 0x20 */ /* Interrupt register 12 doesn't exist prior to version 2.0 */
if (regoffset == 11 && ab8500->chip_id < 0x20) if (regoffset == 11 && ab8500->chip_id < AB8500_CUT2P0)
continue; continue;
status = get_register_interruptible(ab8500, AB8500_INTERRUPT, status = get_register_interruptible(ab8500, AB8500_INTERRUPT,
...@@ -724,17 +725,15 @@ int __devinit ab8500_init(struct ab8500 *ab8500) ...@@ -724,17 +725,15 @@ int __devinit ab8500_init(struct ab8500 *ab8500)
if (ret < 0) if (ret < 0)
return ret; return ret;
/* switch (value) {
* 0x0 - Early Drop case AB8500_CUTEARLY:
* 0x10 - Cut 1.0 case AB8500_CUT1P0:
* 0x11 - Cut 1.1 case AB8500_CUT1P1:
* 0x20 - Cut 2.0 case AB8500_CUT2P0:
* 0x30 - Cut 3.0 case AB8500_CUT3P0:
*/
if (value == 0x0 || value == 0x10 || value == 0x11 || value == 0x20 ||
value == 0x30) {
dev_info(ab8500->dev, "detected chip, revision: %#x\n", value); dev_info(ab8500->dev, "detected chip, revision: %#x\n", value);
} else { break;
default:
dev_err(ab8500->dev, "unknown chip, revision: %#x\n", value); dev_err(ab8500->dev, "unknown chip, revision: %#x\n", value);
return -EINVAL; return -EINVAL;
} }
...@@ -763,8 +762,9 @@ int __devinit ab8500_init(struct ab8500 *ab8500) ...@@ -763,8 +762,9 @@ int __devinit ab8500_init(struct ab8500 *ab8500)
/* Clear and mask all interrupts */ /* Clear and mask all interrupts */
for (i = 0; i < AB8500_NUM_IRQ_REGS; i++) { for (i = 0; i < AB8500_NUM_IRQ_REGS; i++) {
/* Interrupt register 12 does'nt exist prior to version 0x20 */ /* Interrupt register 12 doesn't exist prior to version 2.0 */
if (ab8500_irq_regoffset[i] == 11 && ab8500->chip_id < 0x20) if (ab8500_irq_regoffset[i] == 11 &&
ab8500->chip_id < AB8500_CUT2P0)
continue; continue;
get_register_interruptible(ab8500, AB8500_INTERRUPT, get_register_interruptible(ab8500, AB8500_INTERRUPT,
......
...@@ -34,6 +34,13 @@ ...@@ -34,6 +34,13 @@
#define AB5500_2_0 0x21 #define AB5500_2_0 0x21
#define AB5500_2_1 0x22 #define AB5500_2_1 0x22
/* AB8500 CIDs*/
#define AB8500_CUTEARLY 0x00
#define AB8500_CUT1P0 0x10
#define AB8500_CUT1P1 0x11
#define AB8500_CUT2P0 0x20
#define AB8500_CUT3P0 0x30
/* /*
* AB3100, EVENTA1, A2 and A3 event register flags * AB3100, EVENTA1, A2 and A3 event register flags
* these are catenated into a single 32-bit flag in the code * these are catenated into a single 32-bit flag in the code
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment