Lines Matching refs:hd
103 struct gb_host_device *hd; member
136 static inline struct es2_ap_dev *hd_to_es2(struct gb_host_device *hd) in hd_to_es2() argument
138 return (struct es2_ap_dev *)&hd->hd_priv; in hd_to_es2()
217 static int output(struct gb_host_device *hd, void *req, u16 size, u8 cmd, in output() argument
220 struct es2_ap_dev *es2 = hd_to_es2(hd); in output()
390 static int message_send(struct gb_host_device *hd, u16 cport_id, in message_send() argument
393 struct es2_ap_dev *es2 = hd_to_es2(hd); in message_send()
405 if (!cport_id_valid(hd, cport_id)) { in message_send()
455 struct gb_host_device *hd = message->operation->connection->hd; in message_cancel() local
456 struct es2_ap_dev *es2 = hd_to_es2(hd); in message_cancel()
488 static int es2_cport_allocate(struct gb_host_device *hd, int cport_id, in es2_cport_allocate() argument
491 struct es2_ap_dev *es2 = hd_to_es2(hd); in es2_cport_allocate()
492 struct ida *id_map = &hd->cport_id_map; in es2_cport_allocate()
498 dev_err(&hd->dev, "cport %d not available\n", cport_id); in es2_cport_allocate()
505 dev_err(&hd->dev, "CDSI1 already in use\n"); in es2_cport_allocate()
516 ida_end = hd->num_cports; in es2_cport_allocate()
517 } else if (cport_id < hd->num_cports) { in es2_cport_allocate()
521 dev_err(&hd->dev, "cport %d not available\n", cport_id); in es2_cport_allocate()
528 static void es2_cport_release(struct gb_host_device *hd, u16 cport_id) in es2_cport_release() argument
530 struct es2_ap_dev *es2 = hd_to_es2(hd); in es2_cport_release()
538 ida_simple_remove(&hd->cport_id_map, cport_id); in es2_cport_release()
541 static int cport_enable(struct gb_host_device *hd, u16 cport_id, in cport_enable() argument
544 struct es2_ap_dev *es2 = hd_to_es2(hd); in cport_enable()
562 dev_dbg(&hd->dev, "%s - cport = %u, flags = %02x\n", __func__, in cport_enable()
586 static int es2_cport_connected(struct gb_host_device *hd, u16 cport_id) in es2_cport_connected() argument
588 struct es2_ap_dev *es2 = hd_to_es2(hd); in es2_cport_connected()
605 static int es2_cport_flush(struct gb_host_device *hd, u16 cport_id) in es2_cport_flush() argument
607 struct es2_ap_dev *es2 = hd_to_es2(hd); in es2_cport_flush()
623 static int es2_cport_shutdown(struct gb_host_device *hd, u16 cport_id, in es2_cport_shutdown() argument
626 struct es2_ap_dev *es2 = hd_to_es2(hd); in es2_cport_shutdown()
649 static int es2_cport_quiesce(struct gb_host_device *hd, u16 cport_id, in es2_cport_quiesce() argument
652 struct es2_ap_dev *es2 = hd_to_es2(hd); in es2_cport_quiesce()
678 static int es2_cport_clear(struct gb_host_device *hd, u16 cport_id) in es2_cport_clear() argument
680 struct es2_ap_dev *es2 = hd_to_es2(hd); in es2_cport_clear()
696 static int latency_tag_enable(struct gb_host_device *hd, u16 cport_id) in latency_tag_enable() argument
699 struct es2_ap_dev *es2 = hd_to_es2(hd); in latency_tag_enable()
714 static int latency_tag_disable(struct gb_host_device *hd, u16 cport_id) in latency_tag_disable() argument
717 struct es2_ap_dev *es2 = hd_to_es2(hd); in latency_tag_disable()
807 gb_hd_cport_release_reserved(es2->hd, ES2_CPORT_CDSI1); in es2_destroy()
808 gb_hd_cport_release_reserved(es2->hd, ES2_CPORT_CDSI0); in es2_destroy()
811 gb_hd_put(es2->hd); in es2_destroy()
818 struct gb_host_device *hd = urb->context; in cport_in_callback() local
846 if (cport_id_valid(hd, cport_id)) { in cport_in_callback()
847 greybus_data_rcvd(hd, cport_id, urb->transfer_buffer, in cport_in_callback()
862 struct gb_host_device *hd = message->operation->connection->hd; in cport_out_callback() local
863 struct es2_ap_dev *es2 = hd_to_es2(hd); in cport_out_callback()
877 greybus_message_sent(hd, message, status); in cport_out_callback()
1253 struct gb_host_device *hd; in ap_probe() local
1275 hd = gb_hd_create(&es2_driver, &udev->dev, ES2_GBUF_MSG_SIZE_MAX, in ap_probe()
1277 if (IS_ERR(hd)) { in ap_probe()
1279 return PTR_ERR(hd); in ap_probe()
1282 es2 = hd_to_es2(hd); in ap_probe()
1283 es2->hd = hd; in ap_probe()
1294 retval = gb_hd_cport_reserve(hd, ES2_CPORT_CDSI0); in ap_probe()
1297 retval = gb_hd_cport_reserve(hd, ES2_CPORT_CDSI1); in ap_probe()
1363 cport_in_callback, hd); in ap_probe()
1422 retval = gb_hd_add(hd); in ap_probe()
1433 gb_hd_del(hd); in ap_probe()
1446 gb_hd_del(es2->hd); in ap_disconnect()