Loading include/sound/soc-dapm.h +2 −0 Original line number Diff line number Diff line Loading @@ -447,6 +447,7 @@ struct snd_soc_dapm_widget { char *name; /* widget name */ char *sname; /* stream name */ struct snd_soc_codec *codec; struct snd_soc_platform *platform; struct list_head list; struct snd_soc_dapm_context *dapm; Loading Loading @@ -510,6 +511,7 @@ struct snd_soc_dapm_context { struct device *dev; /* from parent - for debug */ struct snd_soc_codec *codec; /* parent codec */ struct snd_soc_platform *platform; /* parent platform */ struct snd_soc_card *card; /* parent card */ /* used during DAPM updates */ Loading include/sound/soc.h +12 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,8 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, const char *prefix); int snd_soc_add_controls(struct snd_soc_codec *codec, 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, struct snd_ctl_elem_info *uinfo); int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, Loading Loading @@ -649,6 +651,14 @@ struct snd_soc_platform_driver { int (*pcm_new)(struct snd_soc_pcm_runtime *); 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. * Optional. Loading Loading @@ -680,6 +690,8 @@ struct snd_soc_platform { struct snd_soc_card *card; struct list_head list; struct list_head card_list; struct snd_soc_dapm_context dapm; }; struct snd_soc_dai_link { Loading include/trace/events/asoc.h +45 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ struct snd_soc_jack; struct snd_soc_codec; struct snd_soc_platform; struct snd_soc_card; struct snd_soc_dapm_widget; Loading Loading @@ -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, TP_PROTO(struct snd_soc_card *card, int val), Loading sound/soc/codecs/ak4642.c +1 −1 Original line number Diff line number Diff line Loading @@ -357,7 +357,7 @@ static int ak4642_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) default: return -EINVAL; } snd_soc_update_bits(codec, PW_MGMT2, MS, data); snd_soc_update_bits(codec, PW_MGMT2, MS | MCKO | PMPLL, data); snd_soc_update_bits(codec, MD_CTL1, BCKO_MASK, bcko); /* format type */ Loading sound/soc/codecs/wm8731.c +3 −26 Original line number Diff line number Diff line Loading @@ -175,6 +175,7 @@ static const struct snd_kcontrol_new wm8731_input_mux_controls = SOC_DAPM_ENUM("Input Select", wm8731_insel_enum); static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { SND_SOC_DAPM_SUPPLY("ACTIVE",WM8731_ACTIVE, 0, 0, NULL, 0), SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0), SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1, &wm8731_output_mixer_controls[0], Loading Loading @@ -204,6 +205,8 @@ static int wm8731_check_osc(struct snd_soc_dapm_widget *source, static const struct snd_soc_dapm_route wm8731_intercon[] = { {"DAC", NULL, "OSC", wm8731_check_osc}, {"ADC", NULL, "OSC", wm8731_check_osc}, {"DAC", NULL, "ACTIVE"}, {"ADC", NULL, "ACTIVE"}, /* output mixer */ {"Output Mixer", "Line Bypass Switch", "Line Input"}, Loading Loading @@ -315,29 +318,6 @@ static int wm8731_hw_params(struct snd_pcm_substream *substream, return 0; } static int wm8731_pcm_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_codec *codec = dai->codec; /* set active */ snd_soc_write(codec, WM8731_ACTIVE, 0x0001); return 0; } static void wm8731_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_codec *codec = dai->codec; /* deactivate */ if (!codec->active) { udelay(50); snd_soc_write(codec, WM8731_ACTIVE, 0x0); } } static int wm8731_mute(struct snd_soc_dai *dai, int mute) { struct snd_soc_codec *codec = dai->codec; Loading Loading @@ -480,7 +460,6 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, snd_soc_write(codec, WM8731_PWR, reg | 0x0040); break; case SND_SOC_BIAS_OFF: snd_soc_write(codec, WM8731_ACTIVE, 0x0); snd_soc_write(codec, WM8731_PWR, 0xffff); regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); Loading @@ -496,9 +475,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, SNDRV_PCM_FMTBIT_S24_LE) static struct snd_soc_dai_ops wm8731_dai_ops = { .prepare = wm8731_pcm_prepare, .hw_params = wm8731_hw_params, .shutdown = wm8731_shutdown, .digital_mute = wm8731_mute, .set_sysclk = wm8731_set_dai_sysclk, .set_fmt = wm8731_set_dai_fmt, Loading Loading
include/sound/soc-dapm.h +2 −0 Original line number Diff line number Diff line Loading @@ -447,6 +447,7 @@ struct snd_soc_dapm_widget { char *name; /* widget name */ char *sname; /* stream name */ struct snd_soc_codec *codec; struct snd_soc_platform *platform; struct list_head list; struct snd_soc_dapm_context *dapm; Loading Loading @@ -510,6 +511,7 @@ struct snd_soc_dapm_context { struct device *dev; /* from parent - for debug */ struct snd_soc_codec *codec; /* parent codec */ struct snd_soc_platform *platform; /* parent platform */ struct snd_soc_card *card; /* parent card */ /* used during DAPM updates */ Loading
include/sound/soc.h +12 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,8 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, const char *prefix); int snd_soc_add_controls(struct snd_soc_codec *codec, 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, struct snd_ctl_elem_info *uinfo); int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, Loading Loading @@ -649,6 +651,14 @@ struct snd_soc_platform_driver { int (*pcm_new)(struct snd_soc_pcm_runtime *); 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. * Optional. Loading Loading @@ -680,6 +690,8 @@ struct snd_soc_platform { struct snd_soc_card *card; struct list_head list; struct list_head card_list; struct snd_soc_dapm_context dapm; }; struct snd_soc_dai_link { Loading
include/trace/events/asoc.h +45 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ struct snd_soc_jack; struct snd_soc_codec; struct snd_soc_platform; struct snd_soc_card; struct snd_soc_dapm_widget; Loading Loading @@ -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, TP_PROTO(struct snd_soc_card *card, int val), Loading
sound/soc/codecs/ak4642.c +1 −1 Original line number Diff line number Diff line Loading @@ -357,7 +357,7 @@ static int ak4642_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) default: return -EINVAL; } snd_soc_update_bits(codec, PW_MGMT2, MS, data); snd_soc_update_bits(codec, PW_MGMT2, MS | MCKO | PMPLL, data); snd_soc_update_bits(codec, MD_CTL1, BCKO_MASK, bcko); /* format type */ Loading
sound/soc/codecs/wm8731.c +3 −26 Original line number Diff line number Diff line Loading @@ -175,6 +175,7 @@ static const struct snd_kcontrol_new wm8731_input_mux_controls = SOC_DAPM_ENUM("Input Select", wm8731_insel_enum); static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { SND_SOC_DAPM_SUPPLY("ACTIVE",WM8731_ACTIVE, 0, 0, NULL, 0), SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0), SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1, &wm8731_output_mixer_controls[0], Loading Loading @@ -204,6 +205,8 @@ static int wm8731_check_osc(struct snd_soc_dapm_widget *source, static const struct snd_soc_dapm_route wm8731_intercon[] = { {"DAC", NULL, "OSC", wm8731_check_osc}, {"ADC", NULL, "OSC", wm8731_check_osc}, {"DAC", NULL, "ACTIVE"}, {"ADC", NULL, "ACTIVE"}, /* output mixer */ {"Output Mixer", "Line Bypass Switch", "Line Input"}, Loading Loading @@ -315,29 +318,6 @@ static int wm8731_hw_params(struct snd_pcm_substream *substream, return 0; } static int wm8731_pcm_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_codec *codec = dai->codec; /* set active */ snd_soc_write(codec, WM8731_ACTIVE, 0x0001); return 0; } static void wm8731_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_codec *codec = dai->codec; /* deactivate */ if (!codec->active) { udelay(50); snd_soc_write(codec, WM8731_ACTIVE, 0x0); } } static int wm8731_mute(struct snd_soc_dai *dai, int mute) { struct snd_soc_codec *codec = dai->codec; Loading Loading @@ -480,7 +460,6 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, snd_soc_write(codec, WM8731_PWR, reg | 0x0040); break; case SND_SOC_BIAS_OFF: snd_soc_write(codec, WM8731_ACTIVE, 0x0); snd_soc_write(codec, WM8731_PWR, 0xffff); regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); Loading @@ -496,9 +475,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, SNDRV_PCM_FMTBIT_S24_LE) static struct snd_soc_dai_ops wm8731_dai_ops = { .prepare = wm8731_pcm_prepare, .hw_params = wm8731_hw_params, .shutdown = wm8731_shutdown, .digital_mute = wm8731_mute, .set_sysclk = wm8731_set_dai_sysclk, .set_fmt = wm8731_set_dai_fmt, Loading