• Home
  • Raw
  • Download

Lines Matching full:provider

16 #include <linux/clk-provider.h>
33 * struct sci_clk_provider - TI SCI clock provider representation
36 * @dev: Device pointer for the clock provider
38 * @num_clocks: Total number of clocks for this provider
54 * @provider: Master clock provider
65 struct sci_clk_provider *provider; member
87 return clk->provider->ops->get_clock(clk->provider->sci, clk->dev_id, in sci_clk_prepare()
104 ret = clk->provider->ops->put_clock(clk->provider->sci, clk->dev_id, in sci_clk_unprepare()
107 dev_err(clk->provider->dev, in sci_clk_unprepare()
125 ret = clk->provider->ops->is_on(clk->provider->sci, clk->dev_id, in sci_clk_is_prepared()
129 dev_err(clk->provider->dev, in sci_clk_is_prepared()
153 ret = clk->provider->ops->get_freq(clk->provider->sci, clk->dev_id, in sci_clk_recalc_rate()
156 dev_err(clk->provider->dev, in sci_clk_recalc_rate()
187 ret = clk->provider->ops->get_best_match_freq(clk->provider->sci, in sci_clk_determine_rate()
195 dev_err(clk->provider->dev, in sci_clk_determine_rate()
223 return clk->provider->ops->set_freq(clk->provider->sci, clk->dev_id, in sci_clk_set_rate()
240 ret = clk->provider->ops->get_parent(clk->provider->sci, clk->dev_id, in sci_clk_get_parent()
243 dev_err(clk->provider->dev, in sci_clk_get_parent()
267 return clk->provider->ops->set_parent(clk->provider->sci, clk->dev_id, in sci_clk_set_parent()
285 * @provider: Handle to SCI clock provider
294 static int _sci_clk_build(struct sci_clk_provider *provider, in _sci_clk_build() argument
347 ret = devm_clk_hw_register(provider->dev, &sci_clk->hw); in _sci_clk_build()
349 dev_err(provider->dev, "failed clk register with %d\n", ret); in _sci_clk_build()
380 * @data: pointer to the clock provider
389 struct sci_clk_provider *provider = data; in sci_clk_get() local
399 clk = bsearch(&key, provider->clocks, provider->num_clocks, in sci_clk_get()
429 static int ti_sci_scan_clocks_from_fw(struct sci_clk_provider *provider) in ti_sci_scan_clocks_from_fw() argument
441 struct device *dev = provider->dev; in ti_sci_scan_clocks_from_fw()
444 ret = provider->ops->get_num_parents(provider->sci, dev_id, in ti_sci_scan_clocks_from_fw()
483 sci_clk->provider = provider; in ti_sci_scan_clocks_from_fw()
492 provider->clocks = devm_kmalloc_array(dev, num_clks, sizeof(sci_clk), in ti_sci_scan_clocks_from_fw()
494 if (!provider->clocks) in ti_sci_scan_clocks_from_fw()
497 memcpy(provider->clocks, clks, num_clks * sizeof(sci_clk)); in ti_sci_scan_clocks_from_fw()
499 provider->num_clocks = num_clks; in ti_sci_scan_clocks_from_fw()
517 static int ti_sci_scan_clocks_from_dt(struct sci_clk_provider *provider) in ti_sci_scan_clocks_from_dt() argument
519 struct device *dev = provider->dev; in ti_sci_scan_clocks_from_dt()
565 sci_clk->provider = provider; in ti_sci_scan_clocks_from_dt()
566 provider->ops->get_num_parents(provider->sci, in ti_sci_scan_clocks_from_dt()
605 sci_clk->provider = provider; in ti_sci_scan_clocks_from_dt()
618 provider->clocks = devm_kmalloc_array(dev, num_clks, sizeof(sci_clk), in ti_sci_scan_clocks_from_dt()
620 if (!provider->clocks) in ti_sci_scan_clocks_from_dt()
631 provider->clocks[num_clks++] = sci_clk; in ti_sci_scan_clocks_from_dt()
635 provider->num_clocks = num_clks; in ti_sci_scan_clocks_from_dt()
645 * Probes the TI SCI clock device. Allocates a new clock provider
655 struct sci_clk_provider *provider; in ti_sci_clk_probe() local
663 provider = devm_kzalloc(dev, sizeof(*provider), GFP_KERNEL); in ti_sci_clk_probe()
664 if (!provider) in ti_sci_clk_probe()
667 provider->sci = handle; in ti_sci_clk_probe()
668 provider->ops = &handle->ops.clk_ops; in ti_sci_clk_probe()
669 provider->dev = dev; in ti_sci_clk_probe()
672 ret = ti_sci_scan_clocks_from_fw(provider); in ti_sci_clk_probe()
678 ret = ti_sci_scan_clocks_from_dt(provider); in ti_sci_clk_probe()
685 ret = ti_sci_init_clocks(provider); in ti_sci_clk_probe()
691 return of_clk_add_hw_provider(np, sci_clk_get, provider); in ti_sci_clk_probe()
698 * Removes the TI SCI device. Unregisters the clock provider registered