aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl4030-irq.c
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2012-01-31 20:02:48 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2012-03-06 12:46:39 -0500
commitcbcde05ec2c2b428a0fca1e01e944a24f89c5654 (patch)
tree358d2e64b621dac936428e3128fa5bae793ca6f2 /drivers/mfd/twl4030-irq.c
parent450b1151065ae967583fe69c82c50140560a5681 (diff)
mfd: Trivial twl4030 code-style fixes
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/twl4030-irq.c')
-rw-r--r--drivers/mfd/twl4030-irq.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
index b69bb517b102..b31f920feb51 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -59,7 +59,6 @@
59#define REG_PIH_ISR_P2 0x02 59#define REG_PIH_ISR_P2 0x02
60#define REG_PIH_SIR 0x03 /* for testing */ 60#define REG_PIH_SIR 0x03 /* for testing */
61 61
62
63/* Linux could (eventually) use either IRQ line */ 62/* Linux could (eventually) use either IRQ line */
64static int irq_line; 63static int irq_line;
65 64
@@ -111,7 +110,8 @@ static int nr_sih_modules;
111#define TWL4030_MODULE_INT_PWR TWL4030_MODULE_INT 110#define TWL4030_MODULE_INT_PWR TWL4030_MODULE_INT
112 111
113 112
114/* Order in this table matches order in PIH_ISR. That is, 113/*
114 * Order in this table matches order in PIH_ISR. That is,
115 * BIT(n) in PIH_ISR is sih_modules[n]. 115 * BIT(n) in PIH_ISR is sih_modules[n].
116 */ 116 */
117/* sih_modules_twl4030 is used both in twl4030 and twl5030 */ 117/* sih_modules_twl4030 is used both in twl4030 and twl5030 */
@@ -309,6 +309,7 @@ static irqreturn_t handle_twl4030_pih(int irq, void *devid)
309 309
310 return IRQ_HANDLED; 310 return IRQ_HANDLED;
311} 311}
312
312/*----------------------------------------------------------------------*/ 313/*----------------------------------------------------------------------*/
313 314
314/* 315/*
@@ -337,7 +338,6 @@ static int twl4030_init_sih_modules(unsigned line)
337 memset(buf, 0xff, sizeof buf); 338 memset(buf, 0xff, sizeof buf);
338 sih = sih_modules; 339 sih = sih_modules;
339 for (i = 0; i < nr_sih_modules; i++, sih++) { 340 for (i = 0; i < nr_sih_modules; i++, sih++) {
340
341 /* skip USB -- it's funky */ 341 /* skip USB -- it's funky */
342 if (!sih->bytes_ixr) 342 if (!sih->bytes_ixr)
343 continue; 343 continue;
@@ -352,7 +352,8 @@ static int twl4030_init_sih_modules(unsigned line)
352 pr_err("twl4030: err %d initializing %s %s\n", 352 pr_err("twl4030: err %d initializing %s %s\n",
353 status, sih->name, "IMR"); 353 status, sih->name, "IMR");
354 354
355 /* Maybe disable "exclusive" mode; buffer second pending irq; 355 /*
356 * Maybe disable "exclusive" mode; buffer second pending irq;
356 * set Clear-On-Read (COR) bit. 357 * set Clear-On-Read (COR) bit.
357 * 358 *
358 * NOTE that sometimes COR polarity is documented as being 359 * NOTE that sometimes COR polarity is documented as being
@@ -382,7 +383,8 @@ static int twl4030_init_sih_modules(unsigned line)
382 if (sih->irq_lines <= line) 383 if (sih->irq_lines <= line)
383 continue; 384 continue;
384 385
385 /* Clear pending interrupt status. Either the read was 386 /*
387 * Clear pending interrupt status. Either the read was
386 * enough, or we need to write those bits. Repeat, in 388 * enough, or we need to write those bits. Repeat, in
387 * case an IRQ is pending (PENDDIS=0) ... that's not 389 * case an IRQ is pending (PENDDIS=0) ... that's not
388 * uncommon with PWR_INT.PWRON. 390 * uncommon with PWR_INT.PWRON.
@@ -398,7 +400,8 @@ static int twl4030_init_sih_modules(unsigned line)
398 status = twl_i2c_write(sih->module, buf, 400 status = twl_i2c_write(sih->module, buf,
399 sih->mask[line].isr_offset, 401 sih->mask[line].isr_offset,
400 sih->bytes_ixr); 402 sih->bytes_ixr);
401 /* else COR=1 means read sufficed. 403 /*
404 * else COR=1 means read sufficed.
402 * (for most SIH modules...) 405 * (for most SIH modules...)
403 */ 406 */
404 } 407 }
@@ -410,7 +413,8 @@ static int twl4030_init_sih_modules(unsigned line)
410static inline void activate_irq(int irq) 413static inline void activate_irq(int irq)
411{ 414{
412#ifdef CONFIG_ARM 415#ifdef CONFIG_ARM
413 /* ARM requires an extra step to clear IRQ_NOREQUEST, which it 416 /*
417 * ARM requires an extra step to clear IRQ_NOREQUEST, which it
414 * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE. 418 * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE.
415 */ 419 */
416 set_irq_flags(irq, IRQF_VALID); 420 set_irq_flags(irq, IRQF_VALID);
@@ -622,9 +626,7 @@ static irqreturn_t handle_twl4030_sih(int irq, void *data)
622 626
623static unsigned twl4030_irq_next; 627static unsigned twl4030_irq_next;
624 628
625/* returns the first IRQ used by this SIH bank, 629/* returns the first IRQ used by this SIH bank, or negative errno */
626 * or negative errno
627 */
628int twl4030_sih_setup(int module) 630int twl4030_sih_setup(int module)
629{ 631{
630 int sih_mod; 632 int sih_mod;
@@ -688,7 +690,6 @@ int twl4030_sih_setup(int module)
688 690
689/* FIXME need a call to reverse twl4030_sih_setup() ... */ 691/* FIXME need a call to reverse twl4030_sih_setup() ... */
690 692
691
692/*----------------------------------------------------------------------*/ 693/*----------------------------------------------------------------------*/
693 694
694/* FIXME pass in which interrupt line we'll use ... */ 695/* FIXME pass in which interrupt line we'll use ... */
@@ -711,7 +712,8 @@ int twl4030_init_irq(int irq_num, unsigned irq_base, unsigned irq_end)
711 712
712 twl4030_irq_base = irq_base; 713 twl4030_irq_base = irq_base;
713 714
714 /* install an irq handler for each of the SIH modules; 715 /*
716 * install an irq handler for each of the SIH modules;
715 * clone dummy irq_chip since PIH can't *do* anything 717 * clone dummy irq_chip since PIH can't *do* anything
716 */ 718 */
717 twl4030_irq_chip = dummy_irq_chip; 719 twl4030_irq_chip = dummy_irq_chip;