Merge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/oom' and 'asoc/topic...
authorMark Brown <broonie@linaro.org>
Mon, 4 Aug 2014 15:31:50 +0000 (16:31 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 4 Aug 2014 15:31:50 +0000 (16:31 +0100)
1  2  3  4 
sound/soc/codecs/cs42l73.c
sound/soc/codecs/sgtl5000.c
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/twl4030.c
sound/soc/codecs/wm8994.c

index 8658194f50bf7416ca88906a8c034b660c313d4f,ae3717992d568fb2ba533634a25e306a9e8fd05b,e3b6016247949bb6b5a5a5d98f58eb7f496477dc,ae3717992d568fb2ba533634a25e306a9e8fd05b..0e7b9eb2ba61669021064d76c827f759dd50c644
@@@@@ -401,7 -401,7 -401,7 -401,7 +401,7 @@@@@ static const struct snd_kcontrol_new cs
                        CS42L73_LOBAVOL, 0, 0x41, 0x4B, hpaloa_tlv),
    
        SOC_DOUBLE_R_SX_TLV("Input PGA Analog Volume", CS42L73_MICAPREPGAAVOL,
 ---                    CS42L73_MICBPREPGABVOL, 5, 0x34,
 +++                    CS42L73_MICBPREPGABVOL, 0, 0x34,
                        0x24, micpga_tlv),
    
        SOC_DOUBLE_R("MIC Preamp Switch", CS42L73_MICAPREPGAAVOL,
@@@@@ -1408,10 -1408,10 -1408,8 -1408,10 +1408,8 @@@@@ static int cs42l73_i2c_probe(struct i2c
    
        cs42l73 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs42l73_private),
                               GFP_KERNEL);
-- -    if (!cs42l73) {
-- -            dev_err(&i2c_client->dev, "could not allocate codec\n");
++ +    if (!cs42l73)
                return -ENOMEM;
-- -    }
    
        cs42l73->regmap = devm_regmap_init_i2c(i2c_client, &cs42l73_regmap);
        if (IS_ERR(cs42l73->regmap)) {
index 8f4c73d17c8736cbf42de15a280f88cd54b2c1a3,3d39f0b5b4a8afd8352edd95627e1fd690d968d5,249fadbdb42ecd098fcaf7507532b6a5ab8f13f2,3d39f0b5b4a8afd8352edd95627e1fd690d968d5..d739f83380a84570ed8d0212feb05305f2218e90
@@@@@ -843,10 -843,10 -843,8 -843,10 +843,8 @@@@@ static int ldo_regulator_register(struc
    
        ldo = kzalloc(sizeof(struct ldo_regulator), GFP_KERNEL);
    
-- -    if (!ldo) {
-- -            dev_err(codec->dev, "failed to allocate ldo_regulator\n");
++ +    if (!ldo)
                return -ENOMEM;
-- -    }
    
        ldo->desc.name = kstrdup(dev_name(codec->dev), GFP_KERNEL);
        if (!ldo->desc.name) {
@@@@@ -1277,7 -1277,7 -1275,7 -1277,7 +1275,7 @@@@@ static int sgtl5000_enable_regulators(s
                        return ret;
        }
    
 ---    ret = devm_regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies),
 +++    ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies),
                                 sgtl5000->supplies);
        if (ret)
                goto err_ldo_remove;
        ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies),
                                        sgtl5000->supplies);
        if (ret)
 ---            goto err_ldo_remove;
 +++            goto err_regulator_free;
    
        /* wait for all power rails bring up */
        udelay(10);
    
        return 0;
    
 +++err_regulator_free:
 +++    regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
 +++                            sgtl5000->supplies);
    err_ldo_remove:
        if (!external_vddd)
                ldo_regulator_remove(codec);
@@@@@ -1364,8 -1361,6 -1359,6 -1361,6 +1362,8 @@@@@ static int sgtl5000_probe(struct snd_so
    err:
        regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
                                                sgtl5000->supplies);
 +++    regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
 +++                            sgtl5000->supplies);
        ldo_regulator_remove(codec);
    
        return ret;
@@@@@ -1379,8 -1374,6 -1372,6 -1374,6 +1377,8 @@@@@ static int sgtl5000_remove(struct snd_s
    
        regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
                                                sgtl5000->supplies);
 +++    regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
 +++                            sgtl5000->supplies);
        ldo_regulator_remove(codec);
    
        return 0;
index 5360772bc1add02e30c6d4b5510ef9c0ab9ea06e,e12fafbb1e094c539663605a9bb5b5641c081f06,446303198ffd39bb28927e66f980b5b22cee3fe1,e12fafbb1e094c539663605a9bb5b5641c081f06..f14b551b729e390196059d26812997213fd6f8b3
@@@@@ -879,7 -879,7 -879,7 -879,7 +879,7 @@@@@ static int aic3x_hw_params(struct snd_p
        case SNDRV_PCM_FORMAT_S20_3LE:
                data |= (0x01 << 4);
                break;
 ---    case SNDRV_PCM_FORMAT_S24_LE:
 +++    case SNDRV_PCM_FORMAT_S24_3LE:
                data |= (0x02 << 4);
                break;
        case SNDRV_PCM_FORMAT_S32_LE:
@@@@@ -1477,10 -1477,10 -1477,8 -1477,10 +1477,8 @@@@@ static int aic3x_i2c_probe(struct i2c_c
        u32 value;
    
        aic3x = devm_kzalloc(&i2c->dev, sizeof(struct aic3x_priv), GFP_KERNEL);
-- -    if (aic3x == NULL) {
-- -            dev_err(&i2c->dev, "failed to create private data\n");
++ +    if (!aic3x)
                return -ENOMEM;
-- -    }
    
        aic3x->regmap = devm_regmap_init_i2c(i2c, &aic3x_regmap);
        if (IS_ERR(aic3x->regmap)) {
        } else if (np) {
                ai3x_setup = devm_kzalloc(&i2c->dev, sizeof(*ai3x_setup),
                                                                GFP_KERNEL);
-- -            if (ai3x_setup == NULL) {
-- -                    dev_err(&i2c->dev, "failed to create private data\n");
++ +            if (!ai3x_setup)
                        return -ENOMEM;
-- -            }
    
                ret = of_get_named_gpio(np, "gpio-reset", 0);
                if (ret >= 0)
index 6ab1570653531ecd1584be24786a0af244de0eb1,69e12a311ba20009fe489960800f95798eecbbc3,955df35c5ab62b3d0e96b5d5f0d4039be06b624f,69e12a311ba20009fe489960800f95798eecbbc3..cf404505e7d1b01a18681d334c7be857a17530ad
@@@@@ -344,16 -344,17 -344,17 -344,17 +344,16 @@@@@ static void twl4030_init_chip(struct sn
    static void twl4030_apll_enable(struct snd_soc_codec *codec, int enable)
    {
        struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
 ---    int status = -1;
    
        if (enable) {
                twl4030->apll_enabled++;
                if (twl4030->apll_enabled == 1)
 ---                    status = twl4030_audio_enable_resource(
 +++                    twl4030_audio_enable_resource(
                                                        TWL4030_AUDIO_RES_APLL);
        } else {
                twl4030->apll_enabled--;
                if (!twl4030->apll_enabled)
 ---                    status = twl4030_audio_disable_resource(
 +++                    twl4030_audio_disable_resource(
                                                        TWL4030_AUDIO_RES_APLL);
        }
    }
@@@@@ -2161,10 -2162,10 -2162,8 -2162,10 +2161,8 @@@@@ static int twl4030_soc_probe(struct snd
    
        twl4030 = devm_kzalloc(codec->dev, sizeof(struct twl4030_priv),
                               GFP_KERNEL);
-- -    if (twl4030 == NULL) {
-- -            dev_err(codec->dev, "Can not allocate memory\n");
++ +    if (!twl4030)
                return -ENOMEM;
-- -    }
        snd_soc_codec_set_drvdata(codec, twl4030);
        /* Set the defaults, and power up the codec */
        twl4030->sysclk = twl4030_audio_get_mclk() / 1000;
index 9719d3ca8e47e90d1a717727be4d4131f9805fd6,247b39013fba682efa253924a178285e2f7e43ce,621c442160e1e6d82fa268ac6ef73cd81a76f79c,247b39013fba682efa253924a178285e2f7e43ce..39d8df04011616e6f18d4812c4967cae84cf5472
@@@@@ -3296,12 -3296,12 -3296,8 -3296,12 +3296,8 @@@@@ static void wm8994_handle_pdata(struct 
                /* We need an array of texts for the enum API */
                wm8994->drc_texts = devm_kzalloc(wm8994->hubs.codec->dev,
                            sizeof(char *) * pdata->num_drc_cfgs, GFP_KERNEL);
-- -            if (!wm8994->drc_texts) {
-- -                    dev_err(wm8994->hubs.codec->dev,
-- -                            "Failed to allocate %d DRC config texts\n",
-- -                            pdata->num_drc_cfgs);
++ +            if (!wm8994->drc_texts)
                        return;
-- -            }
    
                for (i = 0; i < pdata->num_drc_cfgs; i++)
                        wm8994->drc_texts[i] = pdata->drc_cfgs[i].name;
@@@@@ -3505,7 -3505,6 -3501,6 -3505,6 +3501,7 @@@@@ static irqreturn_t wm8994_mic_irq(int i
        return IRQ_HANDLED;
    }
    
 +++/* Should be called with accdet_lock held */
    static void wm1811_micd_stop(struct snd_soc_codec *codec)
    {
        struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
        if (!wm8994->jackdet)
                return;
    
 ---    mutex_lock(&wm8994->accdet_lock);
 ---
        snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, WM8958_MICD_ENA, 0);
    
        wm1811_jackdet_set_mode(codec, WM1811_JACKDET_MODE_JACK);
    
 ---    mutex_unlock(&wm8994->accdet_lock);
 ---
        if (wm8994->wm8994->pdata.jd_ext_cap)
                snd_soc_dapm_disable_pin(&codec->dapm,
                                         "MICBIAS2");
@@@@@ -3557,10 -3560,10 -3556,10 -3560,10 +3553,10 @@@@@ static void wm8958_open_circuit_work(st
                                                  open_circuit_work.work);
        struct device *dev = wm8994->wm8994->dev;
    
 ---    wm1811_micd_stop(wm8994->hubs.codec);
 ---
        mutex_lock(&wm8994->accdet_lock);
    
 +++    wm1811_micd_stop(wm8994->hubs.codec);
 +++
        dev_dbg(dev, "Reporting open circuit\n");
    
        wm8994->jack_mic = false;