• Home
  • Raw
  • Download

Lines Matching refs:index

293 static bool is_extcon_attached(struct extcon_dev *edev, unsigned int index)  in is_extcon_attached()  argument
295 return !!(edev->state & BIT(index)); in is_extcon_attached()
298 static bool is_extcon_changed(struct extcon_dev *edev, int index, in is_extcon_changed() argument
301 int state = !!(edev->state & BIT(index)); in is_extcon_changed()
319 unsigned int id, int index,unsigned int prop) in is_extcon_property_capability() argument
329 cable = &edev->cables[index]; in is_extcon_property_capability()
351 static void init_property(struct extcon_dev *edev, unsigned int id, int index) in init_property() argument
354 struct extcon_cable *cable = &edev->cables[index]; in init_property()
434 int index; in extcon_sync() local
441 index = find_cable_index_by_id(edev, id); in extcon_sync()
442 if (index < 0) in extcon_sync()
443 return index; in extcon_sync()
446 state = !!(edev->state & BIT(index)); in extcon_sync()
453 raw_notifier_call_chain(&edev->nh[index], state, edev); in extcon_sync()
509 int index, state; in extcon_get_state() local
515 index = find_cable_index_by_id(edev, id); in extcon_get_state()
516 if (index < 0) in extcon_get_state()
517 return index; in extcon_get_state()
520 state = is_extcon_attached(edev, index); in extcon_get_state()
543 int index, ret = 0; in extcon_set_state() local
548 index = find_cable_index_by_id(edev, id); in extcon_set_state()
549 if (index < 0) in extcon_set_state()
550 return index; in extcon_set_state()
555 if (!is_extcon_changed(edev, index, state)) in extcon_set_state()
559 (edev->state & ~BIT(index)) | (state & BIT(index)))) { in extcon_set_state()
569 init_property(edev, id, index); in extcon_set_state()
573 edev->state |= BIT(index); in extcon_set_state()
575 edev->state &= ~(BIT(index)); in extcon_set_state()
597 int ret, index; in extcon_set_state_sync() local
600 index = find_cable_index_by_id(edev, id); in extcon_set_state_sync()
601 if (index < 0) in extcon_set_state_sync()
602 return index; in extcon_set_state_sync()
606 ret = is_extcon_changed(edev, index, state); in extcon_set_state_sync()
639 int index, ret = 0; in extcon_get_property() local
651 index = find_cable_index_by_id(edev, id); in extcon_get_property()
652 if (index < 0) in extcon_get_property()
653 return index; in extcon_get_property()
658 if (!is_extcon_property_capability(edev, id, index, prop)) { in extcon_get_property()
668 if (!is_extcon_attached(edev, index)) { in extcon_get_property()
673 cable = &edev->cables[index]; in extcon_get_property()
718 int index, ret = 0; in extcon_set_property() local
728 index = find_cable_index_by_id(edev, id); in extcon_set_property()
729 if (index < 0) in extcon_set_property()
730 return index; in extcon_set_property()
735 if (!is_extcon_property_capability(edev, id, index, prop)) { in extcon_set_property()
740 cable = &edev->cables[index]; in extcon_set_property()
803 int index; in extcon_get_property_capability() local
813 index = find_cable_index_by_id(edev, id); in extcon_get_property_capability()
814 if (index < 0) in extcon_get_property_capability()
815 return index; in extcon_get_property_capability()
817 return is_extcon_property_capability(edev, id, index, prop); in extcon_get_property_capability()
838 int index, type, ret = 0; in extcon_set_property_capability() local
848 index = find_cable_index_by_id(edev, id); in extcon_set_property_capability()
849 if (index < 0) in extcon_set_property_capability()
850 return index; in extcon_set_property_capability()
856 cable = &edev->cables[index]; in extcon_set_property_capability()
1104 int ret, index = 0; in extcon_dev_register() local
1116 for (; edev->supported_cable[index] != EXTCON_NONE; index++); in extcon_dev_register()
1118 edev->max_supported = index; in extcon_dev_register()
1119 if (index > SUPPORTED_CABLE_MAX) { in extcon_dev_register()
1148 for (index = 0; index < edev->max_supported; index++) { in extcon_dev_register()
1149 cable = &edev->cables[index]; in extcon_dev_register()
1151 str = kasprintf(GFP_KERNEL, "cable.%d", index); in extcon_dev_register()
1153 for (index--; index >= 0; index--) { in extcon_dev_register()
1154 cable = &edev->cables[index]; in extcon_dev_register()
1163 cable->cable_index = index; in extcon_dev_register()
1186 for (index = 0; edev->mutually_exclusive[index]; index++) in extcon_dev_register()
1189 edev->attrs_muex = kcalloc(index + 1, in extcon_dev_register()
1197 edev->d_attrs_muex = kcalloc(index, in extcon_dev_register()
1206 for (index = 0; edev->mutually_exclusive[index]; index++) { in extcon_dev_register()
1208 edev->mutually_exclusive[index]); in extcon_dev_register()
1210 for (index--; index >= 0; index--) { in extcon_dev_register()
1211 kfree(edev->d_attrs_muex[index].attr. in extcon_dev_register()
1219 sysfs_attr_init(&edev->d_attrs_muex[index].attr); in extcon_dev_register()
1220 edev->d_attrs_muex[index].attr.name = name; in extcon_dev_register()
1221 edev->d_attrs_muex[index].attr.mode = 0000; in extcon_dev_register()
1222 edev->attrs_muex[index] = &edev->d_attrs_muex[index] in extcon_dev_register()
1243 for (index = 0; index < edev->max_supported; index++) in extcon_dev_register()
1244 edev->extcon_dev_type.groups[index] = in extcon_dev_register()
1245 &edev->cables[index].attr_g; in extcon_dev_register()
1247 edev->extcon_dev_type.groups[index] = in extcon_dev_register()
1263 for (index = 0; index < edev->max_supported; index++) in extcon_dev_register()
1264 RAW_INIT_NOTIFIER_HEAD(&edev->nh[index]); in extcon_dev_register()
1291 for (index = 0; edev->mutually_exclusive[index]; index++) in extcon_dev_register()
1292 kfree(edev->d_attrs_muex[index].attr.name); in extcon_dev_register()
1297 for (index = 0; index < edev->max_supported; index++) in extcon_dev_register()
1298 kfree(edev->cables[index].attr_g.name); in extcon_dev_register()
1316 int index; in extcon_dev_unregister() local
1334 for (index = 0; edev->mutually_exclusive[index]; in extcon_dev_unregister()
1335 index++) in extcon_dev_unregister()
1336 kfree(edev->d_attrs_muex[index].attr.name); in extcon_dev_unregister()
1341 for (index = 0; index < edev->max_supported; index++) in extcon_dev_unregister()
1342 kfree(edev->cables[index].attr_g.name); in extcon_dev_unregister()
1384 struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index) in extcon_get_edev_by_phandle() argument
1397 node = of_parse_phandle(dev->of_node, "extcon", index); in extcon_get_edev_by_phandle()
1417 struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index) in extcon_get_edev_by_phandle() argument