Skip to content

Commit 6676ba2

Browse files
committed
Merge tag 'pinctrl-v5-17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij: - Fix some drive strength and pull-up code in the K210 driver. - Add the Alder Lake-M ACPI ID so it starts to work properly. - Use a static name for the StarFive GPIO irq_chip, forestalling an upcoming fixes series from Marc Zyngier. - Fix an ages old bug in the Tegra 186 driver where we were indexing at random into struct and being lucky getting the right member. * tag 'pinctrl-v5-17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: gpio: tegra186: Fix chip_data type confusion pinctrl: starfive: Use a static name for the GPIO irq_chip pinctrl: tigerlake: Revert "Add Alder Lake-M ACPI ID" pinctrl: k210: Fix bias-pull-up pinctrl: fix loop in k210_pinconf_get_drive()
2 parents 2293be5 + 486c2d1 commit 6676ba2

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

drivers/gpio/gpio-tegra186.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,12 @@ static int tegra186_gpio_of_xlate(struct gpio_chip *chip,
343343
return offset + pin;
344344
}
345345

346+
#define to_tegra_gpio(x) container_of((x), struct tegra_gpio, gpio)
347+
346348
static void tegra186_irq_ack(struct irq_data *data)
347349
{
348-
struct tegra_gpio *gpio = irq_data_get_irq_chip_data(data);
350+
struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
351+
struct tegra_gpio *gpio = to_tegra_gpio(gc);
349352
void __iomem *base;
350353

351354
base = tegra186_gpio_get_base(gpio, data->hwirq);
@@ -357,7 +360,8 @@ static void tegra186_irq_ack(struct irq_data *data)
357360

358361
static void tegra186_irq_mask(struct irq_data *data)
359362
{
360-
struct tegra_gpio *gpio = irq_data_get_irq_chip_data(data);
363+
struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
364+
struct tegra_gpio *gpio = to_tegra_gpio(gc);
361365
void __iomem *base;
362366
u32 value;
363367

@@ -372,7 +376,8 @@ static void tegra186_irq_mask(struct irq_data *data)
372376

373377
static void tegra186_irq_unmask(struct irq_data *data)
374378
{
375-
struct tegra_gpio *gpio = irq_data_get_irq_chip_data(data);
379+
struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
380+
struct tegra_gpio *gpio = to_tegra_gpio(gc);
376381
void __iomem *base;
377382
u32 value;
378383

@@ -387,7 +392,8 @@ static void tegra186_irq_unmask(struct irq_data *data)
387392

388393
static int tegra186_irq_set_type(struct irq_data *data, unsigned int type)
389394
{
390-
struct tegra_gpio *gpio = irq_data_get_irq_chip_data(data);
395+
struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
396+
struct tegra_gpio *gpio = to_tegra_gpio(gc);
391397
void __iomem *base;
392398
u32 value;
393399

drivers/pinctrl/intel/pinctrl-tigerlake.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,6 @@ static const struct acpi_device_id tgl_pinctrl_acpi_match[] = {
749749
{ "INT34C5", (kernel_ulong_t)&tgllp_soc_data },
750750
{ "INT34C6", (kernel_ulong_t)&tglh_soc_data },
751751
{ "INTC1055", (kernel_ulong_t)&tgllp_soc_data },
752-
{ "INTC1057", (kernel_ulong_t)&tgllp_soc_data },
753752
{ }
754753
};
755754
MODULE_DEVICE_TABLE(acpi, tgl_pinctrl_acpi_match);

drivers/pinctrl/pinctrl-k210.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ static int k210_pinconf_get_drive(unsigned int max_strength_ua)
482482
{
483483
int i;
484484

485-
for (i = K210_PC_DRIVE_MAX; i; i--) {
485+
for (i = K210_PC_DRIVE_MAX; i >= 0; i--) {
486486
if (k210_pinconf_drive_strength[i] <= max_strength_ua)
487487
return i;
488488
}
@@ -527,7 +527,7 @@ static int k210_pinconf_set_param(struct pinctrl_dev *pctldev,
527527
case PIN_CONFIG_BIAS_PULL_UP:
528528
if (!arg)
529529
return -EINVAL;
530-
val |= K210_PC_PD;
530+
val |= K210_PC_PU;
531531
break;
532532
case PIN_CONFIG_DRIVE_STRENGTH:
533533
arg *= 1000;

drivers/pinctrl/pinctrl-starfive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,7 @@ static int starfive_irq_set_type(struct irq_data *d, unsigned int trigger)
11641164
}
11651165

11661166
static struct irq_chip starfive_irq_chip = {
1167+
.name = "StarFive GPIO",
11671168
.irq_ack = starfive_irq_ack,
11681169
.irq_mask = starfive_irq_mask,
11691170
.irq_mask_ack = starfive_irq_mask_ack,
@@ -1308,7 +1309,6 @@ static int starfive_probe(struct platform_device *pdev)
13081309
sfp->gc.ngpio = NR_GPIOS;
13091310

13101311
starfive_irq_chip.parent_device = dev;
1311-
starfive_irq_chip.name = sfp->gc.label;
13121312

13131313
sfp->gc.irq.chip = &starfive_irq_chip;
13141314
sfp->gc.irq.parent_handler = starfive_gpio_irq_handler;

0 commit comments

Comments
 (0)