Skip to content

Commit 2d77fee

Browse files
committed
Merge: pinctrl: Intel drivers updates
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1408 Description: updates for pinctrl: Intel drivers JIRA: https://issues.redhat.com/browse/RHEL-113190 Build Info: 68830360 Tested: Successful platform test results on Intel (intel-pantherlake-h-01) system. The following commits have been excluded from the backport: d9d87d9 treewide: rename GPIO set callbacks back to their original names 20e6227 pinctrl: lynxpoint: use new GPIO line value setter callbacks 241d79f pinctrl: intel: use new GPIO line value setter callbacks 83ab731 pinctrl: cherryview: use new GPIO line value setter callbacks 4863d75 pinctrl: baytrail: use new GPIO line value setter callbacks cdd30eb module: Convert symbol namespace to string literal 1a075b1 pinctrl: Switch back to struct platform_driver::remove() Signed-off-by: Steve Best <sbest@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: Brian Masney <bmasney@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Scott Weaver <scweaver@redhat.com>
2 parents 2a4fc18 + 28b229f commit 2d77fee

File tree

7 files changed

+68
-19
lines changed

7 files changed

+68
-19
lines changed

drivers/pinctrl/intel/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ config PINCTRL_INTEL
3939

4040
config PINCTRL_INTEL_PLATFORM
4141
tristate "Intel pinctrl and GPIO platform driver"
42-
depends on ACPI
4342
select PINCTRL_INTEL
4443
help
4544
This pinctrl driver provides an interface that allows configuring
@@ -141,7 +140,6 @@ config PINCTRL_METEORLAKE
141140

142141
config PINCTRL_METEORPOINT
143142
tristate "Intel Meteor Point pinctrl and GPIO driver"
144-
depends on ACPI
145143
select PINCTRL_INTEL
146144
help
147145
Meteor Point is the PCH of Intel Meteor Lake. This pinctrl driver

drivers/pinctrl/intel/pinctrl-baytrail.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,8 @@ static void byt_gpio_irq_handler(struct irq_desc *desc)
13551355
void __iomem *reg;
13561356
unsigned long pending;
13571357

1358+
chained_irq_enter(chip, desc);
1359+
13581360
/* check from GPIO controller which pin triggered the interrupt */
13591361
for (base = 0; base < vg->chip.ngpio; base += 32) {
13601362
reg = byt_gpio_reg(vg, base, BYT_INT_STAT_REG);
@@ -1369,7 +1371,8 @@ static void byt_gpio_irq_handler(struct irq_desc *desc)
13691371
for_each_set_bit(pin, &pending, 32)
13701372
generic_handle_domain_irq(vg->chip.irq.domain, base + pin);
13711373
}
1372-
chip->irq_eoi(data);
1374+
1375+
chained_irq_exit(chip, desc);
13731376
}
13741377

13751378
static bool byt_direct_irq_sanity_check(struct intel_pinctrl *vg, int pin, u32 conf0)
@@ -1557,16 +1560,14 @@ static int byt_set_soc_data(struct intel_pinctrl *vg,
15571560
vg->soc = soc;
15581561

15591562
vg->ncommunities = vg->soc->ncommunities;
1560-
vg->communities = devm_kcalloc(vg->dev, vg->ncommunities,
1561-
sizeof(*vg->communities), GFP_KERNEL);
1563+
vg->communities = devm_kmemdup_array(vg->dev, vg->soc->communities, vg->ncommunities,
1564+
sizeof(*vg->soc->communities), GFP_KERNEL);
15621565
if (!vg->communities)
15631566
return -ENOMEM;
15641567

15651568
for (i = 0; i < vg->soc->ncommunities; i++) {
15661569
struct intel_community *comm = vg->communities + i;
15671570

1568-
*comm = vg->soc->communities[i];
1569-
15701571
comm->pad_regs = devm_platform_ioremap_resource(pdev, 0);
15711572
if (IS_ERR(comm->pad_regs))
15721573
return PTR_ERR(comm->pad_regs);

drivers/pinctrl/intel/pinctrl-cherryview.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,9 +1631,8 @@ static int chv_pinctrl_probe(struct platform_device *pdev)
16311631
pctrl->soc = soc_data;
16321632

16331633
pctrl->ncommunities = pctrl->soc->ncommunities;
1634-
pctrl->communities = devm_kmemdup(dev, pctrl->soc->communities,
1635-
pctrl->ncommunities * sizeof(*pctrl->communities),
1636-
GFP_KERNEL);
1634+
pctrl->communities = devm_kmemdup_array(dev, pctrl->soc->communities, pctrl->ncommunities,
1635+
sizeof(*pctrl->soc->communities), GFP_KERNEL);
16371636
if (!pctrl->communities)
16381637
return -ENOMEM;
16391638

drivers/pinctrl/intel/pinctrl-elkhartlake.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,43 @@ static const struct intel_pinctrl_soc_data ehl_community1_soc_data = {
264264
.ncommunities = ARRAY_SIZE(ehl_community1),
265265
};
266266

267+
static const struct pinctrl_pin_desc ehl_community2_pins[] = {
268+
/* DSW */
269+
PINCTRL_PIN(0, "BATLOWB"),
270+
PINCTRL_PIN(1, "ACPRESENT"),
271+
PINCTRL_PIN(2, "LAN_WAKEB"),
272+
PINCTRL_PIN(3, "PWRBTNB"),
273+
PINCTRL_PIN(4, "SLP_S3B"),
274+
PINCTRL_PIN(5, "SLP_S4B"),
275+
PINCTRL_PIN(6, "SLP_AB"),
276+
PINCTRL_PIN(7, "GPD_7"),
277+
PINCTRL_PIN(8, "SUSCLK"),
278+
PINCTRL_PIN(9, "SLP_WLANB"),
279+
PINCTRL_PIN(10, "SLP_S5B"),
280+
PINCTRL_PIN(11, "LANPHYPC"),
281+
PINCTRL_PIN(12, "INPUT3VSEL"),
282+
PINCTRL_PIN(13, "SLP_LANB"),
283+
PINCTRL_PIN(14, "SLP_SUSB"),
284+
PINCTRL_PIN(15, "WAKEB"),
285+
PINCTRL_PIN(16, "DRAM_RESETB"),
286+
};
287+
288+
static const struct intel_padgroup ehl_community2_gpps[] = {
289+
EHL_GPP(0, 0, 16), /* DSW */
290+
};
291+
292+
static const struct intel_community ehl_community2[] = {
293+
EHL_COMMUNITY(0, 0, 16, ehl_community2_gpps),
294+
};
295+
296+
static const struct intel_pinctrl_soc_data ehl_community2_soc_data = {
297+
.uid = "2",
298+
.pins = ehl_community2_pins,
299+
.npins = ARRAY_SIZE(ehl_community2_pins),
300+
.communities = ehl_community2,
301+
.ncommunities = ARRAY_SIZE(ehl_community2),
302+
};
303+
267304
static const struct pinctrl_pin_desc ehl_community3_pins[] = {
268305
/* CPU */
269306
PINCTRL_PIN(0, "HDACPU_SDI"),
@@ -474,6 +511,7 @@ static const struct intel_pinctrl_soc_data ehl_community5_soc_data = {
474511
static const struct intel_pinctrl_soc_data *ehl_soc_data_array[] = {
475512
&ehl_community0_soc_data,
476513
&ehl_community1_soc_data,
514+
&ehl_community2_soc_data,
477515
&ehl_community3_soc_data,
478516
&ehl_community4_soc_data,
479517
&ehl_community5_soc_data,

drivers/pinctrl/intel/pinctrl-intel.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <linux/acpi.h>
1111
#include <linux/cleanup.h>
12+
#include <linux/export.h>
1213
#include <linux/gpio/driver.h>
1314
#include <linux/interrupt.h>
1415
#include <linux/log2.h>
@@ -85,6 +86,18 @@
8586
#define PADCFG1_TERM_UP BIT(13)
8687
#define PADCFG1_TERM_SHIFT 10
8788
#define PADCFG1_TERM_MASK GENMASK(12, 10)
89+
/*
90+
* Bit 0 Bit 1 Bit 2 Value, Ohms
91+
*
92+
* 0 0 0 -
93+
* 0 0 1 20000
94+
* 0 1 0 5000
95+
* 0 1 1 ~4000
96+
* 1 0 0 1000 (if supported)
97+
* 1 0 1 ~952 (if supported)
98+
* 1 1 0 ~833 (if supported)
99+
* 1 1 1 ~800 (if supported)
100+
*/
88101
#define PADCFG1_TERM_20K BIT(2)
89102
#define PADCFG1_TERM_5K BIT(1)
90103
#define PADCFG1_TERM_4K (BIT(2) | BIT(1))
@@ -1531,7 +1544,6 @@ static int intel_pinctrl_probe_pwm(struct intel_pinctrl *pctrl,
15311544
.clk_rate = 19200000,
15321545
.npwm = 1,
15331546
.base_unit_bits = 22,
1534-
.bypass = true,
15351547
};
15361548
struct pwm_chip *chip;
15371549

@@ -1565,8 +1577,8 @@ int intel_pinctrl_probe(struct platform_device *pdev,
15651577
* to the registers.
15661578
*/
15671579
pctrl->ncommunities = pctrl->soc->ncommunities;
1568-
pctrl->communities = devm_kcalloc(dev, pctrl->ncommunities,
1569-
sizeof(*pctrl->communities), GFP_KERNEL);
1580+
pctrl->communities = devm_kmemdup_array(dev, pctrl->soc->communities, pctrl->ncommunities,
1581+
sizeof(*pctrl->soc->communities), GFP_KERNEL);
15701582
if (!pctrl->communities)
15711583
return -ENOMEM;
15721584

@@ -1576,8 +1588,6 @@ int intel_pinctrl_probe(struct platform_device *pdev,
15761588
u32 offset;
15771589
u32 value;
15781590

1579-
*community = pctrl->soc->communities[i];
1580-
15811591
regs = devm_platform_ioremap_resource(pdev, community->barno);
15821592
if (IS_ERR(regs))
15831593
return PTR_ERR(regs);
@@ -1929,3 +1939,4 @@ MODULE_AUTHOR("Mathias Nyman <mathias.nyman@linux.intel.com>");
19291939
MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
19301940
MODULE_DESCRIPTION("Intel pinctrl/GPIO core driver");
19311941
MODULE_LICENSE("GPL v2");
1942+
MODULE_IMPORT_NS("PWM_LPSS");

drivers/pinctrl/intel/pinctrl-lynxpoint.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,8 @@ static void lp_gpio_irq_handler(struct irq_desc *desc)
549549
unsigned long pending;
550550
u32 base, pin;
551551

552+
chained_irq_enter(chip, desc);
553+
552554
/* check from GPIO controller which pin triggered the interrupt */
553555
for (base = 0; base < lg->chip.ngpio; base += 32) {
554556
reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT);
@@ -560,7 +562,8 @@ static void lp_gpio_irq_handler(struct irq_desc *desc)
560562
for_each_set_bit(pin, &pending, 32)
561563
generic_handle_domain_irq(lg->chip.irq.domain, base + pin);
562564
}
563-
chip->irq_eoi(data);
565+
566+
chained_irq_exit(chip, desc);
564567
}
565568

566569
static void lp_irq_ack(struct irq_data *d)

drivers/pinctrl/intel/pinctrl-tangier.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ static int tng_pinctrl_probe(struct platform_device *pdev,
524524
struct device *dev = &pdev->dev;
525525
struct tng_family *families;
526526
struct tng_pinctrl *tp;
527-
size_t families_len;
528527
void __iomem *regs;
529528
unsigned int i;
530529

@@ -543,8 +542,8 @@ static int tng_pinctrl_probe(struct platform_device *pdev,
543542
* Make a copy of the families which we can use to hold pointers
544543
* to the registers.
545544
*/
546-
families_len = size_mul(sizeof(*families), tp->nfamilies);
547-
families = devm_kmemdup(dev, tp->families, families_len, GFP_KERNEL);
545+
families = devm_kmemdup_array(dev, tp->families, tp->nfamilies,
546+
sizeof(*tp->families), GFP_KERNEL);
548547
if (!families)
549548
return -ENOMEM;
550549

0 commit comments

Comments
 (0)