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.

ARM: omap1: ams-delta: convert GPIO hogs to using firmware nodes

Setup a software node hierarchy for the latch2 GPIO controller defining
the required hog and stop using legacy machine hog API.

Acked-by: Kevin Hilman <khilman@baylibre.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260309-gpio-hog-fwnode-v2-4-4e61f3dbf06a@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

+27 -5
+27 -5
arch/arm/mach-omap1/board-ams-delta.c
··· 556 556 &ams_delta_nand_gpio_table, 557 557 }; 558 558 559 - static struct gpiod_hog ams_delta_gpio_hogs[] = { 560 - GPIO_HOG(LATCH2_LABEL, LATCH2_PIN_KEYBRD_DATAOUT, "keybrd_dataout", 561 - GPIO_ACTIVE_HIGH, GPIOD_OUT_LOW), 562 - {}, 559 + static const struct software_node latch2_gpio_swnode = { 560 + .name = LATCH2_LABEL, 561 + }; 562 + 563 + static const u32 latch2_hog_gpios[] = { LATCH2_PIN_KEYBRD_DATAOUT, 0 }; 564 + 565 + static const struct property_entry latch2_gpio_hog_props[] = { 566 + PROPERTY_ENTRY_BOOL("gpio-hog"), 567 + PROPERTY_ENTRY_U32_ARRAY("gpios", latch2_hog_gpios), 568 + PROPERTY_ENTRY_STRING("line-name", "keybrd_dataout"), 569 + PROPERTY_ENTRY_BOOL("output-low"), 570 + { } 571 + }; 572 + 573 + static const struct software_node latch2_gpio_hog_swnode = { 574 + .parent = &latch2_gpio_swnode, 575 + .name = "latch2-hog", 576 + .properties = latch2_gpio_hog_props, 577 + }; 578 + 579 + static const struct software_node *const latch2_gpio_swnodes[] = { 580 + &latch2_gpio_swnode, 581 + &latch2_gpio_hog_swnode, 582 + NULL 563 583 }; 564 584 565 585 static struct plat_serial8250_port ams_delta_modem_ports[]; ··· 704 684 705 685 omap_gpio_deps_init(); 706 686 ams_delta_latch2_init(); 707 - gpiod_add_hogs(ams_delta_gpio_hogs); 708 687 709 688 omap_serial_init(); 710 689 omap_register_i2c_bus(1, 100, NULL, 0); ··· 712 693 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); 713 694 714 695 platform_device_register_full(&latch1_gpio_devinfo); 696 + 697 + software_node_register_node_group(latch2_gpio_swnodes); 698 + latch2_gpio_devinfo.fwnode = software_node_fwnode(&latch2_gpio_swnode); 715 699 platform_device_register_full(&latch2_gpio_devinfo); 716 700 717 701 /*