linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Xiubo Li <Li.Xiubo@freescale.com>
To: <r65073@freescale.com>, <timur@tabi.org>, <lgirdwood@gmail.com>,
	<broonie@kernel.org>
Cc: mark.rutland@arm.com, alsa-devel@alsa-project.org,
	linux-doc@vger.kernel.org, tiwai@suse.de, b18965@freescale.com,
	perex@perex.cz, LW@KARO-electronics.de, linux@arm.linux.org.uk,
	b42378@freescale.com, oskar@scara.com, grant.likely@linaro.org,
	devicetree@vger.kernel.org, ian.campbell@citrix.com,
	pawel.moll@arm.com, swarren@wwwdotorg.org,
	rob.herring@calxeda.com, linux-arm-kernel@lists.infradead.org,
	fabio.estevam@freescale.com, linux-kernel@vger.kernel.org,
	rob@landley.net, r64188@freescale.com, shawn.guo@linaro.org,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCHv1 5/8] ASoC: sgtl5000: Revise the bugs about the sgt15000 codec.
Date: Thu, 17 Oct 2013 17:01:14 +0800	[thread overview]
Message-ID: <1382000477-17304-6-git-send-email-Li.Xiubo@freescale.com> (raw)
In-Reply-To: <1382000477-17304-1-git-send-email-Li.Xiubo@freescale.com>

When the CONFIG_REGULATOR is disabled there will be some warnings
printed out.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 sound/soc/codecs/sgtl5000.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 1f4093f..4e2e4c9 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -883,14 +883,19 @@ static int ldo_regulator_register(struct snd_soc_codec *codec,
 				struct regulator_init_data *init_data,
 				int voltage)
 {
+#ifdef CONFIG_SND_SOC_FSL_SGTL5000
+	return 0;
+#else
 	dev_err(codec->dev, "this setup needs regulator support in the kernel\n");
 	return -EINVAL;
+#endif
 }
 
 static int ldo_regulator_remove(struct snd_soc_codec *codec)
 {
 	return 0;
 }
+
 #endif
 
 /*
@@ -1137,6 +1142,7 @@ static int sgtl5000_resume(struct snd_soc_codec *codec)
 #define sgtl5000_resume  NULL
 #endif	/* CONFIG_SUSPEND */
 
+#ifdef CONFIG_REGULATOR
 /*
  * sgtl5000 has 3 internal power supplies:
  * 1. VAG, normally set to vdda/2
@@ -1269,6 +1275,7 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec)
 
 	return 0;
 }
+#endif
 
 static int sgtl5000_replace_vddd_with_ldo(struct snd_soc_codec *codec)
 {
@@ -1370,6 +1377,7 @@ err_regulator_free:
 				sgtl5000->supplies);
 	if (external_vddd)
 		ldo_regulator_remove(codec);
+
 	return ret;
 
 }
@@ -1391,11 +1399,12 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
 	if (ret)
 		return ret;
 
+#ifdef CONFIG_REGULATOR
 	/* power up sgtl5000 */
 	ret = sgtl5000_set_power_regs(codec);
 	if (ret)
 		goto err;
-
+#endif
 	/* enable small pop, introduce 400ms delay in turning off */
 	snd_soc_update_bits(codec, SGTL5000_CHIP_REF_CTRL,
 				SGTL5000_SMALL_POP,
@@ -1446,6 +1455,7 @@ err:
 						sgtl5000->supplies);
 	regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
 				sgtl5000->supplies);
+
 	ldo_regulator_remove(codec);
 
 	return ret;
@@ -1461,6 +1471,7 @@ static int sgtl5000_remove(struct snd_soc_codec *codec)
 						sgtl5000->supplies);
 	regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
 				sgtl5000->supplies);
+
 	ldo_regulator_remove(codec);
 
 	return 0;
-- 
1.8.0

  parent reply	other threads:[~2013-10-17  9:11 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-17  9:01 [PATCHv1 0/8] ALSA: Add SAI driver and enable SGT15000 codec Xiubo Li
2013-10-17  9:01 ` [PATCHv1 1/8] ALSA: Add SAI SoC Digital Audio Interface driver Xiubo Li
2013-10-17  9:42   ` Lothar Waßmann
2013-10-18  3:19     ` Xiubo Li-B47053
2013-10-17 12:15   ` Timur Tabi
2013-10-17 12:21     ` [alsa-devel] " Lars-Peter Clausen
2013-10-17 13:22       ` Timur Tabi
2013-10-17 13:33         ` Lars-Peter Clausen
2013-10-17 13:37           ` Timur Tabi
2013-10-17 13:51             ` Lars-Peter Clausen
2013-10-17 14:10               ` Mark Brown
2013-10-18  3:42                 ` Xiubo Li-B47053
2013-10-17 17:43   ` Lars-Peter Clausen
2013-10-21  6:59     ` Xiubo Li-B47053
2013-10-22  2:20     ` Xiubo Li-B47053
2013-10-28  5:58     ` Xiubo Li-B47053
2013-11-12  5:02       ` Vinod Koul
2013-11-12  7:35         ` Li Xiubo
2013-11-12  7:59           ` Lars-Peter Clausen
2013-10-24 11:05   ` Mark Brown
2013-10-28  7:15     ` Xiubo Li-B47053
2013-10-29  4:00     ` Xiubo Li-B47053
2013-10-29  4:02       ` Nicolin Chen
2013-10-29  9:31         ` Xiubo Li-B47053
2013-10-17  9:01 ` [PATCHv1 2/8] ARM: dts: Add Freescale SAI ALSA SoC Digital Audio Interface node for VF610 Xiubo Li
2013-10-17  9:01 ` [PATCHv1 3/8] ARM: dts: Enables SAI ALSA SoC DAI device for Vybrid VF610 TOWER board Xiubo Li
2013-10-17  9:01 ` [PATCHv1 4/8] Documentation: Add device tree bindings for Freescale SAI Xiubo Li
2013-10-17  9:01 ` Xiubo Li [this message]
2013-10-17  9:56   ` [PATCHv1 5/8] ASoC: sgtl5000: Revise the bugs about the sgt15000 codec Nicolin Chen
2013-10-21  4:07     ` Xiubo Li-B47053
2013-10-17 10:17   ` Lothar Waßmann
2013-10-21  4:15     ` Xiubo Li-B47053
2013-10-21  8:11       ` Lothar Waßmann
2013-10-21 11:21       ` Timur Tabi
2013-10-18 17:28   ` Mark Brown
2013-10-28  6:07     ` Xiubo Li-B47053
2013-10-17  9:01 ` [PATCHv1 6/8] ASoC: fsl: add SGT15000 based audio machine driver Xiubo Li
2013-10-18 17:33   ` Mark Brown
2013-10-21  7:50     ` Xiubo Li-B47053
2013-10-17  9:01 ` [PATCHv1 7/8] ARM: dts: Enable SGT15000 codec based audio driver node for VF610 Xiubo Li
2013-10-17  9:01 ` [PATCHv1 8/8] Documentation: Add device tree bindings for Freescale VF610 sound Xiubo Li
2013-10-17  9:46   ` Lucas Stach
2013-10-18  3:27     ` Xiubo Li-B47053
2013-10-18 17:31   ` Mark Brown
2013-10-21  7:24     ` Xiubo Li-B47053
2013-10-22  9:47       ` Mark Brown
2013-10-17 10:22 ` [PATCHv1 0/8] ALSA: Add SAI driver and enable SGT15000 codec Lothar Waßmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1382000477-17304-6-git-send-email-Li.Xiubo@freescale.com \
    --to=li.xiubo@freescale.com \
    --cc=LW@KARO-electronics.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=b18965@freescale.com \
    --cc=b42378@freescale.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fabio.estevam@freescale.com \
    --cc=grant.likely@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=oskar@scara.com \
    --cc=pawel.moll@arm.com \
    --cc=perex@perex.cz \
    --cc=r64188@freescale.com \
    --cc=r65073@freescale.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=shawn.guo@linaro.org \
    --cc=swarren@wwwdotorg.org \
    --cc=timur@tabi.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).