Skip to content

Commit 9adf143

Browse files
committed
Merge tag 'pinctrl-v6.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij: - Mark som pins as invalid for IRQ use in the Qualcomm driver - Fix up the use of device properties on the MA35DX Nuvoton, apparently something went sidewise - Clear the GPIO debounce settings when going down for suspend in the AMD driver. Very good for some AMD laptops that now wake up from suspend again! - Add the compulsory .can_sleep bool flag in the AW9523 driver, should have been there from the beginning, now there are users finding the bug - Drop some bouncing email address from MAINTAINERS * tag 'pinctrl-v6.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: aw9523: fix can_sleep flag for GPIO chip pinctrl: amd: Clear GPIO debounce for suspend pinctrl: nuvoton: Fix boot on ma35dx platforms MAINTAINERS: drop bouncing Lakshmi Sowjanya D pinctrl: qcom: msm: mark certain pins as invalid for interrupts
2 parents 7339233 + 5285b5e commit 9adf143

File tree

5 files changed

+41
-5
lines changed

5 files changed

+41
-5
lines changed

MAINTAINERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19603,8 +19603,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git
1960319603
F: drivers/pinctrl/intel/
1960419604

1960519605
PIN CONTROLLER - KEEMBAY
19606-
M: Lakshmi Sowjanya D <[email protected]>
19607-
S: Supported
19606+
S: Orphan
1960819607
F: drivers/pinctrl/pinctrl-keembay*
1960919608

1961019609
PIN CONTROLLER - MEDIATEK

drivers/pinctrl/nuvoton/pinctrl-ma35.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,10 @@ static int ma35_pinctrl_probe_dt(struct platform_device *pdev, struct ma35_pinct
10741074
u32 idx = 0;
10751075
int ret;
10761076

1077-
for_each_gpiochip_node(dev, child) {
1077+
device_for_each_child_node(dev, child) {
1078+
if (fwnode_property_present(child, "gpio-controller"))
1079+
continue;
1080+
10781081
npctl->nfunctions++;
10791082
npctl->ngroups += of_get_child_count(to_of_node(child));
10801083
}
@@ -1092,7 +1095,10 @@ static int ma35_pinctrl_probe_dt(struct platform_device *pdev, struct ma35_pinct
10921095
if (!npctl->groups)
10931096
return -ENOMEM;
10941097

1095-
for_each_gpiochip_node(dev, child) {
1098+
device_for_each_child_node(dev, child) {
1099+
if (fwnode_property_present(child, "gpio-controller"))
1100+
continue;
1101+
10961102
ret = ma35_pinctrl_parse_functions(child, npctl, idx++);
10971103
if (ret) {
10981104
fwnode_handle_put(child);

drivers/pinctrl/pinctrl-amd.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,17 @@ static int amd_gpio_suspend_hibernate_common(struct device *dev, bool is_suspend
979979
pin, is_suspend ? "suspend" : "hibernate");
980980
}
981981

982+
/*
983+
* debounce enabled over suspend has shown issues with a GPIO
984+
* being unable to wake the system, as we're only interested in
985+
* the actual wakeup event, clear it.
986+
*/
987+
if (gpio_dev->saved_regs[i] & (DB_CNTRl_MASK << DB_CNTRL_OFF)) {
988+
amd_gpio_set_debounce(gpio_dev, pin, 0);
989+
pm_pr_dbg("Clearing debounce for GPIO #%d during %s.\n",
990+
pin, is_suspend ? "suspend" : "hibernate");
991+
}
992+
982993
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
983994
}
984995

drivers/pinctrl/pinctrl-aw9523.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ static int aw9523_init_gpiochip(struct aw9523 *awi, unsigned int npins)
784784
gc->set_config = gpiochip_generic_config;
785785
gc->parent = dev;
786786
gc->owner = THIS_MODULE;
787-
gc->can_sleep = false;
787+
gc->can_sleep = true;
788788

789789
return 0;
790790
}

drivers/pinctrl/qcom/pinctrl-msm.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,25 @@ static bool msm_gpio_needs_dual_edge_parent_workaround(struct irq_data *d,
10381038
test_bit(d->hwirq, pctrl->skip_wake_irqs);
10391039
}
10401040

1041+
static void msm_gpio_irq_init_valid_mask(struct gpio_chip *gc,
1042+
unsigned long *valid_mask,
1043+
unsigned int ngpios)
1044+
{
1045+
struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
1046+
const struct msm_pingroup *g;
1047+
int i;
1048+
1049+
bitmap_fill(valid_mask, ngpios);
1050+
1051+
for (i = 0; i < ngpios; i++) {
1052+
g = &pctrl->soc->groups[i];
1053+
1054+
if (g->intr_detection_width != 1 &&
1055+
g->intr_detection_width != 2)
1056+
clear_bit(i, valid_mask);
1057+
}
1058+
}
1059+
10411060
static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type)
10421061
{
10431062
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
@@ -1441,6 +1460,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
14411460
girq->default_type = IRQ_TYPE_NONE;
14421461
girq->handler = handle_bad_irq;
14431462
girq->parents[0] = pctrl->irq;
1463+
girq->init_valid_mask = msm_gpio_irq_init_valid_mask;
14441464

14451465
ret = devm_gpiochip_add_data(pctrl->dev, &pctrl->chip, pctrl);
14461466
if (ret) {

0 commit comments

Comments
 (0)