Immutable branch between MFD and GPIO due for the v7.2 merge window

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmn8rw4ACgkQUa+KL4f8
 d2EcmA/8DSOHphmRTqUukRnrZSScH1kfqejqm7d8mPg9jwCPMGvHbqJ1p83VFA+B
 1UTf0a9MsEl+wU+Zs5m1NqZWVrAaEZ7v25kOuopB335mDgsyT4rlg0p5TlNr7Gji
 mqM0o57mskMeG0Npx4CqlyEdG/BG65NiMBCjSkoRkg0ZWJRN6VWohjCi4pP98c3g
 V2X6WcnIDQPc9syp45jxj1RmLk/7NHa14Qezjvf4PBs2KZG2uCfP1MWG1+E6qgMX
 0nJ6SLpVdkD92PZXlwvuEovelF6cFPWbvbCUus0nETbcm+pO3Jd6pGV5g3gWJQyg
 A7Zd2vQ0fTCOhYxkwxsRh6PhL7RayJONu5ctxjXTYNGuq/YLi4j7payODf9lUnhv
 fqg/AVrsriVyUkjfjW7UrGpwVx0eUi3siGzbl/Bolh/1NC/4M15Wt9c6zRGIcViN
 5KeSE5YQnfWDk+4r9w06CkwLX852uqhux6LAqrgdswZ8x+vvPBc2vV6gnU/vGG+/
 xkZTqvt+Z9clksQV3LcqkaztS7vygjBmTYWEoxBY+MxIdwvB6N6Zt67WxSL6DDEd
 X/9ApwX9zKg01tnOPRuJZVGOdmWJvtZsXEp7ETB56m5y+ADRZ2MZop53fuxoGaja
 Y2MT0aclX5MvoTk7kbM/p6Uq4vxAVjsWjbfo2GYYJB3EHtp8kw4=
 =tVLe
 -----END PGP SIGNATURE-----

Merge tag 'ib-mfd-gpio-v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into gpio/for-next

Immutable branch between MFD and GPIO due for the v7.2 merge window
This commit is contained in:
Bartosz Golaszewski 2026-05-13 15:44:51 +02:00
commit cccecb5cbe
4 changed files with 31 additions and 54 deletions

View File

@ -14,7 +14,6 @@
#include <linux/platform_device.h>
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/timb_gpio.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
@ -225,19 +224,21 @@ static int timbgpio_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct gpio_chip *gc;
struct timbgpio *tgpio;
struct timbgpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
int irq = platform_get_irq(pdev, 0);
if (!pdata || pdata->nr_pins > 32) {
dev_err(dev, "Invalid platform data\n");
return -EINVAL;
}
tgpio = devm_kzalloc(dev, sizeof(*tgpio), GFP_KERNEL);
if (!tgpio)
return -EINVAL;
tgpio->irq_base = pdata->irq_base;
gc = &tgpio->gpio;
err = device_property_read_u32(dev, "irq-base", &tgpio->irq_base);
if (err)
return err;
err = device_property_read_u32(dev, "gpio-base", &gc->base);
if (err)
return err;
spin_lock_init(&tgpio->lock);
@ -245,8 +246,6 @@ static int timbgpio_probe(struct platform_device *pdev)
if (IS_ERR(tgpio->membase))
return PTR_ERR(tgpio->membase);
gc = &tgpio->gpio;
gc->label = dev_name(&pdev->dev);
gc->owner = THIS_MODULE;
gc->parent = &pdev->dev;
@ -256,21 +255,22 @@ static int timbgpio_probe(struct platform_device *pdev)
gc->set = timbgpio_gpio_set;
gc->to_irq = (irq >= 0 && tgpio->irq_base > 0) ? timbgpio_to_irq : NULL;
gc->dbg_show = NULL;
gc->base = pdata->gpio_base;
gc->ngpio = pdata->nr_pins;
gc->can_sleep = false;
err = devm_gpiochip_add_data(&pdev->dev, gc, tgpio);
if (err)
return err;
if (gc->ngpio > 32)
return dev_err_probe(dev, -EINVAL, "Invalid number of pins\n");
/* make sure to disable interrupts */
iowrite32(0x0, tgpio->membase + TGPIO_IER);
if (irq < 0 || tgpio->irq_base <= 0)
return 0;
for (i = 0; i < pdata->nr_pins; i++) {
for (i = 0; i < gc->ngpio; i++) {
irq_set_chip_and_handler(tgpio->irq_base + i,
&timbgpio_irqchip, handle_simple_irq);
irq_set_chip_data(tgpio->irq_base + i, tgpio);

View File

@ -15,8 +15,6 @@
#include <linux/property.h>
#include <linux/slab.h>
#include <linux/timb_gpio.h>
#include <linux/i2c.h>
#include <linux/platform_data/i2c-ocores.h>
#include <linux/platform_data/i2c-xiic.h>
@ -37,6 +35,10 @@
#define DRIVER_NAME "timberdale"
#define GPIO_NR_PINS 16
#define GPIO_BASE 0
#define IRQ_BASE 200
struct timberdale_device {
resource_size_t ctl_mapbase;
unsigned char __iomem *ctl_membase;
@ -174,11 +176,16 @@ static const struct resource timberdale_eth_resources[] = {
},
};
static struct timbgpio_platform_data
timberdale_gpio_platform_data = {
.gpio_base = 0,
.nr_pins = GPIO_NR_PINS,
.irq_base = 200,
static const struct property_entry timberdale_gpio_properties[] = {
PROPERTY_ENTRY_U32("ngpios", GPIO_NR_PINS),
PROPERTY_ENTRY_U32("gpio-base", GPIO_BASE),
PROPERTY_ENTRY_U32("irq-base", IRQ_BASE),
{ }
};
static const struct software_node timberdale_gpio_swnode = {
.name = "timb-gpio",
.properties = timberdale_gpio_properties,
};
static const struct resource timberdale_gpio_resources[] = {
@ -390,8 +397,7 @@ static const struct mfd_cell timberdale_cells_bar0_cfg0[] = {
.name = "timb-gpio",
.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
.resources = timberdale_gpio_resources,
.platform_data = &timberdale_gpio_platform_data,
.pdata_size = sizeof(timberdale_gpio_platform_data),
.swnode = &timberdale_gpio_swnode,
},
{
.name = "timb-video",
@ -452,8 +458,7 @@ static const struct mfd_cell timberdale_cells_bar0_cfg1[] = {
.name = "timb-gpio",
.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
.resources = timberdale_gpio_resources,
.platform_data = &timberdale_gpio_platform_data,
.pdata_size = sizeof(timberdale_gpio_platform_data),
.swnode = &timberdale_gpio_swnode,
},
{
.name = "timb-mlogicore",
@ -514,8 +519,7 @@ static const struct mfd_cell timberdale_cells_bar0_cfg2[] = {
.name = "timb-gpio",
.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
.resources = timberdale_gpio_resources,
.platform_data = &timberdale_gpio_platform_data,
.pdata_size = sizeof(timberdale_gpio_platform_data),
.swnode = &timberdale_gpio_swnode,
},
{
.name = "timb-video",
@ -564,8 +568,7 @@ static const struct mfd_cell timberdale_cells_bar0_cfg3[] = {
.name = "timb-gpio",
.num_resources = ARRAY_SIZE(timberdale_gpio_resources),
.resources = timberdale_gpio_resources,
.platform_data = &timberdale_gpio_platform_data,
.pdata_size = sizeof(timberdale_gpio_platform_data),
.swnode = &timberdale_gpio_swnode,
},
{
.name = "timb-video",

View File

@ -113,7 +113,6 @@
#define GPIO_PIN_ASCB 8
#define GPIO_PIN_INIC_RST 14
#define GPIO_PIN_BT_RST 15
#define GPIO_NR_PINS 16
/* DMA Channels */
#define DMA_UART_RX 0

View File

@ -1,25 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* timb_gpio.h timberdale FPGA GPIO driver, platform data definition
* Copyright (c) 2009 Intel Corporation
*/
#ifndef _LINUX_TIMB_GPIO_H
#define _LINUX_TIMB_GPIO_H
/**
* struct timbgpio_platform_data - Platform data of the Timberdale GPIO driver
* @gpio_base: The number of the first GPIO pin, set to -1 for
* dynamic number allocation.
* @nr_pins: Number of pins that is supported by the hardware (1-32)
* @irq_base: If IRQ is supported by the hardware, this is the base
* number of IRQ:s. One IRQ per pin will be used. Set to
* -1 if IRQ:s is not supported.
*/
struct timbgpio_platform_data {
int gpio_base;
int nr_pins;
int irq_base;
};
#endif