Skip to content

Commit a28ba1d

Browse files
bjarki-andreasencarlescufi
authored andcommitted
drivers: gnss: api: Remove periodic configuration
The GNSS device driver API includes an API for setting the periodic power configuration at runtime. This API is not used in-tree, and is antithetical to the pm device subsystem. The periodic config configures the GNSS to search for a fix for a given amount of time, then suspend itself for a given amount of time, and repeat this pattern. The issue with this is that both the application and the GNSS modem itself can be in a conflicting power state, where the device is resumed (pm device), but actually suspended. Applications which wish to periodically resume/suspend the modem, even in more sophisticated ways like suspended after first fix, can simply implement this logic, using the pm_device calls and the GNSS callbacks. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
1 parent 345eb8e commit a28ba1d

File tree

1 file changed

+0
-71
lines changed

1 file changed

+0
-71
lines changed

include/zephyr/drivers/gnss.h

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,6 @@ typedef int (*gnss_set_fix_rate_t)(const struct device *dev, uint32_t fix_interv
4848
/** API for getting fix rate */
4949
typedef int (*gnss_get_fix_rate_t)(const struct device *dev, uint32_t *fix_interval_ms);
5050

51-
/**
52-
* @brief GNSS periodic tracking configuration
53-
*
54-
* @note Setting either active_time or inactive_time to 0 will disable periodic
55-
* function.
56-
*/
57-
struct gnss_periodic_config {
58-
/** The time the GNSS will spend in the active state in ms */
59-
uint32_t active_time_ms;
60-
/** The time the GNSS will spend in the inactive state in ms */
61-
uint32_t inactive_time_ms;
62-
};
63-
64-
/** API for setting periodic tracking configuration */
65-
typedef int (*gnss_set_periodic_config_t)(const struct device *dev,
66-
const struct gnss_periodic_config *periodic_config);
67-
68-
/** API for setting periodic tracking configuration */
69-
typedef int (*gnss_get_periodic_config_t)(const struct device *dev,
70-
struct gnss_periodic_config *periodic_config);
71-
7251
/** GNSS navigation modes */
7352
enum gnss_navigation_mode {
7453
/** Dynamics have no impact on tracking */
@@ -183,8 +162,6 @@ struct gnss_time {
183162
__subsystem struct gnss_driver_api {
184163
gnss_set_fix_rate_t set_fix_rate;
185164
gnss_get_fix_rate_t get_fix_rate;
186-
gnss_set_periodic_config_t set_periodic_config;
187-
gnss_get_periodic_config_t get_periodic_config;
188165
gnss_set_navigation_mode_t set_navigation_mode;
189166
gnss_get_navigation_mode_t get_navigation_mode;
190167
gnss_set_enabled_systems_t set_enabled_systems;
@@ -286,54 +263,6 @@ static inline int z_impl_gnss_get_fix_rate(const struct device *dev, uint32_t *f
286263
return api->get_fix_rate(dev, fix_interval_ms);
287264
}
288265

289-
/**
290-
* @brief Set the GNSS periodic tracking configuration
291-
*
292-
* @param dev Device instance
293-
* @param config Periodic tracking configuration to set
294-
*
295-
* @return 0 if successful
296-
* @return -errno negative errno code on failure
297-
*/
298-
__syscall int gnss_set_periodic_config(const struct device *dev,
299-
const struct gnss_periodic_config *config);
300-
301-
static inline int z_impl_gnss_set_periodic_config(const struct device *dev,
302-
const struct gnss_periodic_config *config)
303-
{
304-
const struct gnss_driver_api *api = (const struct gnss_driver_api *)dev->api;
305-
306-
if (api->set_periodic_config == NULL) {
307-
return -ENOSYS;
308-
}
309-
310-
return api->set_periodic_config(dev, config);
311-
}
312-
313-
/**
314-
* @brief Get the GNSS periodic tracking configuration
315-
*
316-
* @param dev Device instance
317-
* @param config Destination for periodic tracking configuration
318-
*
319-
* @return 0 if successful
320-
* @return -errno negative errno code on failure
321-
*/
322-
__syscall int gnss_get_periodic_config(const struct device *dev,
323-
struct gnss_periodic_config *config);
324-
325-
static inline int z_impl_gnss_get_periodic_config(const struct device *dev,
326-
struct gnss_periodic_config *config)
327-
{
328-
const struct gnss_driver_api *api = (const struct gnss_driver_api *)dev->api;
329-
330-
if (api->get_periodic_config == NULL) {
331-
return -ENOSYS;
332-
}
333-
334-
return api->get_periodic_config(dev, config);
335-
}
336-
337266
/**
338267
* @brief Set the GNSS navigation mode
339268
*

0 commit comments

Comments
 (0)