Lines Matching +full:hfclkaudio +full:- +full:frequency

2  * Copyright (c) 2016-2020 Nordic Semiconductor ASA
5 * SPDX-License-Identifier: Apache-2.0
39 get_sub_config(dev, (enum clock_control_nrf_type)subsys)->name \
86 struct nrf_clock_control_data *data = dev->data; in get_sub_data()
88 return &data->subsys[type]; in get_sub_data()
95 dev->config; in get_sub_config()
97 return &config->subsys[type]; in get_sub_config()
103 struct nrf_clock_control_data *data = dev->data; in get_onoff_manager()
105 return &data->mgr[type]; in get_onoff_manager()
124 return GET_STATUS(get_sub_data(dev, type)->flags); in get_status()
134 err = -EPERM; in set_off_state()
153 err = -EPERM; in set_starting_state()
155 err = -EALREADY; in set_starting_state()
175 clock_control_cb_t callback = sub_data->cb; in clkstarted_handle()
176 void *user_data = sub_data->user_data; in clkstarted_handle()
178 sub_data->cb = NULL; in clkstarted_handle()
179 set_on_state(&sub_data->flags); in clkstarted_handle()
189 #if (CONFIG_NRF52_ANOMALY_132_DELAY_US - 0) in anomaly_132_workaround()
261 struct nrf_clock_control_data *data = CLOCK_DEVICE->data; in get_hf_flags()
263 return &data->subsys[CLOCK_CONTROL_NRF_TYPE_HFCLK].flags; in get_hf_flags()
351 err = set_off_state(&subdata->flags, ctx); in stop()
356 get_sub_config(dev, type)->stop(); in stop()
373 err = set_starting_state(&subdata->flags, ctx); in async_start()
378 subdata->cb = cb; in async_start()
379 subdata->user_data = user_data; in async_start()
381 get_sub_config(dev, type)->start(); in async_start()
408 return -ENOTSUP; in api_blocking_start()
421 struct nrf_clock_control_data *data = CLOCK_DEVICE->data; in get_subsys()
422 size_t offset = (size_t)(mgr - data->mgr); in get_subsys()
491 /* If target clock source is using XTAL then due to two-stage in lfclk_spinwait()
595 if (GET_STATUS(data->flags) == CLOCK_CONTROL_STATUS_STARTING) { in clock_event_handler()
634 const uint32_t frequency = in hfclkaudio_init() local
638 * FREQ_VALUE = 2^16 * ((12 * f_out / 32M) - 4) in hfclkaudio_init()
641 (uint32_t)((384ULL * frequency) / 15625) - 262144; in hfclkaudio_init()
646 #error "hfclkaudio-frequency specified but HFCLKAUDIO clock is not present." in hfclkaudio_init()
665 return -EIO; in clk_init()
671 struct nrf_clock_control_data *data = dev->data; in clk_init()
673 z_nrf_clock_calibration_init(data->mgr); in clk_init()
689 subdata->flags = CLOCK_CONTROL_STATUS_OFF; in clk_init()
727 IF_ENABLED(CONFIG_LOG, (.name = "hfclkaudio",))
763 shell_print(sh, "\t- %srunning (users: %u)", in cmd_status()
764 hf_status ? "" : "not ", hf_mgr->refs); in cmd_status()
765 shell_print(sh, "\t- last start: %u ms (%u ms ago)", in cmd_status()
766 (uint32_t)abs_start, (uint32_t)(now - abs_start)); in cmd_status()
767 shell_print(sh, "\t- last stop: %u ms (%u ms ago)", in cmd_status()
768 (uint32_t)abs_stop, (uint32_t)(now - abs_stop)); in cmd_status()
770 shell_print(sh, "\t- %srunning (users: %u)", in cmd_status()
771 lf_status ? "" : "not ", lf_mgr->refs); in cmd_status()