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

Commit 1f2de0d6 authored by Deepak Katragadda's avatar Deepak Katragadda
Browse files

msm: pil: Add notifications to indicate execution of proxy voting/unvoting



Add notifications to indicate that the generic work required to be
done in the proxy voting and unvoting functions has compeleted.

Moving forward, this will give drivers that have registered for
these notifications about the subsystem, a chance to do more
specific things at their end. This is crucial in moving forward
with having a generic driver for PIL and SSR across all
subsystems.

Change-Id: I8f1449ab86719ced533aa477f062d686958f50b2
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent e5421545
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ enum subsys_notif_type {
	SUBSYS_AFTER_POWERUP,
	SUBSYS_RAMDUMP_NOTIFICATION,
	SUBSYS_POWERUP_FAILURE,
	SUBSYS_PROXY_VOTE,
	SUBSYS_PROXY_UNVOTE,
	SUBSYS_NOTIF_TYPE_COUNT
};

+4 −2
Original line number Diff line number Diff line
@@ -80,7 +80,8 @@ extern void subsys_unregister(struct subsys_device *dev);
extern void subsys_default_online(struct subsys_device *dev);
extern void subsys_set_crash_status(struct subsys_device *dev, bool crashed);
extern bool subsys_get_crash_status(struct subsys_device *dev);

void notify_proxy_vote(struct device *device);
void notify_proxy_unvote(struct device *device);
#else

static inline int subsys_get_restart_level(struct subsys_device *dev)
@@ -125,7 +126,8 @@ static inline bool subsys_get_crash_status(struct subsys_device *dev)
{
	return false;
}

void notify_proxy_vote(struct device *device) { }
void notify_proxy_unvote(struct device *device) { }
#endif /* CONFIG_MSM_SUBSYSTEM_RESTART */

#endif
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@

#include <mach/msm_iomap.h>
#include <mach/ramdump.h>
#include <mach/subsystem_restart.h>

#include "peripheral-loader.h"

@@ -195,6 +196,7 @@ static void __pil_proxy_unvote(struct pil_priv *priv)
	struct pil_desc *desc = priv->desc;

	desc->ops->proxy_unvote(desc);
	notify_proxy_unvote(desc->dev);
	wake_unlock(&priv->wlock);
	module_put(desc->owner);

@@ -221,6 +223,7 @@ static int pil_proxy_vote(struct pil_desc *desc)

	if (desc->proxy_unvote_irq)
		enable_irq(desc->proxy_unvote_irq);
	notify_proxy_vote(desc->dev);

	return ret;
}
+29 −0
Original line number Diff line number Diff line
@@ -844,6 +844,35 @@ bool subsys_get_crash_status(struct subsys_device *dev)
{
	return dev->crashed;
}

static struct subsys_device *desc_to_subsys(struct device *d)
{
	struct subsys_device *device, *subsys_dev = 0;

	mutex_lock(&subsys_list_lock);
	list_for_each_entry(device, &subsys_list, list)
		if (device->desc->dev == d)
			subsys_dev = device;
	mutex_unlock(&subsys_list_lock);
	return subsys_dev;
}

void notify_proxy_vote(struct device *device)
{
	struct subsys_device *dev = desc_to_subsys(device);

	if (dev)
		notify_each_subsys_device(&dev, 1, SUBSYS_PROXY_VOTE, NULL);
}

void notify_proxy_unvote(struct device *device)
{
	struct subsys_device *dev = desc_to_subsys(device);

	if (dev)
		notify_each_subsys_device(&dev, 1, SUBSYS_PROXY_UNVOTE, NULL);
}

#ifdef CONFIG_DEBUG_FS
static ssize_t subsys_debugfs_read(struct file *filp, char __user *ubuf,
		size_t cnt, loff_t *ppos)