All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>, Lars-Peter <lars@metafoo.de>
Subject: [PATCH 02/13] ASoC: add Component level set_bias_level
Date: Fri, 1 Sep 2017 05:31:51 +0000	[thread overview]
Message-ID: <87y3pzm1nl.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <871snrngcu.wl%kuninori.morimoto.gx@renesas.com>


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

In current ALSA SoC, Codec only has set_bias_level feature.
Codec will be merged into Component in next generation ALSA SoC,
thus current Codec specific feature need to be merged into it.
This is glue patch for it.

Codec driver has .idle_bias_off for dapm bias. But Component
driver doesn't have it, and dapm->idle_bias_off is set as "true".
To keep compatibility, this patch adds "idle_bias_on" instead of
".idle_bias_off" on Component driver.
dapm->idle_bias_off will be set by inverted idle_bias_on.

When we replace Codec to Component, the driver which has
".idle_bias_off = ture" is just remove it,
and the driver which doesn't have it will have new
".idle_bias_on = true".

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

diff --git a/include/sound/soc.h b/include/sound/soc.h
index c227861..d776cde 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -816,10 +816,16 @@ struct snd_soc_component_driver {
 	void (*seq_notifier)(struct snd_soc_component *, enum snd_soc_dapm_type,
 		int subseq);
 	int (*stream_event)(struct snd_soc_component *, int event);
+	int (*set_bias_level)(struct snd_soc_component *component,
+			      enum snd_soc_bias_level level);
 
 	/* probe ordering - for components with runtime dependencies */
 	int probe_order;
 	int remove_order;
+
+	/* bits */
+	unsigned int idle_bias_on:1;
+	unsigned int suspend_bias_off:1;
 };
 
 struct snd_soc_component {
@@ -885,6 +891,8 @@ struct snd_soc_component {
 		       int source, unsigned int freq_in, unsigned int freq_out);
 	int (*set_jack)(struct snd_soc_component *component,
 			struct snd_soc_jack *jack,  void *data);
+	int (*set_bias_level)(struct snd_soc_component *component,
+			      enum snd_soc_bias_level level);
 
 	/* machine specific init */
 	int (*init)(struct snd_soc_component *component);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 383ad71..fce0c98 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3268,6 +3268,14 @@ static void snd_soc_component_drv_pcm_free(struct snd_soc_component *component,
 		component->driver->pcm_free(pcm);
 }
 
+static int snd_soc_component_set_bias_level(struct snd_soc_dapm_context *dapm,
+					enum snd_soc_bias_level level)
+{
+	struct snd_soc_component *component = dapm->component;
+
+	return component->driver->set_bias_level(component, level);
+}
+
 static int snd_soc_component_initialize(struct snd_soc_component *component,
 	const struct snd_soc_component_driver *driver, struct device *dev)
 {
@@ -3295,11 +3303,14 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
 	dapm->dev = dev;
 	dapm->component = component;
 	dapm->bias_level = SND_SOC_BIAS_OFF;
-	dapm->idle_bias_off = true;
+	dapm->idle_bias_off = !driver->idle_bias_on;
+	dapm->suspend_bias_off = driver->suspend_bias_off;
 	if (driver->seq_notifier)
 		dapm->seq_notifier = snd_soc_component_seq_notifier;
 	if (driver->stream_event)
 		dapm->stream_event = snd_soc_component_stream_event;
+	if (driver->set_bias_level)
+		dapm->set_bias_level = snd_soc_component_set_bias_level;
 
 	INIT_LIST_HEAD(&component->dai_list);
 	mutex_init(&component->io_mutex);
-- 
1.9.1

  parent reply	other threads:[~2017-09-01  5:31 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01  5:25 Prepare to covert Codec/Platform into Component Kuninori Morimoto
2017-09-01  5:28 ` [PATCH 00/13] ASoC add new necessary features for Conversion Kuninori Morimoto
2017-09-01  5:31   ` [PATCH 01/13] ASoC: add Component level pcm_new/pcm_free v2 Kuninori Morimoto
2017-09-27 17:13     ` Applied "ASoC: add Component level pcm_new/pcm_free v2" to the asoc tree Mark Brown
2017-09-01  5:31   ` Kuninori Morimoto [this message]
2017-09-27 17:13     ` Applied "ASoC: add Component level set_bias_level" " Mark Brown
2017-09-01  5:32   ` [PATCH 03/13] ASoC: soc-core: add component lookup functions Kuninori Morimoto
2017-09-01  5:32   ` [PATCH 04/13] ASoC: soc-core: add snd_soc_add_component() Kuninori Morimoto
2017-10-10  9:19     ` Applied "ASoC: soc-core: add snd_soc_add_component()" to the asoc tree Mark Brown
2017-09-01  5:33   ` [PATCH 05/13] ASoC: snd_soc_component_driver has snd_pcm_ops Kuninori Morimoto
2017-09-01  5:33   ` [PATCH 06/13] ASoC: snd_soc_component_driver has snd_compr_ops Kuninori Morimoto
2017-10-23  9:43     ` Applied "ASoC: snd_soc_component_driver has snd_compr_ops" to the asoc tree Mark Brown
2017-09-01  5:33   ` [PATCH 07/13] ASoC: snd_soc_component_driver has pmdown_time Kuninori Morimoto
2017-10-23  9:43     ` Applied "ASoC: snd_soc_component_driver has pmdown_time" to the asoc tree Mark Brown
2017-09-01  5:34   ` [PATCH 08/13] ASoC: snd_soc_component_driver has endianness Kuninori Morimoto
2017-10-23  9:43     ` Applied "ASoC: snd_soc_component_driver has endianness" to the asoc tree Mark Brown
2017-09-01  5:34   ` [PATCH 09/13] ASoC: snd_soc_component_driver has non_legacy_dai_naming Kuninori Morimoto
2017-10-23  9:43     ` Applied "ASoC: snd_soc_component_driver has non_legacy_dai_naming" to the asoc tree Mark Brown
2017-09-01  5:34   ` [PATCH 10/13] ASoC: add snd_soc_component_read32 Kuninori Morimoto
2017-09-01  5:35   ` [PATCH 11/13] ASoC: add snd_soc_component_xxx_bias_level() Kuninori Morimoto
2017-09-01  5:35   ` [PATCH 12/13] ASoC: add snd_soc_component_cache_sync() Kuninori Morimoto
2017-11-08 21:32     ` Applied "ASoC: add snd_soc_component_cache_sync()" to the asoc tree Mark Brown
2017-09-01  5:36   ` [PATCH 13/13] ASoC: add snd_soc_dapm_kcontrol_component() Kuninori Morimoto
2017-11-08 21:32     ` Applied "ASoC: add snd_soc_dapm_kcontrol_component()" to the asoc tree Mark Brown
2017-09-01  5:42 ` [PATCH 0/6] ASoC don't use codec hw_write/read Kuninori Morimoto
2017-09-01  5:40   ` [PATCH -/-] ASoC: remove codec hw_write/control_data Kuninori Morimoto
2018-05-09  9:45     ` Applied "ASoC: remove codec hw_write/control_data" to the asoc tree Mark Brown
2017-09-01  5:44   ` [PATCH 1/6] ASoC: don't use codec hw_write on uda1380 Kuninori Morimoto
2017-11-27 18:52     ` Applied "ASoC: don't use codec hw_write on uda1380" to the asoc tree Mark Brown
2017-09-01  5:45   ` [PATCH 2/6] ASoC: don't use codec hw_write on tlv320dac33 Kuninori Morimoto
2017-11-27 18:52     ` Applied "ASoC: don't use codec hw_write on tlv320dac33" to the asoc tree Mark Brown
2017-09-01  5:45   ` [PATCH 3/6] ASoC: don't use codec hw_write on cx20442/omap-ams-delta Kuninori Morimoto
2017-11-27 18:52     ` Applied "ASoC: don't use codec hw_write on cx20442/omap-ams-delta" to the asoc tree Mark Brown
2017-09-01  5:45   ` [PATCH 4/6] ASoC: don't use codec hw_write on twl6040 Kuninori Morimoto
2017-11-27 18:52     ` Applied "ASoC: don't use codec hw_write on twl6040" to the asoc tree Mark Brown
2017-09-01  5:46   ` [PATCH 5/6] ASoC: don't use codec hw_write on max98926 Kuninori Morimoto
2017-11-27 18:52     ` Applied "ASoC: don't use codec hw_write on max98926" to the asoc tree Mark Brown
2017-09-01  5:46   ` [PATCH 6/6] ASoC: don't use codec hw_write on max98927 Kuninori Morimoto
2017-11-27 18:52     ` Applied "ASoC: don't use codec hw_write on max98927" to the asoc tree Mark Brown
2017-09-01  6:05 ` [PATCH 00/19] ASoC: cleanup Codec reg_cache Kuninori Morimoto
2017-09-01  6:06   ` [PATCH 01/19] ASoC: use internal reg_cache on uda1380 Kuninori Morimoto
2017-11-27 18:51     ` Applied "ASoC: use internal reg_cache on uda1380" to the asoc tree Mark Brown
2017-09-01  6:06   ` [PATCH 02/19] ASoC: use internal reg_cache on tlv320dac33 Kuninori Morimoto
2017-11-27 18:51     ` Applied "ASoC: use internal reg_cache on tlv320dac33" to the asoc tree Mark Brown
2017-09-01  6:06   ` [PATCH 03/19] ASoC: cx20442: don't use reg_cache Kuninori Morimoto
2017-11-27 18:51     ` Applied "ASoC: cx20442: don't use reg_cache" to the asoc tree Mark Brown
2017-09-01  6:07   ` [PATCH 04/19] ASoC: don't use snd_soc_write/read on twl6040 Kuninori Morimoto
2017-11-27 18:51     ` Applied "ASoC: don't use snd_soc_write/read on twl6040" to the asoc tree Mark Brown
2017-09-01  6:07   ` [PATCH 05/19] ASoC: don't use snd_soc_write/read on twl4030 Kuninori Morimoto
2017-11-27 18:51     ` Applied "ASoC: don't use snd_soc_write/read on twl4030" to the asoc tree Mark Brown
2017-09-01  6:07   ` [PATCH 06/19] ASoC: use snd_soc_component_init_regmap() on wm8998 Kuninori Morimoto
2017-12-04 18:50     ` Applied "ASoC: use snd_soc_component_init_regmap() on wm8998" to the asoc tree Mark Brown
2017-09-01  6:08   ` [PATCH 07/19] ASoC: use snd_soc_component_init_regmap() on wm8997 Kuninori Morimoto
2017-12-04 18:50     ` Applied "ASoC: use snd_soc_component_init_regmap() on wm8997" to the asoc tree Mark Brown
2017-09-01  6:08   ` [PATCH 08/19] ASoC: use snd_soc_component_init_regmap() on wm8994 Kuninori Morimoto
2017-12-04 18:50     ` Applied "ASoC: use snd_soc_component_init_regmap() on wm8994" to the asoc tree Mark Brown
2017-09-01  6:08   ` [PATCH 09/19] ASoC: use snd_soc_component_init_regmap() on wm8400 Kuninori Morimoto
2017-12-04 18:49     ` Applied "ASoC: use snd_soc_component_init_regmap() on wm8400" to the asoc tree Mark Brown
2017-09-01  6:09   ` [PATCH 10/19] ASoC: use snd_soc_component_init_regmap() on wm8350 Kuninori Morimoto
2017-12-04 18:49     ` Applied "ASoC: use snd_soc_component_init_regmap() on wm8350" to the asoc tree Mark Brown
2017-09-01  6:09   ` [PATCH 11/19] ASoC: use snd_soc_component_init_regmap() on wm5110 Kuninori Morimoto
2017-12-04 18:49     ` Applied "ASoC: use snd_soc_component_init_regmap() on wm5110" to the asoc tree Mark Brown
2017-09-01  6:09   ` [PATCH 12/19] ASoC: use snd_soc_component_init_regmap() on wm5102 Kuninori Morimoto
2017-12-04 18:49     ` Applied "ASoC: use snd_soc_component_init_regmap() on wm5102" to the asoc tree Mark Brown
2017-09-01  6:10   ` [PATCH 13/19] ASoC: use snd_soc_component_init_regmap() on si476x Kuninori Morimoto
2017-12-04 18:49     ` Applied "ASoC: use snd_soc_component_init_regmap() on si476x" to the asoc tree Mark Brown
2017-09-01  6:10   ` [PATCH 14/19] ASoC: use snd_soc_component_init_regmap() on mc13783 Kuninori Morimoto
2017-12-04 18:49     ` Applied "ASoC: use snd_soc_component_init_regmap() on mc13783" to the asoc tree Mark Brown
2017-09-01  6:11   ` [PATCH 15/19] ASoC: use snd_soc_component_init_regmap() on cq93vc Kuninori Morimoto
2017-12-04 18:49     ` Applied "ASoC: use snd_soc_component_init_regmap() on cq93vc" to the asoc tree Mark Brown
2017-09-01  6:11   ` [PATCH 16/19] ASoC: use snd_soc_component_init_regmap() on cs47l24 Kuninori Morimoto
2017-12-04 18:49     ` Applied "ASoC: use snd_soc_component_init_regmap() on cs47l24" to the asoc tree Mark Brown
2017-09-01  6:11   ` [PATCH 17/19] ASoC: use snd_soc_component_init_regmap() on 88pm860x Kuninori Morimoto
2017-12-04 18:49     ` Applied "ASoC: use snd_soc_component_init_regmap() on 88pm860x" to the asoc tree Mark Brown
2017-09-01  6:12   ` [PATCH 18/19] ASoC: use snd_soc_component_init_regmap() on msm8916 Kuninori Morimoto
2017-12-04 18:49     ` Applied "ASoC: use snd_soc_component_init_regmap() on msm8916" to the asoc tree Mark Brown
2017-09-01  6:12   ` [PATCH 19/19] ASoC: use snd_soc_component_init_regmap() on atmel-classd Kuninori Morimoto
2017-12-04 18:49     ` Applied "ASoC: use snd_soc_component_init_regmap() on atmel-classd" to the asoc tree Mark Brown
2017-09-01  6:13   ` [PATCH --/--] ASoC: remove codec reg_cache Kuninori Morimoto
2017-09-01  6:14   ` [PATCH --/--] ASoC: remove .get_regmap Kuninori Morimoto
2017-09-01  6:23 ` [SAMPLE 0/4] ASoC: don't use rtd->codec Kuninori Morimoto
2017-09-01  6:24   ` [SAMPLE 1/4] ASoC: don't use rtd->codec on soc_dev_attr_is_visible() Kuninori Morimoto
2017-12-05 12:47     ` Applied "ASoC: don't use rtd->codec on soc_dev_attr_is_visible()" to the asoc tree Mark Brown
2017-09-01  6:25   ` [SAMPLE 2/4] ASoC: don't use rtd->codec on snd_soc_new_compress() Kuninori Morimoto
2017-09-01  6:25   ` [SAMPLE 3/4] ASoC: don't use rtd->codec on fsl-asoc-card Kuninori Morimoto
2017-12-05 12:47     ` Applied "ASoC: don't use rtd->codec on fsl-asoc-card" to the asoc tree Mark Brown
2017-09-01  6:25   ` [SAMPLE 4/4] ASoC: don't use rtd->codec on intel/skylake Kuninori Morimoto
2017-12-05 12:46     ` Applied "ASoC: don't use rtd->codec on intel/skylake" to the asoc tree Mark Brown
2017-09-01  6:27 ` [SAMPLE 0/6] ASoC: replace platform to component Kuninori Morimoto
2017-09-01  6:28   ` [SAMPLE 1/6] ASoC: replace platform to component on soc-utils Kuninori Morimoto
2017-09-01  6:29   ` [SAMPLE 2/6] ASoC: replace platform to component on soc-generic-dmaengine-pcm Kuninori Morimoto
2017-09-01  6:29   ` [SAMPLE 3/6] ASoC: replace platform to component on intel/atom Kuninori Morimoto
2017-09-01  6:29   ` [SAMPLE 4/6] ASoC: replace platform to component on renesas/siu Kuninori Morimoto
2018-02-12 12:30     ` Applied "ASoC: sh: siu: replace platform to component" to the asoc tree Mark Brown
2017-09-01  6:30   ` [SAMPLE 5/6] ASoC: replace platform to component on atmel-xxx Kuninori Morimoto
2017-09-01  6:30   ` [SAMPLE 6/6] ASoC: replace platform to component on amd/acp Kuninori Morimoto
2017-09-01  6:31   ` [SAMPLE -/-] ASoC: remove platform related things Kuninori Morimoto
2017-09-01  6:34 ` [SAMPLE 0/6] ASoC: convert codec to compoent Kuninori Morimoto
2017-09-01  6:35   ` [SAMPLE 1/6] ASoC: convert codec to compoent on hdac_hdmi/nau8825/rt286/rt298/da7219 Kuninori Morimoto
2017-09-01  6:35   ` [PATCH 2/6] ASoC: convert codec to compoent on arizona/cs47l24/wm5102/wm5110/wm8997/wm8998/wm_adsp Kuninori Morimoto
2017-09-01  6:36   ` [SAMPLE 3/6] ASoC: convert codec to compoent on mc13783 Kuninori Morimoto
2017-09-01  6:36   ` [SAMPLE 4/6] ASoC: convert codec to compoent on sgtl5000 Kuninori Morimoto
2017-09-01  6:36   ` [SAMPLE 5/6] ASoC: convert codec to compoent on stac9766 Kuninori Morimoto
2017-09-01  6:37   ` [SAMPLE 6/6] ASoC: convert codec to compoent on sn95031 Kuninori Morimoto
2017-09-01  6:37   ` [SAMPLE -/0] ASoC: remove Codec related code 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=87y3pzm1nl.wl%kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lars@metafoo.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 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.