msm: thermal: Add support for device manager in KTM
Add support for device manager framework to KTM. Device manager allows
for aggregation of muliple kernel clients request on mitigation
devices. Clients can set and register for device change notifications.
Currently it supports hotplug device and cpuX (X= 0... NR_CPUS - 1)
devices.
Device manager framework exports below 3 APIs for a device for
clients to use.
1. struct device_clnt_data *devmgr_register_mitigation_client(
struct device *dev,
const char *device_name,
void (*callback)(struct device_clnt_data *,
union device_request *, void *))
API to register mitigation device. This API returns handle, which
should be used by clients when placing mitigation request.
It supports to register for device change notification with callback
as an optional parameter to client.
@dev: Client device structure.
@device_name: Mitgation device name which the client is interested
to mitigate.
@callback: Optional callback pointer for device change notification,
otherwise pass NULL.
Returns client handle structure for that device on success, or NULL
with IS_ERR() condition containing error number.
2. int devmgr_client_request_mitigation(struct device_clnt_data *clnt,
enum device_req_type type,
union device_request *req);
API for clients to set valid mitigation for a registered device.
@clnt: Client handle for device.
@type: Type of device request populated above.
@req: Valid mitigation request.
Returns zero on successful mitigation update or
negative error number.
3. void devmgr_unregister_mitigation_client(
struct device *dev,
struct device_clnt_data *clnt)
API for clients to unregister for a device whenever it is done with
device.
@dev: Client device structure.
@clnt: Client handle for device.
Change-Id: Ieda99577a035a32b745df6b004b5487a55ec70ac
Signed-off-by:
Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Loading
Please register or sign in to comment