Merge tag 'config-gpio-legacy-for-7.3' of https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground into gpio/for-next

gpio: legacy interface cleanups for 7.3

These are the remaining patches for legacy gpio interface
cleanup, ensuring that files referencing them are sure to
have CONFIG_GPIOLIB_LEGACY set, and use linux/gpio/legacy.h
instead of the old linux/gpio.h header.

There are a few more patches already merged in other
branches for 7.3, including soc, led, net and media. Once
everything is in, we can apply the final patches to turn
off CONFIG_GPIOLIB_LEGACY by default and remove the obsolete
header file.

This branch is based on the immutable ib-mfd-legacy-gpio-7.3
branch from mfd.git to avoid a conflict in the rohm drivers.
This commit is contained in:
Bartosz Golaszewski
2026-07-27 09:56:49 +02:00
60 changed files with 248 additions and 117 deletions

View File

@@ -11,7 +11,7 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <asm/bootinfo.h>

View File

@@ -8,7 +8,7 @@
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/gpio/machine.h>
#include <linux/gpio/property.h>
#include <linux/init.h>

View File

@@ -7,7 +7,7 @@
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>

View File

@@ -7,7 +7,7 @@
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/io.h>

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include "bcm47xx_private.h"
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <bcm47xx_board.h>
#include <bcm47xx.h>

View File

@@ -7,6 +7,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/init.h>
#include <linux/gpio/legacy.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/platform_device.h>

View File

@@ -3,7 +3,7 @@
#define BOARD_BCM963XX_H_
#include <linux/types.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/leds.h>
#include <bcm63xx_dev_enet.h>
#include <bcm63xx_dev_usb_usbd.h>

View File

@@ -462,6 +462,7 @@ config CPU_SUBTYPE_SHX3
select CPU_SHX3
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
select GPIOLIB
select GPIOLIB_LEGACY
select PINCTRL
# SH4AL-DSP Processor Support

View File

@@ -80,6 +80,7 @@ config SH_7724_SOLUTION_ENGINE
select SOLUTION_ENGINE
depends on CPU_SUBTYPE_SH7724
select GPIOLIB
select GPIOLIB_LEGACY
select REGULATOR_FIXED_VOLTAGE if REGULATOR
imply SND_SOC_AK4642 if SND_SIMPLE_CARD
help
@@ -199,6 +200,7 @@ config SH_SH7757LCR
bool "SH7757LCR"
depends on CPU_SUBTYPE_SH7757
select GPIOLIB
select GPIOLIB_LEGACY
select REGULATOR_FIXED_VOLTAGE if REGULATOR
config SH_SH7785LCR
@@ -226,6 +228,7 @@ config SH_URQUELL
bool "Urquell"
depends on CPU_SUBTYPE_SH7786
select GPIOLIB
select GPIOLIB_LEGACY
select HAVE_PCI
select NO_IOPORT_MAP if !PCI
@@ -233,6 +236,7 @@ config SH_MIGOR
bool "Migo-R"
depends on CPU_SUBTYPE_SH7722
select GPIOLIB
select GPIOLIB_LEGACY
select REGULATOR_FIXED_VOLTAGE if REGULATOR
help
Select Migo-R if configuring for the SH7722 Migo-R platform
@@ -242,6 +246,7 @@ config SH_AP325RXA
bool "AP-325RXA"
depends on CPU_SUBTYPE_SH7723
select GPIOLIB
select GPIOLIB_LEGACY
select REGULATOR_FIXED_VOLTAGE if REGULATOR
help
Renesas "AP-325RXA" support.
@@ -251,6 +256,7 @@ config SH_KFR2R09
bool "KFR2R09"
depends on CPU_SUBTYPE_SH7724
select GPIOLIB
select GPIOLIB_LEGACY
select REGULATOR_FIXED_VOLTAGE if REGULATOR
help
"Kit For R2R for 2009" support.
@@ -259,6 +265,7 @@ config SH_ECOVEC
bool "EcoVec"
depends on CPU_SUBTYPE_SH7724
select GPIOLIB
select GPIOLIB_LEGACY
select REGULATOR_FIXED_VOLTAGE if REGULATOR
imply SND_SOC_DA7210 if SND_SIMPLE_CARD
help
@@ -329,6 +336,7 @@ config SH_MAGIC_PANEL_R2
bool "Magic Panel R2"
depends on CPU_SUBTYPE_SH7720
select GPIOLIB
select GPIOLIB_LEGACY
select REGULATOR_FIXED_VOLTAGE if REGULATOR
help
Select Magic Panel R2 if configuring for Magic Panel R2.

View File

@@ -10,7 +10,7 @@
#include <linux/irq.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
#include <linux/smsc911x.h>

View File

@@ -7,7 +7,7 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/irq.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>

View File

@@ -14,7 +14,7 @@
#include <linux/smc91x.h>
#include <linux/mtd/physmap.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/irq.h>
#include <linux/clk.h>
#include <linux/sh_intc.h>

View File

@@ -17,7 +17,7 @@
#include <linux/clkdev.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/machine.h>
#include <linux/i2c.h>

View File

@@ -20,7 +20,7 @@
#include <linux/mmc/host.h>
#include <linux/platform_data/sh_mmcif.h>
#include <linux/mtd/physmap.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/gpio/machine.h>
#include <linux/platform_data/gpio_backlight.h>
#include <linux/platform_data/tmio.h>

View File

@@ -20,6 +20,7 @@ config SH_R7785RP
bool "R7785RP board support"
depends on CPU_SUBTYPE_SH7785
select GPIOLIB
select GPIOLIB_LEGACY
endchoice

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2008 Paul Mundt
*/
#include <linux/init.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <cpu/sh7785.h>
#include <mach/highlander.h>

View File

@@ -14,7 +14,7 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <video/sh_mobile_lcdc.h>
#include <mach/kfr2r09.h>
#include <cpu/sh7724.h>

View File

@@ -14,7 +14,7 @@
#include <linux/clkdev.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/gpio/machine.h>
#include <linux/i2c.h>
#include <linux/init.h>

View File

@@ -14,7 +14,7 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <video/sh_mobile_lcdc.h>
#include <cpu/sh7722.h>
#include <mach/migor.h>

View File

@@ -22,7 +22,7 @@
#include <linux/smc91x.h>
#include <linux/delay.h>
#include <linux/clk.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/gpio/machine.h>
#include <linux/videodev2.h>
#include <linux/sh_intc.h>

View File

@@ -12,16 +12,19 @@ config SH_RSK7201
config SH_RSK7203
bool "RSK7203"
select GPIOLIB
select GPIOLIB_LEGACY
depends on CPU_SUBTYPE_SH7203
config SH_RSK7264
bool "RSK2+SH7264"
select GPIOLIB
select GPIOLIB_LEGACY
depends on CPU_SUBTYPE_SH7264
config SH_RSK7269
bool "RSK2+SH7269"
select GPIOLIB
select GPIOLIB_LEGACY
depends on CPU_SUBTYPE_SH7269
endchoice

View File

@@ -11,7 +11,6 @@
#include <linux/interrupt.h>
#include <linux/input.h>
#include <linux/smsc911x.h>
#include <linux/gpio.h>
#include <asm/machvec.h>
#include <asm/io.h>

View File

@@ -15,7 +15,7 @@
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/input/sh_keysc.h>

View File

@@ -10,8 +10,6 @@
#ifndef __ASM_SH_MAGICPANELR2_H
#define __ASM_SH_MAGICPANELR2_H
#include <linux/gpio.h>
#define __IO_PREFIX mpr2
#include <asm/io_generic.h>

View File

@@ -9,7 +9,7 @@
#include <linux/serial.h>
#include <linux/serial_sci.h>
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/sh_timer.h>
#include <linux/sh_intc.h>
#include <cpu/shx3.h>

View File

@@ -2976,6 +2976,7 @@ config OLPC
bool "One Laptop Per Child support"
depends on !X86_PAE
select GPIOLIB
select GPIOLIB_LEGACY
select OF
select OF_PROMTREE
select IRQ_DOMAIN

View File

@@ -9,7 +9,7 @@
#include <linux/cs5535.h>
#include <linux/device.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>

View File

@@ -64,7 +64,6 @@
#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
#include <linux/gpio/machine.h>
#include <linux/gpio.h>
#include <linux/irq.h>
static int sn7516x_used = 1, sn7516x;

View File

@@ -23,8 +23,8 @@
#include <linux/input.h>
#include <linux/gpio_keys.h>
#include <linux/workqueue.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/legacy.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/spinlock.h>
@@ -528,6 +528,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
*/
bdata->gpiod = NULL;
}
#ifdef CONFIG_GPIOLIB_LEGACY
} else if (gpio_is_valid(button->gpio)) {
/*
* Legacy GPIO number, so request the GPIO here and
@@ -546,6 +547,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
if (button->active_low ^ gpiod_is_active_low(bdata->gpiod))
gpiod_toggle_active_low(bdata->gpiod);
#endif
}
if (bdata->gpiod) {
@@ -583,8 +585,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
if (irq < 0) {
error = irq;
dev_err_probe(dev, error,
"Unable to get irq number for GPIO %d\n",
button->gpio);
"Unable to get irq number for GPIO\n");
return error;
}
bdata->irq = irq;

View File

@@ -18,8 +18,8 @@
#include <linux/input.h>
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/legacy.h>
#include <linux/gpio_keys.h>
#include <linux/property.h>
@@ -301,6 +301,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(bdata->gpiod),
"failed to get gpio\n");
}
#ifdef CONFIG_GPIOLIB_LEGACY
} else if (gpio_is_valid(button->gpio)) {
/*
* Legacy GPIO number so request the GPIO here and
@@ -323,6 +324,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
if (button->active_low ^ gpiod_is_active_low(bdata->gpiod))
gpiod_toggle_active_low(bdata->gpiod);
#endif
}
bdata->last_state = -1;

View File

@@ -16,7 +16,6 @@
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/gpio.h>
#include <linux/input/matrix_keypad.h>
#include <linux/slab.h>
#include <linux/of.h>

View File

@@ -892,6 +892,9 @@ config INPUT_IDEAPAD_SLIDEBAR
config INPUT_SOC_BUTTON_ARRAY
tristate "Windows-compatible SoC Button Array"
depends on KEYBOARD_GPIO && ACPI
depends on X86
depends on GPIOLIB
select GPIOLIB_LEGACY
help
Say Y here if you have a SoC-based tablet that originally runs
Windows 8 or a Microsoft Surface Book 2, Pro 5, Laptop 1 or later.

View File

@@ -15,7 +15,6 @@
#include <linux/dmi.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio_keys.h>
#include <linux/gpio.h>
#include <linux/platform_device.h>
static bool use_low_level_irq;

View File

@@ -13,7 +13,7 @@
#include <linux/uaccess.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/mfd/core.h>
#include <linux/mfd/aat2870.h>
#include <linux/regulator/machine.h>

View File

@@ -8,7 +8,7 @@
*/
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/irqdomain.h>

View File

@@ -28,7 +28,7 @@
*/
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/mfd/core.h>
#include <linux/mfd/lp3943.h>

View File

@@ -5,7 +5,8 @@
* ROHM BD718[15/28/79] and BD72720 PMIC driver
*/
#include <linux/gpio_keys.h>
#include <linux/device/devres.h>
#include <linux/gfp_types.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/interrupt.h>
@@ -18,6 +19,7 @@
#include <linux/mfd/rohm-generic.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/types.h>
@@ -37,19 +39,6 @@
}, \
}
static struct gpio_keys_button button = {
.code = KEY_POWER,
.gpio = -1,
.type = EV_KEY,
.wakeup = 1,
};
static const struct gpio_keys_platform_data bd71828_powerkey_data = {
.buttons = &button,
.nbuttons = 1,
.name = "bd71828-pwrkey",
};
static const struct resource bd71815_rtc_irqs[] = {
DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC0, "bd70528-rtc-alm-0"),
DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC1, "bd70528-rtc-alm-1"),
@@ -174,10 +163,6 @@ static struct mfd_cell bd71828_mfd_cells[] = {
.name = "bd71828-rtc",
.resources = bd71828_rtc_irqs,
.num_resources = ARRAY_SIZE(bd71828_rtc_irqs),
}, {
.name = "gpio-keys",
.platform_data = &bd71828_powerkey_data,
.pdata_size = sizeof(bd71828_powerkey_data),
},
};
@@ -242,11 +227,8 @@ static const struct mfd_cell bd72720_mfd_cells[] = {
.name = "bd72720-rtc",
.resources = bd72720_rtc_irqs,
.num_resources = ARRAY_SIZE(bd72720_rtc_irqs),
}, {
.name = "gpio-keys",
.platform_data = &bd71828_powerkey_data,
.pdata_size = sizeof(bd71828_powerkey_data),
},
/* Power button is registered separately */
};
static const struct regmap_range bd71815_volatile_ranges[] = {
@@ -877,6 +859,84 @@ static int set_clk_mode(struct device *dev, struct regmap *regmap,
OUT32K_MODE_CMOS);
}
static const struct property_entry bd71828_powerkey_parent_props[] = {
PROPERTY_ENTRY_STRING("label", "bd71828-pwrkey"),
{ }
};
static const struct property_entry bd71828_powerkey_props[] = {
PROPERTY_ENTRY_U32("linux,code", KEY_POWER),
PROPERTY_ENTRY_BOOL("wakeup-source"),
{ }
};
#define GPIO_KEYS 0 /* Node corresponding to gpio-keys device itself */
#define PWRON_KEY 1 /* Node describing power button in gpio-keys */
static int bd71828_i2c_register_swnodes(const struct software_node *nodes)
{
const struct software_node * const node_group[] = {
&nodes[GPIO_KEYS], &nodes[PWRON_KEY], NULL
};
return software_node_register_node_group(node_group);
}
static void bd71828_i2c_unregister_swnodes(void *data)
{
const struct software_node *nodes = data;
const struct software_node * const node_group[] = {
&nodes[GPIO_KEYS], &nodes[PWRON_KEY], NULL
};
software_node_unregister_node_group(node_group);
}
static int bd71828_i2c_register_pwrbutton(struct device *dev, int button_irq,
struct irq_domain *irq_domain)
{
const struct resource res[] = {
DEFINE_RES_IRQ_NAMED(button_irq, "bd71828-pwrkey"),
};
struct mfd_cell gpio_keys_cell = {
.name = "gpio-keys",
.resources = res,
.num_resources = ARRAY_SIZE(res),
};
struct software_node *nodes;
int ret;
nodes = devm_kcalloc(dev, 2, sizeof(*nodes), GFP_KERNEL);
if (!nodes)
return -ENOMEM;
nodes[GPIO_KEYS].name = devm_kasprintf(dev, GFP_KERNEL, "%s-power-key", dev_name(dev));
if (!nodes[GPIO_KEYS].name)
return -ENOMEM;
nodes[GPIO_KEYS].properties = bd71828_powerkey_parent_props;
nodes[PWRON_KEY].parent = &nodes[GPIO_KEYS];
nodes[PWRON_KEY].properties = bd71828_powerkey_props;
ret = bd71828_i2c_register_swnodes(nodes);
if (ret)
return ret;
ret = devm_add_action_or_reset(dev, bd71828_i2c_unregister_swnodes, nodes);
if (ret)
return ret;
gpio_keys_cell.swnode = &nodes[GPIO_KEYS];
ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, &gpio_keys_cell, 1,
NULL, 0, irq_domain);
if (ret)
return dev_err_probe(dev, ret, "Failed to register power-button");
return 0;
}
static struct i2c_client *bd71828_dev;
static void bd71828_power_off(void)
{
@@ -929,6 +989,7 @@ static struct regmap *bd72720_do_regmaps(struct i2c_client *i2c)
static int bd71828_i2c_probe(struct i2c_client *i2c)
{
struct regmap_irq_chip_data *irq_data;
struct irq_domain *irq_domain;
int ret;
struct regmap *regmap = NULL;
const struct regmap_config *regmap_config;
@@ -1022,23 +1083,23 @@ static int bd71828_i2c_probe(struct i2c_client *i2c)
"Failed to enable main level IRQs\n");
}
}
if (button_irq) {
ret = regmap_irq_get_virq(irq_data, button_irq);
if (ret < 0)
return dev_err_probe(&i2c->dev, ret,
"Failed to get the power-key IRQ\n");
button.irq = ret;
}
ret = set_clk_mode(&i2c->dev, regmap, clkmode_reg);
if (ret)
return ret;
irq_domain = regmap_irq_get_domain(irq_data);
ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, mfd, cells,
NULL, 0, regmap_irq_get_domain(irq_data));
NULL, 0, irq_domain);
if (ret)
return dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n");
return dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n");
if (button_irq) {
ret = bd71828_i2c_register_pwrbutton(&i2c->dev, button_irq, irq_domain);
if (ret)
return ret;
}
if (of_device_is_system_power_controller(i2c->dev.of_node) &&
chip_type == ROHM_CHIP_TYPE_BD71828) {

View File

@@ -7,7 +7,8 @@
// Datasheet for BD71837MWV available from
// https://www.rohm.com/datasheet/BD71837MWV/bd71837mwv-e
#include <linux/gpio_keys.h>
#include <linux/device/devres.h>
#include <linux/gfp_types.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/interrupt.h>
@@ -15,37 +16,16 @@
#include <linux/mfd/core.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/types.h>
static struct gpio_keys_button button = {
.code = KEY_POWER,
.gpio = -1,
.type = EV_KEY,
};
static struct gpio_keys_platform_data bd718xx_powerkey_data = {
.buttons = &button,
.nbuttons = 1,
.name = "bd718xx-pwrkey",
};
static struct mfd_cell bd71837_mfd_cells[] = {
{
.name = "gpio-keys",
.platform_data = &bd718xx_powerkey_data,
.pdata_size = sizeof(bd718xx_powerkey_data),
},
{ .name = "bd71837-clk", },
{ .name = "bd71837-pmic", },
};
static struct mfd_cell bd71847_mfd_cells[] = {
{
.name = "gpio-keys",
.platform_data = &bd718xx_powerkey_data,
.pdata_size = sizeof(bd718xx_powerkey_data),
},
{ .name = "bd71847-clk", },
{ .name = "bd71847-pmic", },
};
@@ -125,10 +105,89 @@ static int bd718xx_init_press_duration(struct regmap *regmap,
return 0;
}
static const struct property_entry bd718xx_powerkey_parent_props[] = {
PROPERTY_ENTRY_STRING("label", "bd718xx-pwrkey"),
{ }
};
static const struct property_entry bd718xx_powerkey_props[] = {
PROPERTY_ENTRY_U32("linux,code", KEY_POWER),
{ }
};
static const struct resource bd718xx_powerkey_resources[] = {
DEFINE_RES_IRQ_NAMED(BD718XX_INT_PWRBTN_S, "bd718xx-pwrkey"),
};
#define GPIO_KEYS 0 /* Node corresponding to gpio-keys device itself */
#define PWRON_KEY 1 /* Node describing power button in gpio-keys */
static int bd718xx_i2c_register_swnodes(const struct software_node *nodes)
{
const struct software_node * const node_group[] = {
&nodes[GPIO_KEYS], &nodes[PWRON_KEY], NULL
};
return software_node_register_node_group(node_group);
}
static void bd718xx_i2c_unregister_swnodes(void *data)
{
const struct software_node *nodes = data;
const struct software_node * const node_group[] = {
&nodes[GPIO_KEYS], &nodes[PWRON_KEY], NULL
};
software_node_unregister_node_group(node_group);
}
static int bd718xx_i2c_register_pwrbutton(struct device *dev,
struct irq_domain *irq_domain)
{
struct mfd_cell gpio_keys_cell = {
.name = "gpio-keys",
.resources = bd718xx_powerkey_resources,
.num_resources = ARRAY_SIZE(bd718xx_powerkey_resources),
};
struct software_node *nodes;
int ret;
nodes = devm_kcalloc(dev, 2, sizeof(*nodes), GFP_KERNEL);
if (!nodes)
return -ENOMEM;
nodes[GPIO_KEYS].name = devm_kasprintf(dev, GFP_KERNEL, "%s-power-key", dev_name(dev));
if (!nodes[GPIO_KEYS].name)
return -ENOMEM;
nodes[GPIO_KEYS].properties = bd718xx_powerkey_parent_props;
nodes[PWRON_KEY].parent = &nodes[GPIO_KEYS];
nodes[PWRON_KEY].properties = bd718xx_powerkey_props;
ret = bd718xx_i2c_register_swnodes(nodes);
if (ret)
return ret;
ret = devm_add_action_or_reset(dev, bd718xx_i2c_unregister_swnodes, nodes);
if (ret)
return ret;
gpio_keys_cell.swnode = &nodes[GPIO_KEYS];
ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, &gpio_keys_cell, 1,
NULL, 0, irq_domain);
if (ret)
return dev_err_probe(dev, ret, "Failed to register power-button");
return 0;
}
static int bd718xx_i2c_probe(struct i2c_client *i2c)
{
struct regmap *regmap;
struct regmap_irq_chip_data *irq_data;
struct irq_domain *irq_domain;
int ret;
unsigned int chip_type;
struct mfd_cell *mfd;
@@ -169,20 +228,18 @@ static int bd718xx_i2c_probe(struct i2c_client *i2c)
if (ret)
return ret;
ret = regmap_irq_get_virq(irq_data, BD718XX_INT_PWRBTN_S);
if (ret < 0)
return dev_err_probe(&i2c->dev, ret, "Failed to get the IRQ\n");
button.irq = ret;
irq_domain = regmap_irq_get_domain(irq_data);
ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO,
mfd, cells, NULL, 0,
regmap_irq_get_domain(irq_data));
mfd, cells, NULL, 0, irq_domain);
if (ret)
dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n");
return dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n");
return ret;
ret = bd718xx_i2c_register_pwrbutton(&i2c->dev, irq_domain);
if (ret)
return ret;
return 0;
}
static const struct of_device_id bd718xx_of_match[] = {

View File

@@ -35,7 +35,7 @@ struct sm501_device {
struct sm501_gpio;
#ifdef CONFIG_MFD_SM501_GPIO
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
struct sm501_gpio_chip {
struct gpio_chip gpio;

View File

@@ -16,7 +16,7 @@
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/err.h>

View File

@@ -14,7 +14,7 @@
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/debugfs.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/mfd/tps65910.h>
#define COMP1 0

View File

@@ -9,7 +9,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/irq.h>
#include <linux/mfd/core.h>

View File

@@ -14,7 +14,7 @@
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <bcm63xx_regs.h>
#include <bcm63xx_io.h>

View File

@@ -23,7 +23,7 @@
*/
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/interrupt.h>
#include <linux/pm.h>
#include <linux/module.h>

View File

@@ -11,7 +11,7 @@
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <mach/hardware.h>
#include <asm/irq.h>

View File

@@ -32,8 +32,8 @@
#include <linux/cpufreq.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/legacy.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>

View File

@@ -7,7 +7,7 @@
*/
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/ioport.h>

View File

@@ -3,7 +3,6 @@
#include <linux/delay.h>
#include <linux/extcon-provider.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/init.h>
#include <linux/interrupt.h>

View File

@@ -11,7 +11,7 @@
#include <linux/bits.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/mutex.h>

View File

@@ -11,7 +11,6 @@
#include <linux/slab.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/io.h>
#include <linux/module.h>

View File

@@ -25,7 +25,9 @@ struct device;
*/
struct gpio_keys_button {
unsigned int code;
#ifdef CONFIG_GPIOLIB_LEGACY
int gpio;
#endif
int active_low;
const char *desc;
unsigned int type;

View File

@@ -10,7 +10,7 @@
#ifndef __MFD_LP3943_H__
#define __MFD_LP3943_H__
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/regmap.h>
/* Registers */

View File

@@ -10,7 +10,6 @@
#ifndef __MFD_TI_LMU_H__
#define __MFD_TI_LMU_H__
#include <linux/gpio.h>
#include <linux/notifier.h>
#include <linux/regmap.h>
#include <linux/gpio/consumer.h>

View File

@@ -12,7 +12,7 @@
#ifndef __LINUX_MFD_TPS65910_H
#define __LINUX_MFD_TPS65910_H
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/regmap.h>
/* TPS chip id list */

View File

@@ -9,7 +9,7 @@
#include <linux/device.h>
#include <linux/mfd/mcp.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
#include <linux/mutex.h>

View File

@@ -300,6 +300,7 @@ config SND_CS5535AUDIO
tristate "CS5535/CS5536 Audio"
depends on X86_32 || MIPS || COMPILE_TEST
depends on HAS_IOPORT
depends on GPIOLIB_LEGACY || !OLPC
select SND_PCM
select SND_AC97_CODEC
help

View File

@@ -9,7 +9,7 @@
#include <sound/info.h>
#include <sound/control.h>
#include <sound/ac97_codec.h>
#include <linux/gpio.h>
#include <linux/gpio/legacy.h>
#include <asm/olpc.h>
#include "cs5535audio.h"

View File

@@ -16,7 +16,6 @@
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/acpi.h>

View File

@@ -11,7 +11,7 @@
#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/module.h>

View File

@@ -6,7 +6,6 @@
*/
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>