remoteproc: pru: Add APIs to get and put the PRU cores
authorMD Danish Anwar <danishanwar@ti.com>
Fri, 6 Jan 2023 12:10:43 +0000 (17:40 +0530)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Fri, 6 Jan 2023 16:14:22 +0000 (09:14 -0700)
commit919e8942548aa878d374b1b51aa68fdf751f18b8
tree93ee41fcd0eeb366ec72084abc4ac42e71235ece
parent9b9ad70f28675c45ef93cfb6e4af9403cb7bd34c
remoteproc: pru: Add APIs to get and put the PRU cores

Add two new APIs, pru_rproc_get() and pru_rproc_put(), to the PRU
driver to allow client drivers to acquire and release the remoteproc
device associated with a PRU core. The PRU cores are treated as
resources with only one client owning it at a time.

The pru_rproc_get() function returns the rproc handle corresponding
to a PRU core identified by the device tree "ti,prus" property under
the client node. The pru_rproc_put() is the complementary function
to pru_rproc_get().

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Link: https://lore.kernel.org/r/20230106121046.886863-4-danishanwar@ti.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/remoteproc/pru_rproc.c
include/linux/remoteproc/pruss.h