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,
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)) {
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) {
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);
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;
regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
sgtl5000->supplies);
+++ regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
+++ sgtl5000->supplies);
ldo_regulator_remove(codec);
return 0;
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:
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)
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);
}
}
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;
/* 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;
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");
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;