Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132922
b: refs/heads/master
c: eb5f6d7
h: refs/heads/master
v: v3
  • Loading branch information
Philipp Zabel authored and Mark Brown committed Mar 12, 2009
1 parent 0a1cf14 commit 270f420
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 87 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6f7cb44ba1a5195bf719f9ba1d57bd79e13262c1
refs/heads/master: eb5f6d753e337834c7ceb07824ee472e43d9a7a2
23 changes: 5 additions & 18 deletions trunk/sound/soc/codecs/cs4270.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,6 @@ static int cs4270_probe(struct platform_device *pdev)
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
struct snd_soc_codec *codec = cs4270_codec;
unsigned int i;
int ret;

/* Connect the codec to the socdev. snd_soc_new_pcms() needs this. */
Expand All @@ -554,23 +553,11 @@ static int cs4270_probe(struct platform_device *pdev)
}

/* Add the non-DAPM controls */
for (i = 0; i < ARRAY_SIZE(cs4270_snd_controls); i++) {
struct snd_kcontrol *kctrl;

kctrl = snd_soc_cnew(&cs4270_snd_controls[i], codec, NULL);
if (!kctrl) {
dev_err(codec->dev, "error creating control '%s'\n",
cs4270_snd_controls[i].name);
ret = -ENOMEM;
goto error_free_pcms;
}

ret = snd_ctl_add(codec->card, kctrl);
if (ret < 0) {
dev_err(codec->dev, "error adding control '%s'\n",
cs4270_snd_controls[i].name);
goto error_free_pcms;
}
ret = snd_soc_add_controls(codec, cs4270_snd_controls,
ARRAY_SIZE(cs4270_snd_controls));
if (ret < 0) {
dev_err(codec->dev, "failed to add controls\n");
goto error_free_pcms;
}

/* And finally, register the socdev */
Expand Down
11 changes: 4 additions & 7 deletions trunk/sound/soc/codecs/tlv320aic26.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,8 @@ static int aic26_probe(struct platform_device *pdev)
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
struct snd_soc_codec *codec;
struct snd_kcontrol *kcontrol;
struct aic26 *aic26;
int i, ret, err;
int ret, err;

dev_info(&pdev->dev, "Probing AIC26 SoC CODEC driver\n");
dev_dbg(&pdev->dev, "socdev=%p\n", socdev);
Expand All @@ -353,11 +352,9 @@ static int aic26_probe(struct platform_device *pdev)

/* register controls */
dev_dbg(&pdev->dev, "Registering controls\n");
for (i = 0; i < ARRAY_SIZE(aic26_snd_controls); i++) {
kcontrol = snd_soc_cnew(&aic26_snd_controls[i], codec, NULL);
err = snd_ctl_add(codec->card, kcontrol);
WARN_ON(err < 0);
}
err = snd_soc_add_controls(codec, aic26_snd_controls,
ARRAY_SIZE(aic26_snd_controls));
WARN_ON(err < 0);

/* CODEC is setup, we can register the card now */
dev_dbg(&pdev->dev, "Registering card\n");
Expand Down
12 changes: 2 additions & 10 deletions trunk/sound/soc/codecs/wm8400.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,8 @@ SOC_SINGLE("RIN34 Mute Switch", WM8400_RIGHT_LINE_INPUT_3_4_VOLUME,
/* add non dapm controls */
static int wm8400_add_controls(struct snd_soc_codec *codec)
{
int err, i;

for (i = 0; i < ARRAY_SIZE(wm8400_snd_controls); i++) {
err = snd_ctl_add(codec->card,
snd_soc_cnew(&wm8400_snd_controls[i],codec,
NULL));
if (err < 0)
return err;
}
return 0;
return snd_soc_add_controls(codec, wm8400_snd_controls,
ARRAY_SIZE(wm8400_snd_controls));
}

/*
Expand Down
12 changes: 5 additions & 7 deletions trunk/sound/soc/omap/n810.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,20 +248,18 @@ static const struct snd_kcontrol_new aic33_n810_controls[] = {

static int n810_aic33_init(struct snd_soc_codec *codec)
{
int i, err;
int err;

/* Not connected */
snd_soc_dapm_nc_pin(codec, "MONO_LOUT");
snd_soc_dapm_nc_pin(codec, "HPLCOM");
snd_soc_dapm_nc_pin(codec, "HPRCOM");

/* Add N810 specific controls */
for (i = 0; i < ARRAY_SIZE(aic33_n810_controls); i++) {
err = snd_ctl_add(codec->card,
snd_soc_cnew(&aic33_n810_controls[i], codec, NULL));
if (err < 0)
return err;
}
err = snd_soc_add_controls(codec, aic33_n810_controls,
ARRAY_SIZE(aic33_n810_controls));
if (err < 0)
return err;

/* Add N810 specific widgets */
snd_soc_dapm_new_controls(codec, aic33_dapm_widgets,
Expand Down
12 changes: 5 additions & 7 deletions trunk/sound/soc/pxa/corgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,16 @@ static const struct snd_kcontrol_new wm8731_corgi_controls[] = {
*/
static int corgi_wm8731_init(struct snd_soc_codec *codec)
{
int i, err;
int err;

snd_soc_dapm_nc_pin(codec, "LLINEIN");
snd_soc_dapm_nc_pin(codec, "RLINEIN");

/* Add corgi specific controls */
for (i = 0; i < ARRAY_SIZE(wm8731_corgi_controls); i++) {
err = snd_ctl_add(codec->card,
snd_soc_cnew(&wm8731_corgi_controls[i], codec, NULL));
if (err < 0)
return err;
}
err = snd_soc_add_controls(codec, wm8731_corgi_controls,
ARRAY_SIZE(wm8731_corgi_controls));
if (err < 0)
return err;

/* Add corgi specific widgets */
snd_soc_dapm_new_controls(codec, wm8731_dapm_widgets,
Expand Down
13 changes: 5 additions & 8 deletions trunk/sound/soc/pxa/palm27x.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,16 @@ static const struct snd_kcontrol_new palm27x_controls[] = {

static int palm27x_ac97_init(struct snd_soc_codec *codec)
{
int i, err;
int err;

snd_soc_dapm_nc_pin(codec, "OUT3");
snd_soc_dapm_nc_pin(codec, "MONOOUT");

/* add palm27x specific controls */
for (i = 0; i < ARRAY_SIZE(palm27x_controls); i++) {
err = snd_ctl_add(codec->card,
snd_soc_cnew(&palm27x_controls[i],
codec, NULL));
if (err < 0)
return err;
}
err = snd_soc_add_controls(codec, palm27x_controls,
ARRAY_SIZE(palm27x_controls));
if (err < 0)
return err;

/* add palm27x specific widgets */
snd_soc_dapm_new_controls(codec, palm27x_dapm_widgets,
Expand Down
12 changes: 5 additions & 7 deletions trunk/sound/soc/pxa/poodle.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,19 +241,17 @@ static const struct snd_kcontrol_new wm8731_poodle_controls[] = {
*/
static int poodle_wm8731_init(struct snd_soc_codec *codec)
{
int i, err;
int err;

snd_soc_dapm_nc_pin(codec, "LLINEIN");
snd_soc_dapm_nc_pin(codec, "RLINEIN");
snd_soc_dapm_enable_pin(codec, "MICIN");

/* Add poodle specific controls */
for (i = 0; i < ARRAY_SIZE(wm8731_poodle_controls); i++) {
err = snd_ctl_add(codec->card,
snd_soc_cnew(&wm8731_poodle_controls[i], codec, NULL));
if (err < 0)
return err;
}
err = snd_soc_add_controls(codec, wm8731_poodle_controls,
ARRAY_SIZE(wm8731_poodle_controls));
if (err < 0)
return err;

/* Add poodle specific widgets */
snd_soc_dapm_new_controls(codec, wm8731_dapm_widgets,
Expand Down
12 changes: 5 additions & 7 deletions trunk/sound/soc/pxa/spitz.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ static const struct snd_kcontrol_new wm8750_spitz_controls[] = {
*/
static int spitz_wm8750_init(struct snd_soc_codec *codec)
{
int i, err;
int err;

/* NC codec pins */
snd_soc_dapm_nc_pin(codec, "RINPUT1");
Expand All @@ -290,12 +290,10 @@ static int spitz_wm8750_init(struct snd_soc_codec *codec)
snd_soc_dapm_nc_pin(codec, "MONO1");

/* Add spitz specific controls */
for (i = 0; i < ARRAY_SIZE(wm8750_spitz_controls); i++) {
err = snd_ctl_add(codec->card,
snd_soc_cnew(&wm8750_spitz_controls[i], codec, NULL));
if (err < 0)
return err;
}
err = snd_soc_add_controls(codec, wm8750_spitz_controls,
ARRAY_SIZE(wm8750_spitz_controls));
if (err < 0)
return err;

/* Add spitz specific widgets */
snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets,
Expand Down
12 changes: 5 additions & 7 deletions trunk/sound/soc/pxa/tosa.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,16 @@ static const struct snd_kcontrol_new tosa_controls[] = {

static int tosa_ac97_init(struct snd_soc_codec *codec)
{
int i, err;
int err;

snd_soc_dapm_nc_pin(codec, "OUT3");
snd_soc_dapm_nc_pin(codec, "MONOOUT");

/* add tosa specific controls */
for (i = 0; i < ARRAY_SIZE(tosa_controls); i++) {
err = snd_ctl_add(codec->card,
snd_soc_cnew(&tosa_controls[i],codec, NULL));
if (err < 0)
return err;
}
err = snd_soc_add_controls(codec, tosa_controls,
ARRAY_SIZE(tosa_controls));
if (err < 0)
return err;

/* add tosa specific widgets */
snd_soc_dapm_new_controls(codec, tosa_dapm_widgets,
Expand Down
13 changes: 5 additions & 8 deletions trunk/sound/soc/s3c24xx/neo1973_wm8753.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ static const struct snd_kcontrol_new wm8753_neo1973_controls[] = {
*/
static int neo1973_wm8753_init(struct snd_soc_codec *codec)
{
int i, err;
int err;

pr_debug("Entered %s\n", __func__);

Expand All @@ -518,13 +518,10 @@ static int neo1973_wm8753_init(struct snd_soc_codec *codec)
set_scenario_endpoints(codec, NEO_AUDIO_OFF);

/* add neo1973 specific controls */
for (i = 0; i < ARRAY_SIZE(wm8753_neo1973_controls); i++) {
err = snd_ctl_add(codec->card,
snd_soc_cnew(&wm8753_neo1973_controls[i],
codec, NULL));
if (err < 0)
return err;
}
err = snd_soc_add_controls(codec, wm8753_neo1973_controls,
ARRAY_SIZE(8753_neo1973_controls));
if (err < 0)
return err;

/* set up neo1973 specific audio routes */
err = snd_soc_dapm_add_routes(codec, dapm_routes,
Expand Down

0 comments on commit 270f420

Please sign in to comment.