Lines Matching +full:sub +full:- +full:groups
1 // SPDX-License-Identifier: GPL-2.0-only
30 return attr->mode; \
40 ret = parse_attr_name(attr->attr.name, name, &num); \
73 union acpi_object *element = obj->package.elements; in chromeos_acpi_handle_package()
75 if (pkg_num >= obj->package.count) in chromeos_acpi_handle_package()
76 return -EINVAL; in chromeos_acpi_handle_package()
79 if (element->type == ACPI_TYPE_PACKAGE) { in chromeos_acpi_handle_package()
80 if (sub_pkg_num >= element->package.count) in chromeos_acpi_handle_package()
81 return -EINVAL; in chromeos_acpi_handle_package()
82 /* select sub element inside this package */ in chromeos_acpi_handle_package()
83 element = element->package.elements; in chromeos_acpi_handle_package()
87 switch (element->type) { in chromeos_acpi_handle_package()
89 return sysfs_emit(buf, "%d\n", (int)element->integer.value); in chromeos_acpi_handle_package()
91 return sysfs_emit(buf, "%s\n", element->string.pointer); in chromeos_acpi_handle_package()
98 room_left = PAGE_SIZE - 1; in chromeos_acpi_handle_package()
99 for (i = 0; i < element->buffer.length && room_left; i += byte_per_line) { in chromeos_acpi_handle_package()
100 r = hex_dump_to_buffer(element->buffer.pointer + i, in chromeos_acpi_handle_package()
101 element->buffer.length - i, in chromeos_acpi_handle_package()
107 room_left -= r; in chromeos_acpi_handle_package()
113 room_left -= r; in chromeos_acpi_handle_package()
120 sysfs_emit_at(buf, PAGE_SIZE - 4, "..\n"); in chromeos_acpi_handle_package()
121 return PAGE_SIZE - 1; in chromeos_acpi_handle_package()
124 dev_err(dev, "element type %d not supported\n", element->type); in chromeos_acpi_handle_package()
125 return -EINVAL; in chromeos_acpi_handle_package()
134 int ret = -EINVAL; in chromeos_acpi_evaluate_method()
142 if (((union acpi_object *)output.pointer)->type == ACPI_TYPE_PACKAGE) in chromeos_acpi_evaluate_method()
155 if (ret == -E2BIG) in parse_attr_name()
166 ret = parse_attr_name(attr->attr.name, attr_name, &attr_num); in chromeos_first_level_attr_show()
188 if (obj->type == ACPI_TYPE_PACKAGE) in get_gpio_pkg_num()
189 count = obj->package.count; in get_gpio_pkg_num()
227 * Every platform can have a different number of GPIO attribute groups.
228 * Define upper limit groups. At run time, the platform decides to show
229 * the present number of groups only, others are hidden.
255 chromeos_acpi_gpio_groups = get_gpio_pkg_num(&pdev->dev); in chromeos_acpi_device_probe()
258 * If the platform has more GPIO attribute groups than the number of in chromeos_acpi_device_probe()
259 * groups this driver supports, give out a warning message. in chromeos_acpi_device_probe()
261 if (chromeos_acpi_gpio_groups > ARRAY_SIZE(chromeos_acpi_all_groups) - 2) in chromeos_acpi_device_probe()
262 dev_warn(&pdev->dev, "Only %zu GPIO attr groups supported by the driver out of total %u.\n", in chromeos_acpi_device_probe()
263 ARRAY_SIZE(chromeos_acpi_all_groups) - 2, chromeos_acpi_gpio_groups); in chromeos_acpi_device_probe()