diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/mfd/max8925-core.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/mfd/max8925-core.c')
-rw-r--r-- | drivers/mfd/max8925-core.c | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/drivers/mfd/max8925-core.c b/drivers/mfd/max8925-core.c index 428377a5a6f5..e1e59c92f758 100644 --- a/drivers/mfd/max8925-core.c +++ b/drivers/mfd/max8925-core.c | |||
@@ -93,8 +93,13 @@ static struct mfd_cell rtc_devs[] = { | |||
93 | static struct resource onkey_resources[] = { | 93 | static struct resource onkey_resources[] = { |
94 | { | 94 | { |
95 | .name = "max8925-onkey", | 95 | .name = "max8925-onkey", |
96 | .start = MAX8925_IRQ_GPM_SW_3SEC, | 96 | .start = MAX8925_IRQ_GPM_SW_R, |
97 | .end = MAX8925_IRQ_GPM_SW_3SEC, | 97 | .end = MAX8925_IRQ_GPM_SW_R, |
98 | .flags = IORESOURCE_IRQ, | ||
99 | }, { | ||
100 | .name = "max8925-onkey", | ||
101 | .start = MAX8925_IRQ_GPM_SW_F, | ||
102 | .end = MAX8925_IRQ_GPM_SW_F, | ||
98 | .flags = IORESOURCE_IRQ, | 103 | .flags = IORESOURCE_IRQ, |
99 | }, | 104 | }, |
100 | }; | 105 | }; |
@@ -102,7 +107,7 @@ static struct resource onkey_resources[] = { | |||
102 | static struct mfd_cell onkey_devs[] = { | 107 | static struct mfd_cell onkey_devs[] = { |
103 | { | 108 | { |
104 | .name = "max8925-onkey", | 109 | .name = "max8925-onkey", |
105 | .num_resources = 1, | 110 | .num_resources = 2, |
106 | .resources = &onkey_resources[0], | 111 | .resources = &onkey_resources[0], |
107 | .id = -1, | 112 | .id = -1, |
108 | }, | 113 | }, |
@@ -402,16 +407,16 @@ static irqreturn_t max8925_tsc_irq(int irq, void *data) | |||
402 | return IRQ_HANDLED; | 407 | return IRQ_HANDLED; |
403 | } | 408 | } |
404 | 409 | ||
405 | static void max8925_irq_lock(unsigned int irq) | 410 | static void max8925_irq_lock(struct irq_data *data) |
406 | { | 411 | { |
407 | struct max8925_chip *chip = get_irq_chip_data(irq); | 412 | struct max8925_chip *chip = irq_data_get_irq_chip_data(data); |
408 | 413 | ||
409 | mutex_lock(&chip->irq_lock); | 414 | mutex_lock(&chip->irq_lock); |
410 | } | 415 | } |
411 | 416 | ||
412 | static void max8925_irq_sync_unlock(unsigned int irq) | 417 | static void max8925_irq_sync_unlock(struct irq_data *data) |
413 | { | 418 | { |
414 | struct max8925_chip *chip = get_irq_chip_data(irq); | 419 | struct max8925_chip *chip = irq_data_get_irq_chip_data(data); |
415 | struct max8925_irq_data *irq_data; | 420 | struct max8925_irq_data *irq_data; |
416 | static unsigned char cache_chg[2] = {0xff, 0xff}; | 421 | static unsigned char cache_chg[2] = {0xff, 0xff}; |
417 | static unsigned char cache_on[2] = {0xff, 0xff}; | 422 | static unsigned char cache_on[2] = {0xff, 0xff}; |
@@ -487,32 +492,31 @@ static void max8925_irq_sync_unlock(unsigned int irq) | |||
487 | mutex_unlock(&chip->irq_lock); | 492 | mutex_unlock(&chip->irq_lock); |
488 | } | 493 | } |
489 | 494 | ||
490 | static void max8925_irq_enable(unsigned int irq) | 495 | static void max8925_irq_enable(struct irq_data *data) |
491 | { | 496 | { |
492 | struct max8925_chip *chip = get_irq_chip_data(irq); | 497 | struct max8925_chip *chip = irq_data_get_irq_chip_data(data); |
493 | max8925_irqs[irq - chip->irq_base].enable | 498 | max8925_irqs[data->irq - chip->irq_base].enable |
494 | = max8925_irqs[irq - chip->irq_base].offs; | 499 | = max8925_irqs[data->irq - chip->irq_base].offs; |
495 | } | 500 | } |
496 | 501 | ||
497 | static void max8925_irq_disable(unsigned int irq) | 502 | static void max8925_irq_disable(struct irq_data *data) |
498 | { | 503 | { |
499 | struct max8925_chip *chip = get_irq_chip_data(irq); | 504 | struct max8925_chip *chip = irq_data_get_irq_chip_data(data); |
500 | max8925_irqs[irq - chip->irq_base].enable = 0; | 505 | max8925_irqs[data->irq - chip->irq_base].enable = 0; |
501 | } | 506 | } |
502 | 507 | ||
503 | static struct irq_chip max8925_irq_chip = { | 508 | static struct irq_chip max8925_irq_chip = { |
504 | .name = "max8925", | 509 | .name = "max8925", |
505 | .bus_lock = max8925_irq_lock, | 510 | .irq_bus_lock = max8925_irq_lock, |
506 | .bus_sync_unlock = max8925_irq_sync_unlock, | 511 | .irq_bus_sync_unlock = max8925_irq_sync_unlock, |
507 | .enable = max8925_irq_enable, | 512 | .irq_enable = max8925_irq_enable, |
508 | .disable = max8925_irq_disable, | 513 | .irq_disable = max8925_irq_disable, |
509 | }; | 514 | }; |
510 | 515 | ||
511 | static int max8925_irq_init(struct max8925_chip *chip, int irq, | 516 | static int max8925_irq_init(struct max8925_chip *chip, int irq, |
512 | struct max8925_platform_data *pdata) | 517 | struct max8925_platform_data *pdata) |
513 | { | 518 | { |
514 | unsigned long flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT; | 519 | unsigned long flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT; |
515 | struct irq_desc *desc; | ||
516 | int i, ret; | 520 | int i, ret; |
517 | int __irq; | 521 | int __irq; |
518 | 522 | ||
@@ -539,19 +543,18 @@ static int max8925_irq_init(struct max8925_chip *chip, int irq, | |||
539 | mutex_init(&chip->irq_lock); | 543 | mutex_init(&chip->irq_lock); |
540 | chip->core_irq = irq; | 544 | chip->core_irq = irq; |
541 | chip->irq_base = pdata->irq_base; | 545 | chip->irq_base = pdata->irq_base; |
542 | desc = irq_to_desc(chip->core_irq); | ||
543 | 546 | ||
544 | /* register with genirq */ | 547 | /* register with genirq */ |
545 | for (i = 0; i < ARRAY_SIZE(max8925_irqs); i++) { | 548 | for (i = 0; i < ARRAY_SIZE(max8925_irqs); i++) { |
546 | __irq = i + chip->irq_base; | 549 | __irq = i + chip->irq_base; |
547 | set_irq_chip_data(__irq, chip); | 550 | irq_set_chip_data(__irq, chip); |
548 | set_irq_chip_and_handler(__irq, &max8925_irq_chip, | 551 | irq_set_chip_and_handler(__irq, &max8925_irq_chip, |
549 | handle_edge_irq); | 552 | handle_edge_irq); |
550 | set_irq_nested_thread(__irq, 1); | 553 | irq_set_nested_thread(__irq, 1); |
551 | #ifdef CONFIG_ARM | 554 | #ifdef CONFIG_ARM |
552 | set_irq_flags(__irq, IRQF_VALID); | 555 | set_irq_flags(__irq, IRQF_VALID); |
553 | #else | 556 | #else |
554 | set_irq_noprobe(__irq); | 557 | irq_set_noprobe(__irq); |
555 | #endif | 558 | #endif |
556 | } | 559 | } |
557 | if (!irq) { | 560 | if (!irq) { |
@@ -624,7 +627,7 @@ int __devinit max8925_device_init(struct max8925_chip *chip, | |||
624 | goto out_dev; | 627 | goto out_dev; |
625 | } | 628 | } |
626 | 629 | ||
627 | if (pdata && pdata->regulator[0]) { | 630 | if (pdata) { |
628 | ret = mfd_add_devices(chip->dev, 0, ®ulator_devs[0], | 631 | ret = mfd_add_devices(chip->dev, 0, ®ulator_devs[0], |
629 | ARRAY_SIZE(regulator_devs), | 632 | ARRAY_SIZE(regulator_devs), |
630 | ®ulator_resources[0], 0); | 633 | ®ulator_resources[0], 0); |