diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 13:32:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 13:32:54 -0500 |
commit | 66dc918d42eaaa9afe42a47d07526765162017a9 (patch) | |
tree | 947411841773dfb076f1aa78bc5be868bc4281a6 /drivers/regulator | |
parent | b2034d474b7e1e8578bd5c2977024b51693269d9 (diff) | |
parent | 6db9a0f326d3144d790d9479309df480a8f562e4 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (348 commits)
ALSA: hda - Fix NULL-derefence with a single mic in STAC auto-mic detection
ALSA: hda - Add missing NID 0x19 fixup for Sony VAIO
ALSA: hda - Fix ALC275 enable hardware EQ for SONY VAIO
ALSA: oxygen: fix Xonar DG input
ALSA: hda - Fix EAPD on Lenovo NB ALC269 to low
ALSA: hda - Fix missing EAPD for Acer 4930G
ALSA: hda: Disable 4/6 channels on some NVIDIA GPUs.
ALSA: hda - Add static_hdmi_pcm option to HDMI codec parser
ALSA: hda - Don't refer ELD when unplugged
ASoC: tpa6130a2: Fix compiler warning
ASoC: tlv320dac33: Add DAPM selection for LOM invert
ASoC: DMIC codec: Adding a generic DMIC codec
ALSA: snd-usb-us122l: Fix missing NULL checks
ALSA: snd-usb-us122l: Fix MIDI output
ASoC: soc-cache: Fix invalid memory access during snd_soc_lzo_cache_sync()
ASoC: Fix section mismatch in wm8995.c
ALSA: oxygen: add S/PDIF source selection for Claro cards
ALSA: oxygen: fix CD/MIDI for X-Meridian (2G)
ASoC: fix migor audio build
ALSA: include delay.h for msleep in Xonar DG support
...
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/wm8994-regulator.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c index 594f88eb60c3..35b2958d5106 100644 --- a/drivers/regulator/wm8994-regulator.c +++ b/drivers/regulator/wm8994-regulator.c | |||
@@ -130,10 +130,19 @@ static struct regulator_ops wm8994_ldo1_ops = { | |||
130 | static int wm8994_ldo2_list_voltage(struct regulator_dev *rdev, | 130 | static int wm8994_ldo2_list_voltage(struct regulator_dev *rdev, |
131 | unsigned int selector) | 131 | unsigned int selector) |
132 | { | 132 | { |
133 | struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); | ||
134 | |||
133 | if (selector > WM8994_LDO2_MAX_SELECTOR) | 135 | if (selector > WM8994_LDO2_MAX_SELECTOR) |
134 | return -EINVAL; | 136 | return -EINVAL; |
135 | 137 | ||
136 | return (selector * 100000) + 900000; | 138 | switch (ldo->wm8994->type) { |
139 | case WM8994: | ||
140 | return (selector * 100000) + 900000; | ||
141 | case WM8958: | ||
142 | return (selector * 100000) + 1000000; | ||
143 | default: | ||
144 | return -EINVAL; | ||
145 | } | ||
137 | } | 146 | } |
138 | 147 | ||
139 | static int wm8994_ldo2_get_voltage_sel(struct regulator_dev *rdev) | 148 | static int wm8994_ldo2_get_voltage_sel(struct regulator_dev *rdev) |
@@ -154,7 +163,17 @@ static int wm8994_ldo2_set_voltage(struct regulator_dev *rdev, | |||
154 | struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); | 163 | struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); |
155 | int selector, v; | 164 | int selector, v; |
156 | 165 | ||
157 | selector = (min_uV - 900000) / 100000; | 166 | switch (ldo->wm8994->type) { |
167 | case WM8994: | ||
168 | selector = (min_uV - 900000) / 100000; | ||
169 | break; | ||
170 | case WM8958: | ||
171 | selector = (min_uV - 1000000) / 100000; | ||
172 | break; | ||
173 | default: | ||
174 | return -EINVAL; | ||
175 | } | ||
176 | |||
158 | v = wm8994_ldo2_list_voltage(rdev, selector); | 177 | v = wm8994_ldo2_list_voltage(rdev, selector); |
159 | if (v < 0 || v > max_uV) | 178 | if (v < 0 || v > max_uV) |
160 | return -EINVAL; | 179 | return -EINVAL; |