Commit 31a839f81972034cae66fdc914a52f36ec489c00
Committed by
Patrick Delaunay
1 parent
641067fb0c
Exists in
smarc_8mq_lf_v2020.04
and in
9 other branches
remoteproc: fix function headers
Add full function comment headers. Fix rproc_is_initialized() return value description. Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Showing 1 changed file with 68 additions and 36 deletions Side-by-side Diff
include/remoteproc.h
... | ... | @@ -45,32 +45,73 @@ |
45 | 45 | }; |
46 | 46 | |
47 | 47 | /** |
48 | - * struct dm_rproc_ops - Operations that are provided by remote proc driver | |
49 | - * @init: Initialize the remoteproc device invoked after probe (optional) | |
50 | - * Return 0 on success, -ve error on fail | |
51 | - * @load: Load the remoteproc device using data provided(mandatory) | |
52 | - * This takes the following additional arguments. | |
53 | - * addr- Address of the binary image to be loaded | |
54 | - * size- Size of the binary image to be loaded | |
55 | - * Return 0 on success, -ve error on fail | |
56 | - * @start: Start the remoteproc device (mandatory) | |
57 | - * Return 0 on success, -ve error on fail | |
58 | - * @stop: Stop the remoteproc device (optional) | |
59 | - * Return 0 on success, -ve error on fail | |
60 | - * @reset: Reset the remote proc device (optional) | |
61 | - * Return 0 on success, -ve error on fail | |
62 | - * @is_running: Check if the remote processor is running(optional) | |
63 | - * Return 0 on success, 1 if not running, -ve on others errors | |
64 | - * @ping: Ping the remote device for basic communication check(optional) | |
65 | - * Return 0 on success, 1 if not responding, -ve on other errors | |
48 | + * struct dm_rproc_ops - Driver model remote proc operations. | |
49 | + * | |
50 | + * This defines the operations provided by remote proc driver. | |
66 | 51 | */ |
67 | 52 | struct dm_rproc_ops { |
53 | + /** | |
54 | + * init() - Initialize the remoteproc device (optional) | |
55 | + * | |
56 | + * This is called after the probe is completed allowing the remote | |
57 | + * processor drivers to split up the initializations between probe and | |
58 | + * init if needed. | |
59 | + * | |
60 | + * @dev: Remote proc device | |
61 | + * @return 0 if all ok, else appropriate error value. | |
62 | + */ | |
68 | 63 | int (*init)(struct udevice *dev); |
64 | + | |
65 | + /** | |
66 | + * load() - Load the remoteproc device using data provided (mandatory) | |
67 | + * | |
68 | + * Load the remoteproc device with an image, do not start the device. | |
69 | + * | |
70 | + * @dev: Remote proc device | |
71 | + * @addr: Address of the image to be loaded | |
72 | + * @size: Size of the image to be loaded | |
73 | + * @return 0 if all ok, else appropriate error value. | |
74 | + */ | |
69 | 75 | int (*load)(struct udevice *dev, ulong addr, ulong size); |
76 | + | |
77 | + /** | |
78 | + * start() - Start the remoteproc device (mandatory) | |
79 | + * | |
80 | + * @dev: Remote proc device | |
81 | + * @return 0 if all ok, else appropriate error value. | |
82 | + */ | |
70 | 83 | int (*start)(struct udevice *dev); |
84 | + | |
85 | + /** | |
86 | + * stop() - Stop the remoteproc device (optional) | |
87 | + * | |
88 | + * @dev: Remote proc device | |
89 | + * @return 0 if all ok, else appropriate error value. | |
90 | + */ | |
71 | 91 | int (*stop)(struct udevice *dev); |
92 | + | |
93 | + /** | |
94 | + * reset() - Reset the remoteproc device (optional) | |
95 | + * | |
96 | + * @dev: Remote proc device | |
97 | + * @return 0 if all ok, else appropriate error value. | |
98 | + */ | |
72 | 99 | int (*reset)(struct udevice *dev); |
100 | + | |
101 | + /** | |
102 | + * is_running() - Check if the remote processor is running (optional) | |
103 | + * | |
104 | + * @dev: Remote proc device | |
105 | + * @return 0 if running, 1 if not running, -ve on error. | |
106 | + */ | |
73 | 107 | int (*is_running)(struct udevice *dev); |
108 | + | |
109 | + /** | |
110 | + * ping() - Ping the remote device for basic communication (optional) | |
111 | + * | |
112 | + * @dev: Remote proc device | |
113 | + * @return 0 on success, 1 if not responding, -ve on other errors. | |
114 | + */ | |
74 | 115 | int (*ping)(struct udevice *dev); |
75 | 116 | }; |
76 | 117 | |
77 | 118 | |
78 | 119 | |
... | ... | @@ -80,23 +121,20 @@ |
80 | 121 | #ifdef CONFIG_REMOTEPROC |
81 | 122 | /** |
82 | 123 | * rproc_init() - Initialize all bound remote proc devices |
83 | - * | |
84 | - * Return: 0 if all ok, else appropriate error value. | |
124 | + * @return 0 if all ok, else appropriate error value. | |
85 | 125 | */ |
86 | 126 | int rproc_init(void); |
87 | 127 | |
88 | 128 | /** |
89 | 129 | * rproc_dev_init() - Initialize a remote proc device based on id |
90 | 130 | * @id: id of the remote processor |
91 | - * | |
92 | - * Return: 0 if all ok, else appropriate error value. | |
131 | + * @return 0 if all ok, else appropriate error value. | |
93 | 132 | */ |
94 | 133 | int rproc_dev_init(int id); |
95 | 134 | |
96 | 135 | /** |
97 | 136 | * rproc_is_initialized() - check to see if remoteproc devices are initialized |
98 | - * | |
99 | - * Return: 0 if all devices are initialized, else appropriate error value. | |
137 | + * @return true if all devices are initialized, false otherwise. | |
100 | 138 | */ |
101 | 139 | bool rproc_is_initialized(void); |
102 | 140 | |
103 | 141 | |
104 | 142 | |
105 | 143 | |
106 | 144 | |
107 | 145 | |
108 | 146 | |
109 | 147 | |
... | ... | @@ -105,55 +143,49 @@ |
105 | 143 | * @id: id of the remote processor |
106 | 144 | * @addr: address in memory where the binary image is located |
107 | 145 | * @size: size of the binary image |
108 | - * | |
109 | - * Return: 0 if all ok, else appropriate error value. | |
146 | + * @return 0 if all ok, else appropriate error value. | |
110 | 147 | */ |
111 | 148 | int rproc_load(int id, ulong addr, ulong size); |
112 | 149 | |
113 | 150 | /** |
114 | 151 | * rproc_start() - Start a remote processor |
115 | 152 | * @id: id of the remote processor |
116 | - * | |
117 | - * Return: 0 if all ok, else appropriate error value. | |
153 | + * @return 0 if all ok, else appropriate error value. | |
118 | 154 | */ |
119 | 155 | int rproc_start(int id); |
120 | 156 | |
121 | 157 | /** |
122 | 158 | * rproc_stop() - Stop a remote processor |
123 | 159 | * @id: id of the remote processor |
124 | - * | |
125 | - * Return: 0 if all ok, else appropriate error value. | |
160 | + * @return 0 if all ok, else appropriate error value. | |
126 | 161 | */ |
127 | 162 | int rproc_stop(int id); |
128 | 163 | |
129 | 164 | /** |
130 | 165 | * rproc_reset() - reset a remote processor |
131 | 166 | * @id: id of the remote processor |
132 | - * | |
133 | - * Return: 0 if all ok, else appropriate error value. | |
167 | + * @return 0 if all ok, else appropriate error value. | |
134 | 168 | */ |
135 | 169 | int rproc_reset(int id); |
136 | 170 | |
137 | 171 | /** |
138 | 172 | * rproc_ping() - ping a remote processor to check if it can communicate |
139 | 173 | * @id: id of the remote processor |
174 | + * @return 0 if all ok, else appropriate error value. | |
140 | 175 | * |
141 | 176 | * NOTE: this might need communication path available, which is not implemented |
142 | 177 | * as part of remoteproc framework - hook on to appropriate bus architecture to |
143 | 178 | * do the same |
144 | - * | |
145 | - * Return: 0 if all ok, else appropriate error value. | |
146 | 179 | */ |
147 | 180 | int rproc_ping(int id); |
148 | 181 | |
149 | 182 | /** |
150 | 183 | * rproc_is_running() - check to see if remote processor is running |
151 | 184 | * @id: id of the remote processor |
185 | + * @return 0 if running, 1 if not running, -ve on error. | |
152 | 186 | * |
153 | 187 | * NOTE: this may not involve actual communication capability of the remote |
154 | 188 | * processor, but just ensures that it is out of reset and executing code. |
155 | - * | |
156 | - * Return: 0 if all ok, else appropriate error value. | |
157 | 189 | */ |
158 | 190 | int rproc_is_running(int id); |
159 | 191 | #else |