Convert refactored events registration routines to use protocol handles.
In order to maintain bisectability and to allow protocols and drivers
to be later ported to the new protocol handle interface one by one,
introduce here also some transient code and typing that will be removed
later in order to ease such transition.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ic74cc4576b9189c0fff8968b8063a86375bb7ae7
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
Add a new refactored protocol events registration helper and invoke it
from the centralized initialization process triggered by get_ops() and
friends.
Add a .get_num_sources as a new optional callback amongst protocol events
operations; finally remove events registration call-sites from within the
legacy protocol init routines.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ib875eb3ec6be086c7d02175a6ff3742eb112026e
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
Extend common protocol registration routines and provide some new generic
protocols get/put helpers that can track protocols usage and automatically
perform the proper initialization and de-initialization on demand when
required.
Convert all standard protocols to use this new registration scheme while
keeping them all still using the usual initialization logic bound to SCMI
devices probing.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I8d40f1f25f8d007f1fa4788f432a7ffeb012e1c2
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
In preparation to enable building SCMI as a single module, let us move
the SCMI protocol registration call into the driver. This enables us
to also add unregistration of the SCMI protocols.
The main reason for this is to keep it simple instead of maintaining
it as separate modules and dealing with all possible initcall races
and deferred probe handling. We can move it as separate modules if
needed in future.
Link: https://lore.kernel.org/r/20200907195046.56615-4-sudeep.holla@arm.com
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>