From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V6 3/3] firmware: imx: add misc svc support
Date: Wed, 19 Sep 2018 22:21:24 +0200 [thread overview]
Message-ID: <20180919202124.GR4097@pengutronix.de> (raw)
In-Reply-To: <1537326246-28558-4-git-send-email-aisheng.dong@nxp.com>
On Wed, Sep 19, 2018 at 11:04:06AM +0800, Dong Aisheng wrote:
> +enum misc_func_e {
> + MISC_FUNC_UNKNOWN = 0,
> + MISC_FUNC_SET_CONTROL = 1,
> + MISC_FUNC_GET_CONTROL = 2,
> + MISC_FUNC_SET_MAX_DMA_GROUP = 4,
> + MISC_FUNC_SET_DMA_GROUP = 5,
> + MISC_FUNC_SECO_IMAGE_LOAD = 8,
> + MISC_FUNC_SECO_AUTHENTICATE = 9,
> + MISC_FUNC_DEBUG_OUT = 10,
> + MISC_FUNC_WAVEFORM_CAPTURE = 6,
> + MISC_FUNC_BUILD_INFO = 15,
> + MISC_FUNC_UNIQUE_ID = 19,
> + MISC_FUNC_SET_ARI = 3,
> + MISC_FUNC_BOOT_STATUS = 7,
> + MISC_FUNC_BOOT_DONE = 14,
> + MISC_FUNC_OTP_FUSE_READ = 11,
> + MISC_FUNC_OTP_FUSE_WRITE = 17,
> + MISC_FUNC_SET_TEMP = 12,
> + MISC_FUNC_GET_TEMP = 13,
> + MISC_FUNC_GET_BOOT_DEV = 16,
> + MISC_FUNC_GET_BUTTON_STATUS = 18,
> +};
Shouldn't that be in some header file? Some types seem to be used by
other drivers, MISC_FUNC_OTP_FUSE_READ for example.
> +sc_err_t sc_misc_set_control(struct sc_ipc *ipc, sc_rsrc_t resource,
> + sc_ctrl_t ctrl, uint32_t val)
> +{
> + struct imx_sc_msg_req_misc_set_ctrl msg;
> + struct sc_rpc_msg *hdr = &msg.hdr;
> + int ret;
> +
> + hdr->ver = SC_RPC_VERSION;
> + hdr->svc = (uint8_t)SC_RPC_SVC_MISC;
> + hdr->func = (uint8_t)MISC_FUNC_SET_CONTROL;
> + hdr->size = 4;
> +
> + msg.ctrl = ctrl;
> + msg.val = val;
> + msg.resource = resource;
> +
> + ret = sc_call_rpc(ipc, (void *)&msg, false);
No need to cast to void *.
> +/*
> + * This function sets a miscellaneous control value.
> + *
> + * @param[in] ipc IPC handle
> + * @param[in] resource resource the control is associated with
> + * @param[in] ctrl control to change
> + * @param[in] val value to apply to the control
> + *
> + * @return Returns an error code (SC_ERR_NONE = success).
> + *
> + * Return errors:
> + * - SC_PARM if arguments out of range or invalid,
> + * - SC_ERR_NOACCESS if caller's partition is not the resource owner or parent
> + * of the owner
> + */
The function description should be over the function definition, not
above the declaration.
Also I think kerneldoc is preferred here.
Not sure how useful the description of the returned errors is. For once
SC_ERR_FAIL is missing and then the names are quite self explanatory.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2018-09-19 20:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-19 3:04 [PATCH V6 0/3] soc: imx: add scu firmware api support Dong Aisheng
2018-09-19 3:04 ` [PATCH V6 1/3] dt-bindings: arm: fsl: add scu binding doc Dong Aisheng
2018-09-19 3:04 ` [PATCH V6 2/3] firmware: imx: add SCU firmware driver support Dong Aisheng
2018-09-19 19:41 ` Sascha Hauer
2018-09-20 2:27 ` A.s. Dong
2018-09-20 6:33 ` Sascha Hauer
2018-09-20 6:41 ` A.s. Dong
2018-09-20 6:52 ` Sascha Hauer
2018-09-20 6:58 ` A.s. Dong
2018-09-19 3:04 ` [PATCH V6 3/3] firmware: imx: add misc svc support Dong Aisheng
2018-09-19 20:21 ` Sascha Hauer [this message]
2018-09-20 2:46 ` A.s. Dong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180919202124.GR4097@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).