Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bade5f09 authored by Mark Brown's avatar Mark Brown
Browse files

Merge branch 'topic/suspend' of...

Merge branch 'topic/suspend' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-es8328
parents 75c3daaa 85362efb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -587,7 +587,8 @@ struct snd_soc_dapm_context {
	enum snd_soc_bias_level suspend_bias_level;
	struct delayed_work delayed_work;
	unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */

	/* Go to BIAS_OFF in suspend if the DAPM context is idle */
	unsigned int suspend_bias_off:1;
	void (*seq_notifier)(struct snd_soc_dapm_context *,
			     enum snd_soc_dapm_type, int);

+46 −23
Original line number Diff line number Diff line
@@ -690,6 +690,17 @@ struct snd_soc_compr_ops {
struct snd_soc_component_driver {
	const char *name;

	/* Default control and setup, added after probe() is run */
	const struct snd_kcontrol_new *controls;
	unsigned int num_controls;
	const struct snd_soc_dapm_widget *dapm_widgets;
	unsigned int num_dapm_widgets;
	const struct snd_soc_dapm_route *dapm_routes;
	unsigned int num_dapm_routes;

	int (*probe)(struct snd_soc_component *);
	void (*remove)(struct snd_soc_component *);

	/* DT */
	int (*of_xlate_dai_name)(struct snd_soc_component *component,
				 struct of_phandle_args *args,
@@ -697,6 +708,10 @@ 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);

	/* probe ordering - for components with runtime dependencies */
	int probe_order;
	int remove_order;
};

struct snd_soc_component {
@@ -710,6 +725,7 @@ struct snd_soc_component {

	unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
	unsigned int registered_as_component:1;
	unsigned int probed:1;

	struct list_head list;

@@ -728,9 +744,36 @@ struct snd_soc_component {

	struct mutex io_mutex;

#ifdef CONFIG_DEBUG_FS
	struct dentry *debugfs_root;
#endif

	/*
	* DO NOT use any of the fields below in drivers, they are temporary and
	* are going to be removed again soon. If you use them in driver code 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_ptr;

	const struct snd_kcontrol_new *controls;
	unsigned int num_controls;
	const struct snd_soc_dapm_widget *dapm_widgets;
	unsigned int num_dapm_widgets;
	const struct snd_soc_dapm_route *dapm_routes;
	unsigned int num_dapm_routes;
	bool steal_sibling_dai_widgets;
	struct snd_soc_codec *codec;

	int (*probe)(struct snd_soc_component *);
	void (*remove)(struct snd_soc_component *);

#ifdef CONFIG_DEBUG_FS
	void (*init_debugfs)(struct snd_soc_component *component);
	const char *debugfs_prefix;
#endif
};

/* SoC Audio Codec device */
@@ -746,11 +789,9 @@ struct snd_soc_codec {
	struct snd_ac97 *ac97;  /* for ad-hoc ac97 devices */
	unsigned int cache_bypass:1; /* Suppress access to the cache */
	unsigned int suspended:1; /* Codec is in suspend PM state */
	unsigned int probed:1; /* Codec has been probed */
	unsigned int ac97_registered:1; /* Codec has been AC97 registered */
	unsigned int ac97_created:1; /* Codec has been created by SoC */
	unsigned int cache_init:1; /* codec cache has been initialized */
	u32 cache_only;  /* Suppress writes to hardware */
	u32 cache_sync; /* Cache needs to be synced to hardware */

	/* codec IO */
@@ -766,7 +807,6 @@ struct snd_soc_codec {
	struct snd_soc_dapm_context dapm;

#ifdef CONFIG_DEBUG_FS
	struct dentry *debugfs_codec_root;
	struct dentry *debugfs_reg;
#endif
};
@@ -808,15 +848,12 @@ struct snd_soc_codec_driver {
	int (*set_bias_level)(struct snd_soc_codec *,
			      enum snd_soc_bias_level level);
	bool idle_bias_off;
	bool suspend_bias_off;

	void (*seq_notifier)(struct snd_soc_dapm_context *,
			     enum snd_soc_dapm_type, int);

	bool ignore_pmdown_time;  /* Doesn't benefit from pmdown delay */

	/* probe ordering - for components with runtime dependencies */
	int probe_order;
	int remove_order;
};

/* SoC platform interface */
@@ -853,13 +890,6 @@ struct snd_soc_platform_driver {
	/* platform stream compress ops */
	const struct snd_compr_ops *compr_ops;

	/* probe ordering - for components with runtime dependencies */
	int probe_order;
	int remove_order;

	/* platform IO - used for platform DAPM */
	unsigned int (*read)(struct snd_soc_platform *, unsigned int);
	int (*write)(struct snd_soc_platform *, unsigned int, unsigned int);
	int (*bespoke_trigger)(struct snd_pcm_substream *, int);
};

@@ -874,15 +904,10 @@ struct snd_soc_platform {
	const struct snd_soc_platform_driver *driver;

	unsigned int suspended:1; /* platform is suspended */
	unsigned int probed:1;

	struct list_head list;

	struct snd_soc_component component;

#ifdef CONFIG_DEBUG_FS
	struct dentry *debugfs_platform_root;
#endif
};

struct snd_soc_dai_link {
@@ -994,7 +1019,7 @@ struct snd_soc_aux_dev {
	const struct device_node *codec_of_node;

	/* codec/machine specific init - e.g. add machine controls */
	int (*init)(struct snd_soc_dapm_context *dapm);
	int (*init)(struct snd_soc_component *component);
};

/* SoC card */
@@ -1112,6 +1137,7 @@ struct snd_soc_pcm_runtime {
	struct snd_soc_platform *platform;
	struct snd_soc_dai *codec_dai;
	struct snd_soc_dai *cpu_dai;
	struct snd_soc_component *component; /* Only valid for AUX dev rtds */

	struct snd_soc_dai **codec_dais;
	unsigned int num_codecs;
@@ -1260,9 +1286,6 @@ void snd_soc_component_async_complete(struct snd_soc_component *component);
int snd_soc_component_test_bits(struct snd_soc_component *component,
	unsigned int reg, unsigned int mask, unsigned int value);

int snd_soc_component_init_io(struct snd_soc_component *component,
	struct regmap *regmap);

/* device driver data */

static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
+0 −21
Original line number Diff line number Diff line
@@ -1448,29 +1448,10 @@ static int adau1373_set_bias_level(struct snd_soc_codec *codec,
	return 0;
}

static int adau1373_remove(struct snd_soc_codec *codec)
{
	adau1373_set_bias_level(codec, SND_SOC_BIAS_OFF);
	return 0;
}

static int adau1373_suspend(struct snd_soc_codec *codec)
{
	struct adau1373 *adau1373 = snd_soc_codec_get_drvdata(codec);
	int ret;

	ret = adau1373_set_bias_level(codec, SND_SOC_BIAS_OFF);
	regcache_cache_only(adau1373->regmap, true);

	return ret;
}

static int adau1373_resume(struct snd_soc_codec *codec)
{
	struct adau1373 *adau1373 = snd_soc_codec_get_drvdata(codec);

	regcache_cache_only(adau1373->regmap, false);
	adau1373_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
	regcache_sync(adau1373->regmap);

	return 0;
@@ -1501,8 +1482,6 @@ static const struct regmap_config adau1373_regmap_config = {

static struct snd_soc_codec_driver adau1373_codec_driver = {
	.probe =	adau1373_probe,
	.remove =	adau1373_remove,
	.suspend =	adau1373_suspend,
	.resume =	adau1373_resume,
	.set_bias_level = adau1373_set_bias_level,
	.idle_bias_off = true,
+1 −1
Original line number Diff line number Diff line
@@ -714,9 +714,9 @@ static int adau1761_codec_probe(struct snd_soc_codec *codec)

static const struct snd_soc_codec_driver adau1761_codec_driver = {
	.probe = adau1761_codec_probe,
	.suspend = adau17x1_suspend,
	.resume	= adau17x1_resume,
	.set_bias_level	= adau1761_set_bias_level,
	.suspend_bias_off = true,

	.controls = adau1761_controls,
	.num_controls = ARRAY_SIZE(adau1761_controls),
+1 −1
Original line number Diff line number Diff line
@@ -446,9 +446,9 @@ static int adau1781_codec_probe(struct snd_soc_codec *codec)

static const struct snd_soc_codec_driver adau1781_codec_driver = {
	.probe = adau1781_codec_probe,
	.suspend = adau17x1_suspend,
	.resume = adau17x1_resume,
	.set_bias_level = adau1781_set_bias_level,
	.suspend_bias_off = true,

	.controls = adau1781_controls,
	.num_controls = ARRAY_SIZE(adau1781_controls),
Loading