From: Youngjae Cho Date: Thu, 15 Dec 2022 06:57:33 +0000 (+0900) Subject: haptic: fix device API X-Git-Tag: accepted/tizen/8.0/unified/20231005.093755^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90b4faf788cf4a824697436c1226f03e98bdb9f2;p=platform%2Fcore%2Fsystem%2Ffeedbackd.git haptic: fix device API The device internal API enum and function have been updated. Change-Id: I9391e4d74c096eabe79e3e0172a7dbaf51538960 Signed-off-by: Youngjae Cho --- diff --git a/src/core/haptic.c b/src/core/haptic.c index 4fea07d..ea86a05 100644 --- a/src/core/haptic.c +++ b/src/core/haptic.c @@ -1134,12 +1134,13 @@ exit: return g_variant_new("(i)", ret); } -static void haptic_poweroff_cb(const struct device_change_state_info *info, void *udata) +static void haptic_poweroff_cb(device_power_state_e prev_state, + device_power_state_e next_state, uint64_t wait_callback_id, device_power_transition_reason_e reason, void *udata) { int ret, level; struct timespec time = {0,}; - _D("Poweroff: %"PRIx64, info->next_state); + _D("Poweroff: %"PRIx64, (uint64_t) next_state); if (hal_device_haptic_check_backend() < 0) { if (haptic_module_load() < 0) @@ -1172,7 +1173,7 @@ static void haptic_poweroff_cb(const struct device_change_state_info *info, void time.tv_nsec = POWER_OFF_VIB_DURATION * NANO_SECOND_MULTIPLIER; nanosleep(&time, NULL); - device_power_change_state_wait_done(info->id); + device_power_confirm_wait_callback(wait_callback_id); return; } @@ -1306,7 +1307,7 @@ void haptic_init(void) if (r < 0) _E("Failed to init hdbus interface and method: %d", r); - r = device_power_add_change_state_wait_callback(POWER_STATE_POWEROFF | POWER_STATE_REBOOT, + r = device_power_add_state_wait_callback(DEVICE_POWER_STATE_POWEROFF | DEVICE_POWER_STATE_REBOOT, haptic_poweroff_cb, NULL); if (r < 0) { _E("Failed to register poweroff handler: %d", r); @@ -1342,7 +1343,7 @@ void haptic_exit(void) _W("Remove watch for VCONFKEY_RECORDER_STATE failed."); } - device_power_remove_change_state_wait_callback(POWER_STATE_POWEROFF | POWER_STATE_REBOOT); + device_power_remove_state_wait_callback(DEVICE_POWER_STATE_POWEROFF | DEVICE_POWER_STATE_REBOOT); /* release haptic data memory */ safe_free(haptic_conf.level_arr);