Skip to content

Commit d581fa2

Browse files
author
Herton R. Krzesinski
committed
Merge: Backport QDrive 3 subsystem into CS9: pinctrl (6.2-rc5)
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/1962 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2164821 Backport QDrive 3 subsystem into CS9: pinctrl (6.2-rc5) Signed-off-by: Alessandro Carminati <acarmina@redhat.com> Approved-by: Brian Masney <bmasney@redhat.com> Approved-by: Mark Langsdorf <mlangsdo@redhat.com> Approved-by: Eric Chanudet <echanude@redhat.com> Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2 parents 8a04ea6 + 4c33d1a commit d581fa2

28 files changed

+4622
-193
lines changed

arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -841,17 +841,17 @@ hp_i2c: &i2c9 {
841841
};
842842

843843
&spi0 {
844-
pinctrl-0 = <&qup_spi0_cs_gpio_init_high>, <&qup_spi0_cs_gpio>;
844+
pinctrl-0 = <&qup_spi0_cs_gpio>;
845845
cs-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
846846
};
847847

848848
&spi6 {
849-
pinctrl-0 = <&qup_spi6_cs_gpio_init_high>, <&qup_spi6_cs_gpio>;
849+
pinctrl-0 = <&qup_spi6_cs_gpio>;
850850
cs-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;
851851
};
852852

853853
ap_spi_fp: &spi10 {
854-
pinctrl-0 = <&qup_spi10_cs_gpio_init_high>, <&qup_spi10_cs_gpio>;
854+
pinctrl-0 = <&qup_spi10_cs_gpio>;
855855
cs-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
856856

857857
cros_ec_fp: ec@0 {
@@ -1379,27 +1379,6 @@ ap_spi_fp: &spi10 {
13791379
};
13801380
};
13811381

1382-
qup_spi0_cs_gpio_init_high: qup-spi0-cs-gpio-init-high {
1383-
pinconf {
1384-
pins = "gpio37";
1385-
output-high;
1386-
};
1387-
};
1388-
1389-
qup_spi6_cs_gpio_init_high: qup-spi6-cs-gpio-init-high {
1390-
pinconf {
1391-
pins = "gpio62";
1392-
output-high;
1393-
};
1394-
};
1395-
1396-
qup_spi10_cs_gpio_init_high: qup-spi10-cs-gpio-init-high {
1397-
pinconf {
1398-
pins = "gpio89";
1399-
output-high;
1400-
};
1401-
};
1402-
14031382
qup_uart3_sleep: qup-uart3-sleep {
14041383
pinmux {
14051384
pins = "gpio38", "gpio39",

drivers/gpio/gpio-msc313.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -293,23 +293,20 @@ static struct irq_chip msc313_gpio_irqchip = {
293293
* so we need to provide the fwspec. Essentially gpiochip_populate_parent_fwspec_twocell
294294
* that puts GIC_SPI into the first cell.
295295
*/
296-
static void *msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc,
297-
unsigned int parent_hwirq,
298-
unsigned int parent_type)
296+
static int msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc,
297+
union gpio_irq_fwspec *gfwspec,
298+
unsigned int parent_hwirq,
299+
unsigned int parent_type)
299300
{
300-
struct irq_fwspec *fwspec;
301-
302-
fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
303-
if (!fwspec)
304-
return NULL;
301+
struct irq_fwspec *fwspec = &gfwspec->fwspec;
305302

306303
fwspec->fwnode = gc->irq.parent_domain->fwnode;
307304
fwspec->param_count = 3;
308305
fwspec->param[0] = GIC_SPI;
309306
fwspec->param[1] = parent_hwirq;
310307
fwspec->param[2] = parent_type;
311308

312-
return fwspec;
309+
return 0;
313310
}
314311

315312
static int msc313e_gpio_child_to_parent_hwirq(struct gpio_chip *chip,

drivers/gpio/gpio-tegra.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -443,23 +443,20 @@ static int tegra_gpio_child_to_parent_hwirq(struct gpio_chip *chip,
443443
return 0;
444444
}
445445

446-
static void *tegra_gpio_populate_parent_fwspec(struct gpio_chip *chip,
447-
unsigned int parent_hwirq,
448-
unsigned int parent_type)
446+
static int tegra_gpio_populate_parent_fwspec(struct gpio_chip *chip,
447+
union gpio_irq_fwspec *gfwspec,
448+
unsigned int parent_hwirq,
449+
unsigned int parent_type)
449450
{
450-
struct irq_fwspec *fwspec;
451-
452-
fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
453-
if (!fwspec)
454-
return NULL;
451+
struct irq_fwspec *fwspec = &gfwspec->fwspec;
455452

456453
fwspec->fwnode = chip->irq.parent_domain->fwnode;
457454
fwspec->param_count = 3;
458455
fwspec->param[0] = 0;
459456
fwspec->param[1] = parent_hwirq;
460457
fwspec->param[2] = parent_type;
461458

462-
return fwspec;
459+
return 0;
463460
}
464461

465462
#ifdef CONFIG_PM_SLEEP

drivers/gpio/gpio-tegra186.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -621,24 +621,21 @@ static int tegra186_gpio_irq_domain_translate(struct irq_domain *domain,
621621
return 0;
622622
}
623623

624-
static void *tegra186_gpio_populate_parent_fwspec(struct gpio_chip *chip,
625-
unsigned int parent_hwirq,
626-
unsigned int parent_type)
624+
static int tegra186_gpio_populate_parent_fwspec(struct gpio_chip *chip,
625+
union gpio_irq_fwspec *gfwspec,
626+
unsigned int parent_hwirq,
627+
unsigned int parent_type)
627628
{
628629
struct tegra_gpio *gpio = gpiochip_get_data(chip);
629-
struct irq_fwspec *fwspec;
630-
631-
fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
632-
if (!fwspec)
633-
return NULL;
630+
struct irq_fwspec *fwspec = &gfwspec->fwspec;
634631

635632
fwspec->fwnode = chip->irq.parent_domain->fwnode;
636633
fwspec->param_count = 3;
637634
fwspec->param[0] = gpio->soc->instance;
638635
fwspec->param[1] = parent_hwirq;
639636
fwspec->param[2] = parent_type;
640637

641-
return fwspec;
638+
return 0;
642639
}
643640

644641
static int tegra186_gpio_child_to_parent_hwirq(struct gpio_chip *chip,

drivers/gpio/gpio-thunderx.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#include <linux/module.h>
1616
#include <linux/pci.h>
1717
#include <linux/spinlock.h>
18-
#include <asm-generic/msi.h>
19-
2018

2119
#define GPIO_RX_DAT 0x0
2220
#define GPIO_TX_SET 0x8
@@ -408,18 +406,15 @@ static int thunderx_gpio_child_to_parent_hwirq(struct gpio_chip *gc,
408406
return 0;
409407
}
410408

411-
static void *thunderx_gpio_populate_parent_alloc_info(struct gpio_chip *chip,
412-
unsigned int parent_hwirq,
413-
unsigned int parent_type)
409+
static int thunderx_gpio_populate_parent_alloc_info(struct gpio_chip *chip,
410+
union gpio_irq_fwspec *gfwspec,
411+
unsigned int parent_hwirq,
412+
unsigned int parent_type)
414413
{
415-
msi_alloc_info_t *info;
416-
417-
info = kmalloc(sizeof(*info), GFP_KERNEL);
418-
if (!info)
419-
return NULL;
414+
msi_alloc_info_t *info = &gfwspec->msiinfo;
420415

421416
info->hwirq = parent_hwirq;
422-
return info;
417+
return 0;
423418
}
424419

425420
static int thunderx_gpio_probe(struct pci_dev *pdev,

drivers/gpio/gpio-visconti.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,20 @@ static int visconti_gpio_child_to_parent_hwirq(struct gpio_chip *gc,
103103
return -EINVAL;
104104
}
105105

106-
static void *visconti_gpio_populate_parent_fwspec(struct gpio_chip *chip,
107-
unsigned int parent_hwirq,
108-
unsigned int parent_type)
106+
static int visconti_gpio_populate_parent_fwspec(struct gpio_chip *chip,
107+
union gpio_irq_fwspec *gfwspec,
108+
unsigned int parent_hwirq,
109+
unsigned int parent_type)
109110
{
110-
struct irq_fwspec *fwspec;
111-
112-
fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
113-
if (!fwspec)
114-
return NULL;
111+
struct irq_fwspec *fwspec = &gfwspec->fwspec;
115112

116113
fwspec->fwnode = chip->irq.parent_domain->fwnode;
117114
fwspec->param_count = 3;
118115
fwspec->param[0] = 0;
119116
fwspec->param[1] = parent_hwirq;
120117
fwspec->param[2] = parent_type;
121118

122-
return fwspec;
119+
return 0;
123120
}
124121

125122
static int visconti_gpio_probe(struct platform_device *pdev)

drivers/gpio/gpiolib.c

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ static int gpiochip_hierarchy_irq_domain_alloc(struct irq_domain *d,
11071107
irq_hw_number_t hwirq;
11081108
unsigned int type = IRQ_TYPE_NONE;
11091109
struct irq_fwspec *fwspec = data;
1110-
void *parent_arg;
1110+
union gpio_irq_fwspec gpio_parent_fwspec = {};
11111111
unsigned int parent_hwirq;
11121112
unsigned int parent_type;
11131113
struct gpio_irq_chip *girq = &gc->irq;
@@ -1147,14 +1147,15 @@ static int gpiochip_hierarchy_irq_domain_alloc(struct irq_domain *d,
11471147
irq_set_probe(irq);
11481148

11491149
/* This parent only handles asserted level IRQs */
1150-
parent_arg = girq->populate_parent_alloc_arg(gc, parent_hwirq, parent_type);
1151-
if (!parent_arg)
1152-
return -ENOMEM;
1150+
ret = girq->populate_parent_alloc_arg(gc, &gpio_parent_fwspec,
1151+
parent_hwirq, parent_type);
1152+
if (ret)
1153+
return ret;
11531154

11541155
chip_dbg(gc, "alloc_irqs_parent for %d parent hwirq %d\n",
11551156
irq, parent_hwirq);
11561157
irq_set_lockdep_class(irq, gc->irq.lock_key, gc->irq.request_key);
1157-
ret = irq_domain_alloc_irqs_parent(d, irq, 1, parent_arg);
1158+
ret = irq_domain_alloc_irqs_parent(d, irq, 1, &gpio_parent_fwspec);
11581159
/*
11591160
* If the parent irqdomain is msi, the interrupts have already
11601161
* been allocated, so the EEXIST is good.
@@ -1166,7 +1167,6 @@ static int gpiochip_hierarchy_irq_domain_alloc(struct irq_domain *d,
11661167
"failed to allocate parent hwirq %d for hwirq %lu\n",
11671168
parent_hwirq, hwirq);
11681169

1169-
kfree(parent_arg);
11701170
return ret;
11711171
}
11721172

@@ -1230,34 +1230,28 @@ static bool gpiochip_hierarchy_is_hierarchical(struct gpio_chip *gc)
12301230
return !!gc->irq.parent_domain;
12311231
}
12321232

1233-
void *gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *gc,
1234-
unsigned int parent_hwirq,
1235-
unsigned int parent_type)
1233+
int gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *gc,
1234+
union gpio_irq_fwspec *gfwspec,
1235+
unsigned int parent_hwirq,
1236+
unsigned int parent_type)
12361237
{
1237-
struct irq_fwspec *fwspec;
1238-
1239-
fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
1240-
if (!fwspec)
1241-
return NULL;
1238+
struct irq_fwspec *fwspec = &gfwspec->fwspec;
12421239

12431240
fwspec->fwnode = gc->irq.parent_domain->fwnode;
12441241
fwspec->param_count = 2;
12451242
fwspec->param[0] = parent_hwirq;
12461243
fwspec->param[1] = parent_type;
12471244

1248-
return fwspec;
1245+
return 0;
12491246
}
12501247
EXPORT_SYMBOL_GPL(gpiochip_populate_parent_fwspec_twocell);
12511248

1252-
void *gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *gc,
1253-
unsigned int parent_hwirq,
1254-
unsigned int parent_type)
1249+
int gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *gc,
1250+
union gpio_irq_fwspec *gfwspec,
1251+
unsigned int parent_hwirq,
1252+
unsigned int parent_type)
12551253
{
1256-
struct irq_fwspec *fwspec;
1257-
1258-
fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
1259-
if (!fwspec)
1260-
return NULL;
1254+
struct irq_fwspec *fwspec = &gfwspec->fwspec;
12611255

12621256
fwspec->fwnode = gc->irq.parent_domain->fwnode;
12631257
fwspec->param_count = 4;
@@ -1266,7 +1260,7 @@ void *gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *gc,
12661260
fwspec->param[2] = 0;
12671261
fwspec->param[3] = parent_type;
12681262

1269-
return fwspec;
1263+
return 0;
12701264
}
12711265
EXPORT_SYMBOL_GPL(gpiochip_populate_parent_fwspec_fourcell);
12721266

0 commit comments

Comments
 (0)