~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/mfd/ab8500-core.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
                if (new == old)
255
255
                        continue;
256
256
 
257
 
                /* Interrupt register 12 does'nt exist prior to version 0x20 */
258
 
                if (ab8500_irq_regoffset[i] == 11 && ab8500->chip_id < 0x20)
 
257
                /* Interrupt register 12 doesn't exist prior to version 2.0 */
 
258
                if (ab8500_irq_regoffset[i] == 11 &&
 
259
                        ab8500->chip_id < AB8500_CUT2P0)
259
260
                        continue;
260
261
 
261
262
                ab8500->oldmask[i] = new;
307
308
                int status;
308
309
                u8 value;
309
310
 
310
 
                /* Interrupt register 12 does'nt exist prior to version 0x20 */
311
 
                if (regoffset == 11 && ab8500->chip_id < 0x20)
 
311
                /* Interrupt register 12 doesn't exist prior to version 2.0 */
 
312
                if (regoffset == 11 && ab8500->chip_id < AB8500_CUT2P0)
312
313
                        continue;
313
314
 
314
315
                status = get_register_interruptible(ab8500, AB8500_INTERRUPT,
334
335
        int irq;
335
336
 
336
337
        for (irq = base; irq < base + AB8500_NR_IRQS; irq++) {
337
 
                set_irq_chip_data(irq, ab8500);
338
 
                set_irq_chip_and_handler(irq, &ab8500_irq_chip,
 
338
                irq_set_chip_data(irq, ab8500);
 
339
                irq_set_chip_and_handler(irq, &ab8500_irq_chip,
339
340
                                         handle_simple_irq);
340
 
                set_irq_nested_thread(irq, 1);
 
341
                irq_set_nested_thread(irq, 1);
341
342
#ifdef CONFIG_ARM
342
343
                set_irq_flags(irq, IRQF_VALID);
343
344
#else
344
 
                set_irq_noprobe(irq);
 
345
                irq_set_noprobe(irq);
345
346
#endif
346
347
        }
347
348
 
357
358
#ifdef CONFIG_ARM
358
359
                set_irq_flags(irq, 0);
359
360
#endif
360
 
                set_irq_chip_and_handler(irq, NULL, NULL);
361
 
                set_irq_chip_data(irq, NULL);
 
361
                irq_set_chip_and_handler(irq, NULL, NULL);
 
362
                irq_set_chip_data(irq, NULL);
362
363
        }
363
364
}
364
365
 
724
725
        if (ret < 0)
725
726
                return ret;
726
727
 
727
 
        /*
728
 
         * 0x0 - Early Drop
729
 
         * 0x10 - Cut 1.0
730
 
         * 0x11 - Cut 1.1
731
 
         * 0x20 - Cut 2.0
732
 
         * 0x30 - Cut 3.0
733
 
         */
734
 
        if (value == 0x0 || value == 0x10 || value == 0x11 || value == 0x20 ||
735
 
                value == 0x30) {
 
728
        switch (value) {
 
729
        case AB8500_CUTEARLY:
 
730
        case AB8500_CUT1P0:
 
731
        case AB8500_CUT1P1:
 
732
        case AB8500_CUT2P0:
 
733
        case AB8500_CUT3P0:
736
734
                dev_info(ab8500->dev, "detected chip, revision: %#x\n", value);
737
 
        } else {
 
735
                break;
 
736
        default:
738
737
                dev_err(ab8500->dev, "unknown chip, revision: %#x\n", value);
739
738
                return -EINVAL;
740
739
        }
763
762
 
764
763
        /* Clear and mask all interrupts */
765
764
        for (i = 0; i < AB8500_NUM_IRQ_REGS; i++) {
766
 
                /* Interrupt register 12 does'nt exist prior to version 0x20 */
767
 
                if (ab8500_irq_regoffset[i] == 11 && ab8500->chip_id < 0x20)
 
765
                /* Interrupt register 12 doesn't exist prior to version 2.0 */
 
766
                if (ab8500_irq_regoffset[i] == 11 &&
 
767
                        ab8500->chip_id < AB8500_CUT2P0)
768
768
                        continue;
769
769
 
770
770
                get_register_interruptible(ab8500, AB8500_INTERRUPT,