Lines Matching full:fw
41 struct rpi_firmware *fw = container_of(cl, struct rpi_firmware, cl); in response_callback() local
42 complete(&fw->c); in response_callback()
50 rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) in rpi_firmware_transaction() argument
58 reinit_completion(&fw->c); in rpi_firmware_transaction()
59 ret = mbox_send_message(fw->chan, &message); in rpi_firmware_transaction()
61 if (wait_for_completion_timeout(&fw->c, HZ)) { in rpi_firmware_transaction()
67 dev_err(fw->cl.dev, "mbox_send_message returned %d\n", ret); in rpi_firmware_transaction()
76 * @fw: Pointer to firmware structure from rpi_firmware_get().
88 int rpi_firmware_property_list(struct rpi_firmware *fw, in rpi_firmware_property_list() argument
100 buf = dma_alloc_coherent(fw->chan->mbox->dev, PAGE_ALIGN(size), in rpi_firmware_property_list()
114 ret = rpi_firmware_transaction(fw, MBOX_CHAN_PROPERTY, bus_addr); in rpi_firmware_property_list()
124 dev_err(fw->cl.dev, "Request 0x%08x returned status 0x%08x\n", in rpi_firmware_property_list()
131 dma_free_coherent(fw->chan->mbox->dev, PAGE_ALIGN(size), buf, bus_addr); in rpi_firmware_property_list()
139 * @fw: Pointer to firmware structure from rpi_firmware_get().
151 int rpi_firmware_property(struct rpi_firmware *fw, in rpi_firmware_property() argument
173 ret = rpi_firmware_property_list(fw, data, buf_size + sizeof(*header)); in rpi_firmware_property()
184 rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) in rpi_firmware_print_firmware_revision() argument
188 int ret = rpi_firmware_property(fw, in rpi_firmware_print_firmware_revision()
197 dev_info(fw->cl.dev, "Attached to firmware from %ptT\n", &date_and_time); in rpi_firmware_print_firmware_revision()
201 rpi_register_hwmon_driver(struct device *dev, struct rpi_firmware *fw) in rpi_register_hwmon_driver() argument
204 int ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_THROTTLED, in rpi_register_hwmon_driver()
234 unsigned int rpi_firmware_clk_get_max_rate(struct rpi_firmware *fw, unsigned int id) in rpi_firmware_clk_get_max_rate() argument
240 ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_MAX_CLOCK_RATE, in rpi_firmware_clk_get_max_rate()
256 struct rpi_firmware *fw = container_of(kref, struct rpi_firmware, in rpi_firmware_delete() local
259 mbox_free_channel(fw->chan); in rpi_firmware_delete()
260 kfree(fw); in rpi_firmware_delete()
263 void rpi_firmware_put(struct rpi_firmware *fw) in rpi_firmware_put() argument
265 kref_put(&fw->consumers, rpi_firmware_delete); in rpi_firmware_put()
271 struct rpi_firmware *fw = data; in devm_rpi_firmware_put() local
273 rpi_firmware_put(fw); in devm_rpi_firmware_put()
279 struct rpi_firmware *fw; in rpi_firmware_probe() local
285 fw = kzalloc(sizeof(*fw), GFP_KERNEL); in rpi_firmware_probe()
286 if (!fw) in rpi_firmware_probe()
289 fw->cl.dev = dev; in rpi_firmware_probe()
290 fw->cl.rx_callback = response_callback; in rpi_firmware_probe()
291 fw->cl.tx_block = true; in rpi_firmware_probe()
293 fw->chan = mbox_request_channel(&fw->cl, 0); in rpi_firmware_probe()
294 if (IS_ERR(fw->chan)) { in rpi_firmware_probe()
295 int ret = PTR_ERR(fw->chan); in rpi_firmware_probe()
296 kfree(fw); in rpi_firmware_probe()
300 init_completion(&fw->c); in rpi_firmware_probe()
301 kref_init(&fw->consumers); in rpi_firmware_probe()
303 platform_set_drvdata(pdev, fw); in rpi_firmware_probe()
305 rpi_firmware_print_firmware_revision(fw); in rpi_firmware_probe()
306 rpi_register_hwmon_driver(dev, fw); in rpi_firmware_probe()
314 struct rpi_firmware *fw = platform_get_drvdata(pdev); in rpi_firmware_shutdown() local
316 if (!fw) in rpi_firmware_shutdown()
319 rpi_firmware_property(fw, RPI_FIRMWARE_NOTIFY_REBOOT, NULL, 0); in rpi_firmware_shutdown()
324 struct rpi_firmware *fw = platform_get_drvdata(pdev); in rpi_firmware_remove() local
331 rpi_firmware_put(fw); in rpi_firmware_remove()
357 struct rpi_firmware *fw; in rpi_firmware_get() local
362 fw = platform_get_drvdata(pdev); in rpi_firmware_get()
363 if (!fw) in rpi_firmware_get()
366 if (!kref_get_unless_zero(&fw->consumers)) in rpi_firmware_get()
371 return fw; in rpi_firmware_get()
389 struct rpi_firmware *fw; in devm_rpi_firmware_get() local
391 fw = rpi_firmware_get(firmware_node); in devm_rpi_firmware_get()
392 if (!fw) in devm_rpi_firmware_get()
395 if (devm_add_action_or_reset(dev, devm_rpi_firmware_put, fw)) in devm_rpi_firmware_get()
398 return fw; in devm_rpi_firmware_get()