soc: qcom: sysmon-qmi: Fix duplicate BEFORE_POWERUP SSCTL events

Currently, when sending an SSCTL SSR event, the event is
obtained by blindly following a map from the notification ID
provided by the subsystem notifier framework to an SSCTL
SSR event.

Since all the entries in the map that are not explicitly defined
are initialized to 0 (SSCTL_SSR_EVENT_BEFORE_POWERUP), then
notifications, such as SUBSYS_PROXY_VOTE, that do not map
to an actual SSCTL event map to SSCTL_SSR_EVENT_BEFORE_POWERUP,
resulting in multiple SSCTL_SSR_EVENT_BEFORE_POWERUP
notifications being sent.

To avoid this, mark all the notification ID to SSCTL event
mappings that are not defined, as SSCTL_EVENT_SSR_INVALID,
and prior to sending an SSCTL SSR event for a notification ID,
check to ensure that the notification ID maps to a defined
SSCTL event.

Change-Id: If4e4fcd12f7acc6eb82f9776a9db8bc9066d3c4e
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2 files changed