Commit 0f639a3c authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (30 commits)
  ALSA: hda - Use ALC_INIT_DEFAULT for really default initialization
  ASoC: Fix resource reclaim for osk5912
  ASoC: tlv320aic3x - fix variable may be used uninitialized warning
  ASoC: davinci-vcif - fix a memory leak
  ASoC: phycore-ac97: fix resource leak
  ASoC: imx-ssi: fix resource leak
  ASoC: simone: fix resource leak in simone_init error path
  ASoC: sam9g20_wm8731: fix resource leak in at91sam9g20ek_init error path
  ASoC: snd-soc-afeb9260: remove unneeded platform_device_del in error path
  ASoC: pcm030-audio-fabric: fix resource leak in pcm030_fabric_init error path
  ASoC: efika-audio-fabric: fix resource leak in efika_fabric_init error path
  ASoC: Call snd_soc_unregister_dais instead of snd_soc_unregister_dai in sh4_soc_dai_remove
  ASoC: fix SND_PXA2XX_LIB Kconfig warning
  ALSA: hda - Fix ALC660-VD/ALC861-VD capture/playback mixers
  ALSA: HDA: Add an extra DAC for Realtek ALC887-VD
  ASoC: nuc900-ac97: fix a memory leak
  ASoC: Return proper error for omap3pandora_soc_init
  ASoC: wm8961 - clear WM8961_MCLKDIV bit for freq <= 16500000
  ASoC: wm8961 - clear WM8961_DACSLOPE bit for normal mode
  ALSA: hda - Fix Acer 7730G support
  ...
parents 19650e85 37fa84d8
...@@ -1614,6 +1614,7 @@ static int alc_subsystem_id(struct hda_codec *codec, ...@@ -1614,6 +1614,7 @@ static int alc_subsystem_id(struct hda_codec *codec,
spec->init_amp = ALC_INIT_GPIO3; spec->init_amp = ALC_INIT_GPIO3;
break; break;
case 5: case 5:
default:
spec->init_amp = ALC_INIT_DEFAULT; spec->init_amp = ALC_INIT_DEFAULT;
break; break;
} }
...@@ -2013,6 +2014,36 @@ static struct hda_verb alc888_acer_aspire_6530g_verbs[] = { ...@@ -2013,6 +2014,36 @@ static struct hda_verb alc888_acer_aspire_6530g_verbs[] = {
{ } { }
}; };
/*
*ALC888 Acer Aspire 7730G model
*/
static struct hda_verb alc888_acer_aspire_7730G_verbs[] = {
/* Bias voltage on for external mic port */
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80},
/* Front Mic: set to PIN_IN (empty by default) */
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
/* Unselect Front Mic by default in input mixer 3 */
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
/* Enable unsolicited event for HP jack */
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
/* Enable speaker output */
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
/* Enable headphone output */
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
{0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
/*Enable internal subwoofer */
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x17, AC_VERB_SET_CONNECT_SEL, 0x02},
{0x17, AC_VERB_SET_EAPD_BTLENABLE, 2},
{ }
};
/* /*
* ALC889 Acer Aspire 8930G model * ALC889 Acer Aspire 8930G model
*/ */
...@@ -2200,6 +2231,16 @@ static void alc888_acer_aspire_6530g_setup(struct hda_codec *codec) ...@@ -2200,6 +2231,16 @@ static void alc888_acer_aspire_6530g_setup(struct hda_codec *codec)
spec->autocfg.speaker_pins[2] = 0x17; spec->autocfg.speaker_pins[2] = 0x17;
} }
static void alc888_acer_aspire_7730g_setup(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
spec->autocfg.hp_pins[0] = 0x15;
spec->autocfg.speaker_pins[0] = 0x14;
spec->autocfg.speaker_pins[1] = 0x16;
spec->autocfg.speaker_pins[2] = 0x17;
}
static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec) static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec)
{ {
struct alc_spec *spec = codec->spec; struct alc_spec *spec = codec->spec;
...@@ -9524,13 +9565,6 @@ static struct hda_verb alc883_acer_eapd_verbs[] = { ...@@ -9524,13 +9565,6 @@ static struct hda_verb alc883_acer_eapd_verbs[] = {
{ } { }
}; };
static struct hda_verb alc888_acer_aspire_7730G_verbs[] = {
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
{0x17, AC_VERB_SET_CONNECT_SEL, 0x02},
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
{ } /* end */
};
static void alc888_6st_dell_setup(struct hda_codec *codec) static void alc888_6st_dell_setup(struct hda_codec *codec)
{ {
struct alc_spec *spec = codec->spec; struct alc_spec *spec = codec->spec;
...@@ -10328,7 +10362,7 @@ static struct alc_config_preset alc882_presets[] = { ...@@ -10328,7 +10362,7 @@ static struct alc_config_preset alc882_presets[] = {
.const_channel_count = 6, .const_channel_count = 6,
.input_mux = &alc883_capture_source, .input_mux = &alc883_capture_source,
.unsol_event = alc_automute_amp_unsol_event, .unsol_event = alc_automute_amp_unsol_event,
.setup = alc888_acer_aspire_6530g_setup, .setup = alc888_acer_aspire_7730g_setup,
.init_hook = alc_automute_amp, .init_hook = alc_automute_amp,
}, },
[ALC883_MEDION] = { [ALC883_MEDION] = {
...@@ -16910,7 +16944,7 @@ static struct alc_config_preset alc861vd_presets[] = { ...@@ -16910,7 +16944,7 @@ static struct alc_config_preset alc861vd_presets[] = {
static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, static int alc861vd_auto_create_input_ctls(struct hda_codec *codec,
const struct auto_pin_cfg *cfg) const struct auto_pin_cfg *cfg)
{ {
return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x09, 0); return alc_auto_create_input_ctls(codec, cfg, 0x0b, 0x22, 0);
} }
...@@ -18964,6 +18998,8 @@ static inline hda_nid_t alc662_mix_to_dac(hda_nid_t nid) ...@@ -18964,6 +18998,8 @@ static inline hda_nid_t alc662_mix_to_dac(hda_nid_t nid)
return 0x02; return 0x02;
else if (nid >= 0x0c && nid <= 0x0e) else if (nid >= 0x0c && nid <= 0x0e)
return nid - 0x0c + 0x02; return nid - 0x0c + 0x02;
else if (nid == 0x26) /* ALC887-VD has this DAC too */
return 0x25;
else else
return 0; return 0;
} }
...@@ -18972,7 +19008,7 @@ static inline hda_nid_t alc662_mix_to_dac(hda_nid_t nid) ...@@ -18972,7 +19008,7 @@ static inline hda_nid_t alc662_mix_to_dac(hda_nid_t nid)
static hda_nid_t alc662_dac_to_mix(struct hda_codec *codec, hda_nid_t pin, static hda_nid_t alc662_dac_to_mix(struct hda_codec *codec, hda_nid_t pin,
hda_nid_t dac) hda_nid_t dac)
{ {
hda_nid_t mix[4]; hda_nid_t mix[5];
int i, num; int i, num;
num = snd_hda_get_connections(codec, pin, mix, ARRAY_SIZE(mix)); num = snd_hda_get_connections(codec, pin, mix, ARRAY_SIZE(mix));
......
...@@ -222,9 +222,9 @@ static int __init at91sam9g20ek_init(void) ...@@ -222,9 +222,9 @@ static int __init at91sam9g20ek_init(void)
} }
pllb = clk_get(NULL, "pllb"); pllb = clk_get(NULL, "pllb");
if (IS_ERR(mclk)) { if (IS_ERR(pllb)) {
printk(KERN_ERR "ASoC: Failed to get PLLB\n"); printk(KERN_ERR "ASoC: Failed to get PLLB\n");
ret = PTR_ERR(mclk); ret = PTR_ERR(pllb);
goto err_mclk; goto err_mclk;
} }
ret = clk_set_parent(mclk, pllb); ret = clk_set_parent(mclk, pllb);
...@@ -240,6 +240,7 @@ static int __init at91sam9g20ek_init(void) ...@@ -240,6 +240,7 @@ static int __init at91sam9g20ek_init(void)
if (!at91sam9g20ek_snd_device) { if (!at91sam9g20ek_snd_device) {
printk(KERN_ERR "ASoC: Platform device allocation failed\n"); printk(KERN_ERR "ASoC: Platform device allocation failed\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_mclk;
} }
platform_set_drvdata(at91sam9g20ek_snd_device, platform_set_drvdata(at91sam9g20ek_snd_device,
...@@ -248,11 +249,13 @@ static int __init at91sam9g20ek_init(void) ...@@ -248,11 +249,13 @@ static int __init at91sam9g20ek_init(void)
ret = platform_device_add(at91sam9g20ek_snd_device); ret = platform_device_add(at91sam9g20ek_snd_device);
if (ret) { if (ret) {
printk(KERN_ERR "ASoC: Platform device allocation failed\n"); printk(KERN_ERR "ASoC: Platform device allocation failed\n");
platform_device_put(at91sam9g20ek_snd_device); goto err_device_add;
} }
return ret; return ret;
err_device_add:
platform_device_put(at91sam9g20ek_snd_device);
err_mclk: err_mclk:
clk_put(mclk); clk_put(mclk);
mclk = NULL; mclk = NULL;
......
...@@ -167,7 +167,6 @@ static int __init afeb9260_soc_init(void) ...@@ -167,7 +167,6 @@ static int __init afeb9260_soc_init(void)
return 0; return 0;
err1: err1:
platform_device_del(afeb9260_snd_device);
platform_device_put(afeb9260_snd_device); platform_device_put(afeb9260_snd_device);
return err; return err;
} }
......
...@@ -2019,7 +2019,10 @@ static int max98088_probe(struct snd_soc_codec *codec) ...@@ -2019,7 +2019,10 @@ static int max98088_probe(struct snd_soc_codec *codec)
static int max98088_remove(struct snd_soc_codec *codec) static int max98088_remove(struct snd_soc_codec *codec)
{ {
struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); max98088_set_bias_level(codec, SND_SOC_BIAS_OFF);
kfree(max98088->eq_texts);
return 0; return 0;
} }
......
...@@ -383,6 +383,7 @@ static struct snd_soc_codec_driver soc_codec_dev_stac9766 = { ...@@ -383,6 +383,7 @@ static struct snd_soc_codec_driver soc_codec_dev_stac9766 = {
.reg_cache_size = sizeof(stac9766_reg), .reg_cache_size = sizeof(stac9766_reg),
.reg_word_size = sizeof(u16), .reg_word_size = sizeof(u16),
.reg_cache_step = 2, .reg_cache_step = 2,
.reg_cache_default = stac9766_reg,
}; };
static __devinit int stac9766_probe(struct platform_device *pdev) static __devinit int stac9766_probe(struct platform_device *pdev)
......
...@@ -1176,7 +1176,7 @@ EXPORT_SYMBOL_GPL(aic3x_set_gpio); ...@@ -1176,7 +1176,7 @@ EXPORT_SYMBOL_GPL(aic3x_set_gpio);
int aic3x_get_gpio(struct snd_soc_codec *codec, int gpio) int aic3x_get_gpio(struct snd_soc_codec *codec, int gpio)
{ {
u8 reg = gpio ? AIC3X_GPIO2_REG : AIC3X_GPIO1_REG; u8 reg = gpio ? AIC3X_GPIO2_REG : AIC3X_GPIO1_REG;
u8 val, bit = gpio ? 2: 1; u8 val = 0, bit = gpio ? 2 : 1;
aic3x_read(codec, reg, &val); aic3x_read(codec, reg, &val);
return (val >> bit) & 1; return (val >> bit) & 1;
...@@ -1204,7 +1204,7 @@ EXPORT_SYMBOL_GPL(aic3x_set_headset_detection); ...@@ -1204,7 +1204,7 @@ EXPORT_SYMBOL_GPL(aic3x_set_headset_detection);
int aic3x_headset_detected(struct snd_soc_codec *codec) int aic3x_headset_detected(struct snd_soc_codec *codec)
{ {
u8 val; u8 val = 0;
aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val);
return (val >> 4) & 1; return (val >> 4) & 1;
} }
...@@ -1212,7 +1212,7 @@ EXPORT_SYMBOL_GPL(aic3x_headset_detected); ...@@ -1212,7 +1212,7 @@ EXPORT_SYMBOL_GPL(aic3x_headset_detected);
int aic3x_button_pressed(struct snd_soc_codec *codec) int aic3x_button_pressed(struct snd_soc_codec *codec)
{ {
u8 val; u8 val = 0;
aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val);
return (val >> 5) & 1; return (val >> 5) & 1;
} }
......
...@@ -78,8 +78,10 @@ static int tpa6130a2_i2c_write(int reg, u8 value) ...@@ -78,8 +78,10 @@ static int tpa6130a2_i2c_write(int reg, u8 value)
if (data->power_state) { if (data->power_state) {
val = i2c_smbus_write_byte_data(tpa6130a2_client, reg, value); val = i2c_smbus_write_byte_data(tpa6130a2_client, reg, value);
if (val < 0) if (val < 0) {
dev_err(&tpa6130a2_client->dev, "Write failed\n"); dev_err(&tpa6130a2_client->dev, "Write failed\n");
return val;
}
} }
/* Either powered on or off, we save the context */ /* Either powered on or off, we save the context */
......
...@@ -146,7 +146,6 @@ static int wm8523_startup(struct snd_pcm_substream *substream, ...@@ -146,7 +146,6 @@ static int wm8523_startup(struct snd_pcm_substream *substream,
return -EINVAL; return -EINVAL;
} }
return 0;
snd_pcm_hw_constraint_list(substream->runtime, 0, snd_pcm_hw_constraint_list(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_RATE, SNDRV_PCM_HW_PARAM_RATE,
&wm8523->rate_constraint); &wm8523->rate_constraint);
......
...@@ -2498,6 +2498,8 @@ static int wm8904_remove(struct snd_soc_codec *codec) ...@@ -2498,6 +2498,8 @@ static int wm8904_remove(struct snd_soc_codec *codec)
wm8904_set_bias_level(codec, SND_SOC_BIAS_OFF); wm8904_set_bias_level(codec, SND_SOC_BIAS_OFF);
regulator_bulk_free(ARRAY_SIZE(wm8904->supplies), wm8904->supplies); regulator_bulk_free(ARRAY_SIZE(wm8904->supplies), wm8904->supplies);
kfree(wm8904->retune_mobile_texts);
kfree(wm8904->drc_texts);
return 0; return 0;
} }
......
...@@ -711,7 +711,7 @@ static int wm8961_hw_params(struct snd_pcm_substream *substream, ...@@ -711,7 +711,7 @@ static int wm8961_hw_params(struct snd_pcm_substream *substream,
if (fs <= 24000) if (fs <= 24000)
reg |= WM8961_DACSLOPE; reg |= WM8961_DACSLOPE;
else else
reg &= WM8961_DACSLOPE; reg &= ~WM8961_DACSLOPE;
snd_soc_write(codec, WM8961_ADC_DAC_CONTROL_2, reg); snd_soc_write(codec, WM8961_ADC_DAC_CONTROL_2, reg);
return 0; return 0;
...@@ -736,7 +736,7 @@ static int wm8961_set_sysclk(struct snd_soc_dai *dai, int clk_id, ...@@ -736,7 +736,7 @@ static int wm8961_set_sysclk(struct snd_soc_dai *dai, int clk_id,
freq /= 2; freq /= 2;
} else { } else {
dev_dbg(codec->dev, "Using MCLK/1 for %dHz MCLK\n", freq); dev_dbg(codec->dev, "Using MCLK/1 for %dHz MCLK\n", freq);
reg &= WM8961_MCLKDIV; reg &= ~WM8961_MCLKDIV;
} }
snd_soc_write(codec, WM8961_CLOCKING1, reg); snd_soc_write(codec, WM8961_CLOCKING1, reg);
......
...@@ -4061,6 +4061,8 @@ static int wm8994_codec_remove(struct snd_soc_codec *codec) ...@@ -4061,6 +4061,8 @@ static int wm8994_codec_remove(struct snd_soc_codec *codec)
wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_DET, wm8994); wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_DET, wm8994);
wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT, wm8994); wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT, wm8994);
wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_DET, wm8994); wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_DET, wm8994);
kfree(wm8994->retune_mobile_texts);
kfree(wm8994->drc_texts);
kfree(wm8994); kfree(wm8994);
return 0; return 0;
...@@ -4073,6 +4075,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8994 = { ...@@ -4073,6 +4075,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8994 = {
.resume = wm8994_resume, .resume = wm8994_resume,
.read = wm8994_read, .read = wm8994_read,
.write = wm8994_write, .write = wm8994_write,
.readable_register = wm8994_readable,
.volatile_register = wm8994_volatile,
.set_bias_level = wm8994_set_bias_level, .set_bias_level = wm8994_set_bias_level,
}; };
......
...@@ -247,7 +247,10 @@ static int davinci_vcif_probe(struct platform_device *pdev) ...@@ -247,7 +247,10 @@ static int davinci_vcif_probe(struct platform_device *pdev)
static int davinci_vcif_remove(struct platform_device *pdev) static int davinci_vcif_remove(struct platform_device *pdev)
{ {
struct davinci_vcif_dev *davinci_vcif_dev = dev_get_drvdata(&pdev->dev);
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_dai(&pdev->dev);
kfree(davinci_vcif_dev);
return 0; return 0;
} }
......
...@@ -54,24 +54,26 @@ static int __init simone_init(void) ...@@ -54,24 +54,26 @@ static int __init simone_init(void)
ret = platform_device_add(simone_snd_ac97_device); ret = platform_device_add(simone_snd_ac97_device);
if (ret) if (ret)
goto fail; goto fail1;
simone_snd_device = platform_device_alloc("soc-audio", -1); simone_snd_device = platform_device_alloc("soc-audio", -1);
if (!simone_snd_device) { if (!simone_snd_device) {
ret = -ENOMEM; ret = -ENOMEM;
goto fail; goto fail2;
} }
platform_set_drvdata(simone_snd_device, &snd_soc_simone); platform_set_drvdata(simone_snd_device, &snd_soc_simone);
ret = platform_device_add(simone_snd_device); ret = platform_device_add(simone_snd_device);
if (ret) { if (ret)
platform_device_put(simone_snd_device); goto fail3;
goto fail;
}
return ret; return 0;
fail: fail3:
platform_device_put(simone_snd_device);
fail2:
platform_device_del(simone_snd_ac97_device);
fail1:
platform_device_put(simone_snd_ac97_device); platform_device_put(simone_snd_ac97_device);
return ret; return ret;
} }
......
...@@ -76,6 +76,7 @@ static __init int efika_fabric_init(void) ...@@ -76,6 +76,7 @@ static __init int efika_fabric_init(void)
rc = platform_device_add(pdev); rc = platform_device_add(pdev);
if (rc) { if (rc) {
pr_err("efika_fabric_init: platform_device_add() failed\n"); pr_err("efika_fabric_init: platform_device_add() failed\n");
platform_device_put(pdev);
return -ENODEV; return -ENODEV;
} }
return 0; return 0;
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/of_device.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <sound/soc.h> #include <sound/soc.h>
......
...@@ -76,6 +76,7 @@ static __init int pcm030_fabric_init(void) ...@@ -76,6 +76,7 @@ static __init int pcm030_fabric_init(void)
rc = platform_device_add(pdev); rc = platform_device_add(pdev);
if (rc) { if (rc) {
pr_err("pcm030_fabric_init: platform_device_add() failed\n"); pr_err("pcm030_fabric_init: platform_device_add() failed\n");
platform_device_put(pdev);
return -ENODEV; return -ENODEV;
} }
return 0; return 0;
......
...@@ -679,8 +679,11 @@ static int imx_ssi_probe(struct platform_device *pdev) ...@@ -679,8 +679,11 @@ static int imx_ssi_probe(struct platform_device *pdev)
} }
ssi->soc_platform_pdev_fiq = platform_device_alloc("imx-fiq-pcm-audio", pdev->id); ssi->soc_platform_pdev_fiq = platform_device_alloc("imx-fiq-pcm-audio", pdev->id);
if (!ssi->soc_platform_pdev_fiq) if (!ssi->soc_platform_pdev_fiq) {
ret = -ENOMEM;
goto failed_pdev_fiq_alloc; goto failed_pdev_fiq_alloc;
}
platform_set_drvdata(ssi->soc_platform_pdev_fiq, ssi); platform_set_drvdata(ssi->soc_platform_pdev_fiq, ssi);
ret = platform_device_add(ssi->soc_platform_pdev_fiq); ret = platform_device_add(ssi->soc_platform_pdev_fiq);
if (ret) { if (ret) {
...@@ -689,8 +692,11 @@ static int imx_ssi_probe(struct platform_device *pdev) ...@@ -689,8 +692,11 @@ static int imx_ssi_probe(struct platform_device *pdev)
} }
ssi->soc_platform_pdev = platform_device_alloc("imx-pcm-audio", pdev->id); ssi->soc_platform_pdev = platform_device_alloc("imx-pcm-audio", pdev->id);
if (!ssi->soc_platform_pdev) if (!ssi->soc_platform_pdev) {
ret = -ENOMEM;
goto failed_pdev_alloc; goto failed_pdev_alloc;
}
platform_set_drvdata(ssi->soc_platform_pdev, ssi); platform_set_drvdata(ssi->soc_platform_pdev, ssi);
ret = platform_device_add(ssi->soc_platform_pdev); ret = platform_device_add(ssi->soc_platform_pdev);
if (ret) { if (ret) {
...@@ -703,6 +709,7 @@ static int imx_ssi_probe(struct platform_device *pdev) ...@@ -703,6 +709,7 @@ static int imx_ssi_probe(struct platform_device *pdev)
failed_pdev_add: failed_pdev_add:
platform_device_put(ssi->soc_platform_pdev); platform_device_put(ssi->soc_platform_pdev);
failed_pdev_alloc: failed_pdev_alloc:
platform_device_del(ssi->soc_platform_pdev_fiq);
failed_pdev_fiq_add: failed_pdev_fiq_add:
platform_device_put(ssi->soc_platform_pdev_fiq); platform_device_put(ssi->soc_platform_pdev_fiq);
failed_pdev_fiq_alloc: failed_pdev_fiq_alloc:
...@@ -726,8 +733,8 @@ static int __devexit imx_ssi_remove(struct platform_device *pdev) ...@@ -726,8 +733,8 @@ static int __devexit imx_ssi_remove(struct platform_device *pdev)
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
struct imx_ssi *ssi = platform_get_drvdata(pdev); struct imx_ssi *ssi = platform_get_drvdata(pdev);
platform_device_del(ssi->soc_platform_pdev); platform_device_unregister(ssi->soc_platform_pdev);
platform_device_put(ssi->soc_platform_pdev); platform_device_unregister(ssi->soc_platform_pdev_fiq);
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_dai(&pdev->dev);
......
...@@ -43,6 +43,7 @@ static struct snd_soc_card imx_phycore = { ...@@ -43,6 +43,7 @@ static struct snd_soc_card imx_phycore = {
.num_links = ARRAY_SIZE(imx_phycore_dai_ac97), .num_links = ARRAY_SIZE(imx_phycore_dai_ac97),
}; };
static struct platform_device *imx_phycore_snd_ac97_device;
static struct platform_device *imx_phycore_snd_device; static struct platform_device *imx_phycore_snd_device;
static int __init imx_phycore_init(void) static int __init imx_phycore_init(void)
...@@ -53,29 +54,42 @@ static int __init imx_phycore_init(void) ...@@ -53,29 +54,42 @@ static int __init imx_phycore_init(void)
/* return happy. We might run on a totally different machine */ /* return happy. We might run on a totally different machine */
return 0; return 0;
imx_phycore_snd_device = platform_device_alloc("soc-audio", -1); imx_phycore_snd_ac97_device = platform_device_alloc("soc-audio", -1);
if (!imx_phycore_snd_device) if (!imx_phycore_snd_ac97_device)
return -ENOMEM; return -ENOMEM;
platform_set_drvdata(imx_phycore_snd_device, &imx_phycore); platform_set_drvdata(imx_phycore_snd_ac97_device, &imx_phycore);
ret = platform_device_add(imx_phycore_snd_device); ret = platform_device_add(imx_phycore_snd_ac97_device);
if (ret)
goto fail1;
imx_phycore_snd_device = platform_device_alloc("wm9712-codec", -1); imx_phycore_snd_device = platform_device_alloc("wm9712-codec", -1);
if (!imx_phycore_snd_device) if (!imx_phycore_snd_device) {
return -ENOMEM; ret = -ENOMEM;
goto fail2;
}
ret = platform_device_add(imx_phycore_snd_device); ret = platform_device_add(imx_phycore_snd_device);
if (ret) { if (ret) {
printk(KERN_ERR "ASoC: Platform device allocation failed\n"); printk(KERN_ERR "ASoC: Platform device allocation failed\n");
platform_device_put(imx_phycore_snd_device); goto fail3;
} }
return 0;
fail3:
platform_device_put(imx_phycore_snd_device);
fail2:
platform_device_del(imx_phycore_snd_ac97_device);
fail1:
platform_device_put(imx_phycore_snd_ac97_device);
return ret; return ret;
} }
static void __exit imx_phycore_exit(void) static void __exit imx_phycore_exit(void)
{ {
platform_device_unregister(imx_phycore_snd_device); platform_device_unregister(imx_phycore_snd_device);
platform_device_unregister(imx_phycore_snd_ac97_device);
} }
late_initcall(imx_phycore_init); late_initcall(imx_phycore_init);
......
...@@ -384,7 +384,6 @@ static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) ...@@ -384,7 +384,6 @@ static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev)
static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev)
{ {
snd_soc_unregister_dai(&pdev->dev); snd_soc_unregister_dai(&pdev->dev);
clk_put(nuc900_ac97_data->clk); clk_put(nuc900_ac97_data->clk);
...@@ -392,6 +391,7 @@ static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) ...@@ -392,6 +391,7 @@ static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev)
release_mem_region(nuc900_ac97_data->res->start, release_mem_region(nuc900_ac97_data->res->start,
resource_size(nuc900_ac97_data->res)); resource_size(nuc900_ac97_data->res));
kfree(nuc900_ac97_data);
nuc900_ac97_data = NULL; nuc900_ac97_data = NULL;
return 0; return 0;
......
...@@ -306,6 +306,7 @@ static int __init omap3pandora_soc_init(void) ...@@ -306,6 +306,7 @@ static int __init omap3pandora_soc_init(void)
pr_err(PREFIX "Failed to get DAC regulator from %s: %ld\n", pr_err(PREFIX "Failed to get DAC regulator from %s: %ld\n",
dev_name(&omap3pandora_snd_device->dev), dev_name(&omap3pandora_snd_device->dev),
PTR_ERR(omap3pandora_dac_reg)); PTR_ERR(omap3pandora_dac_reg));
ret = PTR_ERR(omap3pandora_dac_reg);
goto fail3; goto fail3;
} }
......
...@@ -177,7 +177,8 @@ static int __init osk_soc_init(void) ...@@ -177,7 +177,8 @@ static int __init osk_soc_init(void)
tlv320aic23_mclk = clk_get(dev, "mclk"); tlv320aic23_mclk = clk_get(dev, "mclk");
if (IS_ERR(tlv320aic23_mclk)) { if (IS_ERR(tlv320aic23_mclk)) {
printk(KERN_ERR "Could not get mclk clock\n"); printk(KERN_ERR "Could not get mclk clock\n");
return -ENODEV; err = PTR_ERR(tlv320aic23_mclk);
goto err2;
} }
/* /*
...@@ -188,7 +189,7 @@ static int __init osk_soc_init(void) ...@@ -188,7 +189,7 @@ static int __init osk_soc_init(void)
if (clk_set_rate(tlv320aic23_mclk, CODEC_CLOCK)) { if (clk_set_rate(tlv320aic23_mclk, CODEC_CLOCK)) {
printk(KERN_ERR "Cannot set MCLK for AIC23 CODEC\n"); printk(KERN_ERR "Cannot set MCLK for AIC23 CODEC\n");
err = -ECANCELED; err = -ECANCELED;
goto err1; goto err3;
} }
} }
...@@ -196,9 +197,12 @@ static int __init osk_soc_init(void) ...@@ -196,9 +197,12 @@ static int __init osk_soc_init(void)
(uint) clk_get_rate(tlv320aic23_mclk), CODEC_CLOCK); (uint) clk_get_rate(tlv320aic23_mclk), CODEC_CLOCK);
return 0; return 0;
err1:
err3:
clk_put(tlv320aic23_mclk); clk_put(tlv320aic23_mclk);
err2:
platform_device_del(osk_snd_device); platform_device_del(osk_snd_device);
err1:
platform_device_put(osk_snd_device); platform_device_put(osk_snd_device);
return err; return err;
...@@ -207,6 +211,7 @@ static int __init osk_soc_init(void) ...@@ -207,6 +211,7 @@ static int __init osk_soc_init(void)
static void __exit osk_soc_exit(void) static void __exit osk_soc_exit(void)
{ {
clk_put(tlv320aic23_mclk);
platform_device_unregister(osk_snd_device); platform_device_unregister(osk_snd_device);
} }
......
config SND_PXA2XX_SOC config SND_PXA2XX_SOC
tristate "SoC Audio for the Intel PXA2xx chip" tristate "SoC Audio for the Intel PXA2xx chip"
depends on ARCH_PXA depends on ARCH_PXA
select SND_ARM
select SND_PXA2XX_LIB select SND_PXA2XX_LIB
help help
Say Y or M if you want to add support for codecs attached to Say Y or M if you want to add support for codecs attached to
......
...@@ -38,7 +38,7 @@ static int set_audio_clock_heirachy(struct platform_device *pdev) ...@@ -38,7 +38,7 @@ static int set_audio_clock_heirachy(struct platform_device *pdev)
} }
mout_epll = clk_get(NULL, "mout_epll"); mout_epll = clk_get(NULL, "mout_epll");
if (IS_ERR(fout_epll)) { if (IS_ERR(mout_epll)) {
printk(KERN_WARNING "%s: Cannot find mout_epll.\n", printk(KERN_WARNING "%s: Cannot find mout_epll.\n",
__func__); __func__);
ret = -EINVAL; ret = -EINVAL;
...@@ -54,7 +54,7 @@ static int set_audio_clock_heirachy(struct platform_device *pdev) ...@@ -54,7 +54,7 @@ static int set_audio_clock_heirachy(struct platform_device *pdev)
} }
sclk_spdif = clk_get(NULL, "sclk_spdif"); sclk_spdif = clk_get(NULL, "sclk_spdif");
if (IS_ERR(fout_epll)) { if (IS_ERR(sclk_spdif)) {
printk(KERN_WARNING "%s: Cannot find sclk_spdif.\n", printk(KERN_WARNING "%s: Cannot find sclk_spdif.\n",
__func__); __func__);
ret = -EINVAL; ret = -EINVAL;
......
...@@ -387,7 +387,7 @@ static int __devinit sh4_soc_dai_probe(struct platform_device *pdev) ...@@ -387,7 +387,7 @@ static int __devinit sh4_soc_dai_probe(struct platform_device *pdev)
static int __devexit sh4_soc_dai_remove(struct platform_device *pdev) static int __devexit sh4_soc_dai_remove(struct platform_device *pdev)
{ {
snd_soc_unregister_dai(&pdev->dev, ARRAY_SIZE(sh4_ssi_dai)); snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(sh4_ssi_dai));
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment