@@ -271,6 +271,39 @@ static int init_hfxo(const struct device *dev)
271
271
return 0 ;
272
272
}
273
273
274
+ static int api_resolve (const struct device * dev ,
275
+ const struct nrf_clock_spec * req_spec ,
276
+ struct nrf_clock_spec * res_spec )
277
+ {
278
+ const struct dev_config_hfxo * dev_config = dev -> config ;
279
+
280
+ if (!is_clock_spec_valid (dev , req_spec )) {
281
+ return - EINVAL ;
282
+ }
283
+
284
+ res_spec -> frequency = dev_config -> fixed_frequency ;
285
+ res_spec -> accuracy = dev_config -> fixed_accuracy ;
286
+ res_spec -> precision = NRF_CLOCK_CONTROL_PRECISION_HIGH ;
287
+ return 0 ;
288
+ }
289
+
290
+ static int api_get_startup_time (const struct device * dev ,
291
+ const struct nrf_clock_spec * spec ,
292
+ uint32_t * startup_time_us )
293
+ {
294
+ if (!is_clock_spec_valid (dev , spec )) {
295
+ return - EINVAL ;
296
+ }
297
+
298
+ * startup_time_us = nrf_bicr_hfxo_startup_time_us_get (BICR );
299
+
300
+ if (* startup_time_us == NRF_BICR_HFXO_STARTUP_TIME_UNCONFIGURED ) {
301
+ return - EINVAL ;
302
+ }
303
+
304
+ return 0 ;
305
+ }
306
+
274
307
static DEVICE_API (nrf_clock_control , drv_api_hfxo ) = {
275
308
.std_api = {
276
309
.on = api_nosys_on_off ,
@@ -280,6 +313,8 @@ static DEVICE_API(nrf_clock_control, drv_api_hfxo) = {
280
313
.request = api_request_hfxo ,
281
314
.release = api_release_hfxo ,
282
315
.cancel_or_release = api_cancel_or_release_hfxo ,
316
+ .resolve = api_resolve ,
317
+ .get_startup_time = api_get_startup_time ,
283
318
};
284
319
285
320
static struct dev_data_hfxo data_hfxo ;
0 commit comments