<html><body><p>
<pre>
Hi, Shu-hsiang:

On Wed, 2024-10-09 at 19:15 +0800, Shu-hsiang Yang wrote:
> Introduces the driver of the MediaTek Sensor Interface,
> focusing on integration with the MediaTek ISP CAMSYS. The
> seninf device bridges camera sensors and the ISP system,
> providing management for sensor data routing and processing.
> Key features include V4L2 framework control, and dynamic
> handling of stream configurations and virtual channels.
>
> Signed-off-by: Shu-hsiang Yang <Shu-hsiang.Yang@mediatek.com>
> ---

[snip]

> +static ssize_t debug_ops_show(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{

Separate debug related code to debug patch.

> +int len = 0;
> +
> +len += snprintf(buf + len, PAGE_SIZE - len, "This is debug ops message\n");
> +
> +return len;
> +}
> +
> +enum REG_OPS_CMD {
> +REG_OPS_CMD_ID,
> +REG_OPS_CMD_CSI,
> +REG_OPS_CMD_RG,
> +REG_OPS_CMD_VAL,
> +REG_OPS_CMD_MAX_NUM,
> +};
> +
> +static ssize_t debug_ops_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count)
> +{

Ditto.

Regards,
CK

> +char delim[] = " ";
> +char csi_names[20];
> +char *token = NULL;
> +char *sbuf = kcalloc(count + 1, sizeof(char), GFP_KERNEL);
> +char *s = sbuf;
> +int ret;
> +char *arg[REG_OPS_CMD_MAX_NUM];
> +struct seninf_core *core = dev_get_drvdata(dev);
> +struct seninf_ctx *ctx;
> +int csi_port = -1;
> +int rg_idx = -1;
> +u32 val, i, num_para = 0;
> +
> +if (!sbuf)
> +goto ERR_DEBUG_OPS_STORE;
> +
> +memcpy(sbuf, buf, count);
> +
> +token = strsep(&s, delim);
> +while (token && num_para < REG_OPS_CMD_MAX_NUM) {
> +if (strlen(token)) {
> +arg[num_para] = token;
> +num_para++;
> +}
> +
> +token = strsep(&s, delim);
> +}
> +
> +if (num_para != REG_OPS_CMD_MAX_NUM) {
> +dev_info(dev, "Wrong command parameter number\n");
> +goto ERR_DEBUG_OPS_STORE;
> +}
> +
> +if (strncmp("SET_REG", arg[REG_OPS_CMD_ID], sizeof("SET_REG")) == 0) {
> +for (i = 0; i < REG_KEY_MAX_NUM; i++) {
> +if (!strcasecmp(arg[REG_OPS_CMD_RG], set_reg_names[i]))
> +rg_idx = i;
> +}
> +if (rg_idx < 0)
> +goto ERR_DEBUG_OPS_STORE;
> +
> +ret = kstrtouint(arg[REG_OPS_CMD_VAL], 0, &val);
> +if (ret)
> +goto ERR_DEBUG_OPS_STORE;
> +
> +for (i = 0; i < CSI_PORT_MAX_NUM; i++) {
> +memset(csi_names, 0, ARRAY_SIZE(csi_names));
> +snprintf(csi_names, 10, "csi-%s", csi_port_names[i]);
> +if (!strcasecmp(arg[REG_OPS_CMD_CSI], csi_names))
> +csi_port = i;
> +}
> +
> +if (csi_port < 0)
> +goto ERR_DEBUG_OPS_STORE;
> +
> +/* reg call */
> +mutex_lock(&core->mutex);
> +
> +list_for_each_entry(ctx, &core->list, list) {
> +if (csi_port == ctx->port)
> +mtk_cam_seninf_set_reg(ctx, rg_idx, val);
> +}
> +
> +mutex_unlock(&core->mutex);
> +}
> +
> +ERR_DEBUG_OPS_STORE:
> +
> +kfree(sbuf);
> +
> +return count;
> +}
> +
> +static DEVICE_ATTR_RW(debug_ops);
> +


</pre>
</p></body></html><!--type:text--><!--{--><pre>************* MEDIATEK Confidentiality Notice ********************
The information contained in this e-mail message (including any 
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be 
conveyed only to the designated recipient(s). Any use, dissemination, 
distribution, printing, retaining or copying of this e-mail (including its 
attachments) by unintended recipient(s) is strictly prohibited and may 
be unlawful. If you are not an intended recipient of this e-mail, or believe 
that you have received this e-mail in error, please notify the sender 
immediately (by replying to this e-mail), delete any and all copies of 
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!
</pre><!--}-->