forked from Minki/linux
gpio: fixes for v6.1-rc3
- convert gpio-tegra to using an immutable irqchip - MAINTAINERS update -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmNeL54ACgkQEacuoBRx 13KvKRAAnYAMomR2J8Nx1KVNV28pLtACrLOULja3Kma+kSdruYNcT3+ZUzcFFgGu iqCVHPR+cKQ3VowqhSp2Ts6YIHMqJlh//Bq/1s7xXU+b5JkvHflWlTVLQXUpZK8I 1JXawwlOZV0a4ByVmTcvvBzxmohReabQodLdsaPtYbRyaQq9Stv66dVLT4j0l3mX J6J+VCFLYkysGIskpvnQjJyMKOrUjYteuoL0yTv74PFczp+PXu7XZw2+6DM4/knK bUGKhi3WNRuKLkiIiLVIkGDlhCdK0Fn91FkMKXBhB4nd0+PRCite4Ai5Z2pkuzkc Laljm5mUFruNU014NqeB1fV2jBB/ZyIqDxNBrnqtUtvD7W/ff2p0xar0lw0BKdrK N/daqSXB00LNNctW8PmdL0JobTPZnV20WZ+bu46t0o3llhzLRdUC2jLrMITP1+6U 1yn1Xff6Dr/8pCKR9hvMY1yVVRRv/tPHRZ5sozWnX0sfVmB2M8lTD9bFeLPAROXj aEpB0DrDtWjsiqJbWcOhjl/TEmexsDgD27Re7+qQKmMcMEvGUd3NU4FPK9eKBBbI tTImlFi8UcKbUsxvfZMF3YaZpafKRHlZYMD/cVKRKK4jzi80gljFYG5ayOVWyjlt Ex44ws2U8FVzFJjMPP1VMAfy3Lo+5EQs0kE4Z2DDV+5ua+J//hY= =IbVz -----END PGP SIGNATURE----- Merge tag 'gpio-fixes-for-v6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - convert gpio-tegra to using an immutable irqchip - MAINTAINERS update * tag 'gpio-fixes-for-v6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: MAINTAINERS: Change myself to a maintainer gpio: tegra: Convert to immutable irq chip
This commit is contained in:
commit
ef3c0949b9
@ -17812,7 +17812,7 @@ S: Odd Fixes
|
||||
F: drivers/tty/serial/rp2.*
|
||||
|
||||
ROHM BD99954 CHARGER IC
|
||||
R: Matti Vaittinen <mazziesaccount@gmail.com>
|
||||
M: Matti Vaittinen <mazziesaccount@gmail.com>
|
||||
S: Supported
|
||||
F: drivers/power/supply/bd99954-charger.c
|
||||
F: drivers/power/supply/bd99954-charger.h
|
||||
@ -17835,7 +17835,7 @@ F: drivers/regulator/bd9571mwv-regulator.c
|
||||
F: include/linux/mfd/bd9571mwv.h
|
||||
|
||||
ROHM POWER MANAGEMENT IC DEVICE DRIVERS
|
||||
R: Matti Vaittinen <mazziesaccount@gmail.com>
|
||||
M: Matti Vaittinen <mazziesaccount@gmail.com>
|
||||
S: Supported
|
||||
F: drivers/clk/clk-bd718x7.c
|
||||
F: drivers/gpio/gpio-bd71815.c
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/irqchip/chained_irq.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
@ -94,7 +95,6 @@ struct tegra_gpio_info {
|
||||
struct tegra_gpio_bank *bank_info;
|
||||
const struct tegra_gpio_soc_config *soc;
|
||||
struct gpio_chip gc;
|
||||
struct irq_chip ic;
|
||||
u32 bank_count;
|
||||
unsigned int *irqs;
|
||||
};
|
||||
@ -288,6 +288,7 @@ static void tegra_gpio_irq_mask(struct irq_data *d)
|
||||
unsigned int gpio = d->hwirq;
|
||||
|
||||
tegra_gpio_mask_write(tgi, GPIO_MSK_INT_ENB(tgi, gpio), gpio, 0);
|
||||
gpiochip_disable_irq(chip, gpio);
|
||||
}
|
||||
|
||||
static void tegra_gpio_irq_unmask(struct irq_data *d)
|
||||
@ -296,6 +297,7 @@ static void tegra_gpio_irq_unmask(struct irq_data *d)
|
||||
struct tegra_gpio_info *tgi = gpiochip_get_data(chip);
|
||||
unsigned int gpio = d->hwirq;
|
||||
|
||||
gpiochip_enable_irq(chip, gpio);
|
||||
tegra_gpio_mask_write(tgi, GPIO_MSK_INT_ENB(tgi, gpio), gpio, 1);
|
||||
}
|
||||
|
||||
@ -598,10 +600,47 @@ static void tegra_gpio_irq_release_resources(struct irq_data *d)
|
||||
tegra_gpio_enable(tgi, d->hwirq);
|
||||
}
|
||||
|
||||
static void tegra_gpio_irq_print_chip(struct irq_data *d, struct seq_file *s)
|
||||
{
|
||||
struct gpio_chip *chip = irq_data_get_irq_chip_data(d);
|
||||
|
||||
seq_printf(s, dev_name(chip->parent));
|
||||
}
|
||||
|
||||
static const struct irq_chip tegra_gpio_irq_chip = {
|
||||
.irq_shutdown = tegra_gpio_irq_shutdown,
|
||||
.irq_ack = tegra_gpio_irq_ack,
|
||||
.irq_mask = tegra_gpio_irq_mask,
|
||||
.irq_unmask = tegra_gpio_irq_unmask,
|
||||
.irq_set_type = tegra_gpio_irq_set_type,
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
.irq_set_wake = tegra_gpio_irq_set_wake,
|
||||
#endif
|
||||
.irq_print_chip = tegra_gpio_irq_print_chip,
|
||||
.irq_request_resources = tegra_gpio_irq_request_resources,
|
||||
.irq_release_resources = tegra_gpio_irq_release_resources,
|
||||
.flags = IRQCHIP_IMMUTABLE,
|
||||
};
|
||||
|
||||
static const struct irq_chip tegra210_gpio_irq_chip = {
|
||||
.irq_shutdown = tegra_gpio_irq_shutdown,
|
||||
.irq_ack = tegra_gpio_irq_ack,
|
||||
.irq_mask = tegra_gpio_irq_mask,
|
||||
.irq_unmask = tegra_gpio_irq_unmask,
|
||||
.irq_set_affinity = tegra_gpio_irq_set_affinity,
|
||||
.irq_set_type = tegra_gpio_irq_set_type,
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
.irq_set_wake = tegra_gpio_irq_set_wake,
|
||||
#endif
|
||||
.irq_print_chip = tegra_gpio_irq_print_chip,
|
||||
.irq_request_resources = tegra_gpio_irq_request_resources,
|
||||
.irq_release_resources = tegra_gpio_irq_release_resources,
|
||||
.flags = IRQCHIP_IMMUTABLE,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/seq_file.h>
|
||||
|
||||
static int tegra_dbg_gpio_show(struct seq_file *s, void *unused)
|
||||
{
|
||||
@ -689,18 +728,6 @@ static int tegra_gpio_probe(struct platform_device *pdev)
|
||||
tgi->gc.ngpio = tgi->bank_count * 32;
|
||||
tgi->gc.parent = &pdev->dev;
|
||||
|
||||
tgi->ic.name = "GPIO";
|
||||
tgi->ic.irq_ack = tegra_gpio_irq_ack;
|
||||
tgi->ic.irq_mask = tegra_gpio_irq_mask;
|
||||
tgi->ic.irq_unmask = tegra_gpio_irq_unmask;
|
||||
tgi->ic.irq_set_type = tegra_gpio_irq_set_type;
|
||||
tgi->ic.irq_shutdown = tegra_gpio_irq_shutdown;
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
tgi->ic.irq_set_wake = tegra_gpio_irq_set_wake;
|
||||
#endif
|
||||
tgi->ic.irq_request_resources = tegra_gpio_irq_request_resources;
|
||||
tgi->ic.irq_release_resources = tegra_gpio_irq_release_resources;
|
||||
|
||||
platform_set_drvdata(pdev, tgi);
|
||||
|
||||
if (tgi->soc->debounce_supported)
|
||||
@ -733,7 +760,6 @@ static int tegra_gpio_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
irq = &tgi->gc.irq;
|
||||
irq->chip = &tgi->ic;
|
||||
irq->fwnode = of_node_to_fwnode(pdev->dev.of_node);
|
||||
irq->child_to_parent_hwirq = tegra_gpio_child_to_parent_hwirq;
|
||||
irq->populate_parent_alloc_arg = tegra_gpio_populate_parent_fwspec;
|
||||
@ -752,7 +778,9 @@ static int tegra_gpio_probe(struct platform_device *pdev)
|
||||
if (!irq->parent_domain)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
tgi->ic.irq_set_affinity = tegra_gpio_irq_set_affinity;
|
||||
gpio_irq_chip_set_chip(irq, &tegra210_gpio_irq_chip);
|
||||
} else {
|
||||
gpio_irq_chip_set_chip(irq, &tegra_gpio_irq_chip);
|
||||
}
|
||||
|
||||
tgi->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user