aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2018-05-09 12:52:06 -0400
committerSudeep Holla <sudeep.holla@arm.com>2018-05-09 12:52:06 -0400
commit1baf47c2e5c946fd17ef07597b9d25722d13ff14 (patch)
tree0184e819b88b19cd5c092758d0dbe85a9ae51aa1
parent354b2e36d7dea9f5d67945498bbbf65551d72e15 (diff)
firmware: arm_scmi: fix kernel-docs documentation
There are few missing descriptions for function parameters and structure members along with certain instances where excessive function parameters or structure members are described. This patch fixes all of those warnings. Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
-rw-r--r--drivers/firmware/arm_scmi/base.c20
-rw-r--r--drivers/firmware/arm_scmi/common.h7
-rw-r--r--drivers/firmware/arm_scmi/driver.c45
-rw-r--r--include/linux/scmi_protocol.h8
4 files changed, 48 insertions, 32 deletions
diff --git a/drivers/firmware/arm_scmi/base.c b/drivers/firmware/arm_scmi/base.c
index 0d3806c0d432..c36ded9dbb83 100644
--- a/drivers/firmware/arm_scmi/base.c
+++ b/drivers/firmware/arm_scmi/base.c
@@ -26,7 +26,7 @@ struct scmi_msg_resp_base_attributes {
26 * scmi_base_attributes_get() - gets the implementation details 26 * scmi_base_attributes_get() - gets the implementation details
27 * that are associated with the base protocol. 27 * that are associated with the base protocol.
28 * 28 *
29 * @handle - SCMI entity handle 29 * @handle: SCMI entity handle
30 * 30 *
31 * Return: 0 on success, else appropriate SCMI error. 31 * Return: 0 on success, else appropriate SCMI error.
32 */ 32 */
@@ -50,14 +50,15 @@ static int scmi_base_attributes_get(const struct scmi_handle *handle)
50 } 50 }
51 51
52 scmi_one_xfer_put(handle, t); 52 scmi_one_xfer_put(handle, t);
53
53 return ret; 54 return ret;
54} 55}
55 56
56/** 57/**
57 * scmi_base_vendor_id_get() - gets vendor/subvendor identifier ASCII string. 58 * scmi_base_vendor_id_get() - gets vendor/subvendor identifier ASCII string.
58 * 59 *
59 * @handle - SCMI entity handle 60 * @handle: SCMI entity handle
60 * @sub_vendor - specify true if sub-vendor ID is needed 61 * @sub_vendor: specify true if sub-vendor ID is needed
61 * 62 *
62 * Return: 0 on success, else appropriate SCMI error. 63 * Return: 0 on success, else appropriate SCMI error.
63 */ 64 */
@@ -97,7 +98,7 @@ scmi_base_vendor_id_get(const struct scmi_handle *handle, bool sub_vendor)
97 * implementation 32-bit version. The format of the version number is 98 * implementation 32-bit version. The format of the version number is
98 * vendor-specific 99 * vendor-specific
99 * 100 *
100 * @handle - SCMI entity handle 101 * @handle: SCMI entity handle
101 * 102 *
102 * Return: 0 on success, else appropriate SCMI error. 103 * Return: 0 on success, else appropriate SCMI error.
103 */ 104 */
@@ -128,8 +129,8 @@ scmi_base_implementation_version_get(const struct scmi_handle *handle)
128 * scmi_base_implementation_list_get() - gets the list of protocols it is 129 * scmi_base_implementation_list_get() - gets the list of protocols it is
129 * OSPM is allowed to access 130 * OSPM is allowed to access
130 * 131 *
131 * @handle - SCMI entity handle 132 * @handle: SCMI entity handle
132 * @protocols_imp - pointer to hold the list of protocol identifiers 133 * @protocols_imp: pointer to hold the list of protocol identifiers
133 * 134 *
134 * Return: 0 on success, else appropriate SCMI error. 135 * Return: 0 on success, else appropriate SCMI error.
135 */ 136 */
@@ -173,15 +174,16 @@ static int scmi_base_implementation_list_get(const struct scmi_handle *handle,
173 } while (loop_num_ret); 174 } while (loop_num_ret);
174 175
175 scmi_one_xfer_put(handle, t); 176 scmi_one_xfer_put(handle, t);
177
176 return ret; 178 return ret;
177} 179}
178 180
179/** 181/**
180 * scmi_base_discover_agent_get() - discover the name of an agent 182 * scmi_base_discover_agent_get() - discover the name of an agent
181 * 183 *
182 * @handle - SCMI entity handle 184 * @handle: SCMI entity handle
183 * @id - Agent identifier 185 * @id: Agent identifier
184 * @name - Agent identifier ASCII string 186 * @name: Agent identifier ASCII string
185 * 187 *
186 * An agent id of 0 is reserved to identify the platform itself. 188 * An agent id of 0 is reserved to identify the platform itself.
187 * Generally operating system is represented as "OSPM" 189 * Generally operating system is represented as "OSPM"
diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
index e8f332c9c469..0821662a4633 100644
--- a/drivers/firmware/arm_scmi/common.h
+++ b/drivers/firmware/arm_scmi/common.h
@@ -51,8 +51,11 @@ struct scmi_msg_resp_prot_version {
51 * @id: The identifier of the command being sent 51 * @id: The identifier of the command being sent
52 * @protocol_id: The identifier of the protocol used to send @id command 52 * @protocol_id: The identifier of the protocol used to send @id command
53 * @seq: The token to identify the message. when a message/command returns, 53 * @seq: The token to identify the message. when a message/command returns,
54 * the platform returns the whole message header unmodified including 54 * the platform returns the whole message header unmodified including
55 * the token. 55 * the token
56 * @status: Status of the transfer once it's complete
57 * @poll_completion: Indicate if the transfer needs to be polled for
58 * completion or interrupt mode is used
56 */ 59 */
57struct scmi_msg_hdr { 60struct scmi_msg_hdr {
58 u8 id; 61 u8 id;
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 917786d91f55..6fee11f06a66 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -51,7 +51,7 @@ enum scmi_error_codes {
51 SCMI_ERR_MAX 51 SCMI_ERR_MAX
52}; 52};
53 53
54/* List of all SCMI devices active in system */ 54/* List of all SCMI devices active in system */
55static LIST_HEAD(scmi_list); 55static LIST_HEAD(scmi_list);
56/* Protection for the entire list */ 56/* Protection for the entire list */
57static DEFINE_MUTEX(scmi_list_mutex); 57static DEFINE_MUTEX(scmi_list_mutex);
@@ -68,7 +68,6 @@ static DEFINE_MUTEX(scmi_list_mutex);
68struct scmi_xfers_info { 68struct scmi_xfers_info {
69 struct scmi_xfer *xfer_block; 69 struct scmi_xfer *xfer_block;
70 unsigned long *xfer_alloc_table; 70 unsigned long *xfer_alloc_table;
71 /* protect transfer allocation */
72 spinlock_t xfer_lock; 71 spinlock_t xfer_lock;
73}; 72};
74 73
@@ -94,6 +93,7 @@ struct scmi_desc {
94 * @payload: Transmit/Receive mailbox channel payload area 93 * @payload: Transmit/Receive mailbox channel payload area
95 * @dev: Reference to device in the SCMI hierarchy corresponding to this 94 * @dev: Reference to device in the SCMI hierarchy corresponding to this
96 * channel 95 * channel
96 * @handle: Pointer to SCMI entity handle
97 */ 97 */
98struct scmi_chan_info { 98struct scmi_chan_info {
99 struct mbox_client cl; 99 struct mbox_client cl;
@@ -104,7 +104,7 @@ struct scmi_chan_info {
104}; 104};
105 105
106/** 106/**
107 * struct scmi_info - Structure representing a SCMI instance 107 * struct scmi_info - Structure representing a SCMI instance
108 * 108 *
109 * @dev: Device pointer 109 * @dev: Device pointer
110 * @desc: SoC description for this instance 110 * @desc: SoC description for this instance
@@ -113,9 +113,9 @@ struct scmi_chan_info {
113 * implementation version and (sub-)vendor identification. 113 * implementation version and (sub-)vendor identification.
114 * @minfo: Message info 114 * @minfo: Message info
115 * @tx_idr: IDR object to map protocol id to channel info pointer 115 * @tx_idr: IDR object to map protocol id to channel info pointer
116 * @protocols_imp: list of protocols implemented, currently maximum of 116 * @protocols_imp: List of protocols implemented, currently maximum of
117 * MAX_PROTOCOLS_IMP elements allocated by the base protocol 117 * MAX_PROTOCOLS_IMP elements allocated by the base protocol
118 * @node: list head 118 * @node: List head
119 * @users: Number of users of this instance 119 * @users: Number of users of this instance
120 */ 120 */
121struct scmi_info { 121struct scmi_info {
@@ -221,9 +221,7 @@ static void scmi_rx_callback(struct mbox_client *cl, void *m)
221 221
222 xfer_id = MSG_XTRACT_TOKEN(ioread32(&mem->msg_header)); 222 xfer_id = MSG_XTRACT_TOKEN(ioread32(&mem->msg_header));
223 223
224 /* 224 /* Are we even expecting this? */
225 * Are we even expecting this?
226 */
227 if (!test_bit(xfer_id, minfo->xfer_alloc_table)) { 225 if (!test_bit(xfer_id, minfo->xfer_alloc_table)) {
228 dev_err(dev, "message for %d is not expected!\n", xfer_id); 226 dev_err(dev, "message for %d is not expected!\n", xfer_id);
229 return; 227 return;
@@ -248,6 +246,8 @@ static void scmi_rx_callback(struct mbox_client *cl, void *m)
248 * 246 *
249 * @hdr: pointer to header containing all the information on message id, 247 * @hdr: pointer to header containing all the information on message id,
250 * protocol id and sequence id. 248 * protocol id and sequence id.
249 *
250 * Return: 32-bit packed command header to be sent to the platform.
251 */ 251 */
252static inline u32 pack_scmi_header(struct scmi_msg_hdr *hdr) 252static inline u32 pack_scmi_header(struct scmi_msg_hdr *hdr)
253{ 253{
@@ -282,9 +282,9 @@ static void scmi_tx_prepare(struct mbox_client *cl, void *m)
282} 282}
283 283
284/** 284/**
285 * scmi_one_xfer_get() - Allocate one message 285 * scmi_xfer_get() - Allocate one message
286 * 286 *
287 * @handle: SCMI entity handle 287 * @handle: Pointer to SCMI entity handle
288 * 288 *
289 * Helper function which is used by various command functions that are 289 * Helper function which is used by various command functions that are
290 * exposed to clients of this driver for allocating a message traffic event. 290 * exposed to clients of this driver for allocating a message traffic event.
@@ -326,8 +326,8 @@ static struct scmi_xfer *scmi_one_xfer_get(const struct scmi_handle *handle)
326/** 326/**
327 * scmi_one_xfer_put() - Release a message 327 * scmi_one_xfer_put() - Release a message
328 * 328 *
329 * @minfo: transfer info pointer 329 * @handle: Pointer to SCMI entity handle
330 * @xfer: message that was reserved by scmi_one_xfer_get 330 * @xfer: message that was reserved by scmi_xfer_get
331 * 331 *
332 * This holds a spinlock to maintain integrity of internal data structures. 332 * This holds a spinlock to maintain integrity of internal data structures.
333 */ 333 */
@@ -374,12 +374,12 @@ static bool scmi_xfer_done_no_timeout(const struct scmi_chan_info *cinfo,
374/** 374/**
375 * scmi_do_xfer() - Do one transfer 375 * scmi_do_xfer() - Do one transfer
376 * 376 *
377 * @info: Pointer to SCMI entity information 377 * @handle: Pointer to SCMI entity handle
378 * @xfer: Transfer to initiate and wait for response 378 * @xfer: Transfer to initiate and wait for response
379 * 379 *
380 * Return: -ETIMEDOUT in case of no response, if transmit error, 380 * Return: -ETIMEDOUT in case of no response, if transmit error,
381 * return corresponding error, else if all goes well, 381 * return corresponding error, else if all goes well,
382 * return 0. 382 * return 0.
383 */ 383 */
384int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer) 384int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer)
385{ 385{
@@ -438,9 +438,9 @@ int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer)
438/** 438/**
439 * scmi_one_xfer_init() - Allocate and initialise one message 439 * scmi_one_xfer_init() - Allocate and initialise one message
440 * 440 *
441 * @handle: SCMI entity handle 441 * @handle: Pointer to SCMI entity handle
442 * @msg_id: Message identifier 442 * @msg_id: Message identifier
443 * @msg_prot_id: Protocol identifier for the message 443 * @prot_id: Protocol identifier for the message
444 * @tx_size: transmit message size 444 * @tx_size: transmit message size
445 * @rx_size: receive message size 445 * @rx_size: receive message size
446 * @p: pointer to the allocated and initialised message 446 * @p: pointer to the allocated and initialised message
@@ -478,13 +478,16 @@ int scmi_one_xfer_init(const struct scmi_handle *handle, u8 msg_id, u8 prot_id,
478 xfer->hdr.poll_completion = false; 478 xfer->hdr.poll_completion = false;
479 479
480 *p = xfer; 480 *p = xfer;
481
481 return 0; 482 return 0;
482} 483}
483 484
484/** 485/**
485 * scmi_version_get() - command to get the revision of the SCMI entity 486 * scmi_version_get() - command to get the revision of the SCMI entity
486 * 487 *
487 * @handle: Handle to SCMI entity information 488 * @handle: Pointer to SCMI entity handle
489 * @protocol: Protocol identifier for the message
490 * @version: Holds returned version of protocol.
488 * 491 *
489 * Updates the SCMI information in the internal data structure. 492 * Updates the SCMI information in the internal data structure.
490 * 493 *
@@ -541,7 +544,7 @@ scmi_is_protocol_implemented(const struct scmi_handle *handle, u8 prot_id)
541 * @dev: pointer to device for which we want SCMI handle 544 * @dev: pointer to device for which we want SCMI handle
542 * 545 *
543 * NOTE: The function does not track individual clients of the framework 546 * NOTE: The function does not track individual clients of the framework
544 * and is expected to be maintained by caller of SCMI protocol library. 547 * and is expected to be maintained by caller of SCMI protocol library.
545 * scmi_handle_put must be balanced with successful scmi_handle_get 548 * scmi_handle_put must be balanced with successful scmi_handle_get
546 * 549 *
547 * Return: pointer to handle if successful, NULL on error 550 * Return: pointer to handle if successful, NULL on error
@@ -572,7 +575,7 @@ struct scmi_handle *scmi_handle_get(struct device *dev)
572 * @handle: handle acquired by scmi_handle_get 575 * @handle: handle acquired by scmi_handle_get
573 * 576 *
574 * NOTE: The function does not track individual clients of the framework 577 * NOTE: The function does not track individual clients of the framework
575 * and is expected to be maintained by caller of SCMI protocol library. 578 * and is expected to be maintained by caller of SCMI protocol library.
576 * scmi_handle_put must be balanced with successful scmi_handle_get 579 * scmi_handle_put must be balanced with successful scmi_handle_get
577 * 580 *
578 * Return: 0 is successfully released 581 * Return: 0 is successfully released
@@ -595,7 +598,7 @@ int scmi_handle_put(const struct scmi_handle *handle)
595} 598}
596 599
597static const struct scmi_desc scmi_generic_desc = { 600static const struct scmi_desc scmi_generic_desc = {
598 .max_rx_timeout_ms = 30, /* we may increase this if required */ 601 .max_rx_timeout_ms = 30, /* We may increase this if required */
599 .max_msg = 20, /* Limited by MBOX_TX_QUEUE_LEN */ 602 .max_msg = 20, /* Limited by MBOX_TX_QUEUE_LEN */
600 .max_msg_size = 128, 603 .max_msg_size = 128,
601}; 604};
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index b458c87b866c..a171c1e293e8 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -189,6 +189,14 @@ struct scmi_sensor_ops {
189 * @perf_ops: pointer to set of performance protocol operations 189 * @perf_ops: pointer to set of performance protocol operations
190 * @clk_ops: pointer to set of clock protocol operations 190 * @clk_ops: pointer to set of clock protocol operations
191 * @sensor_ops: pointer to set of sensor protocol operations 191 * @sensor_ops: pointer to set of sensor protocol operations
192 * @perf_priv: pointer to private data structure specific to performance
193 * protocol(for internal use only)
194 * @clk_priv: pointer to private data structure specific to clock
195 * protocol(for internal use only)
196 * @power_priv: pointer to private data structure specific to power
197 * protocol(for internal use only)
198 * @sensor_priv: pointer to private data structure specific to sensors
199 * protocol(for internal use only)
192 */ 200 */
193struct scmi_handle { 201struct scmi_handle {
194 struct device *dev; 202 struct device *dev;