Lines Matching full:cable
205 * @cable_index: the index of this cable in the edev
206 * @attr_g: the attribute group for the cable
270 /* Find the index of extcon cable in edev->supported_cable */ in find_cable_index_by_id()
323 struct extcon_cable *cable; in is_extcon_property_capability() local
331 cable = &edev->cables[index]; in is_extcon_property_capability()
335 ret = test_bit(prop - EXTCON_PROP_USB_MIN, cable->usb_bits); in is_extcon_property_capability()
338 ret = test_bit(prop - EXTCON_PROP_CHG_MIN, cable->chg_bits); in is_extcon_property_capability()
341 ret = test_bit(prop - EXTCON_PROP_JACK_MIN, cable->jack_bits); in is_extcon_property_capability()
344 ret = test_bit(prop - EXTCON_PROP_DISP_MIN, cable->disp_bits); in is_extcon_property_capability()
356 struct extcon_cable *cable = &edev->cables[index]; in init_property() local
359 memset(cable->usb_propval, 0, sizeof(cable->usb_propval)); in init_property()
361 memset(cable->chg_propval, 0, sizeof(cable->chg_propval)); in init_property()
363 memset(cable->jack_propval, 0, sizeof(cable->jack_propval)); in init_property()
365 memset(cable->disp_propval, 0, sizeof(cable->disp_propval)); in init_property()
399 struct extcon_cable *cable = container_of(attr, struct extcon_cable, in cable_name_show() local
401 int i = cable->cable_index; in cable_name_show()
404 extcon_info[cable->edev->supported_cable[i]].name); in cable_name_show()
410 struct extcon_cable *cable = container_of(attr, struct extcon_cable, in cable_state_show() local
413 int i = cable->cable_index; in cable_state_show()
416 extcon_get_state(cable->edev, cable->edev->supported_cable[i])); in cable_state_show()
628 struct extcon_cable *cable; in extcon_get_property() local
641 /* Find the cable index of external connector by using id */ in extcon_get_property()
664 cable = &edev->cables[index]; in extcon_get_property()
669 *prop_val = cable->usb_propval[prop - EXTCON_PROP_USB_MIN]; in extcon_get_property()
672 *prop_val = cable->chg_propval[prop - EXTCON_PROP_CHG_MIN]; in extcon_get_property()
675 *prop_val = cable->jack_propval[prop - EXTCON_PROP_JACK_MIN]; in extcon_get_property()
678 *prop_val = cable->disp_propval[prop - EXTCON_PROP_DISP_MIN]; in extcon_get_property()
707 struct extcon_cable *cable; in extcon_set_property() local
718 /* Find the cable index of external connector by using id */ in extcon_set_property()
731 cable = &edev->cables[index]; in extcon_set_property()
736 cable->usb_propval[prop - EXTCON_PROP_USB_MIN] = prop_val; in extcon_set_property()
739 cable->chg_propval[prop - EXTCON_PROP_CHG_MIN] = prop_val; in extcon_set_property()
742 cable->jack_propval[prop - EXTCON_PROP_JACK_MIN] = prop_val; in extcon_set_property()
745 cable->disp_propval[prop - EXTCON_PROP_DISP_MIN] = prop_val; in extcon_set_property()
806 /* Find the cable index of external connector by using id */ in extcon_get_property_capability()
831 struct extcon_cable *cable; in extcon_set_property_capability() local
841 /* Find the cable index of external connector by using id. */ in extcon_set_property_capability()
850 cable = &edev->cables[index]; in extcon_set_property_capability()
854 __set_bit(prop - EXTCON_PROP_USB_MIN, cable->usb_bits); in extcon_set_property_capability()
857 __set_bit(prop - EXTCON_PROP_CHG_MIN, cable->chg_bits); in extcon_set_property_capability()
860 __set_bit(prop - EXTCON_PROP_JACK_MIN, cable->jack_bits); in extcon_set_property_capability()
863 __set_bit(prop - EXTCON_PROP_DISP_MIN, cable->disp_bits); in extcon_set_property_capability()
1093 struct extcon_cable *cable; in extcon_alloc_cables() local
1107 cable = &edev->cables[index]; in extcon_alloc_cables()
1109 str = kasprintf(GFP_KERNEL, "cable.%d", index); in extcon_alloc_cables()
1112 cable = &edev->cables[index]; in extcon_alloc_cables()
1113 kfree(cable->attr_g.name); in extcon_alloc_cables()
1120 cable->edev = edev; in extcon_alloc_cables()
1121 cable->cable_index = index; in extcon_alloc_cables()
1122 cable->attrs[0] = &cable->attr_name.attr; in extcon_alloc_cables()
1123 cable->attrs[1] = &cable->attr_state.attr; in extcon_alloc_cables()
1124 cable->attrs[2] = NULL; in extcon_alloc_cables()
1125 cable->attr_g.name = str; in extcon_alloc_cables()
1126 cable->attr_g.attrs = cable->attrs; in extcon_alloc_cables()
1128 sysfs_attr_init(&cable->attr_name.attr); in extcon_alloc_cables()
1129 cable->attr_name.attr.name = "name"; in extcon_alloc_cables()
1130 cable->attr_name.attr.mode = 0444; in extcon_alloc_cables()
1131 cable->attr_name.show = cable_name_show; in extcon_alloc_cables()
1133 sysfs_attr_init(&cable->attr_state.attr); in extcon_alloc_cables()
1134 cable->attr_state.attr.name = "state"; in extcon_alloc_cables()
1135 cable->attr_state.attr.mode = 0444; in extcon_alloc_cables()
1136 cable->attr_state.show = cable_state_show; in extcon_alloc_cables()