Lines Matching full:hsi

3  * HSI core.
9 #include <linux/hsi/hsi.h>
23 return sprintf(buf, "hsi:%s\n", dev_name(dev)); in modalias_show()
35 add_uevent_var(env, "MODALIAS=hsi:%s", dev_name(dev)); in hsi_bus_uevent()
52 .name = "hsi",
103 pr_err("hsi: failed to register client: %s\n", info->name); in hsi_new_client()
118 static void hsi_scan_board_info(struct hsi_controller *hsi) in hsi_scan_board_info() argument
124 if (cl_info->info.hsi_id == hsi->id) { in hsi_scan_board_info()
125 p = hsi_find_port_num(hsi, cl_info->info.port); in hsi_scan_board_info()
214 err = hsi_of_property_parse_mode(client, "hsi-mode", &mode); in hsi_add_client_from_dt()
216 err = hsi_of_property_parse_mode(client, "hsi-rx-mode", in hsi_add_client_from_dt()
221 err = hsi_of_property_parse_mode(client, "hsi-tx-mode", in hsi_add_client_from_dt()
230 err = of_property_read_u32(client, "hsi-speed-kbps", in hsi_add_client_from_dt()
236 err = hsi_of_property_parse_flow(client, "hsi-flow", in hsi_add_client_from_dt()
241 err = hsi_of_property_parse_arb_mode(client, "hsi-arb-mode", in hsi_add_client_from_dt()
246 prop = of_find_property(client, "hsi-channel-ids", &length); in hsi_add_client_from_dt()
270 err = of_property_read_u32_index(client, "hsi-channel-ids", i, in hsi_add_client_from_dt()
275 err = of_property_read_string_index(client, "hsi-channel-names", in hsi_add_client_from_dt()
297 pr_err("hsi: failed to register client: %s\n", name); in hsi_add_client_from_dt()
309 pr_err("hsi client: missing or incorrect of property: err=%d\n", err); in hsi_add_client_from_dt()
316 /* register hsi-char device */ in hsi_add_clients_from_dt()
343 struct hsi_controller *hsi = to_hsi_controller(dev); in hsi_controller_release() local
345 kfree(hsi->port); in hsi_controller_release()
346 kfree(hsi); in hsi_controller_release()
355 * hsi_port_unregister_clients - Unregister an HSI port
356 * @port: The HSI port to unregister
365 * hsi_unregister_controller - Unregister an HSI controller
366 * @hsi: The HSI controller to register
368 void hsi_unregister_controller(struct hsi_controller *hsi) in hsi_unregister_controller() argument
370 device_for_each_child(&hsi->device, NULL, hsi_remove_port); in hsi_unregister_controller()
371 device_unregister(&hsi->device); in hsi_unregister_controller()
376 * hsi_register_controller - Register an HSI controller and its ports
377 * @hsi: The HSI controller to register
381 int hsi_register_controller(struct hsi_controller *hsi) in hsi_register_controller() argument
386 err = device_add(&hsi->device); in hsi_register_controller()
389 for (i = 0; i < hsi->num_ports; i++) { in hsi_register_controller()
390 hsi->port[i]->device.parent = &hsi->device; in hsi_register_controller()
391 err = device_add(&hsi->port[i]->device); in hsi_register_controller()
395 /* Populate HSI bus with HSI clients */ in hsi_register_controller()
396 hsi_scan_board_info(hsi); in hsi_register_controller()
401 device_del(&hsi->port[i]->device); in hsi_register_controller()
402 device_del(&hsi->device); in hsi_register_controller()
409 * hsi_register_client_driver - Register an HSI client to the HSI bus
410 * @drv: HSI client driver to register
433 * hsi_put_controller - Free an HSI controller
435 * @hsi: Pointer to the HSI controller to freed
437 * HSI controller drivers should only use this function if they need
441 void hsi_put_controller(struct hsi_controller *hsi) in hsi_put_controller() argument
445 if (!hsi) in hsi_put_controller()
448 for (i = 0; i < hsi->num_ports; i++) in hsi_put_controller()
449 if (hsi->port && hsi->port[i]) in hsi_put_controller()
450 put_device(&hsi->port[i]->device); in hsi_put_controller()
451 put_device(&hsi->device); in hsi_put_controller()
456 * hsi_alloc_controller - Allocate an HSI controller and its ports
457 * @n_ports: Number of ports on the HSI controller
464 struct hsi_controller *hsi; in hsi_alloc_controller() local
471 hsi = kzalloc(sizeof(*hsi), flags); in hsi_alloc_controller()
472 if (!hsi) in hsi_alloc_controller()
476 kfree(hsi); in hsi_alloc_controller()
479 hsi->num_ports = n_ports; in hsi_alloc_controller()
480 hsi->port = port; in hsi_alloc_controller()
481 hsi->device.release = hsi_controller_release; in hsi_alloc_controller()
482 device_initialize(&hsi->device); in hsi_alloc_controller()
498 hsi->port[i]->device.release = hsi_port_release; in hsi_alloc_controller()
499 device_initialize(&hsi->port[i]->device); in hsi_alloc_controller()
502 return hsi; in hsi_alloc_controller()
504 hsi_put_controller(hsi); in hsi_alloc_controller()
511 * hsi_free_msg - Free an HSI message
512 * @msg: Pointer to the HSI message
526 * hsi_alloc_msg - Allocate an HSI message
531 * In that case, HSI drivers will call the complete callback when
559 * hsi_async - Submit an HSI transfer to the controller
560 * @cl: HSI client sending the transfer
561 * @msg: The HSI transfer passed to controller
563 * The HSI message must have the channel, ttype, complete and destructor
567 * HSI controllers relay on pre-allocated buffers from their clients and they
570 * Once the HSI message transfer finishes, the HSI controller calls the
571 * complete callback with the status and actual_len fields of the HSI message
592 * hsi_claim_port - Claim the HSI client's port
593 * @cl: HSI client that wants to claim its port
623 * hsi_release_port - Release the HSI client's port
624 * @cl: HSI client which previously claimed its port
656 * @cl: HSI client that wants to receive port events
684 * @cl: HSI client that wants to stop receiving port events
712 * to a race condition in HSI HW protocol, clients need to be notified
729 * @cl: HSI client, which uses the channel
732 * Clients can call this function to get the hsi channel ids similar to
766 MODULE_DESCRIPTION("High-speed Synchronous Serial Interface (HSI) framework");