Lines Matching refs:host
197 static int32_t HiRtcReadTime(struct RtcHost *host, struct RtcTime *time)
205 if (host == NULL || host->data == NULL) {
206 HDF_LOGE("HiRtcReadTime: host is null!");
210 rtcInfo = (struct RtcConfigInfo *)host->data;
280 static int32_t HiRtcWriteTime(struct RtcHost *host, const struct RtcTime *time)
288 if (host == NULL || host->data == NULL) {
289 HDF_LOGE("HiRtcWriteTime: host is null!");
293 rtcInfo = (struct RtcConfigInfo *)host->data;
328 static int32_t HiReadAlarm(struct RtcHost *host, enum RtcAlarmIndex alarmIndex, struct RtcTime *time)
333 if (host == NULL || host->data == NULL) {
334 HDF_LOGE("HiReadAlarm: host is null!");
338 rtcInfo = (struct RtcConfigInfo *)host->data;
354 static int32_t HiWriteAlarm(struct RtcHost *host, enum RtcAlarmIndex alarmIndex, const struct RtcTime *time)
359 if (host == NULL || host->data == NULL) {
360 HDF_LOGE("WriteAlarm: host is null!");
364 rtcInfo = (struct RtcConfigInfo *)host->data;
380 static int32_t HiRegisterAlarmCallback(struct RtcHost *host, enum RtcAlarmIndex alarmIndex, RtcAlarmCallback cb)
384 if (host == NULL || host->data == NULL || cb == NULL) {
389 rtcInfo = (struct RtcConfigInfo *)host->data;
398 static int32_t HiAlarmInterruptEnable(struct RtcHost *host, enum RtcAlarmIndex alarmIndex, uint8_t enable)
404 if (host == NULL || host->data == NULL || alarmIndex != RTC_ALARM_INDEX_A) {
409 rtcInfo = (struct RtcConfigInfo *)host->data;
432 static int32_t HiGetFreq(struct RtcHost *host, uint32_t *freq)
440 if (host == NULL || host->data == NULL || freq == NULL) {
441 HDF_LOGE("HiReadFreq: host is null!");
445 rtcInfo = (struct RtcConfigInfo *)host->data;
457 static int32_t HiSetFreq(struct RtcHost *host, uint32_t freq)
464 if (host == NULL || host->data == NULL) {
465 HDF_LOGE("HiWriteFreq: host is null!");
479 rtcInfo = (struct RtcConfigInfo *)host->data;
489 static int32_t HiReset(struct RtcHost *host)
494 if (host == NULL || host->data == NULL) {
495 HDF_LOGE("HiReset: host is null!");
499 rtcInfo = (struct RtcConfigInfo *)host->data;
514 static int32_t HiReadReg(struct RtcHost *host, uint8_t usrDefIndex, uint8_t *value)
518 if (host == NULL || host->data == NULL || value == NULL) {
519 HDF_LOGE("HiReadReg: host is null!");
528 rtcInfo = (struct RtcConfigInfo *)host->data;
532 static int32_t HiWriteReg(struct RtcHost *host, uint8_t usrDefIndex, uint8_t value)
536 if (host == NULL || host->data == NULL) {
537 HDF_LOGE("HiWriteReg: host is null!");
546 rtcInfo = (struct RtcConfigInfo *)host->data;
787 struct RtcHost *host = NULL;
789 host = RtcHostCreate(device);
790 if (host == NULL) {
791 HDF_LOGE("HiRtcBind: create host fail!");
795 host->device = device;
796 device->service = &host->service;
803 struct RtcHost *host = NULL;
809 host = RtcHostFromDevice(device);
835 host->method = &g_method;
836 host->data = rtcInfo;
843 struct RtcHost *host = NULL;
851 host = RtcHostFromDevice(device);
852 rtcInfo = (struct RtcConfigInfo *)host->data;
856 host->data = NULL;
858 RtcHostDestroy(host);