All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: remove dai_drv from snd_soc_component
@ 2017-12-20  1:47 Kuninori Morimoto
  2017-12-20  1:48 ` [PATCH 1/3] ASoC: hdac_hdmi: keep DAI driver pointer in private data Kuninori Morimoto
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kuninori Morimoto @ 2017-12-20  1:47 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon


Hi Mark

These are not important, but cleanup.

snd_soc_component is keeping DAI driver pointer,
but each DAI has its driver, and component has dai_list.
This means, we can reach to all DAI and its driver
by using dai_list. We can remove DAI driver pointer from component.

Kuninori Morimoto (3):
  ASoC: hdac_hdmi: keep DAI driver pointer in private data
  ASoC: soc-core: remove dai_drv from snd_soc_component
  ASoC: soc.h: Arrange DAI related parameter

 include/sound/soc.h          |  4 +---
 sound/soc/codecs/hdac_hdmi.c |  4 +++-
 sound/soc/soc-core.c         | 14 ++++++++++----
 3 files changed, 14 insertions(+), 8 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] ASoC: hdac_hdmi: keep DAI driver pointer in private data
  2017-12-20  1:47 [PATCH 0/3] ASoC: remove dai_drv from snd_soc_component Kuninori Morimoto
@ 2017-12-20  1:48 ` Kuninori Morimoto
  2017-12-20 15:42   ` Applied "ASoC: hdac_hdmi: keep DAI driver pointer in private data" to the asoc tree Mark Brown
  2017-12-20  1:48 ` [PATCH 2/3] ASoC: soc-core: remove dai_drv from snd_soc_component Kuninori Morimoto
  2017-12-20  1:48 ` [PATCH 3/3] ASoC: soc.h: Arrange DAI related parameter Kuninori Morimoto
  2 siblings, 1 reply; 7+ messages in thread
From: Kuninori Morimoto @ 2017-12-20  1:48 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

struct snd_soc_component::dai_drv will be removed soon.
hdac_hdmi is only user of it. Let's keep it on private data.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/codecs/hdac_hdmi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 68a4a6b..15c3638 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -136,6 +136,7 @@ struct hdac_hdmi_priv {
 	struct mutex pin_mutex;
 	struct hdac_chmap chmap;
 	struct hdac_hdmi_drv_data *drv_data;
+	struct snd_soc_dai_driver *dai_drv;
 };
 
 #define hdev_to_hdmi_priv(_hdev) ((to_ehdac_device(_hdev))->private_data)
@@ -1035,7 +1036,7 @@ static int create_fill_widget_route_map(struct snd_soc_dapm_context *dapm)
 	struct snd_soc_dapm_route *route;
 	struct hdac_ext_device *edev = to_hda_ext_device(dapm->dev);
 	struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(&edev->hdev);
-	struct snd_soc_dai_driver *dai_drv = dapm->component->dai_drv;
+	struct snd_soc_dai_driver *dai_drv = hdmi->dai_drv;
 	char widget_name[NAME_SIZE];
 	struct hdac_hdmi_cvt *cvt;
 	struct hdac_hdmi_pin *pin;
@@ -1437,6 +1438,7 @@ static int hdac_hdmi_create_dais(struct hdac_device *hdev,
 	}
 
 	*dais = hdmi_dais;
+	hdmi->dai_drv = hdmi_dais;
 
 	return 0;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] ASoC: soc-core: remove dai_drv from snd_soc_component
  2017-12-20  1:47 [PATCH 0/3] ASoC: remove dai_drv from snd_soc_component Kuninori Morimoto
  2017-12-20  1:48 ` [PATCH 1/3] ASoC: hdac_hdmi: keep DAI driver pointer in private data Kuninori Morimoto
@ 2017-12-20  1:48 ` Kuninori Morimoto
  2017-12-20 15:42   ` Applied "ASoC: soc-core: remove dai_drv from snd_soc_component" to the asoc tree Mark Brown
  2017-12-20  1:48 ` [PATCH 3/3] ASoC: soc.h: Arrange DAI related parameter Kuninori Morimoto
  2 siblings, 1 reply; 7+ messages in thread
From: Kuninori Morimoto @ 2017-12-20  1:48 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ALSA SoC has some duplicate parameter.
snd_soc_component::dai_drv is one of them.

Each DAI is keeping its driver as snd_soc_dai::driver,
and component has dai_list.
This means, we can reach to each DAI and its driver by using dai_link.
Thus, there is no need to keep DAI driver pointer on component.
Let's remove it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc.h  |  1 -
 sound/soc/soc-core.c | 14 ++++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 22f479e..f17de1e 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -860,7 +860,6 @@ struct snd_soc_component {
 	struct list_head card_aux_list; /* for auxiliary bound components */
 	struct list_head card_list;
 
-	struct snd_soc_dai_driver *dai_drv;
 	int num_dai;
 
 	const struct snd_soc_component_driver *driver;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 07881d8..c3c633a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3160,7 +3160,7 @@ static struct snd_soc_dai *soc_add_dai(struct snd_soc_component *component,
 	if (!dai->driver->ops)
 		dai->driver->ops = &null_dai_ops;
 
-	list_add(&dai->list, &component->dai_list);
+	list_add_tail(&dai->list, &component->dai_list);
 	component->num_dai++;
 
 	dev_dbg(dev, "ASoC: Registered DAI '%s'\n", dai->name);
@@ -3187,8 +3187,6 @@ static int snd_soc_register_dais(struct snd_soc_component *component,
 
 	dev_dbg(dev, "ASoC: dai register %s #%zu\n", dev_name(dev), count);
 
-	component->dai_drv = dai_drv;
-
 	for (i = 0; i < count; i++) {
 
 		dai = soc_add_dai(component, dai_drv + i,
@@ -4365,6 +4363,7 @@ int snd_soc_get_dai_name(struct of_phandle_args *args,
 							     args,
 							     dai_name);
 		} else {
+			struct snd_soc_dai *dai;
 			int id = -1;
 
 			switch (args->args_count) {
@@ -4386,7 +4385,14 @@ int snd_soc_get_dai_name(struct of_phandle_args *args,
 
 			ret = 0;
 
-			*dai_name = pos->dai_drv[id].name;
+			/* find target DAI */
+			list_for_each_entry(dai, &pos->dai_list, list) {
+				if (id == 0)
+					break;
+				id--;
+			}
+
+			*dai_name = dai->driver->name;
 			if (!*dai_name)
 				*dai_name = pos->name;
 		}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] ASoC: soc.h: Arrange DAI related parameter
  2017-12-20  1:47 [PATCH 0/3] ASoC: remove dai_drv from snd_soc_component Kuninori Morimoto
  2017-12-20  1:48 ` [PATCH 1/3] ASoC: hdac_hdmi: keep DAI driver pointer in private data Kuninori Morimoto
  2017-12-20  1:48 ` [PATCH 2/3] ASoC: soc-core: remove dai_drv from snd_soc_component Kuninori Morimoto
@ 2017-12-20  1:48 ` Kuninori Morimoto
  2017-12-20 15:42   ` Applied "ASoC: soc.h: Arrange DAI related parameter" to the asoc tree Mark Brown
  2 siblings, 1 reply; 7+ messages in thread
From: Kuninori Morimoto @ 2017-12-20  1:48 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Simon


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

"dai_list" and "num_dai" on snd_soc_component are related
parameter. Let's arrange these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index f17de1e..a34aa20 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -860,11 +860,10 @@ struct snd_soc_component {
 	struct list_head card_aux_list; /* for auxiliary bound components */
 	struct list_head card_list;
 
-	int num_dai;
-
 	const struct snd_soc_component_driver *driver;
 
 	struct list_head dai_list;
+	int num_dai;
 
 	int (*read)(struct snd_soc_component *, unsigned int, unsigned int *);
 	int (*write)(struct snd_soc_component *, unsigned int, unsigned int);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Applied "ASoC: soc.h: Arrange DAI related parameter" to the asoc tree
  2017-12-20  1:48 ` [PATCH 3/3] ASoC: soc.h: Arrange DAI related parameter Kuninori Morimoto
@ 2017-12-20 15:42   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2017-12-20 15:42 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel, Mark Brown, Simon

The patch

   ASoC: soc.h: Arrange DAI related parameter

has been applied to the asoc tree at

   https://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 4855f6a6283fc8ea1f79c9f49c91940afef64ef6 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 20 Dec 2017 01:48:44 +0000
Subject: [PATCH] ASoC: soc.h: Arrange DAI related parameter

"dai_list" and "num_dai" on snd_soc_component are related
parameter. Let's arrange these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 include/sound/soc.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 871e1fabd701..be6b462e2c01 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -858,11 +858,10 @@ struct snd_soc_component {
 	struct list_head card_aux_list; /* for auxiliary bound components */
 	struct list_head card_list;
 
-	int num_dai;
-
 	const struct snd_soc_component_driver *driver;
 
 	struct list_head dai_list;
+	int num_dai;
 
 	int (*read)(struct snd_soc_component *, unsigned int, unsigned int *);
 	int (*write)(struct snd_soc_component *, unsigned int, unsigned int);
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Applied "ASoC: soc-core: remove dai_drv from snd_soc_component" to the asoc tree
  2017-12-20  1:48 ` [PATCH 2/3] ASoC: soc-core: remove dai_drv from snd_soc_component Kuninori Morimoto
@ 2017-12-20 15:42   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2017-12-20 15:42 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel, Mark Brown, Simon

The patch

   ASoC: soc-core: remove dai_drv from snd_soc_component

has been applied to the asoc tree at

   https://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 58bf4179000a37aa9b0ee9ab2796f7573c77fff0 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 20 Dec 2017 01:48:29 +0000
Subject: [PATCH] ASoC: soc-core: remove dai_drv from snd_soc_component

ALSA SoC has some duplicate parameter.
snd_soc_component::dai_drv is one of them.

Each DAI is keeping its driver as snd_soc_dai::driver,
and component has dai_list.
This means, we can reach to each DAI and its driver by using dai_link.
Thus, there is no need to keep DAI driver pointer on component.
Let's remove it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 include/sound/soc.h  |  1 -
 sound/soc/soc-core.c | 14 ++++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 1a7323238c49..871e1fabd701 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -858,7 +858,6 @@ struct snd_soc_component {
 	struct list_head card_aux_list; /* for auxiliary bound components */
 	struct list_head card_list;
 
-	struct snd_soc_dai_driver *dai_drv;
 	int num_dai;
 
 	const struct snd_soc_component_driver *driver;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c0edac80df34..6a13fbcba23f 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3149,7 +3149,7 @@ static struct snd_soc_dai *soc_add_dai(struct snd_soc_component *component,
 	if (!dai->driver->ops)
 		dai->driver->ops = &null_dai_ops;
 
-	list_add(&dai->list, &component->dai_list);
+	list_add_tail(&dai->list, &component->dai_list);
 	component->num_dai++;
 
 	dev_dbg(dev, "ASoC: Registered DAI '%s'\n", dai->name);
@@ -3176,8 +3176,6 @@ static int snd_soc_register_dais(struct snd_soc_component *component,
 
 	dev_dbg(dev, "ASoC: dai register %s #%zu\n", dev_name(dev), count);
 
-	component->dai_drv = dai_drv;
-
 	for (i = 0; i < count; i++) {
 
 		dai = soc_add_dai(component, dai_drv + i,
@@ -4354,6 +4352,7 @@ int snd_soc_get_dai_name(struct of_phandle_args *args,
 							     args,
 							     dai_name);
 		} else {
+			struct snd_soc_dai *dai;
 			int id = -1;
 
 			switch (args->args_count) {
@@ -4375,7 +4374,14 @@ int snd_soc_get_dai_name(struct of_phandle_args *args,
 
 			ret = 0;
 
-			*dai_name = pos->dai_drv[id].name;
+			/* find target DAI */
+			list_for_each_entry(dai, &pos->dai_list, list) {
+				if (id == 0)
+					break;
+				id--;
+			}
+
+			*dai_name = dai->driver->name;
 			if (!*dai_name)
 				*dai_name = pos->name;
 		}
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Applied "ASoC: hdac_hdmi: keep DAI driver pointer in private data" to the asoc tree
  2017-12-20  1:48 ` [PATCH 1/3] ASoC: hdac_hdmi: keep DAI driver pointer in private data Kuninori Morimoto
@ 2017-12-20 15:42   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2017-12-20 15:42 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel, Mark Brown, Simon

The patch

   ASoC: hdac_hdmi: keep DAI driver pointer in private data

has been applied to the asoc tree at

   https://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 1e02dac395fadfff1f2c6bd90f1180f64a9cbebe Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 20 Dec 2017 01:48:13 +0000
Subject: [PATCH] ASoC: hdac_hdmi: keep DAI driver pointer in private data

struct snd_soc_component::dai_drv will be removed soon.
hdac_hdmi is only user of it. Let's keep it on private data.

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

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 68a4a6b4e68e..15c3638fe345 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -136,6 +136,7 @@ struct hdac_hdmi_priv {
 	struct mutex pin_mutex;
 	struct hdac_chmap chmap;
 	struct hdac_hdmi_drv_data *drv_data;
+	struct snd_soc_dai_driver *dai_drv;
 };
 
 #define hdev_to_hdmi_priv(_hdev) ((to_ehdac_device(_hdev))->private_data)
@@ -1035,7 +1036,7 @@ static int create_fill_widget_route_map(struct snd_soc_dapm_context *dapm)
 	struct snd_soc_dapm_route *route;
 	struct hdac_ext_device *edev = to_hda_ext_device(dapm->dev);
 	struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(&edev->hdev);
-	struct snd_soc_dai_driver *dai_drv = dapm->component->dai_drv;
+	struct snd_soc_dai_driver *dai_drv = hdmi->dai_drv;
 	char widget_name[NAME_SIZE];
 	struct hdac_hdmi_cvt *cvt;
 	struct hdac_hdmi_pin *pin;
@@ -1437,6 +1438,7 @@ static int hdac_hdmi_create_dais(struct hdac_device *hdev,
 	}
 
 	*dais = hdmi_dais;
+	hdmi->dai_drv = hdmi_dais;
 
 	return 0;
 }
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-12-20 15:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-20  1:47 [PATCH 0/3] ASoC: remove dai_drv from snd_soc_component Kuninori Morimoto
2017-12-20  1:48 ` [PATCH 1/3] ASoC: hdac_hdmi: keep DAI driver pointer in private data Kuninori Morimoto
2017-12-20 15:42   ` Applied "ASoC: hdac_hdmi: keep DAI driver pointer in private data" to the asoc tree Mark Brown
2017-12-20  1:48 ` [PATCH 2/3] ASoC: soc-core: remove dai_drv from snd_soc_component Kuninori Morimoto
2017-12-20 15:42   ` Applied "ASoC: soc-core: remove dai_drv from snd_soc_component" to the asoc tree Mark Brown
2017-12-20  1:48 ` [PATCH 3/3] ASoC: soc.h: Arrange DAI related parameter Kuninori Morimoto
2017-12-20 15:42   ` Applied "ASoC: soc.h: Arrange DAI related parameter" to the asoc tree Mark Brown

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.