Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4f9a2fb authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: spcom: create control channel"

parents d2f9b7cd c60d298e
Loading
Loading
Loading
Loading
+17 −9
Original line number Diff line number Diff line
@@ -981,6 +981,11 @@ static int spcom_handle_write(struct spcom_channel *ch,

	pr_debug("cmd_id [0x%x]\n", cmd_id);

	if (!ch && cmd_id != SPCOM_CMD_CREATE_CHANNEL) {
		pr_err("channel context is null\n");
		return -EINVAL;
	}

	switch (cmd_id) {
	case SPCOM_CMD_SEND:
		ret = spcom_handle_send_command(ch, buf, buf_size);
@@ -1350,15 +1355,18 @@ static ssize_t spcom_device_write(struct file *filp,

	ch = filp->private_data;
	if (!ch) {
		if (strcmp(name, DEVICE_NAME) != 0) {
			pr_err("invalid ch pointer, command not allowed.\n");
			return -EINVAL;
		}

		pr_debug("control device - no channel context.\n");
	} else {
		/* Check if remote side connect */
		if (!spcom_is_channel_connected(ch)) {
		pr_err("ch [%s] remote side not connected\n", ch->name);
			pr_err("ch [%s] remote side not connect.\n", ch->name);
			return -ENOTCONN;
		}
	}

	if (size > SPCOM_MAX_COMMAND_SIZE) {
		pr_err("size [%d] > max size [%d].\n",
@@ -2079,7 +2087,7 @@ static int __init spcom_init(void)
{
	int ret;

	pr_debug("spcom driver version 2.0 4-Mar-2018\n");
	pr_info("spcom driver version 2.1 23-April-2018.\n");

	ret = platform_driver_register(&spcom_driver);
	if (ret)