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

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

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

parents a0772087 7cc2784a
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);
	}
}