Lines Matching refs:index

205  * @cable_index:	the index of this cable in the edev
270 /* Find the index of extcon cable in edev->supported_cable */
295 static bool is_extcon_attached(struct extcon_dev *edev, unsigned int index)
297 return !!(edev->state & BIT(index));
300 static bool is_extcon_changed(struct extcon_dev *edev, int index,
303 int state = !!(edev->state & BIT(index));
321 unsigned int id, int index,unsigned int prop)
331 cable = &edev->cables[index];
353 static void init_property(struct extcon_dev *edev, unsigned int id, int index)
356 struct extcon_cable *cable = &edev->cables[index];
437 int index;
444 index = find_cable_index_by_id(edev, id);
445 if (index < 0)
446 return index;
449 state = !!(edev->state & BIT(index));
456 raw_notifier_call_chain(&edev->nh[index], state, edev);
512 int index, state;
518 index = find_cable_index_by_id(edev, id);
519 if (index < 0)
520 return index;
523 state = is_extcon_attached(edev, index);
546 int index, ret = 0;
551 index = find_cable_index_by_id(edev, id);
552 if (index < 0)
553 return index;
558 if (!is_extcon_changed(edev, index, state))
562 (edev->state & ~BIT(index)) | (state & BIT(index)))) {
572 init_property(edev, id, index);
576 edev->state |= BIT(index);
578 edev->state &= ~(BIT(index));
630 int index, ret = 0;
641 /* Find the cable index of external connector by using id */
642 index = find_cable_index_by_id(edev, id);
643 if (index < 0)
644 return index;
649 if (!is_extcon_property_capability(edev, id, index, prop)) {
659 if (!is_extcon_attached(edev, index)) {
664 cable = &edev->cables[index];
709 int index, ret = 0;
718 /* Find the cable index of external connector by using id */
719 index = find_cable_index_by_id(edev, id);
720 if (index < 0)
721 return index;
726 if (!is_extcon_property_capability(edev, id, index, prop)) {
731 cable = &edev->cables[index];
797 int index;
806 /* Find the cable index of external connector by using id */
807 index = find_cable_index_by_id(edev, id);
808 if (index < 0)
809 return index;
811 return is_extcon_property_capability(edev, id, index, prop);
832 int index, type, ret = 0;
841 /* Find the cable index of external connector by using id. */
842 index = find_cable_index_by_id(edev, id);
843 if (index < 0)
844 return index;
850 cable = &edev->cables[index];
1091 int index;
1106 for (index = 0; index < edev->max_supported; index++) {
1107 cable = &edev->cables[index];
1109 str = kasprintf(GFP_KERNEL, "cable.%d", index);
1111 for (index--; index >= 0; index--) {
1112 cable = &edev->cables[index];
1121 cable->cable_index = index;
1151 int index;
1160 for (index = 0; edev->mutually_exclusive[index]; index++)
1163 edev->attrs_muex = kcalloc(index + 1, sizeof(*edev->attrs_muex),
1168 edev->d_attrs_muex = kcalloc(index, sizeof(*edev->d_attrs_muex),
1175 for (index = 0; edev->mutually_exclusive[index]; index++) {
1177 edev->mutually_exclusive[index]);
1179 for (index--; index >= 0; index--)
1180 kfree(edev->d_attrs_muex[index].attr.name);
1186 sysfs_attr_init(&edev->d_attrs_muex[index].attr);
1187 edev->d_attrs_muex[index].attr.name = name;
1188 edev->d_attrs_muex[index].attr.mode = 0000;
1189 edev->attrs_muex[index] = &edev->d_attrs_muex[index].attr;
1205 int index;
1222 for (index = 0; index < edev->max_supported; index++)
1223 edev->extcon_dev_type.groups[index] = &edev->cables[index].attr_g;
1226 edev->extcon_dev_type.groups[index] = &edev->attr_g_muex;
1249 int ret, index;
1258 for (index = 0; edev->supported_cable[index] != EXTCON_NONE; index++);
1260 edev->max_supported = index;
1261 if (index > SUPPORTED_CABLE_MAX) {
1305 for (index = 0; index < edev->max_supported; index++)
1306 RAW_INIT_NOTIFIER_HEAD(&edev->nh[index]);
1334 for (index = 0; edev->mutually_exclusive[index]; index++)
1335 kfree(edev->d_attrs_muex[index].attr.name);
1340 for (index = 0; index < edev->max_supported; index++)
1341 kfree(edev->cables[index].attr_g.name);
1360 int index;
1379 for (index = 0; edev->mutually_exclusive[index];
1380 index++)
1381 kfree(edev->d_attrs_muex[index].attr.name);
1386 for (index = 0; index < edev->max_supported; index++)
1387 kfree(edev->cables[index].attr_g.name);
1425 * @index : the index into list of extcon_dev
1429 struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index)
1439 node = of_parse_phandle(np, "extcon", index);
1458 struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index)