diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-28 17:25:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-28 17:25:01 -0400 |
commit | 68d99b2c8efcb6ed3807a55569300c53b5f88be5 (patch) | |
tree | f189c8f2132d3668a2f0e503f5c3f8695b26a1c8 /drivers/input/misc/twl6040-vibra.c | |
parent | 0e59e7e7feb5a12938fbf9135147eeda3238c6c4 (diff) | |
parent | 8128c9f21509f9a8b6da94ac432d845dda458406 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (549 commits)
ALSA: hda - Fix ADC input-amp handling for Cx20549 codec
ALSA: hda - Keep EAPD turned on for old Conexant chips
ALSA: hda/realtek - Fix missing volume controls with ALC260
ASoC: wm8940: Properly set codec->dapm.bias_level
ALSA: hda - Fix pin-config for ASUS W90V
ALSA: hda - Fix surround/CLFE headphone and speaker pins order
ALSA: hda - Fix typo
ALSA: Update the sound git tree URL
ALSA: HDA: Add new revision for ALC662
ASoC: max98095: Convert codec->hw_write to snd_soc_write
ASoC: keep pointer to resource so it can be freed
ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
ASoC: wm8996: Fix wrong mask for setting WM8996_AIF_CLOCKING_2
ASoC: da7210: Add support for line out and DAC
ASoC: da7210: Add support for DAPM
ALSA: hda/realtek - Fix DAC assignments of multiple speakers
ASoC: Use SGTL5000_LINREG_VDDD_MASK instead of hardcoded mask value
ASoC: Set sgtl5000->ldo in ldo_regulator_register
ASoC: wm8996: Use SND_SOC_DAPM_AIF_OUT for AIF2 Capture
ASoC: wm8994: Use SND_SOC_DAPM_AIF_OUT for AIF3 Capture
...
Diffstat (limited to 'drivers/input/misc/twl6040-vibra.c')
-rw-r--r-- | drivers/input/misc/twl6040-vibra.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c index 23855e12a30b..ad153a417eed 100644 --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c | |||
@@ -74,12 +74,12 @@ static irqreturn_t twl6040_vib_irq_handler(int irq, void *data) | |||
74 | if (status & TWL6040_VIBLOCDET) { | 74 | if (status & TWL6040_VIBLOCDET) { |
75 | dev_warn(info->dev, "Left Vibrator overcurrent detected\n"); | 75 | dev_warn(info->dev, "Left Vibrator overcurrent detected\n"); |
76 | twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLL, | 76 | twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLL, |
77 | TWL6040_VIBENAL); | 77 | TWL6040_VIBENA); |
78 | } | 78 | } |
79 | if (status & TWL6040_VIBROCDET) { | 79 | if (status & TWL6040_VIBROCDET) { |
80 | dev_warn(info->dev, "Right Vibrator overcurrent detected\n"); | 80 | dev_warn(info->dev, "Right Vibrator overcurrent detected\n"); |
81 | twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLR, | 81 | twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLR, |
82 | TWL6040_VIBENAR); | 82 | TWL6040_VIBENA); |
83 | } | 83 | } |
84 | 84 | ||
85 | return IRQ_HANDLED; | 85 | return IRQ_HANDLED; |
@@ -97,23 +97,23 @@ static void twl6040_vibra_enable(struct vibra_info *info) | |||
97 | } | 97 | } |
98 | 98 | ||
99 | twl6040_power(info->twl6040, 1); | 99 | twl6040_power(info->twl6040, 1); |
100 | if (twl6040->rev <= TWL6040_REV_ES1_1) { | 100 | if (twl6040_get_revid(twl6040) <= TWL6040_REV_ES1_1) { |
101 | /* | 101 | /* |
102 | * ERRATA: Disable overcurrent protection for at least | 102 | * ERRATA: Disable overcurrent protection for at least |
103 | * 3ms when enabling vibrator drivers to avoid false | 103 | * 3ms when enabling vibrator drivers to avoid false |
104 | * overcurrent detection | 104 | * overcurrent detection |
105 | */ | 105 | */ |
106 | twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLL, | 106 | twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLL, |
107 | TWL6040_VIBENAL | TWL6040_VIBCTRLL); | 107 | TWL6040_VIBENA | TWL6040_VIBCTRL); |
108 | twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLR, | 108 | twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLR, |
109 | TWL6040_VIBENAR | TWL6040_VIBCTRLR); | 109 | TWL6040_VIBENA | TWL6040_VIBCTRL); |
110 | usleep_range(3000, 3500); | 110 | usleep_range(3000, 3500); |
111 | } | 111 | } |
112 | 112 | ||
113 | twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLL, | 113 | twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLL, |
114 | TWL6040_VIBENAL); | 114 | TWL6040_VIBENA); |
115 | twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLR, | 115 | twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLR, |
116 | TWL6040_VIBENAR); | 116 | TWL6040_VIBENA); |
117 | 117 | ||
118 | info->enabled = true; | 118 | info->enabled = true; |
119 | } | 119 | } |
@@ -201,6 +201,13 @@ static int vibra_play(struct input_dev *input, void *data, | |||
201 | struct vibra_info *info = input_get_drvdata(input); | 201 | struct vibra_info *info = input_get_drvdata(input); |
202 | int ret; | 202 | int ret; |
203 | 203 | ||
204 | /* Do not allow effect, while the routing is set to use audio */ | ||
205 | ret = twl6040_get_vibralr_status(info->twl6040); | ||
206 | if (ret & TWL6040_VIBSEL) { | ||
207 | dev_info(&input->dev, "Vibra is configured for audio\n"); | ||
208 | return -EBUSY; | ||
209 | } | ||
210 | |||
204 | info->weak_speed = effect->u.rumble.weak_magnitude; | 211 | info->weak_speed = effect->u.rumble.weak_magnitude; |
205 | info->strong_speed = effect->u.rumble.strong_magnitude; | 212 | info->strong_speed = effect->u.rumble.strong_magnitude; |
206 | info->direction = effect->direction < EFFECT_DIR_180_DEG ? 1 : -1; | 213 | info->direction = effect->direction < EFFECT_DIR_180_DEG ? 1 : -1; |