summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-01-28 03:37:54 +0300
committerMark Brown <broonie@kernel.org>2026-01-28 03:37:54 +0300
commitb4ee17729a11f13fbb15cd1fb54549642cd1c44c (patch)
tree80686e8b69bfcc821af5945c14ad5514ab537043 /include
parent1924bd68a0c06f9f2c06cf35e60dfc55cdc34a91 (diff)
parentaf6d53db28e6448b1e0ce9aa314bc5da494d35ab (diff)
downloadlinux-b4ee17729a11f13fbb15cd1fb54549642cd1c44c.tar.xz
ASoC: capsuling struct snd_soc_dapm_context
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>: Now, all DAPM users are using function to handling it. We can capsuling it. This patchset moves struct snd_soc_dapm_context into soc-dapm.c, and remove un-used functions. Link: https://lore.kernel.org/r/87zf7jrx52.wl-kuninori.morimoto.gx@renesas.com
Diffstat (limited to 'include')
-rw-r--r--include/sound/soc-component.h29
-rw-r--r--include/sound/soc-dapm.h44
-rw-r--r--include/sound/soc.h4
3 files changed, 7 insertions, 70 deletions
diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index d78cda866888..2a2b74b24a60 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -237,8 +237,7 @@ struct snd_soc_component {
* the driver will be marked as BROKEN when these fields are removed.
*/
- /* Don't use these, use snd_soc_component_get_dapm() */
- struct snd_soc_dapm_context dapm;
+ struct snd_soc_dapm_context *dapm;
/* machine specific init */
int (*init)(struct snd_soc_component *component);
@@ -268,12 +267,9 @@ struct snd_soc_component {
static inline struct snd_soc_dapm_context *snd_soc_component_to_dapm(
struct snd_soc_component *component)
{
- return &component->dapm;
+ return component->dapm;
}
-// FIXME
-#define snd_soc_component_get_dapm snd_soc_component_to_dapm
-
/**
* snd_soc_component_cache_sync() - Sync the register cache with the hardware
* @component: COMPONENT to sync
@@ -368,27 +364,6 @@ snd_soc_component_active(struct snd_soc_component *component)
return component->active;
}
-/* component pin */
-int snd_soc_component_enable_pin(struct snd_soc_component *component,
- const char *pin);
-int snd_soc_component_enable_pin_unlocked(struct snd_soc_component *component,
- const char *pin);
-int snd_soc_component_disable_pin(struct snd_soc_component *component,
- const char *pin);
-int snd_soc_component_disable_pin_unlocked(struct snd_soc_component *component,
- const char *pin);
-int snd_soc_component_nc_pin(struct snd_soc_component *component,
- const char *pin);
-int snd_soc_component_nc_pin_unlocked(struct snd_soc_component *component,
- const char *pin);
-int snd_soc_component_get_pin_status(struct snd_soc_component *component,
- const char *pin);
-int snd_soc_component_force_enable_pin(struct snd_soc_component *component,
- const char *pin);
-int snd_soc_component_force_enable_pin_unlocked(
- struct snd_soc_component *component,
- const char *pin);
-
/* component controls */
struct snd_kcontrol *snd_soc_component_get_kcontrol(struct snd_soc_component *component,
const char * const ctl);
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 75941324886b..49f0fe05db01 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -20,6 +20,7 @@ struct regulator;
struct soc_enum;
struct snd_pcm_substream;
struct snd_soc_pcm_runtime;
+struct snd_soc_dapm_context;
/* widget has no PM register bit */
#define SND_SOC_NOPM -1
@@ -579,28 +580,6 @@ struct snd_soc_dapm_update {
bool has_second_set;
};
-/* DAPM context */
-struct snd_soc_dapm_context {
- enum snd_soc_bias_level bias_level;
-
- bool idle_bias; /* Use BIAS_OFF instead of STANDBY when false */
-
- struct device *dev; /* from parent - for debug */ /* REMOVE ME */
- struct snd_soc_component *component; /* parent component */
- struct snd_soc_card *card; /* parent card */
-
- /* used during DAPM updates */
- enum snd_soc_bias_level target_bias_level;
- struct list_head list;
-
- struct snd_soc_dapm_widget *wcache_sink;
- struct snd_soc_dapm_widget *wcache_source;
-
-#ifdef CONFIG_DEBUG_FS
- struct dentry *debugfs_dapm;
-#endif
-};
-
/* A list of widgets associated with an object, typically a snd_kcontrol */
struct snd_soc_dapm_widget_list {
int num_widgets;
@@ -628,6 +607,8 @@ enum snd_soc_dapm_direction {
#define SND_SOC_DAPM_EP_SOURCE SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_IN)
#define SND_SOC_DAPM_EP_SINK SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_OUT)
+struct snd_soc_dapm_context *snd_soc_dapm_alloc(struct device *dev);
+
int snd_soc_dapm_regulator_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event);
int snd_soc_dapm_clock_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event);
int snd_soc_dapm_pinctrl_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event);
@@ -705,16 +686,6 @@ int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, co
int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, const char *pin);
void snd_soc_dapm_mark_endpoints_dirty(struct snd_soc_card *card);
-/*
- * Marks the specified pin as being not connected, disabling it along
- * any parent or child widgets. At present this is identical to
- * snd_soc_dapm_disable_pin[_unlocked]() but in future it will be extended to do
- * additional things such as disabling controls which only affect
- * paths through the pin.
- */
-#define snd_soc_dapm_nc_pin snd_soc_dapm_disable_pin
-#define snd_soc_dapm_nc_pin_unlocked snd_soc_dapm_disable_pin_unlocked
-
/* dapm path query */
int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
struct snd_soc_dapm_widget_list **list,
@@ -730,15 +701,6 @@ int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, enum snd_so
enum snd_soc_bias_level snd_soc_dapm_get_bias_level(struct snd_soc_dapm_context *dapm);
void snd_soc_dapm_init_bias_level(struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level);
-// REMOVE ME !!
-#define snd_soc_component_force_bias_level(c, l) snd_soc_dapm_force_bias_level(&(c)->dapm, l)
-#define snd_soc_component_get_bias_level(c) snd_soc_dapm_get_bias_level(&(c)->dapm)
-#define snd_soc_component_init_bias_level(c, l) snd_soc_dapm_init_bias_level(&(c)->dapm, l)
-#define snd_soc_dapm_kcontrol_widget snd_soc_dapm_kcontrol_to_widget
-#define snd_soc_dapm_kcontrol_dapm snd_soc_dapm_kcontrol_to_dapm
-#define dapm_kcontrol_get_value snd_soc_dapm_kcontrol_get_value
-#define snd_soc_dapm_kcontrol_component snd_soc_dapm_kcontrol_to_component
-
#define for_each_dapm_widgets(list, i, widget) \
for ((i) = 0; \
(i) < list->num_widgets && (widget = list->widgets[i]); \
diff --git a/include/sound/soc.h b/include/sound/soc.h
index aa0fe6b80293..7d8376c8e1be 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1076,7 +1076,7 @@ struct snd_soc_card {
struct list_head dobj_list;
/* Generic DAPM context for the card */
- struct snd_soc_dapm_context dapm;
+ struct snd_soc_dapm_context *dapm;
struct snd_soc_dapm_stats dapm_stats;
#ifdef CONFIG_DEBUG_FS
@@ -1136,7 +1136,7 @@ static inline int snd_soc_card_is_instantiated(struct snd_soc_card *card)
static inline struct snd_soc_dapm_context *snd_soc_card_to_dapm(struct snd_soc_card *card)
{
- return &card->dapm;
+ return card->dapm;
}
/* SoC machine DAI configuration, glues a codec and cpu DAI together */