All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Mark Brown <broonie@kernel.org>, Mark Brown <broonie@kernel.org>,
	Archit Taneja <architt@codeaurora.org>,
	Jose Abreu <joabreu@synopsys.com>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	David Airlie <airlied@linux.ie>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Simon <horms@verge.net.au>,
	alsa-devel@alsa-project.org
Subject: Applied "ASoC: hdmi-codec: remove multi detection support" to the asoc tree
Date: Wed, 24 May 2017 18:45:48 +0100	[thread overview]
Message-ID: <E1dDaM0-0003Si-Ew@debutante> (raw)
In-Reply-To: <87a86boskr.wl%kuninori.morimoto.gx@renesas.com>

The patch

   ASoC: hdmi-codec: remove multi detection support

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 24069b589b02cc1292761b0f72623dd50ad1e19c Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Thu, 18 May 2017 01:40:02 +0000
Subject: [PATCH] ASoC: hdmi-codec: remove multi detection support

DesignWare HDMI driver (= dw-hdmi) is supporting HDMI sound, and its
probe function was calling sound binding function multiple times as
same HDMI device different port.

Because of this behavior, commit 9731f82d601 ("ASoC: hdmi-codec: enable
multi probe for ...") was added for multi detection case.
But, this DesignWare HDMI detection/bind code was exchanged/adjusted by
commit 69497eb9234 ("drm: bridge: dw-hdmi: Implement DRM bridge...").
Now, all DesignWare HDMI sound ports are detected as 1 bindng function.

Because of this, hdmi-codec multi detection support is no longer needed.
Thus, this patch removes
commit 9731f82d601 ("ASoC: hdmi-codec: enable multi probe for ..."),
and its related
commit 340327a62c4 ("ASoC: hdmi-codec: Fix hdmi_of_xlate_dai_name...")
commit 8480ac56795 ("ASoC: hdmi-codec: remove HDMI device unregister")
commit 0c343a35bfe ("ASoC: hdmi-codec: fix spelling mistake: ...)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/hdmi-codec.c | 88 ++-----------------------------------------
 1 file changed, 3 insertions(+), 85 deletions(-)

diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index a3f15149afcf..8659b76b066a 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -25,17 +25,6 @@
 
 #include <drm/drm_crtc.h> /* This is only to get MAX_ELD_BYTES */
 
-struct hdmi_device {
-	struct device *dev;
-	struct list_head list;
-	int cnt;
-};
-#define pos_to_hdmi_device(pos)	container_of((pos), struct hdmi_device, list)
-LIST_HEAD(hdmi_device_list);
-static DEFINE_MUTEX(hdmi_mutex);
-
-#define DAI_NAME_SIZE 16
-
 #define HDMI_CODEC_CHMAP_IDX_UNKNOWN  -1
 
 struct hdmi_codec_channel_map_table {
@@ -702,6 +691,7 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
 }
 
 static struct snd_soc_dai_driver hdmi_i2s_dai = {
+	.name = "i2s-hifi",
 	.id = DAI_ID_I2S,
 	.playback = {
 		.stream_name = "Playback",
@@ -716,6 +706,7 @@ static struct snd_soc_dai_driver hdmi_i2s_dai = {
 };
 
 static const struct snd_soc_dai_driver hdmi_spdif_dai = {
+	.name = "spdif-hifi",
 	.id = DAI_ID_SPDIF,
 	.playback = {
 		.stream_name = "Playback",
@@ -728,32 +719,6 @@ static const struct snd_soc_dai_driver hdmi_spdif_dai = {
 	.pcm_new = hdmi_codec_pcm_new,
 };
 
-static char hdmi_dai_name[][DAI_NAME_SIZE] = {
-	"hdmi-hifi.0",
-	"hdmi-hifi.1",
-	"hdmi-hifi.2",
-	"hdmi-hifi.3",
-};
-
-static int hdmi_of_xlate_dai_name(struct snd_soc_component *component,
-				  struct of_phandle_args *args,
-				  const char **dai_name)
-{
-	int id;
-
-	if (args->args_count)
-		id = args->args[0];
-	else
-		id = 0;
-
-	if (id < ARRAY_SIZE(hdmi_dai_name)) {
-		*dai_name = hdmi_dai_name[id];
-		return 0;
-	}
-
-	return -EAGAIN;
-}
-
 static struct snd_soc_codec_driver hdmi_codec = {
 	.component_driver = {
 		.controls		= hdmi_controls,
@@ -762,7 +727,6 @@ static struct snd_soc_codec_driver hdmi_codec = {
 		.num_dapm_widgets	= ARRAY_SIZE(hdmi_widgets),
 		.dapm_routes		= hdmi_routes,
 		.num_dapm_routes	= ARRAY_SIZE(hdmi_routes),
-		.of_xlate_dai_name	= hdmi_of_xlate_dai_name,
 	},
 };
 
@@ -771,8 +735,6 @@ static int hdmi_codec_probe(struct platform_device *pdev)
 	struct hdmi_codec_pdata *hcd = pdev->dev.platform_data;
 	struct device *dev = &pdev->dev;
 	struct hdmi_codec_priv *hcp;
-	struct hdmi_device *hd;
-	struct list_head *pos;
 	int dai_count, i = 0;
 	int ret;
 
@@ -794,35 +756,6 @@ static int hdmi_codec_probe(struct platform_device *pdev)
 	if (!hcp)
 		return -ENOMEM;
 
-	hd = NULL;
-	mutex_lock(&hdmi_mutex);
-	list_for_each(pos, &hdmi_device_list) {
-		struct hdmi_device *tmp = pos_to_hdmi_device(pos);
-
-		if (tmp->dev == dev->parent) {
-			hd = tmp;
-			break;
-		}
-	}
-
-	if (!hd) {
-		hd = devm_kzalloc(dev, sizeof(*hd), GFP_KERNEL);
-		if (!hd) {
-			mutex_unlock(&hdmi_mutex);
-			return -ENOMEM;
-		}
-
-		hd->dev = dev->parent;
-
-		list_add_tail(&hd->list, &hdmi_device_list);
-	}
-	mutex_unlock(&hdmi_mutex);
-
-	if (hd->cnt >= ARRAY_SIZE(hdmi_dai_name)) {
-		dev_err(dev, "too many hdmi codec are detected\n");
-		return -EINVAL;
-	}
-
 	hcp->hcd = *hcd;
 	mutex_init(&hcp->current_stream_lock);
 
@@ -835,14 +768,11 @@ static int hdmi_codec_probe(struct platform_device *pdev)
 		hcp->daidrv[i] = hdmi_i2s_dai;
 		hcp->daidrv[i].playback.channels_max =
 			hcd->max_i2s_channels;
-		hcp->daidrv[i].name = hdmi_dai_name[hd->cnt++];
 		i++;
 	}
 
-	if (hcd->spdif) {
+	if (hcd->spdif)
 		hcp->daidrv[i] = hdmi_spdif_dai;
-		hcp->daidrv[i].name = hdmi_dai_name[hd->cnt++];
-	}
 
 	ret = snd_soc_register_codec(dev, &hdmi_codec, hcp->daidrv,
 				     dai_count);
@@ -859,20 +789,8 @@ static int hdmi_codec_probe(struct platform_device *pdev)
 static int hdmi_codec_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct list_head *pos;
 	struct hdmi_codec_priv *hcp;
 
-	mutex_lock(&hdmi_mutex);
-	list_for_each(pos, &hdmi_device_list) {
-		struct hdmi_device *tmp = pos_to_hdmi_device(pos);
-
-		if (tmp->dev == dev->parent) {
-			list_del(pos);
-			break;
-		}
-	}
-	mutex_unlock(&hdmi_mutex);
-
 	hcp = dev_get_drvdata(dev);
 	kfree(hcp->chmap_info);
 	snd_soc_unregister_codec(dev);
-- 
2.11.0

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Simon <horms@verge.net.au>, Mark Brown <broonie@kernel.org>,
	alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Jose Abreu <joabreu@synopsys.com>
Subject: Applied "ASoC: hdmi-codec: remove multi detection support" to the asoc tree
Date: Wed, 24 May 2017 18:45:48 +0100	[thread overview]
Message-ID: <E1dDaM0-0003Si-Ew@debutante> (raw)
In-Reply-To: <87a86boskr.wl%kuninori.morimoto.gx@renesas.com>

The patch

   ASoC: hdmi-codec: remove multi detection support

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 24069b589b02cc1292761b0f72623dd50ad1e19c Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Thu, 18 May 2017 01:40:02 +0000
Subject: [PATCH] ASoC: hdmi-codec: remove multi detection support

DesignWare HDMI driver (= dw-hdmi) is supporting HDMI sound, and its
probe function was calling sound binding function multiple times as
same HDMI device different port.

Because of this behavior, commit 9731f82d601 ("ASoC: hdmi-codec: enable
multi probe for ...") was added for multi detection case.
But, this DesignWare HDMI detection/bind code was exchanged/adjusted by
commit 69497eb9234 ("drm: bridge: dw-hdmi: Implement DRM bridge...").
Now, all DesignWare HDMI sound ports are detected as 1 bindng function.

Because of this, hdmi-codec multi detection support is no longer needed.
Thus, this patch removes
commit 9731f82d601 ("ASoC: hdmi-codec: enable multi probe for ..."),
and its related
commit 340327a62c4 ("ASoC: hdmi-codec: Fix hdmi_of_xlate_dai_name...")
commit 8480ac56795 ("ASoC: hdmi-codec: remove HDMI device unregister")
commit 0c343a35bfe ("ASoC: hdmi-codec: fix spelling mistake: ...)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/hdmi-codec.c | 88 ++-----------------------------------------
 1 file changed, 3 insertions(+), 85 deletions(-)

diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index a3f15149afcf..8659b76b066a 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -25,17 +25,6 @@
 
 #include <drm/drm_crtc.h> /* This is only to get MAX_ELD_BYTES */
 
-struct hdmi_device {
-	struct device *dev;
-	struct list_head list;
-	int cnt;
-};
-#define pos_to_hdmi_device(pos)	container_of((pos), struct hdmi_device, list)
-LIST_HEAD(hdmi_device_list);
-static DEFINE_MUTEX(hdmi_mutex);
-
-#define DAI_NAME_SIZE 16
-
 #define HDMI_CODEC_CHMAP_IDX_UNKNOWN  -1
 
 struct hdmi_codec_channel_map_table {
@@ -702,6 +691,7 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
 }
 
 static struct snd_soc_dai_driver hdmi_i2s_dai = {
+	.name = "i2s-hifi",
 	.id = DAI_ID_I2S,
 	.playback = {
 		.stream_name = "Playback",
@@ -716,6 +706,7 @@ static struct snd_soc_dai_driver hdmi_i2s_dai = {
 };
 
 static const struct snd_soc_dai_driver hdmi_spdif_dai = {
+	.name = "spdif-hifi",
 	.id = DAI_ID_SPDIF,
 	.playback = {
 		.stream_name = "Playback",
@@ -728,32 +719,6 @@ static const struct snd_soc_dai_driver hdmi_spdif_dai = {
 	.pcm_new = hdmi_codec_pcm_new,
 };
 
-static char hdmi_dai_name[][DAI_NAME_SIZE] = {
-	"hdmi-hifi.0",
-	"hdmi-hifi.1",
-	"hdmi-hifi.2",
-	"hdmi-hifi.3",
-};
-
-static int hdmi_of_xlate_dai_name(struct snd_soc_component *component,
-				  struct of_phandle_args *args,
-				  const char **dai_name)
-{
-	int id;
-
-	if (args->args_count)
-		id = args->args[0];
-	else
-		id = 0;
-
-	if (id < ARRAY_SIZE(hdmi_dai_name)) {
-		*dai_name = hdmi_dai_name[id];
-		return 0;
-	}
-
-	return -EAGAIN;
-}
-
 static struct snd_soc_codec_driver hdmi_codec = {
 	.component_driver = {
 		.controls		= hdmi_controls,
@@ -762,7 +727,6 @@ static struct snd_soc_codec_driver hdmi_codec = {
 		.num_dapm_widgets	= ARRAY_SIZE(hdmi_widgets),
 		.dapm_routes		= hdmi_routes,
 		.num_dapm_routes	= ARRAY_SIZE(hdmi_routes),
-		.of_xlate_dai_name	= hdmi_of_xlate_dai_name,
 	},
 };
 
@@ -771,8 +735,6 @@ static int hdmi_codec_probe(struct platform_device *pdev)
 	struct hdmi_codec_pdata *hcd = pdev->dev.platform_data;
 	struct device *dev = &pdev->dev;
 	struct hdmi_codec_priv *hcp;
-	struct hdmi_device *hd;
-	struct list_head *pos;
 	int dai_count, i = 0;
 	int ret;
 
@@ -794,35 +756,6 @@ static int hdmi_codec_probe(struct platform_device *pdev)
 	if (!hcp)
 		return -ENOMEM;
 
-	hd = NULL;
-	mutex_lock(&hdmi_mutex);
-	list_for_each(pos, &hdmi_device_list) {
-		struct hdmi_device *tmp = pos_to_hdmi_device(pos);
-
-		if (tmp->dev == dev->parent) {
-			hd = tmp;
-			break;
-		}
-	}
-
-	if (!hd) {
-		hd = devm_kzalloc(dev, sizeof(*hd), GFP_KERNEL);
-		if (!hd) {
-			mutex_unlock(&hdmi_mutex);
-			return -ENOMEM;
-		}
-
-		hd->dev = dev->parent;
-
-		list_add_tail(&hd->list, &hdmi_device_list);
-	}
-	mutex_unlock(&hdmi_mutex);
-
-	if (hd->cnt >= ARRAY_SIZE(hdmi_dai_name)) {
-		dev_err(dev, "too many hdmi codec are detected\n");
-		return -EINVAL;
-	}
-
 	hcp->hcd = *hcd;
 	mutex_init(&hcp->current_stream_lock);
 
@@ -835,14 +768,11 @@ static int hdmi_codec_probe(struct platform_device *pdev)
 		hcp->daidrv[i] = hdmi_i2s_dai;
 		hcp->daidrv[i].playback.channels_max =
 			hcd->max_i2s_channels;
-		hcp->daidrv[i].name = hdmi_dai_name[hd->cnt++];
 		i++;
 	}
 
-	if (hcd->spdif) {
+	if (hcd->spdif)
 		hcp->daidrv[i] = hdmi_spdif_dai;
-		hcp->daidrv[i].name = hdmi_dai_name[hd->cnt++];
-	}
 
 	ret = snd_soc_register_codec(dev, &hdmi_codec, hcp->daidrv,
 				     dai_count);
@@ -859,20 +789,8 @@ static int hdmi_codec_probe(struct platform_device *pdev)
 static int hdmi_codec_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct list_head *pos;
 	struct hdmi_codec_priv *hcp;
 
-	mutex_lock(&hdmi_mutex);
-	list_for_each(pos, &hdmi_device_list) {
-		struct hdmi_device *tmp = pos_to_hdmi_device(pos);
-
-		if (tmp->dev == dev->parent) {
-			list_del(pos);
-			break;
-		}
-	}
-	mutex_unlock(&hdmi_mutex);
-
 	hcp = dev_get_drvdata(dev);
 	kfree(hcp->chmap_info);
 	snd_soc_unregister_codec(dev);
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-05-24 17:46 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18  1:38 [PATCH 0/5] ASoC: add HDMI sound support for Codec Kuninori Morimoto
2017-05-18  1:38 ` Kuninori Morimoto
2017-05-18  1:39 ` [PATCH 1/5] ASoC: add snd_soc_get_dai_id() function Kuninori Morimoto
2017-05-18  1:39   ` Kuninori Morimoto
2017-05-24 17:41   ` Applied "ASoC: add snd_soc_get_dai_id() function" to the asoc tree Mark Brown
2017-05-24 17:41     ` Mark Brown
2017-05-18  1:39 ` [PATCH 2/5] ASoC: simple-card-utils: support snd_soc_get_dai_id() Kuninori Morimoto
2017-05-18  1:39   ` Kuninori Morimoto
2017-05-24 17:44   ` Applied "ASoC: simple-card-utils: support snd_soc_get_dai_id()" to the asoc tree Mark Brown
2017-05-24 17:44     ` Mark Brown
2017-05-18  1:40 ` [PATCH 3/5] ASoC: hdmi-codec: remove multi detection support Kuninori Morimoto
2017-05-18  1:40   ` Kuninori Morimoto
2017-05-24 17:45   ` Mark Brown [this message]
2017-05-24 17:45     ` Applied "ASoC: hdmi-codec: remove multi detection support" to the asoc tree Mark Brown
2017-05-18  1:40 ` [PATCH 4/5] ASoC: hdmi-codec: add .get_dai_id support Kuninori Morimoto
2017-05-18  1:40   ` Kuninori Morimoto
2017-05-24 17:45   ` Applied "ASoC: hdmi-codec: add .get_dai_id support" to the asoc tree Mark Brown
2017-05-24 17:45     ` Mark Brown
2017-05-18  1:40 ` [PATCH 5/5] drm: dw-hdmi-i2s: add .get_dai_id callback for ALSA SoC Kuninori Morimoto
2017-05-18  1:40   ` Kuninori Morimoto
2017-05-24 17:38   ` Mark Brown
2017-05-24 17:38     ` Mark Brown
2017-05-24 23:34     ` Kuninori Morimoto
2017-05-24 23:34       ` Kuninori Morimoto
2017-05-26  4:16       ` Archit Taneja
2017-05-26  4:16         ` Archit Taneja
2017-05-26  4:24         ` Archit Taneja
2017-05-26 17:26       ` Mark Brown
2017-05-26 17:26         ` Mark Brown
2017-06-28 19:48   ` Applied "drm: dw-hdmi-i2s: add .get_dai_id callback for ALSA SoC" to the asoc tree Mark Brown
2017-06-28 19:48     ` Mark Brown
2017-06-19  0:39 ` [PATCH][RESEND] drm: dw-hdmi-i2s: add .get_dai_id callback for ALSA SoC Kuninori Morimoto
2017-06-19  0:39   ` Kuninori Morimoto

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=E1dDaM0-0003Si-Ew@debutante \
    --to=broonie@kernel.org \
    --cc=airlied@linux.ie \
    --cc=alsa-devel@alsa-project.org \
    --cc=architt@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=horms@verge.net.au \
    --cc=joabreu@synopsys.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.