Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270848
b: refs/heads/master
c: 1e036f6
h: refs/heads/master
v: v3
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Oct 12, 2011
1 parent abf67a1 commit 97fbfed
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40a49710107c237a2f4362c8b8bf07df3bac53dd
refs/heads/master: 1e036f65329901a2432c92132b785654944743d9
12 changes: 6 additions & 6 deletions trunk/drivers/input/misc/twl6040-vibra.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ static irqreturn_t twl6040_vib_irq_handler(int irq, void *data)
if (status & TWL6040_VIBLOCDET) {
dev_warn(info->dev, "Left Vibrator overcurrent detected\n");
twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLL,
TWL6040_VIBENAL);
TWL6040_VIBENA);
}
if (status & TWL6040_VIBROCDET) {
dev_warn(info->dev, "Right Vibrator overcurrent detected\n");
twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLR,
TWL6040_VIBENAR);
TWL6040_VIBENA);
}

return IRQ_HANDLED;
Expand All @@ -104,16 +104,16 @@ static void twl6040_vibra_enable(struct vibra_info *info)
* overcurrent detection
*/
twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLL,
TWL6040_VIBENAL | TWL6040_VIBCTRLL);
TWL6040_VIBENA | TWL6040_VIBCTRL);
twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLR,
TWL6040_VIBENAR | TWL6040_VIBCTRLR);
TWL6040_VIBENA | TWL6040_VIBCTRL);
usleep_range(3000, 3500);
}

twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLL,
TWL6040_VIBENAL);
TWL6040_VIBENA);
twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLR,
TWL6040_VIBENAR);
TWL6040_VIBENA);

info->enabled = true;
}
Expand Down
20 changes: 7 additions & 13 deletions trunk/include/linux/mfd/twl6040.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,18 @@
#define TWL6040_HSDACMODE (1 << 1)
#define TWL6040_HSDRVMODE (1 << 3)

/* VIBCTLL (0x18) fields */
/* VIBCTLL/R (0x18/0x1A) fields */

#define TWL6040_VIBENAL 0x01
#define TWL6040_VIBCTRLL 0x04
#define TWL6040_VIBCTRLLP 0x08
#define TWL6040_VIBCTRLLN 0x10
#define TWL6040_VIBENA (1 << 0)
#define TWL6040_VIBSEL (1 << 1)
#define TWL6040_VIBCTRL (1 << 2)
#define TWL6040_VIBCTRL_P (1 << 3)
#define TWL6040_VIBCTRL_N (1 << 4)

/* VIBDATL (0x19) fields */
/* VIBDATL/R (0x19/0x1B) fields */

#define TWL6040_VIBDAT_MAX 0x64

/* VIBCTLR (0x1A) fields */

#define TWL6040_VIBENAR 0x01
#define TWL6040_VIBCTRLR 0x04
#define TWL6040_VIBCTRLRP 0x08
#define TWL6040_VIBCTRLRN 0x10

/* GPOCTL (0x1E) fields */

#define TWL6040_GPO1 0x01
Expand Down

0 comments on commit 97fbfed

Please sign in to comment.