mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-19 10:44:14 +08:00
remoteproc: core: Register the character device interface
Add the character device during rproc_add. This would create a character device node at /dev/remoteproc<index>. Userspace applications can interact with the remote processor using this interface. Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> Link: https://lore.kernel.org/r/1596044401-22083-3-git-send-email-sidgup@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
parent
4476770881
commit
62b8f9e993
@ -1986,6 +1986,11 @@ int rproc_add(struct rproc *rproc)
|
|||||||
/* create debugfs entries */
|
/* create debugfs entries */
|
||||||
rproc_create_debug_dir(rproc);
|
rproc_create_debug_dir(rproc);
|
||||||
|
|
||||||
|
/* add char device for this remoteproc */
|
||||||
|
ret = rproc_char_device_add(rproc);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remind ourselves the remote processor has been attached to rather
|
* Remind ourselves the remote processor has been attached to rather
|
||||||
* than booted by the remoteproc core. This is important because the
|
* than booted by the remoteproc core. This is important because the
|
||||||
@ -2262,6 +2267,7 @@ int rproc_del(struct rproc *rproc)
|
|||||||
mutex_unlock(&rproc->lock);
|
mutex_unlock(&rproc->lock);
|
||||||
|
|
||||||
rproc_delete_debug_dir(rproc);
|
rproc_delete_debug_dir(rproc);
|
||||||
|
rproc_char_device_remove(rproc);
|
||||||
|
|
||||||
/* the rproc is downref'ed as soon as it's removed from the klist */
|
/* the rproc is downref'ed as soon as it's removed from the klist */
|
||||||
mutex_lock(&rproc_list_mutex);
|
mutex_lock(&rproc_list_mutex);
|
||||||
@ -2430,6 +2436,7 @@ static int __init remoteproc_init(void)
|
|||||||
{
|
{
|
||||||
rproc_init_sysfs();
|
rproc_init_sysfs();
|
||||||
rproc_init_debugfs();
|
rproc_init_debugfs();
|
||||||
|
rproc_init_cdev();
|
||||||
rproc_init_panic();
|
rproc_init_panic();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user