Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: Extend wm_adsp so cs35l56 can suppress controls

Merge series from Simon Trimmer <simont@opensource.cirrus.com>:

This pair of patches extend wm_adsp to add a callback that can be used
to control whether ALSA controls are added and then tweak cs35l56 to use
it to suppress controls made from firmware coefficients.

+28 -3
+11
sound/soc/codecs/cs35l56.c
··· 1095 1095 } 1096 1096 EXPORT_SYMBOL_GPL(cs35l56_system_resume); 1097 1097 1098 + static int cs35l56_control_add_nop(struct wm_adsp *dsp, struct cs_dsp_coeff_ctl *cs_ctl) 1099 + { 1100 + return 0; 1101 + } 1102 + 1098 1103 static int cs35l56_dsp_init(struct cs35l56_private *cs35l56) 1099 1104 { 1100 1105 struct wm_adsp *dsp; ··· 1121 1116 */ 1122 1117 dsp->fw = 12; 1123 1118 dsp->wmfw_optional = true; 1119 + 1120 + /* 1121 + * None of the firmware controls need to be exported so add a no-op 1122 + * callback that suppresses creating an ALSA control. 1123 + */ 1124 + dsp->control_add = &cs35l56_control_add_nop; 1124 1125 1125 1126 dev_dbg(cs35l56->base.dev, "DSP system name: '%s'\n", dsp->system_name); 1126 1127
+14 -3
sound/soc/codecs/wm_adsp.c
··· 583 583 kfree(kcontrol); 584 584 } 585 585 586 - static int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl) 586 + int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl) 587 587 { 588 588 struct wm_adsp *dsp = container_of(cs_ctl->dsp, struct wm_adsp, cs_dsp); 589 589 struct cs_dsp *cs_dsp = &dsp->cs_dsp; ··· 657 657 kfree(ctl); 658 658 659 659 return ret; 660 + } 661 + EXPORT_SYMBOL_GPL(wm_adsp_control_add); 662 + 663 + static int wm_adsp_control_add_cb(struct cs_dsp_coeff_ctl *cs_ctl) 664 + { 665 + struct wm_adsp *dsp = container_of(cs_ctl->dsp, struct wm_adsp, cs_dsp); 666 + 667 + if (dsp->control_add) 668 + return (dsp->control_add)(dsp, cs_ctl); 669 + else 670 + return wm_adsp_control_add(cs_ctl); 660 671 } 661 672 662 673 static void wm_adsp_control_remove(struct cs_dsp_coeff_ctl *cs_ctl) ··· 2083 2072 EXPORT_SYMBOL_GPL(wm_halo_wdt_expire); 2084 2073 2085 2074 static const struct cs_dsp_client_ops wm_adsp1_client_ops = { 2086 - .control_add = wm_adsp_control_add, 2075 + .control_add = wm_adsp_control_add_cb, 2087 2076 .control_remove = wm_adsp_control_remove, 2088 2077 }; 2089 2078 2090 2079 static const struct cs_dsp_client_ops wm_adsp2_client_ops = { 2091 - .control_add = wm_adsp_control_add, 2080 + .control_add = wm_adsp_control_add_cb, 2092 2081 .control_remove = wm_adsp_control_remove, 2093 2082 .pre_run = wm_adsp_pre_run, 2094 2083 .post_run = wm_adsp_event_post_run,
+3
sound/soc/codecs/wm_adsp.h
··· 37 37 bool wmfw_optional; 38 38 39 39 struct work_struct boot_work; 40 + int (*control_add)(struct wm_adsp *dsp, struct cs_dsp_coeff_ctl *cs_ctl); 40 41 int (*pre_run)(struct wm_adsp *dsp); 41 42 42 43 bool preloaded; ··· 133 132 int wm_adsp_compr_copy(struct snd_soc_component *component, 134 133 struct snd_compr_stream *stream, 135 134 char __user *buf, size_t count); 135 + 136 + int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl); 136 137 int wm_adsp_write_ctl(struct wm_adsp *dsp, const char *name, int type, 137 138 unsigned int alg, void *buf, size_t len); 138 139 int wm_adsp_read_ctl(struct wm_adsp *dsp, const char *name, int type,