Lines Matching +full:precision +full:- +full:mode

3  * SPDX-License-Identifier: Apache-2.0
40 uint8_t mode; member
44 .mode = FLL16M_MODE_OPEN_LOOP,
47 .mode = FLL16M_MODE_CLOSED_LOOP,
50 /* Bypass mode uses HFXO */
52 .mode = FLL16M_MODE_BYPASS,
66 static void activate_fll16m_mode(struct fll16m_dev_data *dev_data, uint8_t mode) in activate_fll16m_mode() argument
70 if (mode != FLL16M_MODE_DEFAULT) { in activate_fll16m_mode()
71 soc_lrcconf_poweron_request(&dev_data->fll16m_node, NRF_LRCCONF_POWER_MAIN); in activate_fll16m_mode()
74 NRF_LRCCONF010->CLKCTRL[0].SRC = mode; in activate_fll16m_mode()
76 if (mode == FLL16M_MODE_DEFAULT) { in activate_fll16m_mode()
77 soc_lrcconf_poweron_release(&dev_data->fll16m_node, NRF_LRCCONF_POWER_MAIN); in activate_fll16m_mode()
82 clock_config_update_end(&dev_data->clk_cfg, 0); in activate_fll16m_mode()
97 clock_config_update_end(&dev_data->clk_cfg, res); in hfxo_cb()
99 (void)atomic_or(&dev_data->clk_cfg.flags, FLAG_HFXO_STARTED); in hfxo_cb()
113 if (clock_options[to_activate_idx].mode == FLL16M_MODE_BYPASS) { in fll16m_work_handler()
116 /* Bypass mode requires HFXO to be running first. */ in fll16m_work_handler()
117 sys_notify_init_callback(&dev_data->hfxo_cli.notify, hfxo_cb); in fll16m_work_handler()
118 rc = nrf_clock_control_request(hfxo, NULL, &dev_data->hfxo_cli); in fll16m_work_handler()
120 clock_config_update_end(&dev_data->clk_cfg, rc); in fll16m_work_handler()
125 prev_flags = atomic_and(&dev_data->clk_cfg.flags, in fll16m_work_handler()
132 clock_options[to_activate_idx].mode); in fll16m_work_handler()
139 struct fll16m_dev_data *dev_data = dev->data; in fll16m_find_mgr()
140 const struct fll16m_dev_config *dev_config = dev->config; in fll16m_find_mgr()
144 return &dev_data->clk_cfg.onoff[0].mgr; in fll16m_find_mgr()
147 if (spec->frequency > dev_config->fixed_frequency) { in fll16m_find_mgr()
152 if (spec->precision) { in fll16m_find_mgr()
153 LOG_ERR("invalid precision"); in fll16m_find_mgr()
157 accuracy = spec->accuracy == NRF_CLOCK_CONTROL_ACCURACY_MAX in fll16m_find_mgr()
159 : spec->accuracy; in fll16m_find_mgr()
167 return &dev_data->clk_cfg.onoff[i].mgr; in fll16m_find_mgr()
184 return -EINVAL; in api_request_fll16m()
196 return -EINVAL; in api_release_fll16m()
209 return -EINVAL; in api_cancel_or_release_fll16m()
218 const struct fll16m_dev_config *dev_config = dev->config; in api_get_rate_fll16m()
220 *rate = dev_config->fixed_frequency; in api_get_rate_fll16m()
227 struct fll16m_dev_data *dev_data = dev->data; in fll16m_init()
232 /* Closed-loop mode uses LFXO as source if present, HFXO otherwise */ in fll16m_init()
250 return clock_config_init(&dev_data->clk_cfg, in fll16m_init()
251 ARRAY_SIZE(dev_data->clk_cfg.onoff), in fll16m_init()