Lines Matching refs:priv
63 struct LightDevice *priv = GetLightDevicePriv(); in SendLightMsg() local
65 if (priv->ioService == NULL || priv->ioService->dispatcher == NULL || in SendLightMsg()
66 priv->ioService->dispatcher->Dispatch == NULL) { in SendLightMsg()
71 int32_t ret = priv->ioService->dispatcher->Dispatch(&priv->ioService->object, cmd, msg, reply); in SendLightMsg()
80 static int32_t ReadLightInfo(struct HdfSBuf *reply, struct LightDevice *priv) in ReadLightInfo() argument
85 if (!HdfSbufReadUint32(reply, &priv->lightNum)) { in ReadLightInfo()
90 if (priv->lightInfoEntry != NULL) { in ReadLightInfo()
91 OsalMemFree(priv->lightInfoEntry); in ReadLightInfo()
92 priv->lightInfoEntry = NULL; in ReadLightInfo()
95 …priv->lightInfoEntry = (struct LightInfo *)OsalMemCalloc(sizeof(*priv->lightInfoEntry) * priv->lig… in ReadLightInfo()
96 if (priv->lightInfoEntry == NULL) { in ReadLightInfo()
101 pos = priv->lightInfoEntry; in ReadLightInfo()
103 for (uint32_t i = 0; i < priv->lightNum; ++i) { in ReadLightInfo()
137 struct LightDevice *priv = GetLightDevicePriv(); in GetLightInfo() local
139 if (priv->lightNum > 0) { in GetLightInfo()
140 *count = priv->lightNum; in GetLightInfo()
141 *lightInfo = priv->lightInfoEntry; in GetLightInfo()
145 (void)OsalMutexLock(&priv->mutex); in GetLightInfo()
149 (void)OsalMutexUnlock(&priv->mutex); in GetLightInfo()
157 (void)OsalMutexUnlock(&priv->mutex); in GetLightInfo()
161 if (ReadLightInfo(reply, priv) != HDF_SUCCESS) { in GetLightInfo()
163 (void)OsalMutexUnlock(&priv->mutex); in GetLightInfo()
168 (void)OsalMutexUnlock(&priv->mutex); in GetLightInfo()
170 *count = priv->lightNum; in GetLightInfo()
171 *lightInfo = priv->lightInfoEntry; in GetLightInfo()
212 struct LightDevice *priv = GetLightDevicePriv(); in OnLight() local
213 (void)OsalMutexLock(&priv->mutex); in OnLight()
218 (void)OsalMutexUnlock(&priv->mutex); in OnLight()
225 (void)OsalMutexUnlock(&priv->mutex); in OnLight()
232 (void)OsalMutexUnlock(&priv->mutex); in OnLight()
239 (void)OsalMutexUnlock(&priv->mutex); in OnLight()
248 (void)OsalMutexUnlock(&priv->mutex); in OnLight()
291 struct LightDevice *priv = GetLightDevicePriv(); in OnMultiLights() local
292 (void)OsalMutexLock(&priv->mutex); in OnMultiLights()
296 (void)OsalMutexUnlock(&priv->mutex); in OnMultiLights()
331 (void)OsalMutexUnlock(&priv->mutex); in OnMultiLights()
351 struct LightDevice *priv = GetLightDevicePriv(); in OffLight() local
352 (void)OsalMutexLock(&priv->mutex); in OffLight()
357 (void)OsalMutexUnlock(&priv->mutex); in OffLight()
364 (void)OsalMutexUnlock(&priv->mutex); in OffLight()
371 (void)OsalMutexUnlock(&priv->mutex); in OffLight()
380 (void)OsalMutexUnlock(&priv->mutex); in OffLight()
390 struct LightDevice *priv = GetLightDevicePriv(); in NewLightInterfaceInstance() local
392 if (priv->initState) { in NewLightInterfaceInstance()
396 OsalMutexInit(&priv->mutex); in NewLightInterfaceInstance()
402 priv->ioService = HdfIoServiceBind(LIGHT_SERVICE_NAME); in NewLightInterfaceInstance()
403 if (priv->ioService == NULL) { in NewLightInterfaceInstance()
405 OsalMutexDestroy(&priv->mutex); in NewLightInterfaceInstance()
409 priv->initState = true; in NewLightInterfaceInstance()
417 struct LightDevice *priv = GetLightDevicePriv(); in FreeLightInterfaceInstance() local
419 if (!priv->initState) { in FreeLightInterfaceInstance()
424 priv->lightNum = 0; in FreeLightInterfaceInstance()
426 if (priv->ioService != NULL) { in FreeLightInterfaceInstance()
427 HdfIoServiceRecycle(priv->ioService); in FreeLightInterfaceInstance()
430 if (priv->lightInfoEntry != NULL) { in FreeLightInterfaceInstance()
431 OsalMemFree(priv->lightInfoEntry); in FreeLightInterfaceInstance()
432 priv->lightInfoEntry = NULL; in FreeLightInterfaceInstance()
435 OsalMutexDestroy(&priv->mutex); in FreeLightInterfaceInstance()