Merge remote-tracking branches 'asoc/topic/uda1380', 'asoc/topic/unregister', 'asoc...
authorMark Brown <broonie@kernel.org>
Sun, 30 Apr 2017 13:16:41 +0000 (22:16 +0900)
committerMark Brown <broonie@kernel.org>
Sun, 30 Apr 2017 13:16:41 +0000 (22:16 +0900)
Documentation/devicetree/bindings/sound/wm8903.txt
sound/soc/codecs/uda1380.c
sound/soc/codecs/wm5100.c
sound/soc/codecs/wm8903.c
sound/soc/soc-core.c
sound/soc/ux500/mop500.c
sound/soc/ux500/ux500_msp_dai.c
sound/soc/ux500/ux500_msp_i2s.c

index 94ec32c194bb1fc8f3dd4b6bbe10069008e4d673..afc51caf113705e4da112635385c205f290442ac 100644 (file)
@@ -28,6 +28,14 @@ Optional properties:
     performed. If any entry has the value 0xffffffff, that GPIO's
     configuration will not be modified.
 
+  - AVDD-supply : Analog power supply regulator on the AVDD pin.
+
+  - CPVDD-supply : Charge pump supply regulator on the CPVDD pin.
+
+  - DBVDD-supply : Digital buffer supply regulator for the DBVDD pin.
+
+  - DCVDD-supply : Digital core supply regulator for the DCVDD pin.
+
 Pins on the device (for linking into audio routes):
 
   * IN1L
@@ -54,6 +62,11 @@ codec: wm8903@1a {
        reg = <0x1a>;
        interrupts = < 347 >;
 
+       AVDD-supply = <&fooreg_a>;
+       CPVDD-supply = <&fooreg_b>;
+       DBVDD-supply = <&fooreg_c>;
+       DCVDC-supply = <&fooreg_d>;
+
        gpio-controller;
        #gpio-cells = <2>;
 
index 2918fdb95e58581555fe7ef3ae3c6019040b86b3..61cdc79840e70743229f5919bfc5aa3293f38270 100644 (file)
@@ -791,9 +791,16 @@ static const struct i2c_device_id uda1380_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, uda1380_i2c_id);
 
+static const struct of_device_id uda1380_of_match[] = {
+       { .compatible = "nxp,uda1380", },
+       { }
+};
+MODULE_DEVICE_TABLE(of, uda1380_of_match);
+
 static struct i2c_driver uda1380_i2c_driver = {
        .driver = {
                .name =  "uda1380-codec",
+               .of_match_table = uda1380_of_match,
        },
        .probe =    uda1380_i2c_probe,
        .remove =   uda1380_i2c_remove,
index 560575000cc5e5aef666570c78e1f8df714ad718..138a84efdd54cb6047b18645c51377ab2c110570 100644 (file)
@@ -2014,7 +2014,7 @@ static void wm5100_micd_irq(struct wm5100_priv *wm5100)
 
        ret = regmap_read(wm5100->regmap, WM5100_MIC_DETECT_3, &val);
        if (ret != 0) {
-               dev_err(wm5100->dev, "Failed to read micropone status: %d\n",
+               dev_err(wm5100->dev, "Failed to read microphone status: %d\n",
                        ret);
                return;
        }
index 6e887c2c42b1a33808a3bc513dcf5f4b1c481de1..237eeb9a8b97fe726f7535ce46f458852a3626b5 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/pm.h>
 #include <linux/i2c.h>
 #include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
 #include <linux/slab.h>
 #include <linux/irq.h>
 #include <linux/mutex.h>
@@ -115,10 +116,19 @@ static const struct reg_default wm8903_reg_defaults[] = {
        { 172, 0x0000 },    /* R172 - Analogue Output Bias 0 */
 };
 
+#define WM8903_NUM_SUPPLIES 4
+static const char *wm8903_supply_names[WM8903_NUM_SUPPLIES] = {
+       "AVDD",
+       "CPVDD",
+       "DBVDD",
+       "DCVDD",
+};
+
 struct wm8903_priv {
        struct wm8903_platform_data *pdata;
        struct device *dev;
        struct regmap *regmap;
+       struct regulator_bulk_data supplies[WM8903_NUM_SUPPLIES];
 
        int sysclk;
        int irq;
@@ -2030,6 +2040,23 @@ static int wm8903_i2c_probe(struct i2c_client *i2c,
 
        pdata = wm8903->pdata;
 
+       for (i = 0; i < ARRAY_SIZE(wm8903->supplies); i++)
+               wm8903->supplies[i].supply = wm8903_supply_names[i];
+
+       ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8903->supplies),
+                                     wm8903->supplies);
+       if (ret != 0) {
+               dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret);
+               return ret;
+       }
+
+       ret = regulator_bulk_enable(ARRAY_SIZE(wm8903->supplies),
+                                   wm8903->supplies);
+       if (ret != 0) {
+               dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret);
+               return ret;
+       }
+
        ret = regmap_read(wm8903->regmap, WM8903_SW_RESET_AND_ID, &val);
        if (ret != 0) {
                dev_err(&i2c->dev, "Failed to read chip ID: %d\n", ret);
@@ -2160,6 +2187,8 @@ static int wm8903_i2c_probe(struct i2c_client *i2c,
 
        return 0;
 err:
+       regulator_bulk_disable(ARRAY_SIZE(wm8903->supplies),
+                              wm8903->supplies);
        return ret;
 }
 
@@ -2167,6 +2196,8 @@ static int wm8903_i2c_remove(struct i2c_client *client)
 {
        struct wm8903_priv *wm8903 = i2c_get_clientdata(client);
 
+       regulator_bulk_disable(ARRAY_SIZE(wm8903->supplies),
+                              wm8903->supplies);
        if (client->irq)
                free_irq(client->irq, wm8903);
        wm8903_free_gpio(wm8903);
index f45748ef9f13a8e805b72f9b90025fe83dedf73e..525f2f397b4c225208a6b82c94ae8c1addd2eeaf 100644 (file)
@@ -3240,6 +3240,11 @@ static void snd_soc_component_cleanup(struct snd_soc_component *component)
 
 static void snd_soc_component_del_unlocked(struct snd_soc_component *component)
 {
+       struct snd_soc_card *card = component->card;
+
+       if (card)
+               snd_soc_unregister_card(card);
+
        list_del(&component->list);
 }
 
index ba9fc099cf67b22997aad328f256c2b1150c86a1..b50f68a439cebaf5d28ac38331e165b31e72ead2 100644 (file)
@@ -33,7 +33,6 @@ static struct snd_soc_dai_link mop500_dai_links[] = {
                .stream_name = "ab8500_0",
                .cpu_dai_name = "ux500-msp-i2s.1",
                .codec_dai_name = "ab8500-codec-dai.0",
-               .platform_name = "ux500-msp-i2s.1",
                .codec_name = "ab8500-codec.0",
                .init = mop500_ab8500_machine_init,
                .ops = mop500_ab8500_ops,
@@ -43,7 +42,6 @@ static struct snd_soc_dai_link mop500_dai_links[] = {
                .stream_name = "ab8500_1",
                .cpu_dai_name = "ux500-msp-i2s.3",
                .codec_dai_name = "ab8500-codec-dai.1",
-               .platform_name = "ux500-msp-i2s.3",
                .codec_name = "ab8500-codec.0",
                .init = NULL,
                .ops = mop500_ab8500_ops,
@@ -87,8 +85,6 @@ static int mop500_of_probe(struct platform_device *pdev,
        for (i = 0; i < 2; i++) {
                mop500_dai_links[i].cpu_of_node = msp_np[i];
                mop500_dai_links[i].cpu_dai_name = NULL;
-               mop500_dai_links[i].platform_of_node = msp_np[i];
-               mop500_dai_links[i].platform_name = NULL;
                mop500_dai_links[i].codec_of_node = codec_np;
                mop500_dai_links[i].codec_name = NULL;
        }
index b343efd9be5ba7e9d39fa1cf28f30d41f78b82ce..ec5152aa3f6ed2a9b1eeeea37b967d1d689d2dad 100644 (file)
@@ -133,6 +133,7 @@ static int setup_pcm_framing(struct snd_soc_dai *dai, unsigned int rate,
        struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev);
 
        u32 frame_length = MSP_FRAME_LEN_1;
+
        prot_desc->frame_width = 0;
 
        switch (drvdata->slots) {
@@ -482,7 +483,8 @@ static int ux500_msp_dai_prepare(struct snd_pcm_substream *substream,
        if ((drvdata->fmt & SND_SOC_DAIFMT_MASTER_MASK) &&
                (drvdata->msp->f_bitclk > 19200000)) {
                /* If the bit-clock is higher than 19.2MHz, Vape should be
-                * run in 100% OPP. Only when bit-clock is used (MSP master) */
+                * run in 100% OPP. Only when bit-clock is used (MSP master)
+                */
                prcmu_qos_update_requirement(PRCMU_QOS_APE_OPP,
                                        "ux500-msp-i2s", 100);
                drvdata->vape_opp_constraint = 1;
index 959d7b4edf56a94d167d09ea07ca7a597a64bbce..bd5266aca0f128c855a20b0358377f9804f1437f 100644 (file)
@@ -604,7 +604,6 @@ int ux500_msp_i2s_trigger(struct ux500_msp *msp, int cmd, int direction)
                break;
        default:
                return -EINVAL;
-               break;
        }
 
        return 0;