ASoC: SOF: Drop support for mapped control data
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Wed, 30 Mar 2022 20:19:20 +0000 (13:19 -0700)
committerMark Brown <broonie@kernel.org>
Mon, 4 Apr 2022 07:39:05 +0000 (08:39 +0100)
Access through mmapped memory is not supported and it is explicitly
disabled with scontrol->readback_offset = 0; when a control is created.

Remove the dead code and the confusion around this feature.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220330201926.1330402-6-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc.c
sound/soc/sof/sof-audio.c
sound/soc/sof/sof-audio.h

index 166d490..c722ca0 100644 (file)
@@ -823,7 +823,6 @@ int snd_sof_ipc_set_get_comp_data(struct snd_sof_control *scontrol, bool set)
        enum sof_ipc_ctrl_type ctrl_type;
        struct snd_sof_widget *swidget;
        bool widget_found = false;
-       size_t send_bytes;
        u32 ipc_cmd;
        int err;
 
@@ -847,27 +846,6 @@ int snd_sof_ipc_set_get_comp_data(struct snd_sof_control *scontrol, bool set)
        if (!swidget->use_count)
                return 0;
 
-       /* read or write firmware volume */
-       if (scontrol->readback_offset != 0) {
-               /* write/read value header via mmaped region */
-               send_bytes = sizeof(struct sof_ipc_ctrl_value_chan) *
-               cdata->num_elems;
-               if (set)
-                       err = snd_sof_dsp_block_write(sdev, SOF_FW_BLK_TYPE_IRAM,
-                                                     scontrol->readback_offset,
-                                                     cdata->chanv, send_bytes);
-
-               else
-                       err = snd_sof_dsp_block_read(sdev, SOF_FW_BLK_TYPE_IRAM,
-                                                    scontrol->readback_offset,
-                                                    cdata->chanv, send_bytes);
-
-               if (err)
-                       dev_err_once(sdev->dev, "error: %s TYPE_IRAM failed\n",
-                                    set ? "write to" :  "read from");
-               return err;
-       }
-
        /*
         * Select the IPC cmd and the ctrl_type based on the ctrl_cmd and the
         * direction
index b2f009a..49fdfe0 100644 (file)
@@ -16,9 +16,6 @@ static int sof_kcontrol_setup(struct snd_sof_dev *sdev, struct snd_sof_control *
 {
        int ret;
 
-       /* reset readback offset for scontrol */
-       scontrol->readback_offset = 0;
-
        ret = snd_sof_ipc_set_get_comp_data(scontrol, true);
        if (ret < 0)
                dev_err(sdev->dev, "error: failed kcontrol value set for widget: %d\n",
index 7f15b3b..4a8cd7f 100644 (file)
@@ -247,7 +247,6 @@ struct snd_sof_control {
        int max_volume_step; /* max volume step for volume_table */
        int num_channels;
        unsigned int access;
-       u32 readback_offset; /* offset to mmapped data if used */
        int info_type;
        int index; /* pipeline ID */
        void *priv; /* private data copied from topology */