drivers: clock_control: Add subsys argument to the callback

Added subsys argument to the callback, updated one driver which
used it and test cases.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2020-02-03 12:54:34 +01:00 committed by Carles Cufí
commit ce766305b7
6 changed files with 34 additions and 15 deletions

View file

@ -34,7 +34,6 @@ enum clock_control_status {
CLOCK_CONTROL_STATUS_UNKNOWN
};
typedef void (*clock_control_cb_t)(struct device *dev, void *user_data);
/**
* @cond INTERNAL_HIDDEN
@ -48,6 +47,23 @@ typedef void (*clock_control_cb_t)(struct device *dev, void *user_data);
* INTERNAL_HIDDEN @endcond
*/
/**
* clock_control_subsys_t is a type to identify a clock controller sub-system.
* Such data pointed is opaque and relevant only to the clock controller
* driver instance being used.
*/
typedef void *clock_control_subsys_t;
/** @brief Callback called on clock started.
*
* @param dev Device structure whose driver controls the clock.
* @param subsys Opaque data representing the clock.
* @param user_data User data.
*/
typedef void (*clock_control_cb_t)(struct device *dev,
clock_control_subsys_t subsys,
void *user_data);
/**
* Define and initialize clock_control async data.
*
@ -72,13 +88,6 @@ struct clock_control_async_data {
void *user_data;
};
/**
* clock_control_subsys_t is a type to identify a clock controller sub-system.
* Such data pointed is opaque and relevant only to the clock controller
* driver instance being used.
*/
typedef void *clock_control_subsys_t;
typedef int (*clock_control)(struct device *dev, clock_control_subsys_t sys);
typedef int (*clock_control_get)(struct device *dev,