diff options
Diffstat (limited to 'src/mm_radio_priv_hal.c')
-rw-r--r-- | src/mm_radio_priv_hal.c | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/src/mm_radio_priv_hal.c b/src/mm_radio_priv_hal.c index 206e728..ae5bca3 100644 --- a/src/mm_radio_priv_hal.c +++ b/src/mm_radio_priv_hal.c @@ -169,7 +169,7 @@ int _mmradio_apply_region(mm_radio_t *radio, MMRadioRegionType region, bool upda } } - MMRADIO_LOG_DEBUG("setting region - country: %d, de-emphasis: %d, band range: %d ~ %d KHz\n", + MMRADIO_LOG_DEBUG("setting region - country: %d, de-emphasis: %d, band range: %d ~ %d KHz", radio->region_setting.country, radio->region_setting.deemphasis, radio->region_setting.band_min, radio->region_setting.band_max); @@ -198,13 +198,13 @@ int _mmradio_create_radio(mm_radio_t *radio) /* create command lock */ ret = pthread_mutex_init(&radio->cmd_lock, NULL); if (ret) { - MMRADIO_LOG_ERROR("mutex creation failed\n"); + MMRADIO_LOG_ERROR("mutex creation failed"); return MM_ERROR_RADIO_INTERNAL; } ret = pthread_mutex_init(&radio->volume_lock, NULL); if (ret) { - MMRADIO_LOG_ERROR("volume mutex creation failed\n"); + MMRADIO_LOG_ERROR("volume mutex creation failed"); return MM_ERROR_RADIO_INTERNAL; } @@ -218,14 +218,14 @@ int _mmradio_create_radio(mm_radio_t *radio) if (ret) { /* NOTE : we are dealing it as an error since we cannot expect it's behavior */ - MMRADIO_LOG_ERROR("mmradio_audio_focus_register is failed\n"); + MMRADIO_LOG_ERROR("mmradio_audio_focus_register is failed"); return MM_ERROR_RADIO_INTERNAL; } #endif ret = radio_hal_interface_init(&(radio->hal_inf)); if (ret) { - MMRADIO_LOG_ERROR("mmradio hal interface init failed\n"); + MMRADIO_LOG_ERROR("mmradio hal interface init failed"); return ret; } @@ -354,13 +354,13 @@ int _mmradio_destroy(mm_radio_t *radio) ret = radio_hal_interface_deinit(radio->hal_inf); if (ret) { - MMRADIO_LOG_ERROR("mmradio hal interface deinit failed\n"); + MMRADIO_LOG_ERROR("mmradio hal interface deinit failed"); return ret; } #ifdef TIZEN_FEATURE_SOUND_FOCUS ret = mmradio_sound_focus_deregister(&radio->sound_focus); if (ret) { - MMRADIO_LOG_ERROR("failed to deregister sound focus\n"); + MMRADIO_LOG_ERROR("failed to deregister sound focus"); return MM_ERROR_RADIO_INTERNAL; } #endif @@ -379,7 +379,7 @@ int _mmradio_set_frequency(mm_radio_t *radio, int freq) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_SET_FREQ); - MMRADIO_LOG_DEBUG("Setting %d frequency\n", freq); + MMRADIO_LOG_DEBUG("Setting %d frequency", freq); radio->freq = freq; @@ -480,7 +480,7 @@ int _mmradio_set_message_callback(mm_radio_t *radio, MMMessageCallback callback, radio->msg_cb = callback; radio->msg_cb_param = user_param; - MMRADIO_LOG_DEBUG("msg_cb : 0x%x msg_cb_param : 0x%x\n", callback, user_param); + MMRADIO_LOG_DEBUG("msg_cb : 0x%x msg_cb_param : 0x%x", callback, user_param); MMRADIO_LOG_FLEAVE(); @@ -515,7 +515,7 @@ int _mmradio_start(mm_radio_t *radio) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_START); - MMRADIO_LOG_DEBUG("now tune to frequency : %d\n", radio->freq); + MMRADIO_LOG_DEBUG("now tune to frequency : %d", radio->freq); #ifdef TIZEN_FEATURE_SOUND_FOCUS if (radio->sound_focus.handle > 0) { @@ -562,21 +562,21 @@ int _mmradio_start(mm_radio_t *radio) if (ret == MM_ERROR_NOT_SUPPORT_API) { MMRADIO_LOG_WARNING("radio_hal_start is not supported"); } else if (ret) { - MMRADIO_LOG_ERROR("failed to radio_hal_start\n"); + MMRADIO_LOG_ERROR("failed to radio_hal_start"); goto error1; } /* set stored frequency */ ret = radio_hal_set_frequency(radio->hal_inf, radio->freq); if (ret) { - MMRADIO_LOG_ERROR("failed to radio_hal_set_frequency\n"); + MMRADIO_LOG_ERROR("failed to radio_hal_set_frequency"); goto error1; } #ifdef TIZEN_FEATURE_SOUND_VSTREAM ret = sound_manager_start_virtual_stream(radio->vstream); if (ret) { - MMRADIO_LOG_ERROR("failed to sound_manager_start_virtual_stream\n"); + MMRADIO_LOG_ERROR("failed to sound_manager_start_virtual_stream"); goto error; } #endif @@ -623,7 +623,7 @@ int _mmradio_stop(mm_radio_t *radio) if (ret == MM_ERROR_NOT_SUPPORT_API) { MMRADIO_LOG_WARNING("radio_hal_unmute is not supported"); } else if (ret) { - MMRADIO_LOG_ERROR("failed to radio_hal_stop\n"); + MMRADIO_LOG_ERROR("failed to radio_hal_stop"); return ret; } @@ -650,7 +650,7 @@ int _mmradio_stop(mm_radio_t *radio) if (radio->sound_focus.handle > 0) { ret = mmradio_release_sound_focus(&radio->sound_focus); if (ret) { - MMRADIO_LOG_ERROR("mmradio_release_audio_focus is failed\n"); + MMRADIO_LOG_ERROR("mmradio_release_audio_focus is failed"); return ret; } } @@ -685,19 +685,19 @@ int _mmradio_seek(mm_radio_t *radio, MMRadioSeekDirectionType direction) if (ret == MM_ERROR_NOT_SUPPORT_API) { MMRADIO_LOG_WARNING("radio_hal_mute is not supported"); } else if (ret) { - MMRADIO_LOG_ERROR("failed to radio_hal_mute\n"); + MMRADIO_LOG_ERROR("failed to radio_hal_mute"); return ret; } radio->seek_unmute = TRUE; } - MMRADIO_LOG_DEBUG("trying to seek. direction[0:UP/1:DOWN) %d\n", direction); + MMRADIO_LOG_DEBUG("trying to seek. direction[0:UP/1:DOWN) %d", direction); radio->seek_direction = direction; ret = pthread_create(&radio->seek_thread, NULL, (void *)__mmradio_seek_thread, (void *)radio); if (ret) { - MMRADIO_LOG_DEBUG("failed create thread\n"); + MMRADIO_LOG_DEBUG("failed create thread"); radio->is_seeking = FALSE; radio->seek_cancel = TRUE; if (radio->seek_unmute) { @@ -705,7 +705,7 @@ int _mmradio_seek(mm_radio_t *radio, MMRadioSeekDirectionType direction) if (ret == MM_ERROR_NOT_SUPPORT_API) { MMRADIO_LOG_WARNING("radio_hal_mute is not supported"); } else if (ret) { - MMRADIO_LOG_ERROR("failed to radio_hal_mute\n"); + MMRADIO_LOG_ERROR("failed to radio_hal_mute"); radio->seek_unmute = FALSE; return ret; } @@ -787,7 +787,7 @@ int _mmradio_start_scan(mm_radio_t *radio) scan_tr_id = pthread_create(&radio->scan_thread, NULL, (void *)__mmradio_scan_thread, (void *)radio); if (scan_tr_id != 0) { - MMRADIO_LOG_DEBUG("failed to create thread : scan\n"); + MMRADIO_LOG_DEBUG("failed to create thread : scan"); return MM_ERROR_RADIO_NOT_INITIALIZED; } @@ -845,7 +845,7 @@ int _mm_radio_get_signal_strength(mm_radio_t *radio, int *value) if (ret == MM_ERROR_NOT_SUPPORT_API) { MMRADIO_LOG_WARNING("radio_hal_unmute is not supported"); } else if (ret != MM_ERROR_NONE) { - debug_error("radio_hal_get_signal_strength error\n"); + debug_error("radio_hal_get_signal_strength error"); *value = 0; MMRADIO_LOG_FLEAVE(); return ret; @@ -883,7 +883,7 @@ void __mmradio_scan_thread(mm_radio_t *radio) uint32_t freq = 0; MMMessageParamType param = { 0, }; - MMRADIO_LOG_DEBUG("scanning....\n"); + MMRADIO_LOG_DEBUG("scanning...."); pthread_mutex_lock(&radio->seek_cancel_mutex); @@ -908,10 +908,10 @@ void __mmradio_scan_thread(mm_radio_t *radio) ret = radio_hal_get_frequency(radio->hal_inf, &freq); if (ret != MM_ERROR_NONE) { - MMRADIO_LOG_ERROR("failed to get current frequency\n"); + MMRADIO_LOG_ERROR("failed to get current frequency"); } else { if (freq < prev_freq) { - MMRADIO_LOG_DEBUG("scanning wrapped around. stopping scan\n"); + MMRADIO_LOG_DEBUG("scanning wrapped around. stopping scan"); break; } @@ -919,11 +919,11 @@ void __mmradio_scan_thread(mm_radio_t *radio) continue; prev_freq = param.radio_scan.frequency = (int)freq; - MMRADIO_LOG_DEBUG("scanning : new frequency : [%d]\n", param.radio_scan.frequency); + MMRADIO_LOG_DEBUG("scanning : new frequency : [%d]", param.radio_scan.frequency); /* drop if max freq is scanned */ if (param.radio_scan.frequency == radio->region_setting.band_max) { - MMRADIO_LOG_DEBUG("%d freq is dropping...and stopping scan\n", param.radio_scan.frequency); + MMRADIO_LOG_DEBUG("%d freq is dropping...and stopping scan", param.radio_scan.frequency); break; } @@ -1019,13 +1019,13 @@ void __mmradio_seek_thread(mm_radio_t *radio) MMRADIO_POST_MSG(radio, MM_MESSAGE_RADIO_SEEK_START, NULL); - MMRADIO_LOG_DEBUG("seeking....\n"); + MMRADIO_LOG_DEBUG("seeking...."); if (!radio->seek_cancel) { MMRADIO_LOG_DEBUG("try to seek "); pthread_mutex_lock(&radio->seek_cancel_mutex); - MMRADIO_LOG_DEBUG("seek start\n"); + MMRADIO_LOG_DEBUG("seek start"); if (radio->seek_cancel) { MMRADIO_LOG_DEBUG("seek was canceled so we return failure to application"); @@ -1036,22 +1036,22 @@ void __mmradio_seek_thread(mm_radio_t *radio) ret = radio_hal_seek(radio->hal_inf, radio->seek_direction); pthread_mutex_unlock(&radio->seek_cancel_mutex); if (ret) { - MMRADIO_LOG_ERROR("radio_hal_seek failed\n"); + MMRADIO_LOG_ERROR("radio_hal_seek failed"); goto SEEK_FAILED; } /* now we can get new frequency from radio device */ ret = radio_hal_get_frequency(radio->hal_inf, &freq); if (ret) { - MMRADIO_LOG_ERROR("failed to get current frequency\n"); + MMRADIO_LOG_ERROR("failed to get current frequency"); goto SEEK_FAILED; } - MMRADIO_LOG_DEBUG("found frequency\n"); + MMRADIO_LOG_DEBUG("found frequency"); /* if same freq is found, ignore it and search next one. */ if (freq == radio->prev_seek_freq) { - MMRADIO_LOG_DEBUG("It's same with previous found one. So, trying next one. \n"); + MMRADIO_LOG_DEBUG("It's same with previous found one. So, trying next one."); goto SEEK_FAILED; } @@ -1060,7 +1060,7 @@ void __mmradio_seek_thread(mm_radio_t *radio) /* now tune to new frequency */ ret = radio_hal_set_frequency(radio->hal_inf, freq); if (ret) { - MMRADIO_LOG_ERROR("failed to tune to new frequency\n"); + MMRADIO_LOG_ERROR("failed to tune to new frequency"); goto SEEK_FAILED; } } @@ -1072,14 +1072,14 @@ void __mmradio_seek_thread(mm_radio_t *radio) */ ret = radio_hal_unmute(radio->hal_inf); if (ret) { - MMRADIO_LOG_ERROR("failed to tune to new frequency\n"); + MMRADIO_LOG_ERROR("failed to tune to new frequency"); goto SEEK_FAILED; } radio->seek_unmute = FALSE; } param.radio_scan.frequency = radio->prev_seek_freq = (int)freq; - MMRADIO_LOG_DEBUG("seeking : new frequency : [%d]\n", param.radio_scan.frequency); + MMRADIO_LOG_DEBUG("seeking : new frequency : [%d]", param.radio_scan.frequency); MMRADIO_POST_MSG(radio, MM_MESSAGE_RADIO_SEEK_FINISH, ¶m); } @@ -1100,7 +1100,7 @@ SEEK_FAILED: */ ret = radio_hal_unmute(radio->hal_inf); if (ret) - MMRADIO_LOG_ERROR("failed to tune to new frequency\n"); + MMRADIO_LOG_ERROR("failed to tune to new frequency"); radio->seek_unmute = FALSE; } /* freq -1 means it's failed to seek */ @@ -1118,11 +1118,11 @@ static bool __mmradio_post_message(mm_radio_t *radio, enum MMMessageType msgtype MMRADIO_LOG_FENTER(); if (!radio->msg_cb) { - debug_warning("failed to post a message\n"); + debug_warning("failed to post a message"); return false; } - MMRADIO_LOG_DEBUG("address of msg_cb : %p\n", radio->msg_cb); + MMRADIO_LOG_DEBUG("address of msg_cb : %p", radio->msg_cb); radio->msg_cb(msgtype, param, radio->msg_cb_param); @@ -1141,7 +1141,7 @@ static int __mmradio_check_state(mm_radio_t *radio, MMRadioCommand command) radio_state = __mmradio_get_state(radio); - MMRADIO_LOG_DEBUG("incomming command : %d current state : %d\n", command, radio_state); + MMRADIO_LOG_DEBUG("incomming command : %d current state : %d", command, radio_state); switch (command) { case MMRADIO_COMMAND_CREATE: @@ -1240,11 +1240,11 @@ static int __mmradio_check_state(mm_radio_t *radio, MMRadioCommand command) break; default: - MMRADIO_LOG_DEBUG("not handled in FSM. don't care it\n"); + MMRADIO_LOG_DEBUG("not handled in FSM. don't care it"); break; } - MMRADIO_LOG_DEBUG("status OK\n"); + MMRADIO_LOG_DEBUG("status OK"); radio->cmd = command; @@ -1253,12 +1253,12 @@ static int __mmradio_check_state(mm_radio_t *radio, MMRadioCommand command) return MM_ERROR_NONE; INVALID_STATE: - debug_warning("invalid state. current : %d command : %d\n", radio_state, command); + debug_warning("invalid state. current : %d command : %d", radio_state, command); MMRADIO_LOG_FLEAVE(); return MM_ERROR_RADIO_INVALID_STATE; NO_OP: - debug_warning("mm-radio is in the desired state(%d). doing noting\n", radio_state); + debug_warning("mm-radio is in the desired state(%d). doing noting", radio_state); MMRADIO_LOG_FLEAVE(); return MM_ERROR_RADIO_NO_OP; @@ -1272,12 +1272,12 @@ static bool __mmradio_set_state(mm_radio_t *radio, int new_state) MMRADIO_LOG_FENTER(); if (!radio) { - debug_warning("calling set_state with invalid radio handle\n"); + debug_warning("calling set_state with invalid radio handle"); return false; } if (radio->current_state == new_state && radio->pending_state == 0) { - debug_warning("we are in same state\n"); + debug_warning("we are in same state"); return true; } @@ -1326,7 +1326,7 @@ static int __mmradio_get_state(mm_radio_t *radio) { MMRADIO_CHECK_INSTANCE(radio); - MMRADIO_LOG_DEBUG("radio state : current : [%d] old : [%d] pending : [%d]\n", + MMRADIO_LOG_DEBUG("radio state : current : [%d] old : [%d] pending : [%d]", radio->current_state, radio->old_state, radio->pending_state); return radio->current_state; @@ -1355,9 +1355,9 @@ static void __mmradio_sound_focus_cb(int id, mm_sound_focus_type_e focus_type, result = _mmradio_stop(radio); if (result) - MMRADIO_LOG_ERROR("failed to stop radio\n"); + MMRADIO_LOG_ERROR("failed to stop radio"); - MMRADIO_LOG_DEBUG("FOCUS_IS_RELEASED cur_focus_type : %d\n", radio->sound_focus.cur_focus_type); + MMRADIO_LOG_DEBUG("FOCUS_IS_RELEASED cur_focus_type : %d", radio->sound_focus.cur_focus_type); } break; @@ -1373,12 +1373,12 @@ static void __mmradio_sound_focus_cb(int id, mm_sound_focus_type_e focus_type, radio->sound_focus.by_focus_cb = MMRADIO_FOCUS_CB_NONE; - MMRADIO_LOG_DEBUG("FOCUS_IS_ACQUIRED cur_focus_type : %d\n", radio->sound_focus.cur_focus_type); + MMRADIO_LOG_DEBUG("FOCUS_IS_ACQUIRED cur_focus_type : %d", radio->sound_focus.cur_focus_type); } break; default: - MMRADIO_LOG_DEBUG("Unknown focus_state\n"); + MMRADIO_LOG_DEBUG("Unknown focus_state"); break; } @@ -1407,7 +1407,7 @@ static void __mmradio_sound_focus_watch_cb(int id, mm_sound_focus_type_e focus_t result = _mmradio_stop(radio); if (result) - MMRADIO_LOG_ERROR("failed to stop radio\n"); + MMRADIO_LOG_ERROR("failed to stop radio"); MMRADIO_LOG_DEBUG("FOCUS_IS_RELEASED cur_focus_type : %d\n", radio->sound_focus.cur_focus_type); } @@ -1425,12 +1425,12 @@ static void __mmradio_sound_focus_watch_cb(int id, mm_sound_focus_type_e focus_t radio->sound_focus.by_focus_cb = MMRADIO_FOCUS_CB_NONE; - MMRADIO_LOG_DEBUG("FOCUS_IS_ACQUIRED cur_focus_type : %d\n", radio->sound_focus.cur_focus_type); + MMRADIO_LOG_DEBUG("FOCUS_IS_ACQUIRED cur_focus_type : %d", radio->sound_focus.cur_focus_type); } break; default: - MMRADIO_LOG_DEBUG("Unknown focus_state\n"); + MMRADIO_LOG_DEBUG("Unknown focus_state"); break; } @@ -1504,7 +1504,7 @@ int _mmradio_set_volume(mm_radio_t *radio, float volume) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_SET_VOLUME); - MMRADIO_LOG_DEBUG("Setting %f volume\n", volume); + MMRADIO_LOG_DEBUG("Setting %f volume", volume); MMRADIO_VOLUME_LOCK(radio); radio->local_volume = volume; @@ -1556,7 +1556,7 @@ static int __mmradio_set_media_volume(mm_radio_t *radio, unsigned int level) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_SET_VOLUME); - MMRADIO_LOG_DEBUG("Setting %d volume\n", level); + MMRADIO_LOG_DEBUG("Setting %d volume", level); MMRADIO_VOLUME_LOCK(radio); radio->media_volume = level; |