Lines Matching refs:ctx

43     struct mod_mock_clock_element_ctx *ctx,  in get_rate_entry()  argument
49 fwk_assert(ctx != NULL); in get_rate_entry()
53 for (i = 0; i < ctx->config->rate_count; i++) { in get_rate_entry()
54 if (ctx->config->rate_table[i].rate == target_rate) { in get_rate_entry()
55 *entry = (struct mod_mock_clock_rate *)&ctx->config->rate_table[i]; in get_rate_entry()
73 struct mod_mock_clock_element_ctx *ctx; in mod_mock_clock_set_rate() local
76 ctx = mod_mock_clock_get_ctx(clock_id); in mod_mock_clock_set_rate()
78 if (ctx->state == MOD_CLOCK_STATE_STOPPED) { in mod_mock_clock_set_rate()
87 status = get_rate_entry(ctx, rate, &rate_entry); in mod_mock_clock_set_rate()
92 ctx->current_rate_index = in mod_mock_clock_set_rate()
93 (unsigned int)(rate_entry - ctx->config->rate_table); in mod_mock_clock_set_rate()
95 ctx->rate_initialized = true; in mod_mock_clock_set_rate()
102 struct mod_mock_clock_element_ctx *ctx; in mod_mock_clock_get_rate() local
104 ctx = mod_mock_clock_get_ctx(clock_id); in mod_mock_clock_get_rate()
106 if (!ctx->rate_initialized) { in mod_mock_clock_get_rate()
110 *rate = ctx->config->rate_table[ctx->current_rate_index].rate; in mod_mock_clock_get_rate()
120 struct mod_mock_clock_element_ctx *ctx; in mod_mock_clock_get_rate_from_index() local
122 ctx = mod_mock_clock_get_ctx(clock_id); in mod_mock_clock_get_rate_from_index()
124 if (rate_index >= ctx->config->rate_count) { in mod_mock_clock_get_rate_from_index()
128 *rate = ctx->config->rate_table[rate_index].rate; in mod_mock_clock_get_rate_from_index()
137 struct mod_mock_clock_element_ctx *ctx; in mod_mock_clock_set_state() local
139 ctx = mod_mock_clock_get_ctx(clock_id); in mod_mock_clock_set_state()
141 ctx->state = state; in mod_mock_clock_set_state()
150 struct mod_mock_clock_element_ctx *ctx; in mod_mock_clock_get_state() local
152 ctx = mod_mock_clock_get_ctx(clock_id); in mod_mock_clock_get_state()
154 *state = ctx->state; in mod_mock_clock_get_state()
163 struct mod_mock_clock_element_ctx *ctx; in mod_mock_clock_get_range() local
165 ctx = mod_mock_clock_get_ctx(clock_id); in mod_mock_clock_get_range()
168 range->min = ctx->config->rate_table[0].rate; in mod_mock_clock_get_range()
169 range->max = ctx->config->rate_table[ctx->config->rate_count - 1].rate; in mod_mock_clock_get_range()
170 range->rate_count = ctx->config->rate_count; in mod_mock_clock_get_range()
192 struct mod_mock_clock_element_ctx *ctx; in mod_mock_clock_update_input_rate() local
196 ctx = mod_mock_clock_get_ctx(clock_id); in mod_mock_clock_update_input_rate()
198 if (ctx->state == MOD_CLOCK_STATE_STOPPED || !ctx->rate_initialized) { in mod_mock_clock_update_input_rate()
204 status = get_rate_entry(ctx, input_rate, &rate_entry); in mod_mock_clock_update_input_rate()
209 ctx->current_rate_index = in mod_mock_clock_update_input_rate()
210 (unsigned int)(rate_entry - ctx->config->rate_table); in mod_mock_clock_update_input_rate()
249 struct mod_mock_clock_element_ctx *ctx; in mod_mock_clock_element_init() local
254 ctx = mod_mock_clock_get_ctx(element_id); in mod_mock_clock_element_init()
269 ctx->current_rate_index = rate_index; in mod_mock_clock_element_init()
270 ctx->rate_initialized = true; in mod_mock_clock_element_init()
271 ctx->state = MOD_CLOCK_STATE_RUNNING; in mod_mock_clock_element_init()
275 ctx->config = cfg; in mod_mock_clock_element_init()