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

Commit 13b137ef authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'topic/asoc' into for-linus

parents e8fd86ef 44008559
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -533,6 +533,8 @@ L: device-drivers-devel@blackfin.uclinux.org
L:	alsa-devel@alsa-project.org (moderated for non-subscribers)
L:	alsa-devel@alsa-project.org (moderated for non-subscribers)
W:	http://wiki.analog.com/
W:	http://wiki.analog.com/
S:	Supported
S:	Supported
F:	sound/soc/codecs/adau*
F:	sound/soc/codecs/adav*
F:	sound/soc/codecs/ad1*
F:	sound/soc/codecs/ad1*
F:	sound/soc/codecs/ssm*
F:	sound/soc/codecs/ssm*


+4 −0
Original line number Original line Diff line number Diff line
@@ -209,6 +209,10 @@ struct snd_soc_dai_driver {
	struct snd_soc_pcm_stream capture;
	struct snd_soc_pcm_stream capture;
	struct snd_soc_pcm_stream playback;
	struct snd_soc_pcm_stream playback;
	unsigned int symmetric_rates:1;
	unsigned int symmetric_rates:1;

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


/*
/*
+6 −1
Original line number Original line Diff line number Diff line
@@ -348,6 +348,8 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm);
void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
			    const struct snd_soc_dapm_route *route, int num);
			    const struct snd_soc_dapm_route *route, int num);
int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm,
			     const struct snd_soc_dapm_route *route, int num);


/* dapm events */
/* dapm events */
int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd,
int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd,
@@ -429,6 +431,7 @@ struct snd_soc_dapm_path {
	/* status */
	/* status */
	u32 connect:1;	/* source and sink widgets are connected */
	u32 connect:1;	/* source and sink widgets are connected */
	u32 walked:1;	/* path has been walked */
	u32 walked:1;	/* path has been walked */
	u32 weak:1;	/* path ignored for power management */


	int (*connected)(struct snd_soc_dapm_widget *source,
	int (*connected)(struct snd_soc_dapm_widget *source,
			 struct snd_soc_dapm_widget *sink);
			 struct snd_soc_dapm_widget *sink);
@@ -444,6 +447,7 @@ struct snd_soc_dapm_widget {
	char *name;		/* widget name */
	char *name;		/* widget name */
	char *sname;	/* stream name */
	char *sname;	/* stream name */
	struct snd_soc_codec *codec;
	struct snd_soc_codec *codec;
	struct snd_soc_platform *platform;
	struct list_head list;
	struct list_head list;
	struct snd_soc_dapm_context *dapm;
	struct snd_soc_dapm_context *dapm;


@@ -507,10 +511,11 @@ struct snd_soc_dapm_context {


	struct device *dev; /* from parent - for debug */
	struct device *dev; /* from parent - for debug */
	struct snd_soc_codec *codec; /* parent codec */
	struct snd_soc_codec *codec; /* parent codec */
	struct snd_soc_platform *platform; /* parent platform */
	struct snd_soc_card *card; /* parent card */
	struct snd_soc_card *card; /* parent card */


	/* used during DAPM updates */
	/* used during DAPM updates */
	int dev_power;
	enum snd_soc_bias_level target_bias_level;
	struct list_head list;
	struct list_head list;


#ifdef CONFIG_DEBUG_FS
#ifdef CONFIG_DEBUG_FS
+53 −6
Original line number Original line Diff line number Diff line
@@ -202,6 +202,16 @@
#define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \
#define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \
	SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)
	SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)


/*
 * Component probe and remove ordering levels for components with runtime
 * dependencies.
 */
#define SND_SOC_COMP_ORDER_FIRST		-2
#define SND_SOC_COMP_ORDER_EARLY		-1
#define SND_SOC_COMP_ORDER_NORMAL		0
#define SND_SOC_COMP_ORDER_LATE		1
#define SND_SOC_COMP_ORDER_LAST		2

/*
/*
 * Bias levels
 * Bias levels
 *
 *
@@ -214,10 +224,10 @@
 * @OFF:     Power Off. No restrictions on transition times.
 * @OFF:     Power Off. No restrictions on transition times.
 */
 */
enum snd_soc_bias_level {
enum snd_soc_bias_level {
	SND_SOC_BIAS_OFF,
	SND_SOC_BIAS_OFF = 0,
	SND_SOC_BIAS_STANDBY,
	SND_SOC_BIAS_STANDBY = 1,
	SND_SOC_BIAS_PREPARE,
	SND_SOC_BIAS_PREPARE = 2,
	SND_SOC_BIAS_ON,
	SND_SOC_BIAS_ON = 3,
};
};


struct snd_jack;
struct snd_jack;
@@ -258,6 +268,11 @@ enum snd_soc_compress_type {
	SND_SOC_RBTREE_COMPRESSION
	SND_SOC_RBTREE_COMPRESSION
};
};


enum snd_soc_pcm_subclass {
	SND_SOC_PCM_CLASS_PCM	= 0,
	SND_SOC_PCM_CLASS_BE	= 1,
};

int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
			     unsigned int freq, int dir);
			     unsigned int freq, int dir);
int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
@@ -297,6 +312,10 @@ int snd_soc_default_readable_register(struct snd_soc_codec *codec,
				      unsigned int reg);
				      unsigned int reg);
int snd_soc_default_writable_register(struct snd_soc_codec *codec,
int snd_soc_default_writable_register(struct snd_soc_codec *codec,
				      unsigned int reg);
				      unsigned int reg);
int snd_soc_platform_read(struct snd_soc_platform *platform,
					unsigned int reg);
int snd_soc_platform_write(struct snd_soc_platform *platform,
					unsigned int reg, unsigned int val);


/* Utility functions to get clock rates from various things */
/* Utility functions to get clock rates from various things */
int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
@@ -349,6 +368,8 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
				  const char *prefix);
				  const char *prefix);
int snd_soc_add_controls(struct snd_soc_codec *codec,
int snd_soc_add_controls(struct snd_soc_codec *codec,
	const struct snd_kcontrol_new *controls, int num_controls);
	const struct snd_kcontrol_new *controls, int num_controls);
int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
	const struct snd_kcontrol_new *controls, int num_controls);
int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
	struct snd_ctl_elem_info *uinfo);
	struct snd_ctl_elem_info *uinfo);
int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
@@ -612,6 +633,10 @@ struct snd_soc_codec_driver {


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

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


/* SoC platform interface */
/* SoC platform interface */
@@ -623,10 +648,17 @@ struct snd_soc_platform_driver {
	int (*resume)(struct snd_soc_dai *dai);
	int (*resume)(struct snd_soc_dai *dai);


	/* pcm creation and destruction */
	/* pcm creation and destruction */
	int (*pcm_new)(struct snd_card *, struct snd_soc_dai *,
	int (*pcm_new)(struct snd_soc_pcm_runtime *);
		struct snd_pcm *);
	void (*pcm_free)(struct snd_pcm *);
	void (*pcm_free)(struct snd_pcm *);


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

	/*
	/*
	 * For platform caused delay reporting.
	 * For platform caused delay reporting.
	 * Optional.
	 * Optional.
@@ -636,6 +668,14 @@ struct snd_soc_platform_driver {


	/* platform stream ops */
	/* platform stream ops */
	struct snd_pcm_ops *ops;
	struct snd_pcm_ops *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);
};
};


struct snd_soc_platform {
struct snd_soc_platform {
@@ -650,6 +690,8 @@ struct snd_soc_platform {
	struct snd_soc_card *card;
	struct snd_soc_card *card;
	struct list_head list;
	struct list_head list;
	struct list_head card_list;
	struct list_head card_list;

	struct snd_soc_dapm_context dapm;
};
};


struct snd_soc_dai_link {
struct snd_soc_dai_link {
@@ -725,8 +767,10 @@ struct snd_soc_card {


	/* callbacks */
	/* callbacks */
	int (*set_bias_level)(struct snd_soc_card *,
	int (*set_bias_level)(struct snd_soc_card *,
			      struct snd_soc_dapm_context *dapm,
			      enum snd_soc_bias_level level);
			      enum snd_soc_bias_level level);
	int (*set_bias_level_post)(struct snd_soc_card *,
	int (*set_bias_level_post)(struct snd_soc_card *,
				   struct snd_soc_dapm_context *dapm,
				   enum snd_soc_bias_level level);
				   enum snd_soc_bias_level level);


	long pmdown_time;
	long pmdown_time;
@@ -789,6 +833,9 @@ struct snd_soc_pcm_runtime {
	struct device dev;
	struct device dev;
	struct snd_soc_card *card;
	struct snd_soc_card *card;
	struct snd_soc_dai_link *dai_link;
	struct snd_soc_dai_link *dai_link;
	struct mutex pcm_mutex;
	enum snd_soc_pcm_subclass pcm_subclass;
	struct snd_pcm_ops ops;


	unsigned int complete:1;
	unsigned int complete:1;
	unsigned int dev_registered:1;
	unsigned int dev_registered:1;
+45 −0
Original line number Original line Diff line number Diff line
@@ -9,6 +9,7 @@


struct snd_soc_jack;
struct snd_soc_jack;
struct snd_soc_codec;
struct snd_soc_codec;
struct snd_soc_platform;
struct snd_soc_card;
struct snd_soc_card;
struct snd_soc_dapm_widget;
struct snd_soc_dapm_widget;


@@ -59,6 +60,50 @@ DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read,


);
);


DECLARE_EVENT_CLASS(snd_soc_preg,

	TP_PROTO(struct snd_soc_platform *platform, unsigned int reg,
		 unsigned int val),

	TP_ARGS(platform, reg, val),

	TP_STRUCT__entry(
		__string(	name,		platform->name	)
		__field(	int,		id		)
		__field(	unsigned int,	reg		)
		__field(	unsigned int,	val		)
	),

	TP_fast_assign(
		__assign_str(name, platform->name);
		__entry->id = platform->id;
		__entry->reg = reg;
		__entry->val = val;
	),

	TP_printk("platform=%s.%d reg=%x val=%x", __get_str(name),
		  (int)__entry->id, (unsigned int)__entry->reg,
		  (unsigned int)__entry->val)
);

DEFINE_EVENT(snd_soc_preg, snd_soc_preg_write,

	TP_PROTO(struct snd_soc_platform *platform, unsigned int reg,
		 unsigned int val),

	TP_ARGS(platform, reg, val)

);

DEFINE_EVENT(snd_soc_preg, snd_soc_preg_read,

	TP_PROTO(struct snd_soc_platform *platform, unsigned int reg,
		 unsigned int val),

	TP_ARGS(platform, reg, val)

);

DECLARE_EVENT_CLASS(snd_soc_card,
DECLARE_EVENT_CLASS(snd_soc_card,


	TP_PROTO(struct snd_soc_card *card, int val),
	TP_PROTO(struct snd_soc_card *card, int val),
Loading