mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 06:04:44 +01:00
mfd: vexpress-sysreg: set-up software nodes for gpio-mmio
Replace struct bgpio_pdata - that we plan to remove - with software nodes containing properties encoding the same values thatr can now be parsed by gpio-mmio. Acked-by: Lee Jones <lee@kernel.org> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250701-gpio-mmio-pdata-v2-3-ebf34d273497@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
c4a8348405
commit
11cd2e582b
1 changed files with 28 additions and 18 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/stat.h>
|
||||
|
||||
|
|
@ -37,22 +38,34 @@
|
|||
|
||||
/* The sysreg block is just a random collection of various functions... */
|
||||
|
||||
static struct bgpio_pdata vexpress_sysreg_sys_led_pdata = {
|
||||
.label = "sys_led",
|
||||
.base = -1,
|
||||
.ngpio = 8,
|
||||
static const struct property_entry vexpress_sysreg_sys_led_props[] = {
|
||||
PROPERTY_ENTRY_STRING("label", "sys_led"),
|
||||
PROPERTY_ENTRY_U32("ngpios", 8),
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct bgpio_pdata vexpress_sysreg_sys_mci_pdata = {
|
||||
.label = "sys_mci",
|
||||
.base = -1,
|
||||
.ngpio = 2,
|
||||
static const struct software_node vexpress_sysreg_sys_led_swnode = {
|
||||
.properties = vexpress_sysreg_sys_led_props,
|
||||
};
|
||||
|
||||
static struct bgpio_pdata vexpress_sysreg_sys_flash_pdata = {
|
||||
.label = "sys_flash",
|
||||
.base = -1,
|
||||
.ngpio = 1,
|
||||
static const struct property_entry vexpress_sysreg_sys_mci_props[] = {
|
||||
PROPERTY_ENTRY_STRING("label", "sys_mci"),
|
||||
PROPERTY_ENTRY_U32("ngpios", 2),
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct software_node vexpress_sysreg_sys_mci_swnode = {
|
||||
.properties = vexpress_sysreg_sys_mci_props,
|
||||
};
|
||||
|
||||
static const struct property_entry vexpress_sysreg_sys_flash_props[] = {
|
||||
PROPERTY_ENTRY_STRING("label", "sys_flash"),
|
||||
PROPERTY_ENTRY_U32("ngpios", 1),
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct software_node vexpress_sysreg_sys_flash_swnode = {
|
||||
.properties = vexpress_sysreg_sys_flash_props,
|
||||
};
|
||||
|
||||
static struct mfd_cell vexpress_sysreg_cells[] = {
|
||||
|
|
@ -61,22 +74,19 @@ static struct mfd_cell vexpress_sysreg_cells[] = {
|
|||
.of_compatible = "arm,vexpress-sysreg,sys_led",
|
||||
.num_resources = 1,
|
||||
.resources = &DEFINE_RES_MEM_NAMED(SYS_LED, 0x4, "dat"),
|
||||
.platform_data = &vexpress_sysreg_sys_led_pdata,
|
||||
.pdata_size = sizeof(vexpress_sysreg_sys_led_pdata),
|
||||
.swnode = &vexpress_sysreg_sys_led_swnode,
|
||||
}, {
|
||||
.name = "basic-mmio-gpio",
|
||||
.of_compatible = "arm,vexpress-sysreg,sys_mci",
|
||||
.num_resources = 1,
|
||||
.resources = &DEFINE_RES_MEM_NAMED(SYS_MCI, 0x4, "dat"),
|
||||
.platform_data = &vexpress_sysreg_sys_mci_pdata,
|
||||
.pdata_size = sizeof(vexpress_sysreg_sys_mci_pdata),
|
||||
.swnode = &vexpress_sysreg_sys_mci_swnode,
|
||||
}, {
|
||||
.name = "basic-mmio-gpio",
|
||||
.of_compatible = "arm,vexpress-sysreg,sys_flash",
|
||||
.num_resources = 1,
|
||||
.resources = &DEFINE_RES_MEM_NAMED(SYS_FLASH, 0x4, "dat"),
|
||||
.platform_data = &vexpress_sysreg_sys_flash_pdata,
|
||||
.pdata_size = sizeof(vexpress_sysreg_sys_flash_pdata),
|
||||
.swnode = &vexpress_sysreg_sys_flash_swnode,
|
||||
}, {
|
||||
.name = "vexpress-syscfg",
|
||||
.num_resources = 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue