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

Commit 7cc2784a authored by Jitendra Sharma's avatar Jitendra Sharma
Browse files

soc: qcom: pil: Notify user space about subsys events



Add support to notify user space about subsystem power
up events.

Change-Id: I707fd0563a82e9c4a05c99a693b1627ba01c2349
Signed-off-by: default avatarJitendra Sharma <shajit@codeaurora.org>
parent c1b1f71e
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -620,6 +620,22 @@ static int for_each_subsys_device(struct subsys_device **list,
	return 0;
}

static void subsys_notif_uevent(struct subsys_desc *desc,
				enum subsys_notif_type notif)
{
	char *envp[3];

	if (notif == SUBSYS_AFTER_POWERUP) {
		envp[0] = kasprintf(GFP_KERNEL, "SUBSYSTEM=%s", desc->name);
		envp[1] = kasprintf(GFP_KERNEL, "NOTIFICATION=%d", notif);
		envp[2] = NULL;
		kobject_uevent_env(&desc->dev->kobj, KOBJ_CHANGE, envp);
		pr_debug("%s %s sent\n", envp[0], envp[1]);
		kfree(envp[1]);
		kfree(envp[0]);
	}
}

static void notify_each_subsys_device(struct subsys_device **list,
		unsigned int count,
		enum subsys_notif_type notif, void *data)
@@ -666,6 +682,7 @@ static void notify_each_subsys_device(struct subsys_device **list,
								&notif_data);
		cancel_timeout(dev->desc);
		trace_pil_notif("after_send_notif", notif, dev->desc->fw_name);
		subsys_notif_uevent(dev->desc, notif);
	}
}