Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'gpio-fixes-for-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:
"A single fix for gpio-sim and two patches for GPIO ACPI pulled from
Andy:

- fix the set/get_multiple() callbacks in gpio-sim

- use correct format characters in gpiolib-acpi

- use an unsigned type for pins in gpiolib-acpi"

* tag 'gpio-fixes-for-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
gpio: sim: fix setting and getting multiple lines
gpiolib: acpi: Convert type for pin to be unsigned
gpiolib: acpi: use correct format characters

+21 -13
+2 -2
drivers/gpio/gpio-sim.c
··· 134 134 struct gpio_sim_chip *chip = gpiochip_get_data(gc); 135 135 136 136 mutex_lock(&chip->lock); 137 - bitmap_copy(bits, chip->value_map, gc->ngpio); 137 + bitmap_replace(bits, bits, chip->value_map, mask, gc->ngpio); 138 138 mutex_unlock(&chip->lock); 139 139 140 140 return 0; ··· 146 146 struct gpio_sim_chip *chip = gpiochip_get_data(gc); 147 147 148 148 mutex_lock(&chip->lock); 149 - bitmap_copy(chip->value_map, bits, gc->ngpio); 149 + bitmap_replace(chip->value_map, chip->value_map, bits, mask, gc->ngpio); 150 150 mutex_unlock(&chip->lock); 151 151 } 152 152
+12 -10
drivers/gpio/gpiolib-acpi.c
··· 108 108 * controller does not have GPIO chip registered at the moment. This is to 109 109 * support probe deferral. 110 110 */ 111 - static struct gpio_desc *acpi_get_gpiod(char *path, int pin) 111 + static struct gpio_desc *acpi_get_gpiod(char *path, unsigned int pin) 112 112 { 113 113 struct gpio_chip *chip; 114 114 acpi_handle handle; ··· 136 136 * as it is intended for use outside of the GPIO layer (in a similar fashion to 137 137 * gpiod_get_index() for example) it also holds a reference to the GPIO device. 138 138 */ 139 - struct gpio_desc *acpi_get_and_request_gpiod(char *path, int pin, char *label) 139 + struct gpio_desc *acpi_get_and_request_gpiod(char *path, unsigned int pin, char *label) 140 140 { 141 141 struct gpio_desc *gpio; 142 142 int ret; ··· 317 317 return desc; 318 318 } 319 319 320 - static bool acpi_gpio_in_ignore_list(const char *controller_in, int pin_in) 320 + static bool acpi_gpio_in_ignore_list(const char *controller_in, unsigned int pin_in) 321 321 { 322 322 const char *controller, *pin_str; 323 - int len, pin; 323 + unsigned int pin; 324 324 char *endp; 325 + int len; 325 326 326 327 controller = ignore_wake; 327 328 while (controller) { ··· 355 354 static bool acpi_gpio_irq_is_wake(struct device *parent, 356 355 struct acpi_resource_gpio *agpio) 357 356 { 358 - int pin = agpio->pin_table[0]; 357 + unsigned int pin = agpio->pin_table[0]; 359 358 360 359 if (agpio->wake_capable != ACPI_WAKE_CAPABLE) 361 360 return false; 362 361 363 362 if (acpi_gpio_in_ignore_list(dev_name(parent), pin)) { 364 - dev_info(parent, "Ignoring wakeup on pin %d\n", pin); 363 + dev_info(parent, "Ignoring wakeup on pin %u\n", pin); 365 364 return false; 366 365 } 367 366 ··· 379 378 struct acpi_gpio_event *event; 380 379 irq_handler_t handler = NULL; 381 380 struct gpio_desc *desc; 382 - int ret, pin, irq; 381 + unsigned int pin; 382 + int ret, irq; 383 383 384 384 if (!acpi_gpio_get_irq_resource(ares, &agpio)) 385 385 return AE_OK; ··· 389 387 pin = agpio->pin_table[0]; 390 388 391 389 if (pin <= 255) { 392 - char ev_name[5]; 393 - sprintf(ev_name, "_%c%02hhX", 390 + char ev_name[8]; 391 + sprintf(ev_name, "_%c%02X", 394 392 agpio->triggering == ACPI_EDGE_SENSITIVE ? 'E' : 'L', 395 393 pin); 396 394 if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle))) ··· 1100 1098 1101 1099 length = min_t(u16, agpio->pin_table_length, pin_index + bits); 1102 1100 for (i = pin_index; i < length; ++i) { 1103 - int pin = agpio->pin_table[i]; 1101 + unsigned int pin = agpio->pin_table[i]; 1104 1102 struct acpi_gpio_connection *conn; 1105 1103 struct gpio_desc *desc; 1106 1104 bool found;
+7 -1
include/linux/gpio/consumer.h
··· 688 688 int devm_acpi_dev_add_driver_gpios(struct device *dev, 689 689 const struct acpi_gpio_mapping *gpios); 690 690 691 - struct gpio_desc *acpi_get_and_request_gpiod(char *path, int pin, char *label); 691 + struct gpio_desc *acpi_get_and_request_gpiod(char *path, unsigned int pin, char *label); 692 692 693 693 #else /* CONFIG_GPIOLIB && CONFIG_ACPI */ 694 694 ··· 703 703 const struct acpi_gpio_mapping *gpios) 704 704 { 705 705 return -ENXIO; 706 + } 707 + 708 + static inline struct gpio_desc *acpi_get_and_request_gpiod(char *path, unsigned int pin, 709 + char *label) 710 + { 711 + return ERR_PTR(-ENOSYS); 706 712 } 707 713 708 714 #endif /* CONFIG_GPIOLIB && CONFIG_ACPI */