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-v6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:

- fix incorrect output in in-tree gpio tools

- fix a shell coding issue in gpio-sim selftests

- correctly set the permissions for debugfs attributes exposed by
gpio-mockup

- fix chip name and pin count in gpio-f7188x for one of the supported
models

- fix numberspace pollution when using dynamically and statically
allocated GPIOs together

* tag 'gpio-fixes-for-v6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
gpio-f7188x: fix chip name and pin count on Nuvoton chip
gpiolib: fix allocation of mixed dynamic/static GPIOs
gpio: mockup: Fix mode of debugfs files
selftests: gpio: gpio-sim: Fix BUG: test FAILED due to recent change
tools: gpio: fix debounce_period_us output of lsgpio

+22 -17
+1 -1
drivers/gpio/Kconfig
··· 897 897 help 898 898 This option enables support for GPIOs found on Fintek Super-I/O 899 899 chips F71869, F71869A, F71882FG, F71889F and F81866. 900 - As well as Nuvoton Super-I/O chip NCT6116D. 900 + As well as Nuvoton Super-I/O chip NCT6126D. 901 901 902 902 To compile this driver as a module, choose M here: the module will 903 903 be called f7188x-gpio.
+14 -14
drivers/gpio/gpio-f7188x.c
··· 48 48 /* 49 49 * Nuvoton devices. 50 50 */ 51 - #define SIO_NCT6116D_ID 0xD283 /* NCT6116D chipset ID */ 51 + #define SIO_NCT6126D_ID 0xD283 /* NCT6126D chipset ID */ 52 52 53 53 #define SIO_LD_GPIO_NUVOTON 0x07 /* GPIO logical device */ 54 54 ··· 62 62 f81866, 63 63 f81804, 64 64 f81865, 65 - nct6116d, 65 + nct6126d, 66 66 }; 67 67 68 68 static const char * const f7188x_names[] = { ··· 74 74 "f81866", 75 75 "f81804", 76 76 "f81865", 77 - "nct6116d", 77 + "nct6126d", 78 78 }; 79 79 80 80 struct f7188x_sio { ··· 187 187 /* Output mode register (0:open drain 1:push-pull). */ 188 188 #define f7188x_gpio_out_mode(base) ((base) + 3) 189 189 190 - #define f7188x_gpio_dir_invert(type) ((type) == nct6116d) 191 - #define f7188x_gpio_data_single(type) ((type) == nct6116d) 190 + #define f7188x_gpio_dir_invert(type) ((type) == nct6126d) 191 + #define f7188x_gpio_data_single(type) ((type) == nct6126d) 192 192 193 193 static struct f7188x_gpio_bank f71869_gpio_bank[] = { 194 194 F7188X_GPIO_BANK(0, 6, 0xF0, DRVNAME "-0"), ··· 274 274 F7188X_GPIO_BANK(60, 5, 0x90, DRVNAME "-6"), 275 275 }; 276 276 277 - static struct f7188x_gpio_bank nct6116d_gpio_bank[] = { 277 + static struct f7188x_gpio_bank nct6126d_gpio_bank[] = { 278 278 F7188X_GPIO_BANK(0, 8, 0xE0, DRVNAME "-0"), 279 279 F7188X_GPIO_BANK(10, 8, 0xE4, DRVNAME "-1"), 280 280 F7188X_GPIO_BANK(20, 8, 0xE8, DRVNAME "-2"), ··· 282 282 F7188X_GPIO_BANK(40, 8, 0xF0, DRVNAME "-4"), 283 283 F7188X_GPIO_BANK(50, 8, 0xF4, DRVNAME "-5"), 284 284 F7188X_GPIO_BANK(60, 8, 0xF8, DRVNAME "-6"), 285 - F7188X_GPIO_BANK(70, 1, 0xFC, DRVNAME "-7"), 285 + F7188X_GPIO_BANK(70, 8, 0xFC, DRVNAME "-7"), 286 286 }; 287 287 288 288 static int f7188x_gpio_get_direction(struct gpio_chip *chip, unsigned offset) ··· 490 490 data->nr_bank = ARRAY_SIZE(f81865_gpio_bank); 491 491 data->bank = f81865_gpio_bank; 492 492 break; 493 - case nct6116d: 494 - data->nr_bank = ARRAY_SIZE(nct6116d_gpio_bank); 495 - data->bank = nct6116d_gpio_bank; 493 + case nct6126d: 494 + data->nr_bank = ARRAY_SIZE(nct6126d_gpio_bank); 495 + data->bank = nct6126d_gpio_bank; 496 496 break; 497 497 default: 498 498 return -ENODEV; ··· 559 559 case SIO_F81865_ID: 560 560 sio->type = f81865; 561 561 break; 562 - case SIO_NCT6116D_ID: 562 + case SIO_NCT6126D_ID: 563 563 sio->device = SIO_LD_GPIO_NUVOTON; 564 - sio->type = nct6116d; 564 + sio->type = nct6126d; 565 565 break; 566 566 default: 567 567 pr_info("Unsupported Fintek device 0x%04x\n", devid); ··· 569 569 } 570 570 571 571 /* double check manufacturer where possible */ 572 - if (sio->type != nct6116d) { 572 + if (sio->type != nct6126d) { 573 573 manid = superio_inw(addr, SIO_FINTEK_MANID); 574 574 if (manid != SIO_FINTEK_ID) { 575 575 pr_debug("Not a Fintek device at 0x%08x\n", addr); ··· 581 581 err = 0; 582 582 583 583 pr_info("Found %s at %#x\n", f7188x_names[sio->type], (unsigned int)addr); 584 - if (sio->type != nct6116d) 584 + if (sio->type != nct6126d) 585 585 pr_info(" revision %d\n", superio_inb(addr, SIO_FINTEK_DEVREV)); 586 586 587 587 err:
+1 -1
drivers/gpio/gpio-mockup.c
··· 369 369 priv->offset = i; 370 370 priv->desc = gpiochip_get_desc(gc, i); 371 371 372 - debugfs_create_file(name, 0200, chip->dbg_dir, priv, 372 + debugfs_create_file(name, 0600, chip->dbg_dir, priv, 373 373 &gpio_mockup_debugfs_ops); 374 374 } 375 375 }
+2
drivers/gpio/gpiolib.c
··· 209 209 break; 210 210 /* nope, check the space right after the chip */ 211 211 base = gdev->base + gdev->ngpio; 212 + if (base < GPIO_DYNAMIC_BASE) 213 + base = GPIO_DYNAMIC_BASE; 212 214 } 213 215 214 216 if (gpio_is_valid(base)) {
+1 -1
tools/gpio/lsgpio.c
··· 94 94 for (i = 0; i < info->num_attrs; i++) { 95 95 if (info->attrs[i].id == GPIO_V2_LINE_ATTR_ID_DEBOUNCE) 96 96 fprintf(stdout, ", debounce_period=%dusec", 97 - info->attrs[0].debounce_period_us); 97 + info->attrs[i].debounce_period_us); 98 98 } 99 99 } 100 100
+3
tools/testing/selftests/gpio/gpio-sim.sh
··· 389 389 create_bank chip bank 390 390 set_num_lines chip bank 8 391 391 enable_chip chip 392 + DEVNAME=`configfs_dev_name chip` 393 + CHIPNAME=`configfs_chip_name chip bank` 394 + SYSFS_PATH="/sys/devices/platform/$DEVNAME/$CHIPNAME/sim_gpio0/value" 392 395 $BASE_DIR/gpio-mockup-cdev -b pull-up /dev/`configfs_chip_name chip bank` 0 393 396 test `cat $SYSFS_PATH` = "1" || fail "bias setting does not work" 394 397 remove_chip chip