Lines Matching full:cable

209  * @cable_index:	the index of this cable in the edev
210 * @attr_g: the attribute group for the cable
265 /* Find the the index of extcon cable in edev->supported_cable */ in find_cable_index_by_id()
318 struct extcon_cable *cable; in is_extcon_property_capability() local
326 cable = &edev->cables[index]; in is_extcon_property_capability()
330 ret = test_bit(prop - EXTCON_PROP_USB_MIN, cable->usb_bits); in is_extcon_property_capability()
333 ret = test_bit(prop - EXTCON_PROP_CHG_MIN, cable->chg_bits); in is_extcon_property_capability()
336 ret = test_bit(prop - EXTCON_PROP_JACK_MIN, cable->jack_bits); in is_extcon_property_capability()
339 ret = test_bit(prop - EXTCON_PROP_DISP_MIN, cable->disp_bits); in is_extcon_property_capability()
351 struct extcon_cable *cable = &edev->cables[index]; in init_property() local
354 memset(cable->usb_propval, 0, sizeof(cable->usb_propval)); in init_property()
356 memset(cable->chg_propval, 0, sizeof(cable->chg_propval)); in init_property()
358 memset(cable->jack_propval, 0, sizeof(cable->jack_propval)); in init_property()
360 memset(cable->disp_propval, 0, sizeof(cable->disp_propval)); in init_property()
394 struct extcon_cable *cable = container_of(attr, struct extcon_cable, in cable_name_show() local
396 int i = cable->cable_index; in cable_name_show()
399 extcon_info[cable->edev->supported_cable[i]].name); in cable_name_show()
405 struct extcon_cable *cable = container_of(attr, struct extcon_cable, in cable_state_show() local
408 int i = cable->cable_index; in cable_state_show()
411 extcon_get_state(cable->edev, cable->edev->supported_cable[i])); in cable_state_show()
634 struct extcon_cable *cable; in extcon_get_property() local
647 /* Find the cable index of external connector by using id */ in extcon_get_property()
670 cable = &edev->cables[index]; in extcon_get_property()
675 *prop_val = cable->usb_propval[prop - EXTCON_PROP_USB_MIN]; in extcon_get_property()
678 *prop_val = cable->chg_propval[prop - EXTCON_PROP_CHG_MIN]; in extcon_get_property()
681 *prop_val = cable->jack_propval[prop - EXTCON_PROP_JACK_MIN]; in extcon_get_property()
684 *prop_val = cable->disp_propval[prop - EXTCON_PROP_DISP_MIN]; in extcon_get_property()
713 struct extcon_cable *cable; in extcon_set_property() local
724 /* Find the cable index of external connector by using id */ in extcon_set_property()
737 cable = &edev->cables[index]; in extcon_set_property()
742 cable->usb_propval[prop - EXTCON_PROP_USB_MIN] = prop_val; in extcon_set_property()
745 cable->chg_propval[prop - EXTCON_PROP_CHG_MIN] = prop_val; in extcon_set_property()
748 cable->jack_propval[prop - EXTCON_PROP_JACK_MIN] = prop_val; in extcon_set_property()
751 cable->disp_propval[prop - EXTCON_PROP_DISP_MIN] = prop_val; in extcon_set_property()
809 /* Find the cable index of external connector by using id */ in extcon_get_property_capability()
834 struct extcon_cable *cable; in extcon_set_property_capability() local
844 /* Find the cable index of external connector by using id. */ in extcon_set_property_capability()
853 cable = &edev->cables[index]; in extcon_set_property_capability()
857 __set_bit(prop - EXTCON_PROP_USB_MIN, cable->usb_bits); in extcon_set_property_capability()
860 __set_bit(prop - EXTCON_PROP_CHG_MIN, cable->chg_bits); in extcon_set_property_capability()
863 __set_bit(prop - EXTCON_PROP_JACK_MIN, cable->jack_bits); in extcon_set_property_capability()
866 __set_bit(prop - EXTCON_PROP_DISP_MIN, cable->disp_bits); in extcon_set_property_capability()
1134 struct extcon_cable *cable; in extcon_dev_register() local
1144 cable = &edev->cables[index]; in extcon_dev_register()
1146 str = kasprintf(GFP_KERNEL, "cable.%d", index); in extcon_dev_register()
1149 cable = &edev->cables[index]; in extcon_dev_register()
1150 kfree(cable->attr_g.name); in extcon_dev_register()
1157 cable->edev = edev; in extcon_dev_register()
1158 cable->cable_index = index; in extcon_dev_register()
1159 cable->attrs[0] = &cable->attr_name.attr; in extcon_dev_register()
1160 cable->attrs[1] = &cable->attr_state.attr; in extcon_dev_register()
1161 cable->attrs[2] = NULL; in extcon_dev_register()
1162 cable->attr_g.name = str; in extcon_dev_register()
1163 cable->attr_g.attrs = cable->attrs; in extcon_dev_register()
1165 sysfs_attr_init(&cable->attr_name.attr); in extcon_dev_register()
1166 cable->attr_name.attr.name = "name"; in extcon_dev_register()
1167 cable->attr_name.attr.mode = 0444; in extcon_dev_register()
1168 cable->attr_name.show = cable_name_show; in extcon_dev_register()
1170 sysfs_attr_init(&cable->attr_state.attr); in extcon_dev_register()
1171 cable->attr_state.attr.name = "state"; in extcon_dev_register()
1172 cable->attr_state.attr.mode = 0444; in extcon_dev_register()
1173 cable->attr_state.show = cable_state_show; in extcon_dev_register()