[RFT PATCH v2] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770
Arnd Bergmann
arnd at kernel.org
Wed Feb 11 22:57:28 PST 2026
On Thu, Feb 12, 2026, at 02:12, Dmitry Torokhov wrote:
> On Wed, Feb 11, 2026 at 01:40:44PM -0800, Dmitry Torokhov wrote:
>> On Wed, Feb 11, 2026 at 05:31:52PM +0100, Arnd Bergmann wrote:
>> >
>> > Do you know if there is a good way to do this without using static
>> > platform devices?
>>
>> I wonder if something like below will help reducing boilerplate...
>
> And then we can change the gpio16xx like this (on top of Bartosz
> changes):
> @@ -49,27 +49,27 @@ static struct omap_gpio_reg_offs omap16xx_mpuio_regs = {
> .irqctrl = OMAP_MPUIO_GPIO_INT_EDGE,
> };
>
> -static struct omap_gpio_platform_data omap16xx_mpu_gpio_config = {
> +static const struct omap_gpio_platform_data omap16xx_mpu_gpio_config
> __initconst = {
> .is_mpuio = true,
> .bank_width = 16,
> .bank_stride = 1,
> .regs = &omap16xx_mpuio_regs,
> };
>
> -const struct software_node omap16xx_mpu_gpio_swnode = { };
> +static const struct software_node omap16xx_mpu_gpio_swnode;
>
> -static struct platform_device omap16xx_mpu_gpio = {
> - .name = "omap_gpio",
> - .id = 0,
> - .dev = {
> - .platform_data = &omap16xx_mpu_gpio_config,
> - },
> - .num_resources = ARRAY_SIZE(omap16xx_mpu_gpio_resources),
> - .resource = omap16xx_mpu_gpio_resources,
> +static const struct platform_device_info omap16xx_mpu_gpio_info __initconst = {
> + .name = "omap_gpio",
> + .id = 0,
> + .data = &omap16xx_mpu_gpio_config,
> + .size_data = sizeof(omap16xx_mpu_gpio_config),
> + .res = omap16xx_mpu_gpio_resources,
> + .num_res = ARRAY_SIZE(omap16xx_mpu_gpio_resources),
> + .swnode = &omap16xx_mpu_gpio_swnode,
> };
Yes, that looks really nice!
Arnd
More information about the linux-arm-kernel
mailing list