Lines Matching refs:sys_controller

36 int mpfs_blocking_transaction(struct mpfs_sys_controller *sys_controller, struct mpfs_mss_msg *msg)  in mpfs_blocking_transaction()  argument
45 reinit_completion(&sys_controller->c); in mpfs_blocking_transaction()
47 ret = mbox_send_message(sys_controller->chan, msg); in mpfs_blocking_transaction()
49 dev_warn(sys_controller->client.dev, "MPFS sys controller service timeout\n"); in mpfs_blocking_transaction()
64 if (!wait_for_completion_timeout(&sys_controller->c, timeout)) { in mpfs_blocking_transaction()
66 dev_warn(sys_controller->client.dev, "MPFS sys controller service failed\n"); in mpfs_blocking_transaction()
80 struct mpfs_sys_controller *sys_controller = in mpfs_sys_controller_rx_callback() local
83 complete(&sys_controller->c); in mpfs_sys_controller_rx_callback()
88 struct mpfs_sys_controller *sys_controller = in mpfs_sys_controller_delete() local
91 mbox_free_channel(sys_controller->chan); in mpfs_sys_controller_delete()
92 kfree(sys_controller); in mpfs_sys_controller_delete()
97 struct mpfs_sys_controller *sys_controller = data; in mpfs_sys_controller_put() local
99 kref_put(&sys_controller->consumers, mpfs_sys_controller_delete); in mpfs_sys_controller_put()
116 struct mpfs_sys_controller *sys_controller; in mpfs_sys_controller_probe() local
119 sys_controller = kzalloc(sizeof(*sys_controller), GFP_KERNEL); in mpfs_sys_controller_probe()
120 if (!sys_controller) in mpfs_sys_controller_probe()
123 sys_controller->client.dev = dev; in mpfs_sys_controller_probe()
124 sys_controller->client.rx_callback = mpfs_sys_controller_rx_callback; in mpfs_sys_controller_probe()
125 sys_controller->client.tx_block = 1U; in mpfs_sys_controller_probe()
126 sys_controller->client.tx_tout = msecs_to_jiffies(MPFS_SYS_CTRL_TIMEOUT_MS); in mpfs_sys_controller_probe()
128 sys_controller->chan = mbox_request_channel(&sys_controller->client, 0); in mpfs_sys_controller_probe()
129 if (IS_ERR(sys_controller->chan)) { in mpfs_sys_controller_probe()
130 ret = dev_err_probe(dev, PTR_ERR(sys_controller->chan), in mpfs_sys_controller_probe()
132 kfree(sys_controller); in mpfs_sys_controller_probe()
136 init_completion(&sys_controller->c); in mpfs_sys_controller_probe()
137 kref_init(&sys_controller->consumers); in mpfs_sys_controller_probe()
139 platform_set_drvdata(pdev, sys_controller); in mpfs_sys_controller_probe()
154 struct mpfs_sys_controller *sys_controller = platform_get_drvdata(pdev); in mpfs_sys_controller_remove() local
156 mpfs_sys_controller_put(sys_controller); in mpfs_sys_controller_remove()
170 struct mpfs_sys_controller *sys_controller; in mpfs_sys_controller_get() local
181 sys_controller = dev_get_drvdata(dev->parent); in mpfs_sys_controller_get()
182 if (!sys_controller) in mpfs_sys_controller_get()
185 if (!kref_get_unless_zero(&sys_controller->consumers)) in mpfs_sys_controller_get()
188 ret = devm_add_action_or_reset(dev, mpfs_sys_controller_put, sys_controller); in mpfs_sys_controller_get()
192 return sys_controller; in mpfs_sys_controller_get()