Lines Matching refs:intf

45 static int gb_interface_hibernate_link(struct gb_interface *intf);
46 static int gb_interface_refclk_set(struct gb_interface *intf, bool enable);
48 static int gb_interface_dme_attr_get(struct gb_interface *intf, in gb_interface_dme_attr_get() argument
51 return gb_svc_dme_peer_get(intf->hd->svc, intf->interface_id, in gb_interface_dme_attr_get()
55 static int gb_interface_read_ara_dme(struct gb_interface *intf) in gb_interface_read_ara_dme() argument
64 if (intf->ddbl1_manufacturer_id != TOSHIBA_DMID) { in gb_interface_read_ara_dme()
65 dev_err(&intf->dev, "unknown manufacturer %08x\n", in gb_interface_read_ara_dme()
66 intf->ddbl1_manufacturer_id); in gb_interface_read_ara_dme()
70 ret = gb_interface_dme_attr_get(intf, DME_TOSHIBA_GMP_VID, in gb_interface_read_ara_dme()
71 &intf->vendor_id); in gb_interface_read_ara_dme()
75 ret = gb_interface_dme_attr_get(intf, DME_TOSHIBA_GMP_PID, in gb_interface_read_ara_dme()
76 &intf->product_id); in gb_interface_read_ara_dme()
80 ret = gb_interface_dme_attr_get(intf, DME_TOSHIBA_GMP_SN0, &sn0); in gb_interface_read_ara_dme()
84 ret = gb_interface_dme_attr_get(intf, DME_TOSHIBA_GMP_SN1, &sn1); in gb_interface_read_ara_dme()
88 intf->serial_number = (u64)sn1 << 32 | sn0; in gb_interface_read_ara_dme()
93 static int gb_interface_read_dme(struct gb_interface *intf) in gb_interface_read_dme() argument
98 if (intf->dme_read) in gb_interface_read_dme()
101 ret = gb_interface_dme_attr_get(intf, DME_DDBL1_MANUFACTURERID, in gb_interface_read_dme()
102 &intf->ddbl1_manufacturer_id); in gb_interface_read_dme()
106 ret = gb_interface_dme_attr_get(intf, DME_DDBL1_PRODUCTID, in gb_interface_read_dme()
107 &intf->ddbl1_product_id); in gb_interface_read_dme()
111 if (intf->ddbl1_manufacturer_id == TOSHIBA_DMID && in gb_interface_read_dme()
112 intf->ddbl1_product_id == TOSHIBA_ES2_BRIDGE_DPID) { in gb_interface_read_dme()
113 intf->quirks |= GB_INTERFACE_QUIRK_NO_GMP_IDS; in gb_interface_read_dme()
114 intf->quirks |= GB_INTERFACE_QUIRK_NO_INIT_STATUS; in gb_interface_read_dme()
117 ret = gb_interface_read_ara_dme(intf); in gb_interface_read_dme()
121 intf->dme_read = true; in gb_interface_read_dme()
126 static int gb_interface_route_create(struct gb_interface *intf) in gb_interface_route_create() argument
128 struct gb_svc *svc = intf->hd->svc; in gb_interface_route_create()
129 u8 intf_id = intf->interface_id; in gb_interface_route_create()
138 dev_err(&intf->dev, "failed to allocate device id: %d\n", ret); in gb_interface_route_create()
145 dev_err(&intf->dev, "failed to set device id %u: %d\n", in gb_interface_route_create()
154 dev_err(&intf->dev, "failed to create route: %d\n", ret); in gb_interface_route_create()
158 intf->device_id = device_id; in gb_interface_route_create()
173 static void gb_interface_route_destroy(struct gb_interface *intf) in gb_interface_route_destroy() argument
175 struct gb_svc *svc = intf->hd->svc; in gb_interface_route_destroy()
177 if (intf->device_id == GB_INTERFACE_DEVICE_ID_BAD) in gb_interface_route_destroy()
180 gb_svc_route_destroy(svc, svc->ap_intf_id, intf->interface_id); in gb_interface_route_destroy()
181 ida_simple_remove(&svc->device_id_map, intf->device_id); in gb_interface_route_destroy()
182 intf->device_id = GB_INTERFACE_DEVICE_ID_BAD; in gb_interface_route_destroy()
186 static int gb_interface_legacy_mode_switch(struct gb_interface *intf) in gb_interface_legacy_mode_switch() argument
190 dev_info(&intf->dev, "legacy mode switch detected\n"); in gb_interface_legacy_mode_switch()
193 intf->disconnected = true; in gb_interface_legacy_mode_switch()
194 gb_interface_disable(intf); in gb_interface_legacy_mode_switch()
195 intf->disconnected = false; in gb_interface_legacy_mode_switch()
197 ret = gb_interface_enable(intf); in gb_interface_legacy_mode_switch()
199 dev_err(&intf->dev, "failed to re-enable interface: %d\n", ret); in gb_interface_legacy_mode_switch()
200 gb_interface_deactivate(intf); in gb_interface_legacy_mode_switch()
206 void gb_interface_mailbox_event(struct gb_interface *intf, u16 result, in gb_interface_mailbox_event() argument
209 mutex_lock(&intf->mutex); in gb_interface_mailbox_event()
212 dev_warn(&intf->dev, in gb_interface_mailbox_event()
219 dev_warn(&intf->dev, in gb_interface_mailbox_event()
225 if (intf->quirks & GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH) { in gb_interface_mailbox_event()
226 gb_interface_legacy_mode_switch(intf); in gb_interface_mailbox_event()
230 if (!intf->mode_switch) { in gb_interface_mailbox_event()
231 dev_warn(&intf->dev, "unexpected mailbox event: 0x%08x\n", in gb_interface_mailbox_event()
236 dev_info(&intf->dev, "mode switch detected\n"); in gb_interface_mailbox_event()
238 complete(&intf->mode_switch_completion); in gb_interface_mailbox_event()
241 mutex_unlock(&intf->mutex); in gb_interface_mailbox_event()
246 gb_interface_disable(intf); in gb_interface_mailbox_event()
247 gb_interface_deactivate(intf); in gb_interface_mailbox_event()
248 mutex_unlock(&intf->mutex); in gb_interface_mailbox_event()
253 struct gb_interface *intf; in gb_interface_mode_switch_work() local
258 intf = container_of(work, struct gb_interface, mode_switch_work); in gb_interface_mode_switch_work()
260 mutex_lock(&intf->mutex); in gb_interface_mode_switch_work()
262 if (!intf->enabled) { in gb_interface_mode_switch_work()
263 dev_dbg(&intf->dev, "mode switch aborted\n"); in gb_interface_mode_switch_work()
264 intf->mode_switch = false; in gb_interface_mode_switch_work()
265 mutex_unlock(&intf->mutex); in gb_interface_mode_switch_work()
273 control = gb_control_get(intf->control); in gb_interface_mode_switch_work()
275 gb_interface_disable(intf); in gb_interface_mode_switch_work()
276 mutex_unlock(&intf->mutex); in gb_interface_mode_switch_work()
280 &intf->mode_switch_completion, timeout); in gb_interface_mode_switch_work()
287 dev_err(&intf->dev, "mode switch interrupted\n"); in gb_interface_mode_switch_work()
290 dev_err(&intf->dev, "mode switch timed out\n"); in gb_interface_mode_switch_work()
295 mutex_lock(&intf->mutex); in gb_interface_mode_switch_work()
296 intf->mode_switch = false; in gb_interface_mode_switch_work()
297 if (intf->active) { in gb_interface_mode_switch_work()
298 ret = gb_interface_enable(intf); in gb_interface_mode_switch_work()
300 dev_err(&intf->dev, "failed to re-enable interface: %d\n", in gb_interface_mode_switch_work()
302 gb_interface_deactivate(intf); in gb_interface_mode_switch_work()
305 mutex_unlock(&intf->mutex); in gb_interface_mode_switch_work()
308 gb_interface_put(intf); in gb_interface_mode_switch_work()
313 mutex_lock(&intf->mutex); in gb_interface_mode_switch_work()
314 intf->mode_switch = false; in gb_interface_mode_switch_work()
315 gb_interface_deactivate(intf); in gb_interface_mode_switch_work()
316 mutex_unlock(&intf->mutex); in gb_interface_mode_switch_work()
318 gb_interface_put(intf); in gb_interface_mode_switch_work()
321 int gb_interface_request_mode_switch(struct gb_interface *intf) in gb_interface_request_mode_switch() argument
325 mutex_lock(&intf->mutex); in gb_interface_request_mode_switch()
326 if (intf->mode_switch) { in gb_interface_request_mode_switch()
331 intf->mode_switch = true; in gb_interface_request_mode_switch()
332 reinit_completion(&intf->mode_switch_completion); in gb_interface_request_mode_switch()
338 get_device(&intf->dev); in gb_interface_request_mode_switch()
340 if (!queue_work(system_long_wq, &intf->mode_switch_work)) { in gb_interface_request_mode_switch()
341 put_device(&intf->dev); in gb_interface_request_mode_switch()
347 mutex_unlock(&intf->mutex); in gb_interface_request_mode_switch()
361 static int gb_interface_read_and_clear_init_status(struct gb_interface *intf) in gb_interface_read_and_clear_init_status() argument
363 struct gb_host_device *hd = intf->hd; in gb_interface_read_and_clear_init_status()
376 if (intf->quirks & GB_INTERFACE_QUIRK_NO_INIT_STATUS) in gb_interface_read_and_clear_init_status()
381 ret = gb_svc_dme_peer_get(hd->svc, intf->interface_id, attr, in gb_interface_read_and_clear_init_status()
391 dev_err(&intf->dev, "invalid init status\n"); in gb_interface_read_and_clear_init_status()
403 if (intf->quirks & GB_INTERFACE_QUIRK_NO_INIT_STATUS) in gb_interface_read_and_clear_init_status()
422 intf->quirks |= bootrom_quirks; in gb_interface_read_and_clear_init_status()
426 intf->quirks &= ~bootrom_quirks; in gb_interface_read_and_clear_init_status()
427 intf->quirks |= s2l_quirks; in gb_interface_read_and_clear_init_status()
430 intf->quirks &= ~bootrom_quirks; in gb_interface_read_and_clear_init_status()
431 intf->quirks &= ~s2l_quirks; in gb_interface_read_and_clear_init_status()
435 return gb_svc_dme_peer_set(hd->svc, intf->interface_id, attr, in gb_interface_read_and_clear_init_status()
445 struct gb_interface *intf = to_gb_interface(dev); \
446 return scnprintf(buf, PAGE_SIZE, type"\n", intf->field); \
460 struct gb_interface *intf = to_gb_interface(dev); in voltage_now_show() local
464 ret = gb_svc_pwrmon_intf_sample_get(intf->hd->svc, intf->interface_id, in voltage_now_show()
468 dev_err(&intf->dev, "failed to get voltage sample (%d)\n", ret); in voltage_now_show()
479 struct gb_interface *intf = to_gb_interface(dev); in current_now_show() local
483 ret = gb_svc_pwrmon_intf_sample_get(intf->hd->svc, intf->interface_id, in current_now_show()
487 dev_err(&intf->dev, "failed to get current sample (%d)\n", ret); in current_now_show()
498 struct gb_interface *intf = to_gb_interface(dev); in power_now_show() local
502 ret = gb_svc_pwrmon_intf_sample_get(intf->hd->svc, intf->interface_id, in power_now_show()
506 dev_err(&intf->dev, "failed to get power sample (%d)\n", ret); in power_now_show()
517 struct gb_interface *intf = to_gb_interface(dev); in power_state_show() local
519 if (intf->active) in power_state_show()
529 struct gb_interface *intf = to_gb_interface(dev); in power_state_store() local
536 mutex_lock(&intf->mutex); in power_state_store()
538 if (activate == intf->active) in power_state_store()
542 ret = gb_interface_activate(intf); in power_state_store()
544 dev_err(&intf->dev, in power_state_store()
549 ret = gb_interface_enable(intf); in power_state_store()
551 dev_err(&intf->dev, in power_state_store()
553 gb_interface_deactivate(intf); in power_state_store()
557 gb_interface_disable(intf); in power_state_store()
558 gb_interface_deactivate(intf); in power_state_store()
562 mutex_unlock(&intf->mutex); in power_state_store()
571 static const char *gb_interface_type_string(struct gb_interface *intf) in gb_interface_type_string() argument
581 return types[intf->type]; in gb_interface_type_string()
587 struct gb_interface *intf = to_gb_interface(dev); in interface_type_show() local
589 return sprintf(buf, "%s\n", gb_interface_type_string(intf)); in interface_type_show()
624 struct gb_interface *intf = to_gb_interface(dev); in interface_unipro_is_visible() local
626 switch (intf->type) { in interface_unipro_is_visible()
639 struct gb_interface *intf = to_gb_interface(dev); in interface_greybus_is_visible() local
641 switch (intf->type) { in interface_greybus_is_visible()
653 struct gb_interface *intf = to_gb_interface(dev); in interface_power_is_visible() local
655 switch (intf->type) { in interface_power_is_visible()
693 struct gb_interface *intf = to_gb_interface(dev); in gb_interface_release() local
695 trace_gb_interface_release(intf); in gb_interface_release()
697 kfree(intf); in gb_interface_release()
703 struct gb_interface *intf = to_gb_interface(dev); in gb_interface_suspend() local
706 ret = gb_control_interface_suspend_prepare(intf->control); in gb_interface_suspend()
710 ret = gb_control_suspend(intf->control); in gb_interface_suspend()
714 ret = gb_interface_hibernate_link(intf); in gb_interface_suspend()
721 ret = gb_interface_refclk_set(intf, false); in gb_interface_suspend()
728 gb_control_interface_hibernate_abort(intf->control); in gb_interface_suspend()
735 struct gb_interface *intf = to_gb_interface(dev); in gb_interface_resume() local
736 struct gb_svc *svc = intf->hd->svc; in gb_interface_resume()
739 ret = gb_interface_refclk_set(intf, true); in gb_interface_resume()
743 ret = gb_svc_intf_resume(svc, intf->interface_id); in gb_interface_resume()
747 ret = gb_control_resume(intf->control); in gb_interface_resume()
790 struct gb_interface *intf; in gb_interface_create() local
792 intf = kzalloc(sizeof(*intf), GFP_KERNEL); in gb_interface_create()
793 if (!intf) in gb_interface_create()
796 intf->hd = hd; /* XXX refcount? */ in gb_interface_create()
797 intf->module = module; in gb_interface_create()
798 intf->interface_id = interface_id; in gb_interface_create()
799 INIT_LIST_HEAD(&intf->bundles); in gb_interface_create()
800 INIT_LIST_HEAD(&intf->manifest_descs); in gb_interface_create()
801 mutex_init(&intf->mutex); in gb_interface_create()
802 INIT_WORK(&intf->mode_switch_work, gb_interface_mode_switch_work); in gb_interface_create()
803 init_completion(&intf->mode_switch_completion); in gb_interface_create()
806 intf->device_id = GB_INTERFACE_DEVICE_ID_BAD; in gb_interface_create()
808 intf->dev.parent = &module->dev; in gb_interface_create()
809 intf->dev.bus = &greybus_bus_type; in gb_interface_create()
810 intf->dev.type = &greybus_interface_type; in gb_interface_create()
811 intf->dev.groups = interface_groups; in gb_interface_create()
812 intf->dev.dma_mask = module->dev.dma_mask; in gb_interface_create()
813 device_initialize(&intf->dev); in gb_interface_create()
814 dev_set_name(&intf->dev, "%s.%u", dev_name(&module->dev), in gb_interface_create()
817 pm_runtime_set_autosuspend_delay(&intf->dev, in gb_interface_create()
820 trace_gb_interface_create(intf); in gb_interface_create()
822 return intf; in gb_interface_create()
825 static int gb_interface_vsys_set(struct gb_interface *intf, bool enable) in gb_interface_vsys_set() argument
827 struct gb_svc *svc = intf->hd->svc; in gb_interface_vsys_set()
830 dev_dbg(&intf->dev, "%s - %d\n", __func__, enable); in gb_interface_vsys_set()
832 ret = gb_svc_intf_vsys_set(svc, intf->interface_id, enable); in gb_interface_vsys_set()
834 dev_err(&intf->dev, "failed to set v_sys: %d\n", ret); in gb_interface_vsys_set()
841 static int gb_interface_refclk_set(struct gb_interface *intf, bool enable) in gb_interface_refclk_set() argument
843 struct gb_svc *svc = intf->hd->svc; in gb_interface_refclk_set()
846 dev_dbg(&intf->dev, "%s - %d\n", __func__, enable); in gb_interface_refclk_set()
848 ret = gb_svc_intf_refclk_set(svc, intf->interface_id, enable); in gb_interface_refclk_set()
850 dev_err(&intf->dev, "failed to set refclk: %d\n", ret); in gb_interface_refclk_set()
857 static int gb_interface_unipro_set(struct gb_interface *intf, bool enable) in gb_interface_unipro_set() argument
859 struct gb_svc *svc = intf->hd->svc; in gb_interface_unipro_set()
862 dev_dbg(&intf->dev, "%s - %d\n", __func__, enable); in gb_interface_unipro_set()
864 ret = gb_svc_intf_unipro_set(svc, intf->interface_id, enable); in gb_interface_unipro_set()
866 dev_err(&intf->dev, "failed to set UniPro: %d\n", ret); in gb_interface_unipro_set()
873 static int gb_interface_activate_operation(struct gb_interface *intf, in gb_interface_activate_operation() argument
876 struct gb_svc *svc = intf->hd->svc; in gb_interface_activate_operation()
880 dev_dbg(&intf->dev, "%s\n", __func__); in gb_interface_activate_operation()
882 ret = gb_svc_intf_activate(svc, intf->interface_id, &type); in gb_interface_activate_operation()
884 dev_err(&intf->dev, "failed to activate: %d\n", ret); in gb_interface_activate_operation()
895 dev_err(&intf->dev, "interface type UniPro not supported\n"); in gb_interface_activate_operation()
902 dev_err(&intf->dev, "unknown interface type: %u\n", type); in gb_interface_activate_operation()
910 static int gb_interface_hibernate_link(struct gb_interface *intf) in gb_interface_hibernate_link() argument
912 struct gb_svc *svc = intf->hd->svc; in gb_interface_hibernate_link()
914 return gb_svc_intf_set_power_mode_hibernate(svc, intf->interface_id); in gb_interface_hibernate_link()
917 static int _gb_interface_activate(struct gb_interface *intf, in _gb_interface_activate() argument
924 if (intf->ejected || intf->removed) in _gb_interface_activate()
927 ret = gb_interface_vsys_set(intf, true); in _gb_interface_activate()
931 ret = gb_interface_refclk_set(intf, true); in _gb_interface_activate()
935 ret = gb_interface_unipro_set(intf, true); in _gb_interface_activate()
939 ret = gb_interface_activate_operation(intf, type); in _gb_interface_activate()
950 ret = gb_interface_read_dme(intf); in _gb_interface_activate()
954 ret = gb_interface_route_create(intf); in _gb_interface_activate()
958 intf->active = true; in _gb_interface_activate()
960 trace_gb_interface_activate(intf); in _gb_interface_activate()
965 gb_interface_hibernate_link(intf); in _gb_interface_activate()
967 gb_interface_unipro_set(intf, false); in _gb_interface_activate()
969 gb_interface_refclk_set(intf, false); in _gb_interface_activate()
971 gb_interface_vsys_set(intf, false); in _gb_interface_activate()
983 static int _gb_interface_activate_es3_hack(struct gb_interface *intf, in _gb_interface_activate_es3_hack() argument
990 ret = _gb_interface_activate(intf, type); in _gb_interface_activate_es3_hack()
1005 int gb_interface_activate(struct gb_interface *intf) in gb_interface_activate() argument
1010 switch (intf->type) { in gb_interface_activate()
1013 ret = _gb_interface_activate_es3_hack(intf, &type); in gb_interface_activate()
1016 ret = _gb_interface_activate(intf, &type); in gb_interface_activate()
1020 if (intf->type != GB_INTERFACE_TYPE_INVALID) { in gb_interface_activate()
1021 if (type != intf->type) { in gb_interface_activate()
1022 dev_err(&intf->dev, "failed to detect interface type\n"); in gb_interface_activate()
1025 gb_interface_deactivate(intf); in gb_interface_activate()
1030 intf->type = type; in gb_interface_activate()
1041 void gb_interface_deactivate(struct gb_interface *intf) in gb_interface_deactivate() argument
1043 if (!intf->active) in gb_interface_deactivate()
1046 trace_gb_interface_deactivate(intf); in gb_interface_deactivate()
1049 if (intf->mode_switch) in gb_interface_deactivate()
1050 complete(&intf->mode_switch_completion); in gb_interface_deactivate()
1052 gb_interface_route_destroy(intf); in gb_interface_deactivate()
1053 gb_interface_hibernate_link(intf); in gb_interface_deactivate()
1054 gb_interface_unipro_set(intf, false); in gb_interface_deactivate()
1055 gb_interface_refclk_set(intf, false); in gb_interface_deactivate()
1056 gb_interface_vsys_set(intf, false); in gb_interface_deactivate()
1058 intf->active = false; in gb_interface_deactivate()
1068 int gb_interface_enable(struct gb_interface *intf) in gb_interface_enable() argument
1075 ret = gb_interface_read_and_clear_init_status(intf); in gb_interface_enable()
1077 dev_err(&intf->dev, "failed to clear init status: %d\n", ret); in gb_interface_enable()
1082 control = gb_control_create(intf); in gb_interface_enable()
1084 dev_err(&intf->dev, "failed to create control device: %ld\n", in gb_interface_enable()
1088 intf->control = control; in gb_interface_enable()
1090 ret = gb_control_enable(intf->control); in gb_interface_enable()
1095 size = gb_control_get_manifest_size_operation(intf); in gb_interface_enable()
1097 dev_err(&intf->dev, "failed to get manifest size: %d\n", size); in gb_interface_enable()
1114 ret = gb_control_get_manifest_operation(intf, manifest, size); in gb_interface_enable()
1116 dev_err(&intf->dev, "failed to get manifest: %d\n", ret); in gb_interface_enable()
1124 if (!gb_manifest_parse(intf, manifest, size)) { in gb_interface_enable()
1125 dev_err(&intf->dev, "failed to parse manifest\n"); in gb_interface_enable()
1130 ret = gb_control_get_bundle_versions(intf->control); in gb_interface_enable()
1135 ret = gb_control_add(intf->control); in gb_interface_enable()
1139 pm_runtime_use_autosuspend(&intf->dev); in gb_interface_enable()
1140 pm_runtime_get_noresume(&intf->dev); in gb_interface_enable()
1141 pm_runtime_set_active(&intf->dev); in gb_interface_enable()
1142 pm_runtime_enable(&intf->dev); in gb_interface_enable()
1144 list_for_each_entry_safe_reverse(bundle, tmp, &intf->bundles, links) { in gb_interface_enable()
1154 intf->enabled = true; in gb_interface_enable()
1156 pm_runtime_put(&intf->dev); in gb_interface_enable()
1158 trace_gb_interface_enable(intf); in gb_interface_enable()
1163 list_for_each_entry_safe(bundle, tmp, &intf->bundles, links) in gb_interface_enable()
1168 gb_control_disable(intf->control); in gb_interface_enable()
1170 gb_control_put(intf->control); in gb_interface_enable()
1171 intf->control = NULL; in gb_interface_enable()
1181 void gb_interface_disable(struct gb_interface *intf) in gb_interface_disable() argument
1186 if (!intf->enabled) in gb_interface_disable()
1189 trace_gb_interface_disable(intf); in gb_interface_disable()
1191 pm_runtime_get_sync(&intf->dev); in gb_interface_disable()
1194 if (intf->quirks & GB_INTERFACE_QUIRK_FORCED_DISABLE) in gb_interface_disable()
1195 intf->disconnected = true; in gb_interface_disable()
1197 list_for_each_entry_safe(bundle, next, &intf->bundles, links) in gb_interface_disable()
1200 if (!intf->mode_switch && !intf->disconnected) in gb_interface_disable()
1201 gb_control_interface_deactivate_prepare(intf->control); in gb_interface_disable()
1203 gb_control_del(intf->control); in gb_interface_disable()
1204 gb_control_disable(intf->control); in gb_interface_disable()
1205 gb_control_put(intf->control); in gb_interface_disable()
1206 intf->control = NULL; in gb_interface_disable()
1208 intf->enabled = false; in gb_interface_disable()
1210 pm_runtime_disable(&intf->dev); in gb_interface_disable()
1211 pm_runtime_set_suspended(&intf->dev); in gb_interface_disable()
1212 pm_runtime_dont_use_autosuspend(&intf->dev); in gb_interface_disable()
1213 pm_runtime_put_noidle(&intf->dev); in gb_interface_disable()
1217 int gb_interface_add(struct gb_interface *intf) in gb_interface_add() argument
1221 ret = device_add(&intf->dev); in gb_interface_add()
1223 dev_err(&intf->dev, "failed to register interface: %d\n", ret); in gb_interface_add()
1227 trace_gb_interface_add(intf); in gb_interface_add()
1229 dev_info(&intf->dev, "Interface added (%s)\n", in gb_interface_add()
1230 gb_interface_type_string(intf)); in gb_interface_add()
1232 switch (intf->type) { in gb_interface_add()
1234 dev_info(&intf->dev, "GMP VID=0x%08x, PID=0x%08x\n", in gb_interface_add()
1235 intf->vendor_id, intf->product_id); in gb_interface_add()
1238 dev_info(&intf->dev, "DDBL1 Manufacturer=0x%08x, Product=0x%08x\n", in gb_interface_add()
1239 intf->ddbl1_manufacturer_id, in gb_interface_add()
1240 intf->ddbl1_product_id); in gb_interface_add()
1250 void gb_interface_del(struct gb_interface *intf) in gb_interface_del() argument
1252 if (device_is_registered(&intf->dev)) { in gb_interface_del()
1253 trace_gb_interface_del(intf); in gb_interface_del()
1255 device_del(&intf->dev); in gb_interface_del()
1256 dev_info(&intf->dev, "Interface removed\n"); in gb_interface_del()
1260 void gb_interface_put(struct gb_interface *intf) in gb_interface_put() argument
1262 put_device(&intf->dev); in gb_interface_put()