Lines Matching +full:dsp +full:- +full:based
1 // SPDX-License-Identifier: GPL-2.0-only
20 #include "sof-client.h"
38 struct sof_client_dev *cdev = inode->i_private; in sof_ipc_flood_dfs_open()
42 return -ENODEV; in sof_ipc_flood_dfs_open()
44 ret = debugfs_file_get(file->f_path.dentry); in sof_ipc_flood_dfs_open()
50 debugfs_file_put(file->f_path.dentry); in sof_ipc_flood_dfs_open()
57 * or ipc_count, will be non-zero and will determine the type of test
64 struct sof_ipc_flood_priv *priv = cdev->data; in sof_debug_ipc_flood_test()
65 struct device *dev = &cdev->auxdev.dev; in sof_debug_ipc_flood_test()
122 memset(priv->buf, 0, IPC_FLOOD_TEST_RESULT_LEN); in sof_debug_ipc_flood_test()
126 snprintf(priv->buf, IPC_FLOOD_TEST_RESULT_LEN, in sof_debug_ipc_flood_test()
136 snprintf(priv->buf + strlen(priv->buf), in sof_debug_ipc_flood_test()
137 IPC_FLOOD_TEST_RESULT_LEN - strlen(priv->buf), in sof_debug_ipc_flood_test()
141 snprintf(priv->buf + strlen(priv->buf), in sof_debug_ipc_flood_test()
142 IPC_FLOOD_TEST_RESULT_LEN - strlen(priv->buf), in sof_debug_ipc_flood_test()
150 * Writing to the debugfs entry initiates the IPC flood test based on
156 struct sof_client_dev *cdev = file->private_data; in sof_ipc_flood_dfs_write()
157 struct device *dev = &cdev->auxdev.dev; in sof_ipc_flood_dfs_write()
167 return -EINVAL; in sof_ipc_flood_dfs_write()
171 return -ENOMEM; in sof_ipc_flood_dfs_write()
174 ret = -EFAULT; in sof_ipc_flood_dfs_write()
181 * ipc_flood_count floods the DSP with the number of IPC's specified. in sof_ipc_flood_dfs_write()
182 * ipc_duration_ms test floods the DSP for the time specified in sof_ipc_flood_dfs_write()
185 dentry = file->f_path.dentry; in sof_ipc_flood_dfs_write()
186 if (strcmp(dentry->d_name.name, DEBUGFS_IPC_FLOOD_COUNT) && in sof_ipc_flood_dfs_write()
187 strcmp(dentry->d_name.name, DEBUGFS_IPC_FLOOD_DURATION)) { in sof_ipc_flood_dfs_write()
188 ret = -EINVAL; in sof_ipc_flood_dfs_write()
192 if (!strcmp(dentry->d_name.name, DEBUGFS_IPC_FLOOD_DURATION)) in sof_ipc_flood_dfs_write()
225 if (ret < 0 && ret != -EACCES) { in sof_ipc_flood_dfs_write()
251 struct sof_client_dev *cdev = file->private_data; in sof_ipc_flood_dfs_read()
252 struct sof_ipc_flood_priv *priv = cdev->data; in sof_ipc_flood_dfs_read()
257 dentry = file->f_path.dentry; in sof_ipc_flood_dfs_read()
258 if (!strcmp(dentry->d_name.name, DEBUGFS_IPC_FLOOD_COUNT) || in sof_ipc_flood_dfs_read()
259 !strcmp(dentry->d_name.name, DEBUGFS_IPC_FLOOD_DURATION)) { in sof_ipc_flood_dfs_read()
263 count = min_t(size_t, count, strlen(priv->buf)); in sof_ipc_flood_dfs_read()
264 size_ret = copy_to_user(buffer, priv->buf, count); in sof_ipc_flood_dfs_read()
266 return -EFAULT; in sof_ipc_flood_dfs_read()
276 debugfs_file_put(file->f_path.dentry); in sof_ipc_flood_dfs_release()
294 * by specifying either the number of IPCs to flood the DSP with or the duration
295 * (in ms) for which the DSP should be flooded with test IPCs. At the
305 struct device *dev = &auxdev->dev; in sof_ipc_flood_probe()
311 return -ENOMEM; in sof_ipc_flood_probe()
313 priv->buf = devm_kmalloc(dev, IPC_FLOOD_TEST_RESULT_LEN, GFP_KERNEL); in sof_ipc_flood_probe()
314 if (!priv->buf) in sof_ipc_flood_probe()
315 return -ENOMEM; in sof_ipc_flood_probe()
317 cdev->data = priv; in sof_ipc_flood_probe()
320 priv->dfs_root = debugfs_create_dir(dev_name(dev), debugfs_root); in sof_ipc_flood_probe()
321 if (!IS_ERR_OR_NULL(priv->dfs_root)) { in sof_ipc_flood_probe()
322 /* create read-write ipc_flood_count debugfs entry */ in sof_ipc_flood_probe()
323 debugfs_create_file(DEBUGFS_IPC_FLOOD_COUNT, 0644, priv->dfs_root, in sof_ipc_flood_probe()
326 /* create read-write ipc_flood_duration_ms debugfs entry */ in sof_ipc_flood_probe()
328 priv->dfs_root, cdev, &sof_ipc_flood_fops); in sof_ipc_flood_probe()
330 if (auxdev->id == 0) { in sof_ipc_flood_probe()
339 priv->dfs_link[0] = in sof_ipc_flood_probe()
345 priv->dfs_link[1] = in sof_ipc_flood_probe()
364 struct sof_ipc_flood_priv *priv = cdev->data; in sof_ipc_flood_remove()
366 pm_runtime_disable(&auxdev->dev); in sof_ipc_flood_remove()
368 if (auxdev->id == 0) { in sof_ipc_flood_remove()
369 debugfs_remove(priv->dfs_link[0]); in sof_ipc_flood_remove()
370 debugfs_remove(priv->dfs_link[1]); in sof_ipc_flood_remove()
373 debugfs_remove_recursive(priv->dfs_root); in sof_ipc_flood_remove()
384 * type are enough to ensure that the parent SOF device resumes to bring the DSP
386 * Driver name will be set based on KBUILD_MODNAME.