aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-11 06:06:53 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-11 06:06:53 -0500
commit555df91a00c2d70949cb38415b6de7e4304c0f9a (patch)
tree207a5ed1b434374bc4a5edbea9a41f7c22da9ca5
parentfa10a92b4746caa90bdd930755774ce9607290bc (diff)
parent346f1d40833c75ddb5e9e4b47fb00e20f8152762 (diff)
Merge remote-tracking branch 'asoc/topic/wm8962' into asoc-next
-rw-r--r--Documentation/devicetree/bindings/sound/wm8962.txt16
-rw-r--r--sound/soc/codecs/wm8962.c37
2 files changed, 36 insertions, 17 deletions
diff --git a/Documentation/devicetree/bindings/sound/wm8962.txt b/Documentation/devicetree/bindings/sound/wm8962.txt
new file mode 100644
index 000000000000..dceb3b1c2bb7
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/wm8962.txt
@@ -0,0 +1,16 @@
1WM8962 audio CODEC
2
3This device supports I2C only.
4
5Required properties:
6
7 - compatible : "wlf,wm8962"
8
9 - reg : the I2C address of the device.
10
11Example:
12
13codec: wm8962@1a {
14 compatible = "wlf,wm8962";
15 reg = <0x1a>;
16};
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index bd4b0db4cdaa..e9710280e5e1 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -2873,22 +2873,20 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
2873 2873
2874 ret = 0; 2874 ret = 0;
2875 2875
2876 if (fll1 & WM8962_FLL_ENA) { 2876 /* This should be a massive overestimate but go even
2877 /* This should be a massive overestimate but go even 2877 * higher if we'll error out
2878 * higher if we'll error out 2878 */
2879 */ 2879 if (wm8962->irq)
2880 if (wm8962->irq) 2880 timeout = msecs_to_jiffies(5);
2881 timeout = msecs_to_jiffies(5); 2881 else
2882 else 2882 timeout = msecs_to_jiffies(1);
2883 timeout = msecs_to_jiffies(1);
2884 2883
2885 timeout = wait_for_completion_timeout(&wm8962->fll_lock, 2884 timeout = wait_for_completion_timeout(&wm8962->fll_lock,
2886 timeout); 2885 timeout);
2887 2886
2888 if (timeout == 0 && wm8962->irq) { 2887 if (timeout == 0 && wm8962->irq) {
2889 dev_err(codec->dev, "FLL lock timed out"); 2888 dev_err(codec->dev, "FLL lock timed out");
2890 ret = -ETIMEDOUT; 2889 ret = -ETIMEDOUT;
2891 }
2892 } 2890 }
2893 2891
2894 wm8962->fll_fref = Fref; 2892 wm8962->fll_fref = Fref;
@@ -3189,7 +3187,7 @@ static void wm8962_init_beep(struct snd_soc_codec *codec)
3189 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); 3187 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
3190 int ret; 3188 int ret;
3191 3189
3192 wm8962->beep = input_allocate_device(); 3190 wm8962->beep = devm_input_allocate_device(codec->dev);
3193 if (!wm8962->beep) { 3191 if (!wm8962->beep) {
3194 dev_err(codec->dev, "Failed to allocate beep device\n"); 3192 dev_err(codec->dev, "Failed to allocate beep device\n");
3195 return; 3193 return;
@@ -3210,7 +3208,6 @@ static void wm8962_init_beep(struct snd_soc_codec *codec)
3210 3208
3211 ret = input_register_device(wm8962->beep); 3209 ret = input_register_device(wm8962->beep);
3212 if (ret != 0) { 3210 if (ret != 0) {
3213 input_free_device(wm8962->beep);
3214 wm8962->beep = NULL; 3211 wm8962->beep = NULL;
3215 dev_err(codec->dev, "Failed to register beep device\n"); 3212 dev_err(codec->dev, "Failed to register beep device\n");
3216 } 3213 }
@@ -3227,7 +3224,6 @@ static void wm8962_free_beep(struct snd_soc_codec *codec)
3227 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); 3224 struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
3228 3225
3229 device_remove_file(codec->dev, &dev_attr_beep); 3226 device_remove_file(codec->dev, &dev_attr_beep);
3230 input_unregister_device(wm8962->beep);
3231 cancel_work_sync(&wm8962->beep_work); 3227 cancel_work_sync(&wm8962->beep_work);
3232 wm8962->beep = NULL; 3228 wm8962->beep = NULL;
3233 3229
@@ -3758,10 +3754,17 @@ static const struct i2c_device_id wm8962_i2c_id[] = {
3758}; 3754};
3759MODULE_DEVICE_TABLE(i2c, wm8962_i2c_id); 3755MODULE_DEVICE_TABLE(i2c, wm8962_i2c_id);
3760 3756
3757static const struct of_device_id wm8962_of_match[] = {
3758 { .compatible = "wlf,wm8962", },
3759 { }
3760};
3761MODULE_DEVICE_TABLE(of, wm8962_of_match);
3762
3761static struct i2c_driver wm8962_i2c_driver = { 3763static struct i2c_driver wm8962_i2c_driver = {
3762 .driver = { 3764 .driver = {
3763 .name = "wm8962", 3765 .name = "wm8962",
3764 .owner = THIS_MODULE, 3766 .owner = THIS_MODULE,
3767 .of_match_table = wm8962_of_match,
3765 .pm = &wm8962_pm, 3768 .pm = &wm8962_pm,
3766 }, 3769 },
3767 .probe = wm8962_i2c_probe, 3770 .probe = wm8962_i2c_probe,