]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: Intel: sof_da7219: remove local max98373 ops
authorBrent Lu <brent.lu@intel.com>
Mon, 27 May 2024 19:35:51 +0000 (14:35 -0500)
committerMark Brown <broonie@kernel.org>
Wed, 29 May 2024 10:10:58 +0000 (11:10 +0100)
Since maxim-module could detect tdm slot number in runtime, we could
remove local ops and use maxim-module to handle max98373.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240527193552.165567-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_board_helpers.h
sound/soc/intel/boards/sof_da7219.c

index dfcc2c5c25cc1a58390bd56816a39e3d3743685c..faba847bb7c9901e25558d7de64b4c6cc0e5855f 100644 (file)
@@ -86,12 +86,10 @@ enum {
 /*
  * sof_da7219_private: private data for da7219 machine driver
  *
- * @is_jsl_board: true for JSL boards
  * @mclk_en: true for mclk pin is connected
  * @pll_bypass: true for PLL bypass mode
  */
 struct sof_da7219_private {
-       bool is_jsl_board;
        bool mclk_en;
        bool pll_bypass;
 };
index 886771e9b9d694e52e62f52f2f0fc12f86665f19..0e3c352a1672340f464b1811f85075df068271fc 100644 (file)
@@ -178,40 +178,6 @@ static void da7219_codec_exit(struct snd_soc_pcm_runtime *rtd)
        snd_soc_component_set_jack(component, NULL, NULL);
 }
 
-static int max98373_hw_params(struct snd_pcm_substream *substream,
-                             struct snd_pcm_hw_params *params)
-{
-       struct snd_soc_pcm_runtime *runtime = snd_soc_substream_to_rtd(substream);
-       int ret, j;
-
-       for (j = 0; j < runtime->dai_link->num_codecs; j++) {
-               struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, j);
-
-               if (!strcmp(codec_dai->component->name, MAX_98373_DEV0_NAME)) {
-                       /* vmon_slot_no = 0 imon_slot_no = 1 for TX slots */
-                       ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 3, 4, 16);
-                       if (ret < 0) {
-                               dev_err(runtime->dev, "DEV0 TDM slot err:%d\n", ret);
-                               return ret;
-                       }
-               }
-               if (!strcmp(codec_dai->component->name, MAX_98373_DEV1_NAME)) {
-                       /* vmon_slot_no = 2 imon_slot_no = 3 for TX slots */
-                       ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xC, 3, 4, 16);
-                       if (ret < 0) {
-                               dev_err(runtime->dev, "DEV1 TDM slot err:%d\n", ret);
-                               return ret;
-                       }
-               }
-       }
-
-       return 0;
-}
-
-static const struct snd_soc_ops max98373_ops = {
-       .hw_params = max98373_hw_params,
-};
-
 static int card_late_probe(struct snd_soc_card *card)
 {
        return sof_intel_board_card_late_probe(card);
@@ -276,14 +242,6 @@ sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card,
                break;
        case CODEC_MAX98373:
                max_98373_dai_link(dev, ctx->amp_link);
-
-               if (ctx->da7219.is_jsl_board) {
-                       ctx->amp_link->ops = &max98373_ops; /* use local ops */
-               } else {
-                       /* TBD: implement the amp for later platform */
-                       dev_err(dev, "max98373 not support yet\n");
-                       return -EINVAL;
-               }
                break;
        case CODEC_MAX98390:
                max_98390_dai_link(dev, ctx->amp_link);
@@ -388,8 +346,6 @@ static int audio_probe(struct platform_device *pdev)
                        break;
                }
        } else if (board_quirk & SOF_DA7219_JSL_BOARD) {
-               ctx->da7219.is_jsl_board = true;
-
                /* overwrite the DAI link order for JSL boards */
                ctx->link_order_overwrite = JSL_LINK_ORDER;