linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Helen Koike <helen.koike@collabora.co.uk>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Mark Brown <broonie@kernel.org>,
	Sebastian Reichel <sre@kernel.org>,
	k.kozlowski@samsung.com, lars@metafoo.de,
	alsa-devel@alsa-project.org, tiwai@suse.com, lgirdwood@gmail.com,
	linux-kernel@vger.kernel.org, peter.ujfalusi@ti.com,
	broonie@kernel.org, cphealy@gmail.com,
	linux-omap@vger.kernel.org, jarkko.nikula@bitmer.com
Subject: Applied "ASoC: tpa6130a2: Register component" to the asoc tree
Date: Thu, 23 Jun 2016 15:38:11 +0100	[thread overview]
Message-ID: <E1bG5lj-000461-S1@debutante> (raw)
In-Reply-To: <139032aca71410fa9df608ea34ecb8046439c626.1466441036.git.helen.koike@collabora.co.uk>

The patch

   ASoC: tpa6130a2: Register component

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From cb7e62256e99d285e415cf75db67558f0f8bb107 Mon Sep 17 00:00:00 2001
From: Helen Koike <helen.koike@collabora.co.uk>
Date: Mon, 20 Jun 2016 14:12:29 -0300
Subject: [PATCH] ASoC: tpa6130a2: Register component

Add tpa6130a2 controls by the component API and update rx51 accordingly

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
[koike: port for upstream]
Signed-off-by: Helen Koike <helen.koike@collabora.co.uk>
Tested-By: Sebastian Reichel <sre@kernel.org>
Reviewed-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/tpa6130a2.c | 30 +++++++++++++++---------------
 sound/soc/codecs/tpa6130a2.h |  1 -
 sound/soc/omap/rx51.c        | 23 ++++++++++++-----------
 3 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c
index 11d85c5c787a..f31326a332fb 100644
--- a/sound/soc/codecs/tpa6130a2.c
+++ b/sound/soc/codecs/tpa6130a2.c
@@ -273,7 +273,7 @@ static const DECLARE_TLV_DB_RANGE(tpa6130_tlv,
 );
 
 static const struct snd_kcontrol_new tpa6130a2_controls[] = {
-	SOC_SINGLE_EXT_TLV("TPA6130A2 Headphone Playback Volume",
+	SOC_SINGLE_EXT_TLV("Headphone Playback Volume",
 		       TPA6130A2_REG_VOL_MUTE, 0, 0x3f, 0,
 		       tpa6130a2_get_volsw, tpa6130a2_put_volsw,
 		       tpa6130_tlv),
@@ -286,7 +286,7 @@ static const DECLARE_TLV_DB_RANGE(tpa6140_tlv,
 );
 
 static const struct snd_kcontrol_new tpa6140a2_controls[] = {
-	SOC_SINGLE_EXT_TLV("TPA6140A2 Headphone Playback Volume",
+	SOC_SINGLE_EXT_TLV("Headphone Playback Volume",
 		       TPA6130A2_REG_VOL_MUTE, 1, 0x1f, 0,
 		       tpa6130a2_get_volsw, tpa6130a2_put_volsw,
 		       tpa6140_tlv),
@@ -348,23 +348,22 @@ int tpa6130a2_stereo_enable(struct snd_soc_codec *codec, int enable)
 }
 EXPORT_SYMBOL_GPL(tpa6130a2_stereo_enable);
 
-int tpa6130a2_add_controls(struct snd_soc_codec *codec)
+static int tpa6130a2_component_probe(struct snd_soc_component *component)
 {
-	struct	tpa6130a2_data *data;
-
-	if (tpa6130a2_client == NULL)
-		return -ENODEV;
-
-	data = i2c_get_clientdata(tpa6130a2_client);
+	struct tpa6130a2_data *data = snd_soc_component_get_drvdata(component);
 
 	if (data->id == TPA6140A2)
-		return snd_soc_add_codec_controls(codec, tpa6140a2_controls,
-						ARRAY_SIZE(tpa6140a2_controls));
+		return snd_soc_add_component_controls(component,
+			tpa6140a2_controls, ARRAY_SIZE(tpa6140a2_controls));
 	else
-		return snd_soc_add_codec_controls(codec, tpa6130a2_controls,
-						ARRAY_SIZE(tpa6130a2_controls));
+		return snd_soc_add_component_controls(component,
+			tpa6130a2_controls, ARRAY_SIZE(tpa6130a2_controls));
 }
-EXPORT_SYMBOL_GPL(tpa6130a2_add_controls);
+
+struct snd_soc_component_driver tpa6130a2_component_driver = {
+	.name = "tpa6130a2",
+	.probe = tpa6130a2_component_probe,
+};
 
 static int tpa6130a2_probe(struct i2c_client *client,
 			   const struct i2c_device_id *id)
@@ -451,7 +450,8 @@ static int tpa6130a2_probe(struct i2c_client *client,
 	if (ret != 0)
 		goto err_gpio;
 
-	return 0;
+	return devm_snd_soc_register_component(&client->dev,
+			&tpa6130a2_component_driver, NULL, 0);
 
 err_gpio:
 	tpa6130a2_client = NULL;
diff --git a/sound/soc/codecs/tpa6130a2.h b/sound/soc/codecs/tpa6130a2.h
index 417444020ba6..78ee7237568b 100644
--- a/sound/soc/codecs/tpa6130a2.h
+++ b/sound/soc/codecs/tpa6130a2.h
@@ -56,7 +56,6 @@
 /* TPA6130A2_REG_VERSION (0x04) */
 #define TPA6130A2_VERSION_MASK		(0x0f)
 
-extern int tpa6130a2_add_controls(struct snd_soc_codec *codec);
 extern int tpa6130a2_stereo_enable(struct snd_soc_codec *codec, int enable);
 
 #endif /* __TPA6130A2_H__ */
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
index 54949242bc70..b59cf89c5cab 100644
--- a/sound/soc/omap/rx51.c
+++ b/sound/soc/omap/rx51.c
@@ -286,16 +286,10 @@ static const struct snd_kcontrol_new aic34_rx51_controls[] = {
 
 static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)
 {
-	struct snd_soc_codec *codec = rtd->codec;
 	struct snd_soc_card *card = rtd->card;
 	struct rx51_audio_pdata *pdata = snd_soc_card_get_drvdata(card);
 	int err;
 
-	err = tpa6130a2_add_controls(codec);
-	if (err < 0) {
-		dev_err(card->dev, "Failed to add TPA6130A2 controls\n");
-		return err;
-	}
 	snd_soc_limit_volume(card, "TPA6130A2 Headphone Playback Volume", 42);
 
 	err = omap_mcbsp_st_add_controls(rtd, 2);
@@ -357,6 +351,10 @@ static struct snd_soc_aux_dev rx51_aux_dev[] = {
 		.name = "TLV320AIC34b",
 		.codec_name = "tlv320aic3x-codec.2-0019",
 	},
+	{
+		.name = "TPA61320A2",
+		.codec_name = "tpa6130a2.2-0060",
+	},
 };
 
 static struct snd_soc_codec_conf rx51_codec_conf[] = {
@@ -364,6 +362,10 @@ static struct snd_soc_codec_conf rx51_codec_conf[] = {
 		.dev_name = "tlv320aic3x-codec.2-0019",
 		.name_prefix = "b",
 	},
+	{
+		.dev_name = "tpa6130a2.2-0060",
+		.name_prefix = "TPA6130A2",
+	},
 };
 
 /* Audio card */
@@ -435,11 +437,10 @@ static int rx51_soc_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev, "Headphone amplifier node is not provided\n");
 			return -EINVAL;
 		}
-
-		/* TODO: tpa6130a2a driver supports only a single instance, so
-		 * this driver ignores the headphone-amplifier node for now.
-		 * It's already mandatory in the DT binding to be future proof.
-		 */
+		rx51_aux_dev[1].codec_name = NULL;
+		rx51_aux_dev[1].codec_of_node = dai_node;
+		rx51_codec_conf[1].dev_name = NULL;
+		rx51_codec_conf[1].of_node = dai_node;
 	}
 
 	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
-- 
2.8.1

  reply	other threads:[~2016-06-23 14:38 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-18  3:26 [PATCH 0/4] ASoC: tpa6130a2: Add support for multiple instances Helen Koike
2016-06-18  3:26 ` [PATCH 1/4] ASoC: tpa6130a2: Register component Helen Koike
2016-06-18 22:28   ` Sebastian Reichel
2016-06-18  3:26 ` [PATCH 2/4] ASoC: tap6130a2: Use regmap Helen Koike
2016-06-18 22:33   ` Sebastian Reichel
2016-06-23 14:38   ` Applied "ASoC: tap6130a2: Use regmap" to the asoc tree Mark Brown
2016-06-18  3:26 ` [PATCH 3/4] ASoC: tpa6130a2: Use snd soc volsw functions Helen Koike
2016-06-18 22:34   ` Sebastian Reichel
2016-06-18  3:26 ` [PATCH 4/4] ASoC: tpa6130a2: Add DAPM support Helen Koike
2016-06-18 23:21   ` Sebastian Reichel
2016-06-19  9:39     ` Lars-Peter Clausen
2016-06-19 20:03       ` Sebastian Reichel
2016-06-20  8:34   ` Peter Ujfalusi
2016-06-18 10:40 ` [PATCH 0/4] ASoC: tpa6130a2: Add support for multiple instances Sebastian Reichel
2016-06-18 21:33   ` Sebastian Reichel
2016-06-20 17:12   ` [PATCH v2 0/5] " Helen Koike
2016-06-20 17:12     ` [PATCH v2 1/5] ASoC: tpa6130a2: Register component Helen Koike
2016-06-23 14:38       ` Mark Brown [this message]
2016-06-20 17:12     ` [PATCH v2 2/5] ASoC: tap6130a2: Use regmap Helen Koike
2016-06-21  1:41       ` Sebastian Reichel
2016-06-20 17:12     ` [PATCH v2 3/5] ASoC: tpa6130a2: Use snd soc volsw functions Helen Koike
2016-06-21  1:41       ` Sebastian Reichel
2016-06-23 14:38       ` Applied "ASoC: tpa6130a2: Use snd soc volsw functions" to the asoc tree Mark Brown
2016-06-20 17:12     ` [PATCH v2 4/5] ASoC: tpa6130a2: Add DAPM support Helen Koike
2016-06-20 19:06       ` Helen Koike
2016-06-21  1:45         ` Sebastian Reichel
2016-06-20 19:44       ` Lars-Peter Clausen
2016-06-20 20:12         ` Helen Koike
2016-06-20 17:12     ` [PATCH v2 5/5] ASoC: tpa6130a2: Remove goto err_gpio Helen Koike
2016-06-21  1:42       ` Sebastian Reichel
2016-06-26 12:02       ` Applied "ASoC: tpa6130a2: Remove goto err_gpio" to the asoc tree Mark Brown
2016-06-23 19:23     ` [PATCH v3 0/2] ASoC: tpa6130a2: Add support for multiple instances Helen Koike
2016-06-23 19:23       ` [PATCH v3 1/2] ASoC: tpa6130a2: Add DAPM support Helen Koike
2016-06-26 12:02         ` Applied "ASoC: tpa6130a2: Add DAPM support" to the asoc tree Mark Brown
2016-06-23 19:23       ` [PATCH v3 2/2] ASoC: tpa6130a2: Remove goto err_gpio Helen Koike
2016-06-19 20:14 ` [PATCH 0/4] ASoC: tpa6130a2: Add support for multiple instances Sebastian Reichel

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=E1bG5lj-000461-S1@debutante \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=cphealy@gmail.com \
    --cc=helen.koike@collabora.co.uk \
    --cc=jarkko.nikula@bitmer.com \
    --cc=k.kozlowski@samsung.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    --cc=sre@kernel.org \
    --cc=tiwai@suse.com \
    /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).