Skip to content

Commit 60d7275

Browse files
committed
ASoC: SOF: ipc-test: Register SOF client driver
Create and register the SOF IPC test client driver. The client ops are dummy placeholders atm. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent 8bcc1f3 commit 60d7275

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

sound/soc/sof/sof-ipc-test.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,36 @@
99
#include <linux/module.h>
1010
#include <linux/pm_runtime.h>
1111
#include <linux/virtual_bus.h>
12+
#include "sof-client.h"
1213

1314
#define SOF_IPC_CLIENT_SUSPEND_DELAY_MS 3000
1415

16+
static int sof_ipc_client_probe(struct sof_client_dev *cdev)
17+
{
18+
dev_dbg(cdev->dev, "SOF client probing\n");
19+
return 0;
20+
}
21+
22+
struct sof_client_ops sof_ipc_client_ops = {
23+
.probe = sof_ipc_client_probe,
24+
};
25+
26+
static const struct sof_client_drv sof_ipc_test_client_drv = {
27+
.name = "sof-ipc-test-client",
28+
.type = SOF_CLIENT_IPC,
29+
.ops = &sof_ipc_client_ops,
30+
};
31+
1532
static int sof_ipc_test_probe(struct virtbus_device *vdev)
1633
{
17-
dev_dbg(&vdev->dev, "probing %s\n", vdev->name);
34+
int ret;
35+
36+
ret = sof_client_drv_register(&vdev->dev, &sof_ipc_test_client_drv);
37+
if (ret < 0) {
38+
dev_err(&vdev->dev, "error: registering SOF client drv %s\n",
39+
sof_ipc_test_client_drv.name);
40+
return ret;
41+
}
1842

1943
/* enable runtime PM */
2044
pm_runtime_set_autosuspend_delay(&vdev->dev,
@@ -24,11 +48,12 @@ static int sof_ipc_test_probe(struct virtbus_device *vdev)
2448
pm_runtime_mark_last_busy(&vdev->dev);
2549
pm_runtime_put_autosuspend(&vdev->dev);
2650

27-
return 0;
51+
return ret;
2852
}
2953

3054
static int sof_ipc_test_remove(struct virtbus_device *vdev)
3155
{
56+
sof_client_drv_unregister(&sof_ipc_test_client_drv);
3257
return 0;
3358
}
3459

@@ -74,4 +99,5 @@ module_exit(sof_ipc_test_exit_module);
7499

75100
MODULE_DESCRIPTION("SOF IPC Test Virtual Bus Driver");
76101
MODULE_LICENSE("Dual BSD/GPL");
102+
MODULE_IMPORT_NS(SND_SOC_SOF_CLIENT);
77103
MODULE_ALIAS("virtbus:sof-ipc-test-drv");

0 commit comments

Comments
 (0)