Lines Matching refs:ddata
78 struct st_rproc *ddata = rproc->priv; in st_rproc_kick() local
86 ret = mbox_send_message(ddata->mbox_chan[vqid * MBOX_MAX + MBOX_TX], in st_rproc_kick()
165 struct st_rproc *ddata = rproc->priv; in st_rproc_start() local
168 regmap_update_bits(ddata->boot_base, ddata->boot_offset, in st_rproc_start()
169 ddata->config->bootaddr_mask, rproc->bootaddr); in st_rproc_start()
171 err = clk_enable(ddata->clk); in st_rproc_start()
177 if (ddata->config->sw_reset) { in st_rproc_start()
178 err = reset_control_deassert(ddata->sw_reset); in st_rproc_start()
185 if (ddata->config->pwr_reset) { in st_rproc_start()
186 err = reset_control_deassert(ddata->pwr_reset); in st_rproc_start()
199 if (ddata->config->pwr_reset) in st_rproc_start()
200 reset_control_assert(ddata->sw_reset); in st_rproc_start()
202 clk_disable(ddata->clk); in st_rproc_start()
209 struct st_rproc *ddata = rproc->priv; in st_rproc_stop() local
212 if (ddata->config->sw_reset) { in st_rproc_stop()
213 sw_err = reset_control_assert(ddata->sw_reset); in st_rproc_stop()
218 if (ddata->config->pwr_reset) { in st_rproc_stop()
219 pwr_err = reset_control_assert(ddata->pwr_reset); in st_rproc_stop()
224 clk_disable(ddata->clk); in st_rproc_stop()
246 struct st_rproc *ddata = rproc->priv; in st_rproc_state() local
249 if (ddata->config->sw_reset) in st_rproc_state()
250 reset_sw = reset_control_status(ddata->sw_reset); in st_rproc_state()
252 if (ddata->config->pwr_reset) in st_rproc_state()
253 reset_pwr = reset_control_status(ddata->pwr_reset); in st_rproc_state()
284 struct st_rproc *ddata = rproc->priv; in st_rproc_parse_dt() local
288 if (ddata->config->sw_reset) { in st_rproc_parse_dt()
289 ddata->sw_reset = devm_reset_control_get_exclusive(dev, in st_rproc_parse_dt()
291 if (IS_ERR(ddata->sw_reset)) { in st_rproc_parse_dt()
293 return PTR_ERR(ddata->sw_reset); in st_rproc_parse_dt()
297 if (ddata->config->pwr_reset) { in st_rproc_parse_dt()
298 ddata->pwr_reset = devm_reset_control_get_exclusive(dev, in st_rproc_parse_dt()
300 if (IS_ERR(ddata->pwr_reset)) { in st_rproc_parse_dt()
302 return PTR_ERR(ddata->pwr_reset); in st_rproc_parse_dt()
306 ddata->clk = devm_clk_get(dev, NULL); in st_rproc_parse_dt()
307 if (IS_ERR(ddata->clk)) { in st_rproc_parse_dt()
309 return PTR_ERR(ddata->clk); in st_rproc_parse_dt()
312 err = of_property_read_u32(np, "clock-frequency", &ddata->clk_rate); in st_rproc_parse_dt()
318 ddata->boot_base = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); in st_rproc_parse_dt()
319 if (IS_ERR(ddata->boot_base)) { in st_rproc_parse_dt()
321 return PTR_ERR(ddata->boot_base); in st_rproc_parse_dt()
325 &ddata->boot_offset); in st_rproc_parse_dt()
331 err = clk_prepare(ddata->clk); in st_rproc_parse_dt()
342 struct st_rproc *ddata; in st_rproc_probe() local
355 rproc = rproc_alloc(dev, np->name, &st_rproc_ops, NULL, sizeof(*ddata)); in st_rproc_probe()
360 ddata = rproc->priv; in st_rproc_probe()
361 ddata->config = (struct st_rproc_config *)match->data; in st_rproc_probe()
379 clk_set_rate(ddata->clk, ddata->clk_rate); in st_rproc_probe()
383 ddata->mbox_client_vq0.dev = dev; in st_rproc_probe()
384 ddata->mbox_client_vq0.tx_done = NULL; in st_rproc_probe()
385 ddata->mbox_client_vq0.tx_block = false; in st_rproc_probe()
386 ddata->mbox_client_vq0.knows_txdone = false; in st_rproc_probe()
387 ddata->mbox_client_vq0.rx_callback = st_rproc_mbox_callback_vq0; in st_rproc_probe()
389 ddata->mbox_client_vq1.dev = dev; in st_rproc_probe()
390 ddata->mbox_client_vq1.tx_done = NULL; in st_rproc_probe()
391 ddata->mbox_client_vq1.tx_block = false; in st_rproc_probe()
392 ddata->mbox_client_vq1.knows_txdone = false; in st_rproc_probe()
393 ddata->mbox_client_vq1.rx_callback = st_rproc_mbox_callback_vq1; in st_rproc_probe()
399 chan = mbox_request_channel_byname(&ddata->mbox_client_vq0, "vq0_rx"); in st_rproc_probe()
405 ddata->mbox_chan[ST_RPROC_VQ0 * MBOX_MAX + MBOX_RX] = chan; in st_rproc_probe()
407 chan = mbox_request_channel_byname(&ddata->mbox_client_vq0, "vq0_tx"); in st_rproc_probe()
413 ddata->mbox_chan[ST_RPROC_VQ0 * MBOX_MAX + MBOX_TX] = chan; in st_rproc_probe()
415 chan = mbox_request_channel_byname(&ddata->mbox_client_vq1, "vq1_rx"); in st_rproc_probe()
421 ddata->mbox_chan[ST_RPROC_VQ1 * MBOX_MAX + MBOX_RX] = chan; in st_rproc_probe()
423 chan = mbox_request_channel_byname(&ddata->mbox_client_vq1, "vq1_tx"); in st_rproc_probe()
429 ddata->mbox_chan[ST_RPROC_VQ1 * MBOX_MAX + MBOX_TX] = chan; in st_rproc_probe()
440 mbox_free_channel(ddata->mbox_chan[i]); in st_rproc_probe()
442 clk_unprepare(ddata->clk); in st_rproc_probe()
451 struct st_rproc *ddata = rproc->priv; in st_rproc_remove() local
456 clk_disable_unprepare(ddata->clk); in st_rproc_remove()
459 mbox_free_channel(ddata->mbox_chan[i]); in st_rproc_remove()