Merge remote-tracking branches 'asoc/topic/txx9', 'asoc/topic/wm8750', 'asoc/topic...
authorMark Brown <broonie@kernel.org>
Wed, 4 Feb 2015 20:57:24 +0000 (20:57 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 4 Feb 2015 20:57:24 +0000 (20:57 +0000)
Documentation/devicetree/bindings/sound/wm8904.txt
sound/soc/codecs/wm8750.c
sound/soc/codecs/wm8804.c
sound/soc/codecs/wm8904.c
sound/soc/codecs/wm8995.c
sound/soc/txx9/txx9aclc.c

index e99f409..66bf261 100644 (file)
@@ -3,7 +3,7 @@ WM8904 audio CODEC
 This device supports I2C only.
 
 Required properties:
-  - compatible: "wlf,wm8904"
+  - compatible: "wlf,wm8904" or "wlf,wm8912"
   - reg: the I2C address of the device.
   - clock-names: "mclk"
   - clocks: reference to
index f6847fd..eb0a164 100644 (file)
@@ -323,7 +323,7 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = {
        SND_SOC_DAPM_OUTPUT("ROUT2"),
        SND_SOC_DAPM_OUTPUT("MONO1"),
        SND_SOC_DAPM_OUTPUT("OUT3"),
-       SND_SOC_DAPM_OUTPUT("VREF"),
+       SND_SOC_DAPM_VMID("VREF"),
 
        SND_SOC_DAPM_INPUT("LINPUT1"),
        SND_SOC_DAPM_INPUT("LINPUT2"),
index 1315f76..b2b0e68 100644 (file)
@@ -648,7 +648,7 @@ static struct snd_soc_dai_driver wm8804_dai = {
        .symmetric_rates = 1
 };
 
-static struct snd_soc_codec_driver soc_codec_dev_wm8804 = {
+static const struct snd_soc_codec_driver soc_codec_dev_wm8804 = {
        .probe = wm8804_probe,
        .remove = wm8804_remove,
        .set_bias_level = wm8804_set_bias_level,
@@ -664,7 +664,7 @@ static const struct of_device_id wm8804_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, wm8804_of_match);
 
-static struct regmap_config wm8804_regmap_config = {
+static const struct regmap_config wm8804_regmap_config = {
        .reg_bits = 8,
        .val_bits = 8,
 
index c5eaa01..d3b3f57 100644 (file)
@@ -2105,6 +2105,24 @@ static const struct regmap_config wm8904_regmap = {
        .num_reg_defaults = ARRAY_SIZE(wm8904_reg_defaults),
 };
 
+#ifdef CONFIG_OF
+static enum wm8904_type wm8904_data = WM8904;
+static enum wm8904_type wm8912_data = WM8912;
+
+static const struct of_device_id wm8904_of_match[] = {
+       {
+               .compatible = "wlf,wm8904",
+               .data = &wm8904_data,
+       }, {
+               .compatible = "wlf,wm8912",
+               .data = &wm8912_data,
+       }, {
+               /* sentinel */
+       }
+};
+MODULE_DEVICE_TABLE(of, wm8904_of_match);
+#endif
+
 static int wm8904_i2c_probe(struct i2c_client *i2c,
                            const struct i2c_device_id *id)
 {
@@ -2132,7 +2150,17 @@ static int wm8904_i2c_probe(struct i2c_client *i2c,
                return ret;
        }
 
-       wm8904->devtype = id->driver_data;
+       if (i2c->dev.of_node) {
+               const struct of_device_id *match;
+
+               match = of_match_node(wm8904_of_match, i2c->dev.of_node);
+               if (match == NULL)
+                       return -EINVAL;
+               wm8904->devtype = *((enum wm8904_type *)match->data);
+       } else {
+               wm8904->devtype = id->driver_data;
+       }
+
        i2c_set_clientdata(i2c, wm8904);
        wm8904->pdata = i2c->dev.platform_data;
 
@@ -2266,6 +2294,7 @@ static struct i2c_driver wm8904_i2c_driver = {
        .driver = {
                .name = "wm8904",
                .owner = THIS_MODULE,
+               .of_match_table = of_match_ptr(wm8904_of_match),
        },
        .probe =    wm8904_i2c_probe,
        .remove =   wm8904_i2c_remove,
index 79e1aea..66103c2 100644 (file)
@@ -44,7 +44,7 @@ static const char *wm8995_supply_names[WM8995_NUM_SUPPLIES] = {
        "MICVDD"
 };
 
-static struct reg_default wm8995_reg_defaults[] = {
+static const struct reg_default wm8995_reg_defaults[] = {
        { 0, 0x8995 },
        { 5, 0x0100 },
        { 16, 0x000b },
@@ -2186,7 +2186,7 @@ static struct snd_soc_dai_driver wm8995_dai[] = {
        }
 };
 
-static struct snd_soc_codec_driver soc_codec_dev_wm8995 = {
+static const struct snd_soc_codec_driver soc_codec_dev_wm8995 = {
        .probe = wm8995_probe,
        .remove = wm8995_remove,
        .set_bias_level = wm8995_set_bias_level,
@@ -2200,7 +2200,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8995 = {
        .num_dapm_routes = ARRAY_SIZE(wm8995_intercon),
 };
 
-static struct regmap_config wm8995_regmap = {
+static const struct regmap_config wm8995_regmap = {
        .reg_bits = 16,
        .val_bits = 16,
 
index 070e44e..88eacfd 100644 (file)
@@ -282,11 +282,6 @@ static struct snd_pcm_ops txx9aclc_pcm_ops = {
        .pointer        = txx9aclc_pcm_pointer,
 };
 
-static void txx9aclc_pcm_free_dma_buffers(struct snd_pcm *pcm)
-{
-       snd_pcm_lib_preallocate_free_for_all(pcm);
-}
-
 static int txx9aclc_pcm_new(struct snd_soc_pcm_runtime *rtd)
 {
        struct snd_card *card = rtd->card->snd_card;
@@ -412,7 +407,6 @@ static struct snd_soc_platform_driver txx9aclc_soc_platform = {
        .remove         = txx9aclc_pcm_remove,
        .ops            = &txx9aclc_pcm_ops,
        .pcm_new        = txx9aclc_pcm_new,
-       .pcm_free       = txx9aclc_pcm_free_dma_buffers,
 };
 
 static int txx9aclc_soc_platform_probe(struct platform_device *pdev)