Create tas2781 driver.
Signed-off-by: Shenghao Ding <13916275206-7R9yAhoRP9E@xxxxxxxxxxxxxxxx>
---
Changes in v4:
- fixed issue| Reported-by: kernel test robot <lkp-ral2JQCrhuEAvxtiuMwx3w@xxxxxxxxxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305192322.gBZ4JIyr-lkp-ral2JQCrhuEAvxtiuMwx3w@xxxxxxxxxxxxxxxx/
Changes to be committed:
modified: sound/soc/codecs/Kconfig
modified: sound/soc/codecs/Makefile
new file: sound/soc/codecs/tas2781-comlib.c
new file: sound/soc/codecs/tas2781-i2c.c
---
sound/soc/codecs/Kconfig | 25 +
sound/soc/codecs/Makefile | 6 +
sound/soc/codecs/tas2781-comlib.c | 581 +++++++++++++++++++++++
sound/soc/codecs/tas2781-i2c.c | 736 ++++++++++++++++++++++++++++++
4 files changed, 1348 insertions(+)
create mode 100644 sound/soc/codecs/tas2781-comlib.c
create mode 100644 sound/soc/codecs/tas2781-i2c.c
+static void tasdev_dsp_prog_blk_remove(struct tasdevice_prog *prog)
+{
+ struct tasdevice_data *im;
+ struct tasdev_blk *blk;
+ unsigned int nr_blk;
+
+ if (!prog)
+ return;
+
+ im = &(prog->dev_data);
+
+ if (!im->dev_blks)
+ return;
+
+ for (nr_blk = 0; nr_blk < im->nr_blk; nr_blk++) {
+ blk = &(im->dev_blks[nr_blk]);
+ kfree(blk->data);
+ }
+ kfree(im->dev_blks);
+}
+static int tasdevice_set_profile_id(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol);
+ struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
+ int ret = 0;
+
+ if (tas_priv->rcabin.profile_cfg_id !=
+ ucontrol->value.integer.value[0]) {
+ tas_priv->rcabin.profile_cfg_id =
+ ucontrol->value.integer.value[0];
+ ret = 0;