* Re: [PATCH RFC 03/14] drivers: irqchip: add PDC irqdomain for wakeup capable GPIOs
From: Lina Iyer @ 2019-08-30 15:58 UTC (permalink / raw)
To: Marc Zyngier
Cc: swboyd, evgreen, linus.walleij, linux-kernel, linux-arm-msm,
bjorn.andersson, mkshah, linux-gpio, rnayak
In-Reply-To: <d2a45d45-3071-ab8d-060b-92a2812a8d42@kernel.org>
On Fri, Aug 30 2019 at 08:50 -0600, Marc Zyngier wrote:
>[Please use my kernel.org address in the future. The days of this
>arm.com address are numbered...]
>
Sure, will update and repost.
>On 29/08/2019 19:11, Lina Iyer wrote:
>> Introduce a new domain for wakeup capable GPIOs. The domain can be
>> requested using the bus token DOMAIN_BUS_WAKEUP. In the following
>> patches, we will specify PDC as the wakeup-parent for the TLMM GPIO
>> irqchip. Requesting a wakeup GPIO will setup the GPIO and the
>> corresponding PDC interrupt as its parent.
>>
>> Co-developed-by: Stephen Boyd <swboyd@chromium.org>
>> Signed-off-by: Lina Iyer <ilina@codeaurora.org>
>> ---
>> drivers/irqchip/qcom-pdc.c | 104 ++++++++++++++++++++++++++++++++---
>> include/linux/soc/qcom/irq.h | 34 ++++++++++++
>> 2 files changed, 129 insertions(+), 9 deletions(-)
>> create mode 100644 include/linux/soc/qcom/irq.h
>>
>> diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c
>> index 338fae604af5..ad1faf634bcf 100644
>> --- a/drivers/irqchip/qcom-pdc.c
>> +++ b/drivers/irqchip/qcom-pdc.c
>> @@ -13,12 +13,13 @@
>> #include <linux/of.h>
>> #include <linux/of_address.h>
>> #include <linux/of_device.h>
>> +#include <linux/soc/qcom/irq.h>
>> #include <linux/spinlock.h>
>> -#include <linux/platform_device.h>
>> #include <linux/slab.h>
>> #include <linux/types.h>
>>
>> #define PDC_MAX_IRQS 126
>> +#define PDC_MAX_GPIO_IRQS 256
>>
>> #define CLEAR_INTR(reg, intr) (reg & ~(1 << intr))
>> #define ENABLE_INTR(reg, intr) (reg | (1 << intr))
>> @@ -26,6 +27,8 @@
>> #define IRQ_ENABLE_BANK 0x10
>> #define IRQ_i_CFG 0x110
>>
>> +#define PDC_NO_PARENT_IRQ ~0UL
>> +
>> struct pdc_pin_region {
>> u32 pin_base;
>> u32 parent_base;
>> @@ -65,23 +68,35 @@ static void pdc_enable_intr(struct irq_data *d, bool on)
>>
>> static void qcom_pdc_gic_disable(struct irq_data *d)
>> {
>> + if (d->hwirq == GPIO_NO_WAKE_IRQ)
>> + return;
>> +
>> pdc_enable_intr(d, false);
>> irq_chip_disable_parent(d);
>> }
>>
>> static void qcom_pdc_gic_enable(struct irq_data *d)
>> {
>> + if (d->hwirq == GPIO_NO_WAKE_IRQ)
>> + return;
>> +
>> pdc_enable_intr(d, true);
>> irq_chip_enable_parent(d);
>> }
>>
>> static void qcom_pdc_gic_mask(struct irq_data *d)
>> {
>> + if (d->hwirq == GPIO_NO_WAKE_IRQ)
>> + return;
>> +
>> irq_chip_mask_parent(d);
>> }
>>
>> static void qcom_pdc_gic_unmask(struct irq_data *d)
>> {
>> + if (d->hwirq == GPIO_NO_WAKE_IRQ)
>> + return;
>> +
>> irq_chip_unmask_parent(d);
>> }
>>
>> @@ -124,6 +139,9 @@ static int qcom_pdc_gic_set_type(struct irq_data *d, unsigned int type)
>> int pin_out = d->hwirq;
>> enum pdc_irq_config_bits pdc_type;
>>
>> + if (pin_out == GPIO_NO_WAKE_IRQ)
>> + return 0;
>> +
>> switch (type) {
>> case IRQ_TYPE_EDGE_RISING:
>> pdc_type = PDC_EDGE_RISING;
>> @@ -181,8 +199,7 @@ static irq_hw_number_t get_parent_hwirq(int pin)
>> return (region->parent_base + pin - region->pin_base);
>> }
>>
>> - WARN_ON(1);
>> - return ~0UL;
>> + return PDC_NO_PARENT_IRQ;
>> }
>>
>> static int qcom_pdc_translate(struct irq_domain *d, struct irq_fwspec *fwspec,
>> @@ -211,17 +228,17 @@ static int qcom_pdc_alloc(struct irq_domain *domain, unsigned int virq,
>>
>> ret = qcom_pdc_translate(domain, fwspec, &hwirq, &type);
>> if (ret)
>> - return -EINVAL;
>> -
>> - parent_hwirq = get_parent_hwirq(hwirq);
>> - if (parent_hwirq == ~0UL)
>> - return -EINVAL;
>> + return ret;
>>
>> ret = irq_domain_set_hwirq_and_chip(domain, virq, hwirq,
>> &qcom_pdc_gic_chip, NULL);
>> if (ret)
>> return ret;
>>
>> + parent_hwirq = get_parent_hwirq(hwirq);
>> + if (parent_hwirq == PDC_NO_PARENT_IRQ)
>> + return 0;
>> +
>> if (type & IRQ_TYPE_EDGE_BOTH)
>> type = IRQ_TYPE_EDGE_RISING;
>>
>> @@ -244,6 +261,60 @@ static const struct irq_domain_ops qcom_pdc_ops = {
>> .free = irq_domain_free_irqs_common,
>> };
>>
>> +static int qcom_pdc_gpio_alloc(struct irq_domain *domain, unsigned int virq,
>> + unsigned int nr_irqs, void *data)
>> +{
>> + struct irq_fwspec *fwspec = data;
>> + struct irq_fwspec parent_fwspec;
>> + irq_hw_number_t hwirq, parent_hwirq;
>> + unsigned int type;
>> + int ret;
>> +
>> + ret = qcom_pdc_translate(domain, fwspec, &hwirq, &type);
>> + if (ret)
>> + return ret;
>> +
>> + ret = irq_domain_set_hwirq_and_chip(domain, virq, hwirq,
>> + &qcom_pdc_gic_chip, NULL);
>> + if (ret)
>> + return ret;
>> +
>> + if (hwirq == GPIO_NO_WAKE_IRQ)
>> + return 0;
>> +
>> + parent_hwirq = get_parent_hwirq(hwirq);
>> + if (parent_hwirq == PDC_NO_PARENT_IRQ)
>> + return 0;
>> +
>> + if (type & IRQ_TYPE_EDGE_BOTH)
>> + type = IRQ_TYPE_EDGE_RISING;
>> +
>> + if (type & IRQ_TYPE_LEVEL_MASK)
>> + type = IRQ_TYPE_LEVEL_HIGH;
>> +
>> + parent_fwspec.fwnode = domain->parent->fwnode;
>> + parent_fwspec.param_count = 3;
>> + parent_fwspec.param[0] = 0;
>> + parent_fwspec.param[1] = parent_hwirq;
>> + parent_fwspec.param[2] = type;
>> +
>> + return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs,
>> + &parent_fwspec);
>> +}
>> +
>> +static int qcom_pdc_gpio_domain_select(struct irq_domain *d,
>> + struct irq_fwspec *fwspec,
>> + enum irq_domain_bus_token bus_token)
>> +{
>> + return (bus_token == DOMAIN_BUS_WAKEUP);
>> +}
>> +
>> +static const struct irq_domain_ops qcom_pdc_gpio_ops = {
>> + .select = qcom_pdc_gpio_domain_select,
>> + .alloc = qcom_pdc_gpio_alloc,
>> + .free = irq_domain_free_irqs_common,
>> +};
>> +
>> static int pdc_setup_pin_mapping(struct device_node *np)
>> {
>> int ret, n;
>> @@ -282,7 +353,7 @@ static int pdc_setup_pin_mapping(struct device_node *np)
>>
>> static int qcom_pdc_init(struct device_node *node, struct device_node *parent)
>> {
>> - struct irq_domain *parent_domain, *pdc_domain;
>> + struct irq_domain *parent_domain, *pdc_domain, *pdc_gpio_domain;
>> int ret;
>>
>> pdc_base = of_iomap(node, 0);
>> @@ -313,8 +384,23 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent)
>> goto fail;
>> }
>>
>> + pdc_gpio_domain = irq_domain_create_hierarchy(parent_domain,
>> + IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP,
>> + PDC_MAX_GPIO_IRQS,
>> + of_fwnode_handle(node),
>> + &qcom_pdc_gpio_ops, NULL);
>> + if (!pdc_gpio_domain) {
>> + pr_err("%pOF: GIC domain add failed for GPIO domain\n", node);
>> + ret = -ENOMEM;
>> + goto remove;
>> + }
>> +
>> + irq_domain_update_bus_token(pdc_gpio_domain, DOMAIN_BUS_WAKEUP);
>> +
>> return 0;
>>
>> +remove:
>> + irq_domain_remove(pdc_domain);
>> fail:
>> kfree(pdc_region);
>> iounmap(pdc_base);
>> diff --git a/include/linux/soc/qcom/irq.h b/include/linux/soc/qcom/irq.h
>> new file mode 100644
>> index 000000000000..73239917dc38
>> --- /dev/null
>> +++ b/include/linux/soc/qcom/irq.h
>> @@ -0,0 +1,34 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only */
>> +
>> +#ifndef __QCOM_IRQ_H
>> +#define __QCOM_IRQ_H
>> +
>> +#include <linux/irqdomain.h>
>> +
>> +#define GPIO_NO_WAKE_IRQ ~0U
>> +
>> +/**
>> + * QCOM specific IRQ domain flags that distinguishes the handling of wakeup
>> + * capable interrupts by different interrupt controllers.
>> + *
>> + * IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP: Line must be masked at TLMM and the
>> + * interrupt configuration is done at PDC
>> + * IRQ_DOMAIN_FLAG_QCOM_MPM_WAKEUP: Interrupt configuration is handled at TLMM
>> + */
>> +#define IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP (1 << 17)
>> +#define IRQ_DOMAIN_FLAG_QCOM_MPM_WAKEUP (1 << 18)
>
>Any reason why you're starting at bit 17? The available range in from
>bit 16... But overall, it would be better if you expressed it as:
>
>#define IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP (IRQ_DOMAIN_FLAG_NONCORE << 0)
>#define IRQ_DOMAIN_FLAG_QCOM_MPM_WAKEUP (IRQ_DOMAIN_FLAG_NONCORE << 1)
>
Okay.
>> +
>> +/**
>> + * irq_domain_qcom_handle_wakeup: Return if the domain handles interrupt
>> + * configuration
>> + * @parent: irq domain
>> + *
>> + * This QCOM specific irq domain call returns if the interrupt controller
>> + * requires the interrupt be masked at the child interrupt controller.
>> + */
>> +static inline bool irq_domain_qcom_handle_wakeup(struct irq_domain *parent)
>> +{
>> + return (parent->flags & IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP);
>> +}
>> +
>> +#endif
>>
>
>But most of this file isn't used by this patch, so maybe it should be
>moved somewhere else...
>
Apart from creating the domain, this is not used here, but a separate
patch seemed excessive. Let me know if you have any suggestions.
Thanks,
Lina
^ permalink raw reply
* Re: [PATCH 0/9] drivers: add new variants of devm_platform_ioremap_resource()
From: Christoph Hellwig @ 2019-08-30 15:59 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Bartosz Golaszewski, Jonathan Corbet, Greg Kroah-Hartman,
Rafael J . Wysocki, Alban Bedel, Linus Walleij, Arnd Bergmann,
Geert Uytterhoeven, open list:DOCUMENTATION,
Linux Kernel Mailing List, open list:GPIO SUBSYSTEM, Julia Lawall,
Bartosz Golaszewski, Christoph Hellwig
In-Reply-To: <CAMuHMdW8d1h-81jy-dgDiLfGB3MGPx+f-Zqz+4D5S+gtmk3-BQ@mail.gmail.com>
On Thu, Aug 29, 2019 at 04:48:36PM +0200, Geert Uytterhoeven wrote:
> Hi Bartosz,
>
> On Thu, Aug 29, 2019 at 4:38 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> >
> > The new devm_platform_ioremap_resource() helper has now been widely
> > adopted and used in many drivers. Users of nocache and write-combined
> > ioremap() variants could profit from the same code shrinkage. This
> > series provides two new versions of devm_platform_ioremap_resource()
> > and uses it in a few example drivers with the assumption that - just
> > like was the case previously - a coccinelle script will be developed
> > to ease the transition for others.
>
> Please be aware that the number of ioremap() variants is being
> reduced, as some of them are redundant (e.g. ioremap() already creates
> an uncached mapping, so ioremap_nocache() is not needed).
> So less is better than more ;-)
Yes. If I can get the ia64 and openrisc patch in I plan to send Linus
a scripted removal of ioremap_nocache after -rc1. I already have a
local patch for current mainline as of about two weeks ago.
^ permalink raw reply
* linusw/for-next build: 6 builds: 0 failed, 6 passed, 30 warnings (v5.3-rc6-51-g1fc4f3c962b7)
From: kernelci.org bot @ 2019-08-30 16:20 UTC (permalink / raw)
To: linux-gpio, fellows
linusw/for-next build: 6 builds: 0 failed, 6 passed, 30 warnings (v5.3-rc6-51-g1fc4f3c962b7)
Full Build Summary: https://kernelci.org/build/linusw/branch/for-next/kernel/v5.3-rc6-51-g1fc4f3c962b7/
Tree: linusw
Branch: for-next
Git Describe: v5.3-rc6-51-g1fc4f3c962b7
Git Commit: 1fc4f3c962b7ecbb43ecc49f0ff6da1add83dc6c
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Built: 6 unique architectures
Warnings Detected:
arc:
nsim_hs_defconfig (gcc-8): 5 warnings
arm64:
defconfig (gcc-8): 3 warnings
arm:
multi_v7_defconfig (gcc-8): 19 warnings
mips:
32r2el_defconfig (gcc-8): 3 warnings
riscv:
x86_64:
Warnings summary:
5 <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
2 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:800:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
2 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:795:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
2 drivers/pinctrl/pinctrl-rockchip.c:2783:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 include/linux/compiler.h:328:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/video/fbdev/sh_mobile_lcdcfb.c:2086:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/video/fbdev/sh_mobile_lcdcfb.c:1596:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:459:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:440:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:424:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:370:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:352:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:332:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/mmc/host/sdhci-s3c.c:613:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/mmc/host/atmel-mci.c:2426:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/mmc/host/atmel-mci.c:2422:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/mmc/host/atmel-mci.c:2415:30: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/gpu/drm/sti/sti_hdmi.c:855:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/gpu/drm/sti/sti_hdmi.c:853:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/gpu/drm/sti/sti_hdmi.c:851:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 arch/arc/kernel/unwind.c:836:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 arch/arc/kernel/unwind.c:827:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
================================================================================
Detailed per-defconfig build reports:
--------------------------------------------------------------------------------
32r2el_defconfig (mips, gcc-8) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
defconfig (riscv, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
defconfig (arm64, gcc-8) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:795:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:800:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/pinctrl-rockchip.c:2783:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
--------------------------------------------------------------------------------
multi_v7_defconfig (arm, gcc-8) — PASS, 0 errors, 19 warnings, 0 section mismatches
Warnings:
drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mmc/host/sdhci-s3c.c:613:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mmc/host/atmel-mci.c:2415:30: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mmc/host/atmel-mci.c:2422:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mmc/host/atmel-mci.c:2426:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:795:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:800:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/pinctrl-rockchip.c:2783:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/video/fbdev/sh_mobile_lcdcfb.c:2086:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/video/fbdev/sh_mobile_lcdcfb.c:1596:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:424:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:440:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:459:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:332:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:352:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:370:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/gpu/drm/sti/sti_hdmi.c:851:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/gpu/drm/sti/sti_hdmi.c:853:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/gpu/drm/sti/sti_hdmi.c:855:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
--------------------------------------------------------------------------------
nsim_hs_defconfig (arc, gcc-8) — PASS, 0 errors, 5 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
include/linux/compiler.h:328:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
arch/arc/kernel/unwind.c:827:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
arch/arc/kernel/unwind.c:836:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
x86_64_defconfig (x86_64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches
---
For more info write to <info@kernelci.org>
^ permalink raw reply
* linusw/fixes build: 6 builds: 0 failed, 6 passed, 30 warnings (v5.3-rc6-3-g89f2c0425cb5)
From: kernelci.org bot @ 2019-08-30 16:30 UTC (permalink / raw)
To: linux-gpio, fellows
linusw/fixes build: 6 builds: 0 failed, 6 passed, 30 warnings (v5.3-rc6-3-g89f2c0425cb5)
Full Build Summary: https://kernelci.org/build/linusw/branch/fixes/kernel/v5.3-rc6-3-g89f2c0425cb5/
Tree: linusw
Branch: fixes
Git Describe: v5.3-rc6-3-g89f2c0425cb5
Git Commit: 89f2c0425cb51e38d6b39795c08d55421bec680c
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Built: 6 unique architectures
Warnings Detected:
arc:
nsim_hs_defconfig (gcc-8): 5 warnings
arm64:
defconfig (gcc-8): 3 warnings
arm:
multi_v7_defconfig (gcc-8): 19 warnings
mips:
32r2el_defconfig (gcc-8): 3 warnings
riscv:
x86_64:
Warnings summary:
5 <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
2 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:820:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
2 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:815:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
2 drivers/pinctrl/pinctrl-rockchip.c:2783:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 include/linux/compiler.h:328:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/video/fbdev/sh_mobile_lcdcfb.c:2086:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/video/fbdev/sh_mobile_lcdcfb.c:1596:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:459:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:440:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:424:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:370:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:352:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/usb/phy/phy-ab8500-usb.c:332:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/mmc/host/sdhci-s3c.c:613:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/mmc/host/atmel-mci.c:2426:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/mmc/host/atmel-mci.c:2422:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/mmc/host/atmel-mci.c:2415:30: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/gpu/drm/sti/sti_hdmi.c:855:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/gpu/drm/sti/sti_hdmi.c:853:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/gpu/drm/sti/sti_hdmi.c:851:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 arch/arc/kernel/unwind.c:836:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
1 arch/arc/kernel/unwind.c:827:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
================================================================================
Detailed per-defconfig build reports:
--------------------------------------------------------------------------------
32r2el_defconfig (mips, gcc-8) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
defconfig (riscv, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
defconfig (arm64, gcc-8) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:815:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:820:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/pinctrl-rockchip.c:2783:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
--------------------------------------------------------------------------------
multi_v7_defconfig (arm, gcc-8) — PASS, 0 errors, 19 warnings, 0 section mismatches
Warnings:
drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mmc/host/sdhci-s3c.c:613:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mmc/host/atmel-mci.c:2415:30: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mmc/host/atmel-mci.c:2422:28: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/mmc/host/atmel-mci.c:2426:40: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:815:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c:820:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/pinctrl/pinctrl-rockchip.c:2783:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/video/fbdev/sh_mobile_lcdcfb.c:2086:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/video/fbdev/sh_mobile_lcdcfb.c:1596:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:424:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:440:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:459:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:332:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:352:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/usb/phy/phy-ab8500-usb.c:370:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/gpu/drm/sti/sti_hdmi.c:851:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/gpu/drm/sti/sti_hdmi.c:853:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/gpu/drm/sti/sti_hdmi.c:855:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
--------------------------------------------------------------------------------
nsim_hs_defconfig (arc, gcc-8) — PASS, 0 errors, 5 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
include/linux/compiler.h:328:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
arch/arc/kernel/unwind.c:827:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
arch/arc/kernel/unwind.c:836:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
x86_64_defconfig (x86_64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches
---
For more info write to <info@kernelci.org>
^ permalink raw reply
* [gpio:devel-gpio-driver-isolation 51/59] sound/soc/codecs/ak5386.c:116:3: error: implicit declaration of function 'gpio_set_value'; did you mean 'pmd_set_huge'?
From: kbuild test robot @ 2019-08-30 16:53 UTC (permalink / raw)
To: Linus Walleij; +Cc: kbuild-all, linux-gpio
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 4254 bytes --]
tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/linusw/linux-gpio.git devel-gpio-driver-isolation
head: 913bead035f39e059ce462d3bbd137d2a223bb0c
commit: 2e7bfc286b22879e076690e121e967a89cf48ae6 [51/59] gpio: Drop driver header from legacy header include
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-11) 7.4.0
reproduce:
git checkout 2e7bfc286b22879e076690e121e967a89cf48ae6
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
sound/soc/codecs/ak5386.c: In function 'ak5386_hw_params':
sound/soc/codecs/ak5386.c:115:6: error: implicit declaration of function 'gpio_is_valid'; did you mean 'uuid_is_valid'? [-Werror=implicit-function-declaration]
if (gpio_is_valid(priv->reset_gpio))
^~~~~~~~~~~~~
uuid_is_valid
>> sound/soc/codecs/ak5386.c:116:3: error: implicit declaration of function 'gpio_set_value'; did you mean 'pmd_set_huge'? [-Werror=implicit-function-declaration]
gpio_set_value(priv->reset_gpio, 1);
^~~~~~~~~~~~~~
pmd_set_huge
sound/soc/codecs/ak5386.c: In function 'ak5386_probe':
sound/soc/codecs/ak5386.c:188:7: error: implicit declaration of function 'devm_gpio_request_one'; did you mean 'devm_request_irq'? [-Werror=implicit-function-declaration]
if (devm_gpio_request_one(dev, priv->reset_gpio,
^~~~~~~~~~~~~~~~~~~~~
devm_request_irq
sound/soc/codecs/ak5386.c:189:8: error: 'GPIOF_OUT_INIT_LOW' undeclared (first use in this function)
GPIOF_OUT_INIT_LOW,
^~~~~~~~~~~~~~~~~~
sound/soc/codecs/ak5386.c:189:8: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors
vim +116 sound/soc/codecs/ak5386.c
cc289be8c91300 Daniel Mack 2013-03-08 97
cc289be8c91300 Daniel Mack 2013-03-08 98 static int ak5386_hw_params(struct snd_pcm_substream *substream,
cc289be8c91300 Daniel Mack 2013-03-08 99 struct snd_pcm_hw_params *params,
cc289be8c91300 Daniel Mack 2013-03-08 100 struct snd_soc_dai *dai)
cc289be8c91300 Daniel Mack 2013-03-08 101 {
12132de654bbcd Kuninori Morimoto 2018-01-29 102 struct snd_soc_component *component = dai->component;
12132de654bbcd Kuninori Morimoto 2018-01-29 103 struct ak5386_priv *priv = snd_soc_component_get_drvdata(component);
cc289be8c91300 Daniel Mack 2013-03-08 104
cc289be8c91300 Daniel Mack 2013-03-08 105 /*
cc289be8c91300 Daniel Mack 2013-03-08 106 * From the datasheet:
cc289be8c91300 Daniel Mack 2013-03-08 107 *
cc289be8c91300 Daniel Mack 2013-03-08 108 * All external clocks (MCLK, SCLK and LRCK) must be present unless
cc289be8c91300 Daniel Mack 2013-03-08 109 * PDN pin = “L”. If these clocks are not provided, the AK5386 may
cc289be8c91300 Daniel Mack 2013-03-08 110 * draw excess current due to its use of internal dynamically
cc289be8c91300 Daniel Mack 2013-03-08 111 * refreshed logic. If the external clocks are not present, place
cc289be8c91300 Daniel Mack 2013-03-08 112 * the AK5386 in power-down mode (PDN pin = “L”).
cc289be8c91300 Daniel Mack 2013-03-08 113 */
cc289be8c91300 Daniel Mack 2013-03-08 114
cc289be8c91300 Daniel Mack 2013-03-08 @115 if (gpio_is_valid(priv->reset_gpio))
cc289be8c91300 Daniel Mack 2013-03-08 @116 gpio_set_value(priv->reset_gpio, 1);
cc289be8c91300 Daniel Mack 2013-03-08 117
cc289be8c91300 Daniel Mack 2013-03-08 118 return 0;
cc289be8c91300 Daniel Mack 2013-03-08 119 }
cc289be8c91300 Daniel Mack 2013-03-08 120
:::::: The code at line 116 was first introduced by commit
:::::: cc289be8c913006a43275dfd8ed4ac56b43140a8 ASoC: Add codec driver for AK5386
:::::: TO: Daniel Mack <zonque@gmail.com>
:::::: CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 69434 bytes --]
^ permalink raw reply
* linusw/for-next boot: 45 boots: 0 failed, 45 passed (v5.3-rc6-51-g1fc4f3c962b7)
From: kernelci.org bot @ 2019-08-30 17:05 UTC (permalink / raw)
To: linux-gpio, fellows
linusw/for-next boot: 45 boots: 0 failed, 45 passed (v5.3-rc6-51-g1fc4f3c962b7)
Full Boot Summary: https://kernelci.org/boot/all/job/linusw/branch/for-next/kernel/v5.3-rc6-51-g1fc4f3c962b7/
Full Build Summary: https://kernelci.org/build/linusw/branch/for-next/kernel/v5.3-rc6-51-g1fc4f3c962b7/
Tree: linusw
Branch: for-next
Git Describe: v5.3-rc6-51-g1fc4f3c962b7
Git Commit: 1fc4f3c962b7ecbb43ecc49f0ff6da1add83dc6c
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Tested: 38 unique boards, 15 SoC families, 3 builds out of 6
---
For more info write to <info@kernelci.org>
^ permalink raw reply
* linusw/devel build: 6 builds: 0 failed, 6 passed, 13 warnings (v5.3-rc1-47-gf6a7053ddcf1)
From: kernelci.org bot @ 2019-08-30 17:11 UTC (permalink / raw)
To: linux-gpio, fellows
linusw/devel build: 6 builds: 0 failed, 6 passed, 13 warnings (v5.3-rc1-47-gf6a7053ddcf1)
Full Build Summary: https://kernelci.org/build/linusw/branch/devel/kernel/v5.3-rc1-47-gf6a7053ddcf1/
Tree: linusw
Branch: devel
Git Describe: v5.3-rc1-47-gf6a7053ddcf1
Git Commit: f6a7053ddcf1c05c443715d627507f0ab9a0b491
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Built: 6 unique architectures
Warnings Detected:
arc:
nsim_hs_defconfig (gcc-8): 2 warnings
arm64:
arm:
multi_v7_defconfig (gcc-8): 6 warnings
mips:
32r2el_defconfig (gcc-8): 3 warnings
riscv:
defconfig (gcc-8): 2 warnings
x86_64:
Warnings summary:
7 <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dts:129.4-18: Warning (reg_format): /mdio-bus-mux/mdio@200:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #size-cells value
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #address-cells value
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
1 arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
================================================================================
Detailed per-defconfig build reports:
--------------------------------------------------------------------------------
32r2el_defconfig (mips, gcc-8) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
defconfig (riscv, gcc-8) — PASS, 0 errors, 2 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
defconfig (arm64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
multi_v7_defconfig (arm, gcc-8) — PASS, 0 errors, 6 warnings, 0 section mismatches
Warnings:
arch/arm/boot/dts/bcm47094-linksys-panamera.dts:129.4-18: Warning (reg_format): /mdio-bus-mux/mdio@200:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #address-cells value
arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #size-cells value
--------------------------------------------------------------------------------
nsim_hs_defconfig (arc, gcc-8) — PASS, 0 errors, 2 warnings, 0 section mismatches
Warnings:
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
<stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
--------------------------------------------------------------------------------
x86_64_defconfig (x86_64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches
---
For more info write to <info@kernelci.org>
^ permalink raw reply
* linusw/fixes boot: 54 boots: 1 failed, 53 passed (v5.3-rc6-3-g89f2c0425cb5)
From: kernelci.org bot @ 2019-08-30 17:15 UTC (permalink / raw)
To: linux-gpio, fellows
linusw/fixes boot: 54 boots: 1 failed, 53 passed (v5.3-rc6-3-g89f2c0425cb5)
Full Boot Summary: https://kernelci.org/boot/all/job/linusw/branch/fixes/kernel/v5.3-rc6-3-g89f2c0425cb5/
Full Build Summary: https://kernelci.org/build/linusw/branch/fixes/kernel/v5.3-rc6-3-g89f2c0425cb5/
Tree: linusw
Branch: fixes
Git Describe: v5.3-rc6-3-g89f2c0425cb5
Git Commit: 89f2c0425cb51e38d6b39795c08d55421bec680c
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Tested: 42 unique boards, 15 SoC families, 3 builds out of 6
Boot Failure Detected:
arm64:
defconfig:
gcc-8:
meson-gxm-khadas-vim2: 1 failed lab
---
For more info write to <info@kernelci.org>
^ permalink raw reply
* [gpio:devel-gpio-driver-isolation 51/59] drivers/net//phy/spi_ks8995.c:467:2: note: in expansion of macro 'if'
From: kbuild test robot @ 2019-08-30 17:47 UTC (permalink / raw)
To: Linus Walleij; +Cc: kbuild-all, linux-gpio
[-- Attachment #1: Type: text/plain, Size: 9101 bytes --]
tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/linusw/linux-gpio.git devel-gpio-driver-isolation
head: 913bead035f39e059ce462d3bbd137d2a223bb0c
commit: 2e7bfc286b22879e076690e121e967a89cf48ae6 [51/59] gpio: Drop driver header from legacy header include
config: x86_64-randconfig-c001-201934 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-11) 7.4.0
reproduce:
git checkout 2e7bfc286b22879e076690e121e967a89cf48ae6
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/export.h:45:0,
from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from drivers/net//phy/spi_ks8995.c:14:
drivers/net//phy/spi_ks8995.c: In function 'ks8995_probe':
drivers/net//phy/spi_ks8995.c:467:19: error: implicit declaration of function 'gpio_is_valid'; did you mean 'uuid_is_valid'? [-Werror=implicit-function-declaration]
if (ks->pdata && gpio_is_valid(ks->pdata->reset_gpio)) {
^
include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
>> drivers/net//phy/spi_ks8995.c:467:2: note: in expansion of macro 'if'
if (ks->pdata && gpio_is_valid(ks->pdata->reset_gpio)) {
^~
drivers/net//phy/spi_ks8995.c:471:5: error: 'GPIOF_ACTIVE_LOW' undeclared (first use in this function); did you mean 'OF_GPIO_ACTIVE_LOW'?
GPIOF_ACTIVE_LOW : 0);
^~~~~~~~~~~~~~~~
OF_GPIO_ACTIVE_LOW
drivers/net//phy/spi_ks8995.c:471:5: note: each undeclared identifier is reported only once for each function it appears in
drivers/net//phy/spi_ks8995.c:473:9: error: implicit declaration of function 'devm_gpio_request_one'; did you mean 'devm_gpiod_get_optional'? [-Werror=implicit-function-declaration]
err = devm_gpio_request_one(&spi->dev,
^~~~~~~~~~~~~~~~~~~~~
devm_gpiod_get_optional
cc1: some warnings being treated as errors
vim +/if +467 drivers/net//phy/spi_ks8995.c
a8e510f682fe6d Frederic LAMBERT 2011-12-18 431
a8e510f682fe6d Frederic LAMBERT 2011-12-18 432 /* ------------------------------------------------------------------------ */
633d1594974b33 Bill Pemberton 2012-12-03 433 static int ks8995_probe(struct spi_device *spi)
a8e510f682fe6d Frederic LAMBERT 2011-12-18 434 {
a8e510f682fe6d Frederic LAMBERT 2011-12-18 435 struct ks8995_switch *ks;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 436 int err;
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 437 int variant = spi_get_device_id(spi)->driver_data;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 438
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 439 if (variant >= max_variant) {
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 440 dev_err(&spi->dev, "bad chip variant %d\n", variant);
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 441 return -ENODEV;
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 442 }
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 443
b32a8b6410b9e7 Himangi Saraogi 2014-08-03 444 ks = devm_kzalloc(&spi->dev, sizeof(*ks), GFP_KERNEL);
e68ed8f0d8f5b0 Joe Perches 2013-02-03 445 if (!ks)
a8e510f682fe6d Frederic LAMBERT 2011-12-18 446 return -ENOMEM;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 447
a8e510f682fe6d Frederic LAMBERT 2011-12-18 448 mutex_init(&ks->lock);
a1459c1c9ebcd7 Mark Brown 2016-04-20 449 ks->spi = spi;
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 450 ks->chip = &ks8995_chip[variant];
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 451
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 452 if (ks->spi->dev.of_node) {
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 453 ks->pdata = devm_kzalloc(&spi->dev, sizeof(*ks->pdata),
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 454 GFP_KERNEL);
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 455 if (!ks->pdata)
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 456 return -ENOMEM;
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 457
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 458 ks->pdata->reset_gpio = -1;
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 459
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 460 ks8995_parse_dt(ks);
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 461 }
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 462
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 463 if (!ks->pdata)
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 464 ks->pdata = spi->dev.platform_data;
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 465
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 466 /* de-assert switch reset */
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 @467 if (ks->pdata && gpio_is_valid(ks->pdata->reset_gpio)) {
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 468 unsigned long flags;
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 469
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 470 flags = (ks->pdata->reset_gpio_flags == OF_GPIO_ACTIVE_LOW ?
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 471 GPIOF_ACTIVE_LOW : 0);
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 472
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 473 err = devm_gpio_request_one(&spi->dev,
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 474 ks->pdata->reset_gpio,
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 475 flags, "switch-reset");
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 476 if (err) {
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 477 dev_err(&spi->dev,
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 478 "failed to get reset-gpios: %d\n", err);
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 479 return -EIO;
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 480 }
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 481
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 482 gpiod_set_value(gpio_to_desc(ks->pdata->reset_gpio), 0);
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 483 }
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 484
5d5f18460f451d Jingoo Han 2013-04-05 485 spi_set_drvdata(spi, ks);
a8e510f682fe6d Frederic LAMBERT 2011-12-18 486
a8e510f682fe6d Frederic LAMBERT 2011-12-18 487 spi->mode = SPI_MODE_0;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 488 spi->bits_per_word = 8;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 489 err = spi_setup(spi);
a8e510f682fe6d Frederic LAMBERT 2011-12-18 490 if (err) {
a8e510f682fe6d Frederic LAMBERT 2011-12-18 491 dev_err(&spi->dev, "spi_setup failed, err=%d\n", err);
b32a8b6410b9e7 Himangi Saraogi 2014-08-03 492 return err;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 493 }
a8e510f682fe6d Frederic LAMBERT 2011-12-18 494
484e36ff18341c Helmut Buchsbaum 2016-02-09 495 err = ks8995_get_revision(ks);
484e36ff18341c Helmut Buchsbaum 2016-02-09 496 if (err)
b32a8b6410b9e7 Himangi Saraogi 2014-08-03 497 return err;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 498
240a12d58e3935 Philipp Zabel 2014-04-03 499 memcpy(&ks->regs_attr, &ks8995_registers_attr, sizeof(ks->regs_attr));
239870f2a0ebf7 Blomme, Maarten 2017-03-02 500 ks->regs_attr.size = ks->chip->regs_size;
240a12d58e3935 Philipp Zabel 2014-04-03 501
a8e510f682fe6d Frederic LAMBERT 2011-12-18 502 err = ks8995_reset(ks);
a8e510f682fe6d Frederic LAMBERT 2011-12-18 503 if (err)
b32a8b6410b9e7 Himangi Saraogi 2014-08-03 504 return err;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 505
4342696df764ec Blomme, Maarten 2017-03-02 506 sysfs_attr_init(&ks->regs_attr.attr);
240a12d58e3935 Philipp Zabel 2014-04-03 507 err = sysfs_create_bin_file(&spi->dev.kobj, &ks->regs_attr);
a8e510f682fe6d Frederic LAMBERT 2011-12-18 508 if (err) {
a8e510f682fe6d Frederic LAMBERT 2011-12-18 509 dev_err(&spi->dev, "unable to create sysfs file, err=%d\n",
a8e510f682fe6d Frederic LAMBERT 2011-12-18 510 err);
b32a8b6410b9e7 Himangi Saraogi 2014-08-03 511 return err;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 512 }
a8e510f682fe6d Frederic LAMBERT 2011-12-18 513
484e36ff18341c Helmut Buchsbaum 2016-02-09 514 dev_info(&spi->dev, "%s device found, Chip ID:%x, Revision:%x\n",
484e36ff18341c Helmut Buchsbaum 2016-02-09 515 ks->chip->name, ks->chip->chip_id, ks->revision_id);
a8e510f682fe6d Frederic LAMBERT 2011-12-18 516
a8e510f682fe6d Frederic LAMBERT 2011-12-18 517 return 0;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 518 }
a8e510f682fe6d Frederic LAMBERT 2011-12-18 519
:::::: The code at line 467 was first introduced by commit
:::::: cd6f288cbaab656cebd524c5ef2388c11378c827 net: phy: spi_ks8995: add support for resetting switch using GPIO
:::::: TO: Helmut Buchsbaum <helmut.buchsbaum@gmail.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34097 bytes --]
^ permalink raw reply
* linusw/devel boot: 53 boots: 2 failed, 51 passed (v5.3-rc1-47-gf6a7053ddcf1)
From: kernelci.org bot @ 2019-08-30 17:56 UTC (permalink / raw)
To: linux-gpio, fellows
linusw/devel boot: 53 boots: 2 failed, 51 passed (v5.3-rc1-47-gf6a7053ddcf1)
Full Boot Summary: https://kernelci.org/boot/all/job/linusw/branch/devel/kernel/v5.3-rc1-47-gf6a7053ddcf1/
Full Build Summary: https://kernelci.org/build/linusw/branch/devel/kernel/v5.3-rc1-47-gf6a7053ddcf1/
Tree: linusw
Branch: devel
Git Describe: v5.3-rc1-47-gf6a7053ddcf1
Git Commit: f6a7053ddcf1c05c443715d627507f0ab9a0b491
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Tested: 41 unique boards, 15 SoC families, 3 builds out of 6
Boot Regressions Detected:
arm64:
defconfig:
gcc-8:
apq8016-sbc:
lab-mhart: failing since 31 days (last pass: v5.2-10808-g9637d517347e - first fail: v5.3-rc1-5-ga299726da44f)
Boot Failures Detected:
arm64:
defconfig:
gcc-8:
apq8016-sbc: 1 failed lab
meson-gxm-khadas-vim2: 1 failed lab
---
For more info write to <info@kernelci.org>
^ permalink raw reply
* Re: [PATCH 2/2] touchscreen: goodix: define GPIO mapping for GPD P2 Max
From: Andy Shevchenko @ 2019-08-30 18:16 UTC (permalink / raw)
To: Peter Cai
Cc: Mika Westerberg, Linus Walleij, Bartosz Golaszewski,
Bastien Nocera, Dmitry Torokhov, Rafael J. Wysocki, Len Brown,
linux-gpio, linux-acpi, linux-kernel, linux-input
In-Reply-To: <CA+Zf_0etfu7282TQ4wYE8tOrhh2Je4aV4Dz5tgC_wt7=FMAidA@mail.gmail.com>
On Fri, Aug 30, 2019 at 11:15:27PM +0800, Peter Cai wrote:
> On Fri, Aug 30, 2019, 7:55 PM Andy Shevchenko <
> andriy.shevchenko@linux.intel.com> wrote:
> > I guess most of these #ifdef:s makes code less readable for exchange of
> saving
> few bytes in the module footprint.
>
> Well since they can only be used when ACPI is supported
> (devm_acpi_dev_add_driver_gpios does not exist without ACPI defined, thus
> the last guard must exist),
This is not correct.
> if they were not guarded then we would be left
> with a bunch of unused variables warnings when building without ACPI which
> doesn't seem good.
Good / no-good is only matter of few dozens of bytes here and there to be saved.
> Should we use __maybe_unused here instead of #ifdef guards?
No, it won't make sense, because the structures will be part of
_add_driver_gpio() call, due to which compiler likely can't recognize unused
structures. However, you may try with warnings enabled `make W=1`.
> > Comma at the end?
>
> I was trying to follow the style of this driver but it doesn't seem to be
> really consistent within itself. Another dmi_system_id definition in the
> same file mixed both styles so I was kind of confused.
I see. So, this is for Dmitry's preferences.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* [PATCH v2 1/2] gpio: acpi: add quirk to override GpioInt polarity
From: Peter Cai @ 2019-08-31 3:09 UTC (permalink / raw)
Cc: Rafael J. Wysocki, Len Brown, Peter Cai, Mika Westerberg,
Andy Shevchenko, Linus Walleij, Bartosz Golaszewski,
Bastien Nocera, Dmitry Torokhov, linux-gpio, linux-acpi,
linux-kernel, linux-input
On GPD P2 Max, the firmware could not reset the touch panel correctly.
The kernel needs to take on the job instead, but the GpioInt definition
in DSDT specifies ActiveHigh while the GPIO pin should actually be
ActiveLow.
We need to override the polarity defined by DSDT. The GPIO driver
already allows defining polarity in acpi_gpio_params, but the option is
not applied to GpioInt.
This patch adds a new quirk that enables the polarity specified in
acpi_gpio_params to also be applied to GpioInt.
Signed-off-by: Peter Cai <peter@typeblog.net>
---
v2: rebased to gpio/for-next, moved quirk out of the gpioint
conditional.
---
drivers/gpio/gpiolib-acpi.c | 9 +++++++++
include/linux/gpio/consumer.h | 6 ++++++
2 files changed, 15 insertions(+)
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index fdee8afa5339..ab16ea61a8fa 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -603,6 +603,15 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
lookup->info.flags = acpi_gpio_to_gpiod_flags(agpio);
lookup->info.polarity = lookup->active_low;
}
+
+ /*
+ * Override the polarity specified by GpioInt if
+ * ACPI_GPIO_QUIRK_OVERRIDE_POLARITY is set.
+ */
+ if (lookup->info.quirks & ACPI_GPIO_QUIRK_OVERRIDE_POLARITY) {
+ dev_warn(&lookup->info.adev->dev, FW_BUG "Incorrect polarity specified by GpioInt, overriding.\n");
+ lookup->info.polarity = lookup->active_low;
+ }
}
return 1;
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index b70af921c614..7e9f24ebb085 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -622,6 +622,12 @@ struct acpi_gpio_mapping {
* get GpioIo type explicitly, this quirk may be used.
*/
#define ACPI_GPIO_QUIRK_ONLY_GPIOIO BIT(1)
+/*
+ * Use the GPIO polarity (ActiveHigh / ActiveLow) from acpi_gpio_params
+ * for GpioInt as well. The default behavior is to use the one specified
+ * by GpioInt, which can be incorrect on some devices.
+ */
+#define ACPI_GPIO_QUIRK_OVERRIDE_POLARITY BIT(2)
unsigned int quirks;
};
--
2.23.0
^ permalink raw reply related
* [PATCH v2 2/2] touchscreen: goodix: define GPIO mapping for GPD P2 Max
From: Peter Cai @ 2019-08-31 3:09 UTC (permalink / raw)
Cc: Rafael J. Wysocki, Len Brown, Peter Cai, Mika Westerberg,
Andy Shevchenko, Linus Walleij, Bartosz Golaszewski,
Bastien Nocera, Dmitry Torokhov, linux-gpio, linux-acpi,
linux-kernel, linux-input
In-Reply-To: <20190831030916.13172-1-peter@typeblog.net>
The firmware of GPD P2 Max could not handle panel resets although code
is present in DSDT. The kernel needs to take on this job instead, but
the DSDT does not provide _DSD, rendering kernel helpless when trying to
find the respective GPIO pins.
Fortunately, this time GPD has proper DMI vendor / product strings that
we could match against. We simply apply an acpi_gpio_mapping table when
GPD P2 Max is matched.
Additionally, the DSDT definition of the irq pin specifies a wrong
polarity. The new quirk introduced in the previous patch
(ACPI_GPIO_QUIRK_OVERRIDE_POLARITY) is applied to correct this.
Signed-off-by: Peter Cai <peter@typeblog.net>
---
v2: removed '#ifdef CONFIG_ACPI' as per suggestion. The #ifdef guards
for CONFIG_DMI is kept for consistency with the other dmi_system_id
definition in the same file.
---
drivers/input/touchscreen/goodix.c | 31 ++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index 5178ea8b5f30..df476f7dcd95 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -144,6 +144,31 @@ static const struct dmi_system_id rotated_screen[] = {
{}
};
+static const struct acpi_gpio_params irq_gpios_default = { 0, 0, false };
+static const struct acpi_gpio_params reset_gpios_default = { 1, 0, false };
+static const struct acpi_gpio_mapping gpio_mapping_force_irq_active_high[] = {
+ { "irq-gpios", &irq_gpios_default, 1, ACPI_GPIO_QUIRK_OVERRIDE_POLARITY },
+ { "reset-gpios", &reset_gpios_default, 1 },
+ {}
+};
+
+/*
+ * Devices that need acpi_gpio_mapping to function correctly
+ */
+static const struct dmi_system_id need_gpio_mapping[] = {
+#if defined(CONFIG_DMI) && defined(CONFIG_X86)
+ {
+ .ident = "GPD P2 Max",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GPD"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "P2 MAX")
+ },
+ .driver_data = &gpio_mapping_force_irq_active_high
+ },
+#endif
+ {}
+};
+
/**
* goodix_i2c_read - read data from a register of the i2c slave device.
*
@@ -795,6 +820,12 @@ static int goodix_ts_probe(struct i2c_client *client,
{
struct goodix_ts_data *ts;
int error;
+ struct dmi_system_id *dmi_match;
+
+ dmi_match = dmi_first_match(need_gpio_mapping);
+ if (dmi_match)
+ devm_acpi_dev_add_driver_gpios(&client->dev,
+ dmi_match->driver_data);
dev_dbg(&client->dev, "I2C Address: 0x%02x\n", client->addr);
--
2.23.0
^ permalink raw reply related
* [PATCH] spi: ep93xx: Repair SPI CS lookup tables
From: Alexander Sverdlin @ 2019-08-31 18:04 UTC (permalink / raw)
To: Linus Walleij, Mark Brown, linux-arm-kernel, linux-gpio,
linux-spi
Cc: Alexander Sverdlin, Hartley Sweeten, Russell King,
Lukasz Majewski, stable
The actual device name of the SPI controller being registered on EP93xx is
"spi0" (as seen by gpiod_find_lookup_table()). This patch fixes all
relevant lookup tables and the following failure (seen on EDB9302):
ep93xx-spi ep93xx-spi.0: failed to register SPI master
ep93xx-spi: probe of ep93xx-spi.0 failed with error -22
Fixes: 1dfbf334f1236 ("spi: ep93xx: Convert to use CS GPIO descriptors")
Cc: stable@vger.kernel.org
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
arch/arm/mach-ep93xx/edb93xx.c | 2 +-
arch/arm/mach-ep93xx/simone.c | 2 +-
arch/arm/mach-ep93xx/ts72xx.c | 4 ++--
arch/arm/mach-ep93xx/vision_ep9307.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index 1f0da76a39de..7b7280c21ee0 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -103,7 +103,7 @@ static struct spi_board_info edb93xx_spi_board_info[] __initdata = {
};
static struct gpiod_lookup_table edb93xx_spi_cs_gpio_table = {
- .dev_id = "ep93xx-spi.0",
+ .dev_id = "spi0",
.table = {
GPIO_LOOKUP("A", 6, "cs", GPIO_ACTIVE_LOW),
{ },
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c
index e2658e22bba1..8a53b74dc4b2 100644
--- a/arch/arm/mach-ep93xx/simone.c
+++ b/arch/arm/mach-ep93xx/simone.c
@@ -73,7 +73,7 @@ static struct spi_board_info simone_spi_devices[] __initdata = {
* v1.3 parts will still work, since the signal on SFRMOUT is automatic.
*/
static struct gpiod_lookup_table simone_spi_cs_gpio_table = {
- .dev_id = "ep93xx-spi.0",
+ .dev_id = "spi0",
.table = {
GPIO_LOOKUP("A", 1, "cs", GPIO_ACTIVE_LOW),
{ },
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 582e06e104fd..e0e1b11032f1 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -267,7 +267,7 @@ static struct spi_board_info bk3_spi_board_info[] __initdata = {
* goes through CPLD
*/
static struct gpiod_lookup_table bk3_spi_cs_gpio_table = {
- .dev_id = "ep93xx-spi.0",
+ .dev_id = "spi0",
.table = {
GPIO_LOOKUP("F", 3, "cs", GPIO_ACTIVE_LOW),
{ },
@@ -316,7 +316,7 @@ static struct spi_board_info ts72xx_spi_devices[] __initdata = {
};
static struct gpiod_lookup_table ts72xx_spi_cs_gpio_table = {
- .dev_id = "ep93xx-spi.0",
+ .dev_id = "spi0",
.table = {
/* DIO_17 */
GPIO_LOOKUP("F", 2, "cs", GPIO_ACTIVE_LOW),
diff --git a/arch/arm/mach-ep93xx/vision_ep9307.c b/arch/arm/mach-ep93xx/vision_ep9307.c
index a88a1d807b32..cbcba3136d74 100644
--- a/arch/arm/mach-ep93xx/vision_ep9307.c
+++ b/arch/arm/mach-ep93xx/vision_ep9307.c
@@ -242,7 +242,7 @@ static struct spi_board_info vision_spi_board_info[] __initdata = {
};
static struct gpiod_lookup_table vision_spi_cs_gpio_table = {
- .dev_id = "ep93xx-spi.0",
+ .dev_id = "spi0",
.table = {
GPIO_LOOKUP_IDX("A", 6, "cs", 0, GPIO_ACTIVE_LOW),
GPIO_LOOKUP_IDX("A", 7, "cs", 1, GPIO_ACTIVE_LOW),
--
2.21.0
^ permalink raw reply related
* Re: [PATCH] gpio: ep93xx: Pass irqchip when adding gpiochip
From: Alexander Sverdlin @ 2019-08-31 18:42 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-gpio, Bartosz Golaszewski, H Hartley Sweeten,
Thierry Reding
In-Reply-To: <20190812130000.22252-1-linus.walleij@linaro.org>
Hi Linus,
On Mon, 12 Aug 2019 15:00:00 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:
> We need to convert all old gpio irqchips to pass the irqchip
> setup along when adding the gpio_chip. For more info see
> drivers/gpio/TODO.
>
> For chained irqchips this is a pretty straight-forward
> conversion.
>
> Cc: Alexander Sverdlin <alexander.sverdlin@gmail.com>
> Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Thierry Reding <treding@nvidia.com>
The only new thing I see with this patch is this one:
gpio gpiochip5: (F): detected irqchip that is shared with multiple gpiochips: please fix the driver.
But as we already had this one before the patch:
gpio gpiochip1: (B): detected irqchip that is shared with multiple gpiochips: please fix the driver.
Seems, both of them could be fixed in another patch.
I unfortunately don't have a use-case for IRQs, but
at least GPIOs continue to work as before.
Other than above, looks good to me,
Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/gpio/gpio-ep93xx.c | 140 +++++++++++++++++++------------------
> 1 file changed, 73 insertions(+), 67 deletions(-)
>
> diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
> index a90870a60c15..226da8df6f10 100644
> --- a/drivers/gpio/gpio-ep93xx.c
> +++ b/drivers/gpio/gpio-ep93xx.c
> @@ -269,56 +269,6 @@ static struct irq_chip ep93xx_gpio_irq_chip = {
> .irq_set_type = ep93xx_gpio_irq_type,
> };
>
> -static int ep93xx_gpio_init_irq(struct platform_device *pdev,
> - struct ep93xx_gpio *epg)
> -{
> - int ab_parent_irq = platform_get_irq(pdev, 0);
> - struct device *dev = &pdev->dev;
> - int gpio_irq;
> - int ret;
> - int i;
> -
> - /* The A bank */
> - ret = gpiochip_irqchip_add(&epg->gc[0], &ep93xx_gpio_irq_chip,
> - 64, handle_level_irq,
> - IRQ_TYPE_NONE);
> - if (ret) {
> - dev_err(dev, "Could not add irqchip 0\n");
> - return ret;
> - }
> - gpiochip_set_chained_irqchip(&epg->gc[0], &ep93xx_gpio_irq_chip,
> - ab_parent_irq,
> - ep93xx_gpio_ab_irq_handler);
> -
> - /* The B bank */
> - ret = gpiochip_irqchip_add(&epg->gc[1], &ep93xx_gpio_irq_chip,
> - 72, handle_level_irq,
> - IRQ_TYPE_NONE);
> - if (ret) {
> - dev_err(dev, "Could not add irqchip 1\n");
> - return ret;
> - }
> - gpiochip_set_chained_irqchip(&epg->gc[1], &ep93xx_gpio_irq_chip,
> - ab_parent_irq,
> - ep93xx_gpio_ab_irq_handler);
> -
> - /* The F bank */
> - for (i = 0; i < 8; i++) {
> - gpio_irq = EP93XX_GPIO_F_IRQ_BASE + i;
> - irq_set_chip_data(gpio_irq, &epg->gc[5]);
> - irq_set_chip_and_handler(gpio_irq, &ep93xx_gpio_irq_chip,
> - handle_level_irq);
> - irq_clear_status_flags(gpio_irq, IRQ_NOREQUEST);
> - }
> -
> - for (i = 1; i <= 8; i++)
> - irq_set_chained_handler_and_data(platform_get_irq(pdev, i),
> - ep93xx_gpio_f_irq_handler,
> - &epg->gc[i]);
> - return 0;
> -}
> -
> -
> /*************************************************************************
> * gpiolib interface for EP93xx on-chip GPIOs
> *************************************************************************/
> @@ -328,26 +278,33 @@ struct ep93xx_gpio_bank {
> int dir;
> int base;
> bool has_irq;
> + bool has_hierarchical_irq;
> + unsigned int irq_base;
> };
>
> -#define EP93XX_GPIO_BANK(_label, _data, _dir, _base, _has_irq) \
> +#define EP93XX_GPIO_BANK(_label, _data, _dir, _base, _has_irq, _has_hier, _irq_base) \
> { \
> .label = _label, \
> .data = _data, \
> .dir = _dir, \
> .base = _base, \
> .has_irq = _has_irq, \
> + .has_hierarchical_irq = _has_hier, \
> + .irq_base = _irq_base, \
> }
>
> static struct ep93xx_gpio_bank ep93xx_gpio_banks[] = {
> - EP93XX_GPIO_BANK("A", 0x00, 0x10, 0, true), /* Bank A has 8 IRQs */
> - EP93XX_GPIO_BANK("B", 0x04, 0x14, 8, true), /* Bank B has 8 IRQs */
> - EP93XX_GPIO_BANK("C", 0x08, 0x18, 40, false),
> - EP93XX_GPIO_BANK("D", 0x0c, 0x1c, 24, false),
> - EP93XX_GPIO_BANK("E", 0x20, 0x24, 32, false),
> - EP93XX_GPIO_BANK("F", 0x30, 0x34, 16, true), /* Bank F has 8 IRQs */
> - EP93XX_GPIO_BANK("G", 0x38, 0x3c, 48, false),
> - EP93XX_GPIO_BANK("H", 0x40, 0x44, 56, false),
> + /* Bank A has 8 IRQs */
> + EP93XX_GPIO_BANK("A", 0x00, 0x10, 0, true, false, 64),
> + /* Bank B has 8 IRQs */
> + EP93XX_GPIO_BANK("B", 0x04, 0x14, 8, true, false, 72),
> + EP93XX_GPIO_BANK("C", 0x08, 0x18, 40, false, false, 0),
> + EP93XX_GPIO_BANK("D", 0x0c, 0x1c, 24, false, false, 0),
> + EP93XX_GPIO_BANK("E", 0x20, 0x24, 32, false, false, 0),
> + /* Bank F has 8 IRQs */
> + EP93XX_GPIO_BANK("F", 0x30, 0x34, 16, false, true, 0),
> + EP93XX_GPIO_BANK("G", 0x38, 0x3c, 48, false, false, 0),
> + EP93XX_GPIO_BANK("H", 0x40, 0x44, 56, false, false, 0),
> };
>
> static int ep93xx_gpio_set_config(struct gpio_chip *gc, unsigned offset,
> @@ -369,12 +326,15 @@ static int ep93xx_gpio_f_to_irq(struct gpio_chip *gc, unsigned offset)
> return EP93XX_GPIO_F_IRQ_BASE + offset;
> }
>
> -static int ep93xx_gpio_add_bank(struct gpio_chip *gc, struct device *dev,
> +static int ep93xx_gpio_add_bank(struct gpio_chip *gc,
> + struct platform_device *pdev,
> struct ep93xx_gpio *epg,
> struct ep93xx_gpio_bank *bank)
> {
> void __iomem *data = epg->base + bank->data;
> void __iomem *dir = epg->base + bank->dir;
> + struct device *dev = &pdev->dev;
> + struct gpio_irq_chip *girq;
> int err;
>
> err = bgpio_init(gc, dev, 1, data, NULL, NULL, dir, NULL, 0);
> @@ -384,8 +344,59 @@ static int ep93xx_gpio_add_bank(struct gpio_chip *gc, struct device *dev,
> gc->label = bank->label;
> gc->base = bank->base;
>
> - if (bank->has_irq)
> + girq = &gc->irq;
> + if (bank->has_irq || bank->has_hierarchical_irq) {
> gc->set_config = ep93xx_gpio_set_config;
> + girq->chip = &ep93xx_gpio_irq_chip;
> + }
> +
> + if (bank->has_irq) {
> + int ab_parent_irq = platform_get_irq(pdev, 0);
> +
> + girq->parent_handler = ep93xx_gpio_ab_irq_handler;
> + girq->num_parents = 1;
> + girq->parents = devm_kcalloc(dev, 1,
> + sizeof(*girq->parents),
> + GFP_KERNEL);
> + if (!girq->parents)
> + return -ENOMEM;
> + girq->default_type = IRQ_TYPE_NONE;
> + girq->handler = handle_level_irq;
> + girq->parents[0] = ab_parent_irq;
> + girq->first = bank->irq_base;
> + }
> +
> + /* Only bank F has especially funky IRQ handling */
> + if (bank->has_hierarchical_irq) {
> + int gpio_irq;
> + int i;
> +
> + /*
> + * FIXME: convert this to use hierarchical IRQ support!
> + * this requires fixing the root irqchip to be hierarchial.
> + */
> + girq->parent_handler = ep93xx_gpio_f_irq_handler;
> + girq->num_parents = 8;
> + girq->parents = devm_kcalloc(dev, 8,
> + sizeof(*girq->parents),
> + GFP_KERNEL);
> + if (!girq->parents)
> + return -ENOMEM;
> + /* Pick resources 1..8 for these IRQs */
> + for (i = 1; i <= 8; i++)
> + girq->parents[i - 1] = platform_get_irq(pdev, i);
> + for (i = 0; i < 8; i++) {
> + gpio_irq = EP93XX_GPIO_F_IRQ_BASE + i;
> + irq_set_chip_data(gpio_irq, &epg->gc[5]);
> + irq_set_chip_and_handler(gpio_irq,
> + &ep93xx_gpio_irq_chip,
> + handle_level_irq);
> + irq_clear_status_flags(gpio_irq, IRQ_NOREQUEST);
> + }
> + girq->default_type = IRQ_TYPE_NONE;
> + girq->handler = handle_level_irq;
> + gc->to_irq = ep93xx_gpio_f_to_irq;
> + }
>
> return devm_gpiochip_add_data(dev, gc, epg);
> }
> @@ -407,16 +418,11 @@ static int ep93xx_gpio_probe(struct platform_device *pdev)
> struct gpio_chip *gc = &epg->gc[i];
> struct ep93xx_gpio_bank *bank = &ep93xx_gpio_banks[i];
>
> - if (ep93xx_gpio_add_bank(gc, &pdev->dev, epg, bank))
> + if (ep93xx_gpio_add_bank(gc, pdev, epg, bank))
> dev_warn(&pdev->dev, "Unable to add gpio bank %s\n",
> bank->label);
> - /* Only bank F has especially funky IRQ handling */
> - if (i == 5)
> - gc->to_irq = ep93xx_gpio_f_to_irq;
> }
>
> - ep93xx_gpio_init_irq(pdev, epg);
> -
> return 0;
> }
>
> --
> 2.21.0
>
--
Alexander Sverdlin.
^ permalink raw reply
* Re: [PATCH] spi: ep93xx: Repair SPI CS lookup tables
From: Linus Walleij @ 2019-09-01 20:16 UTC (permalink / raw)
To: Alexander Sverdlin
Cc: Mark Brown, Linux ARM, open list:GPIO SUBSYSTEM, linux-spi,
Hartley Sweeten, Russell King, Lukasz Majewski, stable
In-Reply-To: <20190831180402.10008-1-alexander.sverdlin@gmail.com>
On Sat, Aug 31, 2019 at 8:05 PM Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
> The actual device name of the SPI controller being registered on EP93xx is
> "spi0" (as seen by gpiod_find_lookup_table()). This patch fixes all
> relevant lookup tables and the following failure (seen on EDB9302):
>
> ep93xx-spi ep93xx-spi.0: failed to register SPI master
> ep93xx-spi: probe of ep93xx-spi.0 failed with error -22
>
> Fixes: 1dfbf334f1236 ("spi: ep93xx: Convert to use CS GPIO descriptors")
> Cc: stable@vger.kernel.org
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Sorry for the mistakes and thanks for fixing, much appreciated!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply
* Re: [PATCH 2/2] touchscreen: goodix: define GPIO mapping for GPD P2 Max
From: kbuild test robot @ 2019-09-02 6:35 UTC (permalink / raw)
To: Peter Cai
Cc: kbuild-all, Peter Cai, Mika Westerberg, Andy Shevchenko,
Linus Walleij, Bartosz Golaszewski, Bastien Nocera,
Dmitry Torokhov, Rafael J. Wysocki, Len Brown, linux-gpio,
linux-acpi, linux-kernel, linux-input
In-Reply-To: <20190830000024.20384-2-peter@typeblog.net>
[-- Attachment #1: Type: text/plain, Size: 1934 bytes --]
Hi Peter,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[cannot apply to v5.3-rc6 next-20190830]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Peter-Cai/gpio-acpi-add-quirk-to-override-GpioInt-polarity/20190902-004801
config: x86_64-fedora-25 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-11) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/input/touchscreen/goodix.c:168:18: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
.driver_data = &gpio_mapping_force_irq_active_high
^
drivers/input/touchscreen/goodix.c: In function 'goodix_ts_probe':
>> drivers/input/touchscreen/goodix.c:830:12: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
dmi_match = dmi_first_match(need_gpio_mapping);
^
vim +/const +168 drivers/input/touchscreen/goodix.c
156
157 /*
158 * Devices that need acpi_gpio_mapping to function correctly
159 */
160 static const struct dmi_system_id need_gpio_mapping[] = {
161 #if defined(CONFIG_DMI) && defined(CONFIG_X86)
162 {
163 .ident = "GPD P2 Max",
164 .matches = {
165 DMI_MATCH(DMI_SYS_VENDOR, "GPD"),
166 DMI_MATCH(DMI_PRODUCT_NAME, "P2 MAX")
167 },
> 168 .driver_data = &gpio_mapping_force_irq_active_high
169 },
170 #endif
171 {}
172 };
173 #endif
174
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 50840 bytes --]
^ permalink raw reply
* Re: [PATCH] spi: ep93xx: Repair SPI CS lookup tables
From: Lukasz Majewski @ 2019-09-02 7:18 UTC (permalink / raw)
To: Alexander Sverdlin
Cc: Linus Walleij, Mark Brown, linux-arm-kernel, linux-gpio,
linux-spi, Hartley Sweeten, Russell King, stable
In-Reply-To: <20190831180402.10008-1-alexander.sverdlin@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3660 bytes --]
On Sat, 31 Aug 2019 20:04:02 +0200
Alexander Sverdlin <alexander.sverdlin@gmail.com> wrote:
> The actual device name of the SPI controller being registered on
> EP93xx is "spi0" (as seen by gpiod_find_lookup_table()). This patch
> fixes all relevant lookup tables and the following failure (seen on
> EDB9302):
>
> ep93xx-spi ep93xx-spi.0: failed to register SPI master
> ep93xx-spi: probe of ep93xx-spi.0 failed with error -22
>
> Fixes: 1dfbf334f1236 ("spi: ep93xx: Convert to use CS GPIO
> descriptors") Cc: stable@vger.kernel.org
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
> ---
> arch/arm/mach-ep93xx/edb93xx.c | 2 +-
> arch/arm/mach-ep93xx/simone.c | 2 +-
> arch/arm/mach-ep93xx/ts72xx.c | 4 ++--
> arch/arm/mach-ep93xx/vision_ep9307.c | 2 +-
> 4 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-ep93xx/edb93xx.c
> b/arch/arm/mach-ep93xx/edb93xx.c index 1f0da76a39de..7b7280c21ee0
> 100644 --- a/arch/arm/mach-ep93xx/edb93xx.c
> +++ b/arch/arm/mach-ep93xx/edb93xx.c
> @@ -103,7 +103,7 @@ static struct spi_board_info
> edb93xx_spi_board_info[] __initdata = { };
>
> static struct gpiod_lookup_table edb93xx_spi_cs_gpio_table = {
> - .dev_id = "ep93xx-spi.0",
> + .dev_id = "spi0",
> .table = {
> GPIO_LOOKUP("A", 6, "cs", GPIO_ACTIVE_LOW),
> { },
> diff --git a/arch/arm/mach-ep93xx/simone.c
> b/arch/arm/mach-ep93xx/simone.c index e2658e22bba1..8a53b74dc4b2
> 100644 --- a/arch/arm/mach-ep93xx/simone.c
> +++ b/arch/arm/mach-ep93xx/simone.c
> @@ -73,7 +73,7 @@ static struct spi_board_info simone_spi_devices[]
> __initdata = {
> * v1.3 parts will still work, since the signal on SFRMOUT is
> automatic. */
> static struct gpiod_lookup_table simone_spi_cs_gpio_table = {
> - .dev_id = "ep93xx-spi.0",
> + .dev_id = "spi0",
> .table = {
> GPIO_LOOKUP("A", 1, "cs", GPIO_ACTIVE_LOW),
> { },
> diff --git a/arch/arm/mach-ep93xx/ts72xx.c
> b/arch/arm/mach-ep93xx/ts72xx.c index 582e06e104fd..e0e1b11032f1
> 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -267,7 +267,7 @@ static struct spi_board_info bk3_spi_board_info[]
> __initdata = {
> * goes through CPLD
> */
> static struct gpiod_lookup_table bk3_spi_cs_gpio_table = {
> - .dev_id = "ep93xx-spi.0",
> + .dev_id = "spi0",
> .table = {
> GPIO_LOOKUP("F", 3, "cs", GPIO_ACTIVE_LOW),
> { },
> @@ -316,7 +316,7 @@ static struct spi_board_info ts72xx_spi_devices[]
> __initdata = { };
>
> static struct gpiod_lookup_table ts72xx_spi_cs_gpio_table = {
> - .dev_id = "ep93xx-spi.0",
> + .dev_id = "spi0",
> .table = {
> /* DIO_17 */
> GPIO_LOOKUP("F", 2, "cs", GPIO_ACTIVE_LOW),
> diff --git a/arch/arm/mach-ep93xx/vision_ep9307.c
> b/arch/arm/mach-ep93xx/vision_ep9307.c index
> a88a1d807b32..cbcba3136d74 100644 ---
> a/arch/arm/mach-ep93xx/vision_ep9307.c +++
> b/arch/arm/mach-ep93xx/vision_ep9307.c @@ -242,7 +242,7 @@ static
> struct spi_board_info vision_spi_board_info[] __initdata = { };
>
> static struct gpiod_lookup_table vision_spi_cs_gpio_table = {
> - .dev_id = "ep93xx-spi.0",
> + .dev_id = "spi0",
> .table = {
> GPIO_LOOKUP_IDX("A", 6, "cs", 0, GPIO_ACTIVE_LOW),
> GPIO_LOOKUP_IDX("A", 7, "cs", 1, GPIO_ACTIVE_LOW),
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH RFC 03/14] drivers: irqchip: add PDC irqdomain for wakeup capable GPIOs
From: Marc Zyngier @ 2019-09-02 8:21 UTC (permalink / raw)
To: Lina Iyer
Cc: swboyd, evgreen, linus.walleij, linux-kernel, linux-arm-msm,
bjorn.andersson, mkshah, linux-gpio, rnayak
In-Reply-To: <20190830155853.GA5224@codeaurora.org>
On 30/08/2019 16:58, Lina Iyer wrote:
> On Fri, Aug 30 2019 at 08:50 -0600, Marc Zyngier wrote:
>> [Please use my kernel.org address in the future. The days of this
>> arm.com address are numbered...]
>>
> Sure, will update and repost.
>
>> On 29/08/2019 19:11, Lina Iyer wrote:
>>> Introduce a new domain for wakeup capable GPIOs. The domain can be
>>> requested using the bus token DOMAIN_BUS_WAKEUP. In the following
>>> patches, we will specify PDC as the wakeup-parent for the TLMM GPIO
>>> irqchip. Requesting a wakeup GPIO will setup the GPIO and the
>>> corresponding PDC interrupt as its parent.
>>>
>>> Co-developed-by: Stephen Boyd <swboyd@chromium.org>
>>> Signed-off-by: Lina Iyer <ilina@codeaurora.org>
>>> ---
>>> drivers/irqchip/qcom-pdc.c | 104 ++++++++++++++++++++++++++++++++---
>>> include/linux/soc/qcom/irq.h | 34 ++++++++++++
>>> 2 files changed, 129 insertions(+), 9 deletions(-)
>>> create mode 100644 include/linux/soc/qcom/irq.h
>>>
[...]
>>> diff --git a/include/linux/soc/qcom/irq.h b/include/linux/soc/qcom/irq.h
>>> new file mode 100644
>>> index 000000000000..73239917dc38
>>> --- /dev/null
>>> +++ b/include/linux/soc/qcom/irq.h
>>> @@ -0,0 +1,34 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +
>>> +#ifndef __QCOM_IRQ_H
>>> +#define __QCOM_IRQ_H
>>> +
>>> +#include <linux/irqdomain.h>
>>> +
>>> +#define GPIO_NO_WAKE_IRQ ~0U
>>> +
>>> +/**
>>> + * QCOM specific IRQ domain flags that distinguishes the handling of wakeup
>>> + * capable interrupts by different interrupt controllers.
>>> + *
>>> + * IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP: Line must be masked at TLMM and the
>>> + * interrupt configuration is done at PDC
>>> + * IRQ_DOMAIN_FLAG_QCOM_MPM_WAKEUP: Interrupt configuration is handled at TLMM
>>> + */
>>> +#define IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP (1 << 17)
>>> +#define IRQ_DOMAIN_FLAG_QCOM_MPM_WAKEUP (1 << 18)
>>
>> Any reason why you're starting at bit 17? The available range in from
>> bit 16... But overall, it would be better if you expressed it as:
>>
>> #define IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP (IRQ_DOMAIN_FLAG_NONCORE << 0)
>> #define IRQ_DOMAIN_FLAG_QCOM_MPM_WAKEUP (IRQ_DOMAIN_FLAG_NONCORE << 1)
>>
> Okay.
>
>>> +
>>> +/**
>>> + * irq_domain_qcom_handle_wakeup: Return if the domain handles interrupt
>>> + * configuration
>>> + * @parent: irq domain
>>> + *
>>> + * This QCOM specific irq domain call returns if the interrupt controller
>>> + * requires the interrupt be masked at the child interrupt controller.
>>> + */
>>> +static inline bool irq_domain_qcom_handle_wakeup(struct irq_domain *parent)
>>> +{
>>> + return (parent->flags & IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP);
>>> +}
>>> +
>>> +#endif
>>>
>>
>> But most of this file isn't used by this patch, so maybe it should be
>> moved somewhere else...
>>
> Apart from creating the domain, this is not used here, but a separate
> patch seemed excessive. Let me know if you have any suggestions.
My personal preference would be to move it into the patch that actually
makes use of this.
M.
--
Jazz is not dead, it just smells funny...
^ permalink raw reply
* Re: [PATCH v2 1/2] gpio: acpi: add quirk to override GpioInt polarity
From: Andy Shevchenko @ 2019-09-02 10:01 UTC (permalink / raw)
To: Peter Cai
Cc: Rafael J. Wysocki, Len Brown, Mika Westerberg, Linus Walleij,
Bartosz Golaszewski, Bastien Nocera, Dmitry Torokhov, linux-gpio,
linux-acpi, linux-kernel, linux-input
In-Reply-To: <20190831030916.13172-1-peter@typeblog.net>
On Sat, Aug 31, 2019 at 11:09:14AM +0800, Peter Cai wrote:
> On GPD P2 Max, the firmware could not reset the touch panel correctly.
> The kernel needs to take on the job instead, but the GpioInt definition
> in DSDT specifies ActiveHigh while the GPIO pin should actually be
> ActiveLow.
>
> We need to override the polarity defined by DSDT. The GPIO driver
> already allows defining polarity in acpi_gpio_params, but the option is
> not applied to GpioInt.
>
> This patch adds a new quirk that enables the polarity specified in
> acpi_gpio_params to also be applied to GpioInt.
Thank you for an update!
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
on the condition that Dmitry and other input / Goodix developers are okay with
the approach in general.
>
> Signed-off-by: Peter Cai <peter@typeblog.net>
> ---
>
> v2: rebased to gpio/for-next, moved quirk out of the gpioint
> conditional.
> ---
> drivers/gpio/gpiolib-acpi.c | 9 +++++++++
> include/linux/gpio/consumer.h | 6 ++++++
> 2 files changed, 15 insertions(+)
>
> diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> index fdee8afa5339..ab16ea61a8fa 100644
> --- a/drivers/gpio/gpiolib-acpi.c
> +++ b/drivers/gpio/gpiolib-acpi.c
> @@ -603,6 +603,15 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
> lookup->info.flags = acpi_gpio_to_gpiod_flags(agpio);
> lookup->info.polarity = lookup->active_low;
> }
> +
> + /*
> + * Override the polarity specified by GpioInt if
> + * ACPI_GPIO_QUIRK_OVERRIDE_POLARITY is set.
> + */
> + if (lookup->info.quirks & ACPI_GPIO_QUIRK_OVERRIDE_POLARITY) {
> + dev_warn(&lookup->info.adev->dev, FW_BUG "Incorrect polarity specified by GpioInt, overriding.\n");
> + lookup->info.polarity = lookup->active_low;
> + }
> }
>
> return 1;
> diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
> index b70af921c614..7e9f24ebb085 100644
> --- a/include/linux/gpio/consumer.h
> +++ b/include/linux/gpio/consumer.h
> @@ -622,6 +622,12 @@ struct acpi_gpio_mapping {
> * get GpioIo type explicitly, this quirk may be used.
> */
> #define ACPI_GPIO_QUIRK_ONLY_GPIOIO BIT(1)
> +/*
> + * Use the GPIO polarity (ActiveHigh / ActiveLow) from acpi_gpio_params
> + * for GpioInt as well. The default behavior is to use the one specified
> + * by GpioInt, which can be incorrect on some devices.
> + */
> +#define ACPI_GPIO_QUIRK_OVERRIDE_POLARITY BIT(2)
>
> unsigned int quirks;
> };
> --
> 2.23.0
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH v2 2/2] touchscreen: goodix: define GPIO mapping for GPD P2 Max
From: Andy Shevchenko @ 2019-09-02 10:04 UTC (permalink / raw)
To: Peter Cai
Cc: Rafael J. Wysocki, Len Brown, Mika Westerberg, Linus Walleij,
Bartosz Golaszewski, Bastien Nocera, Dmitry Torokhov, linux-gpio,
linux-acpi, linux-kernel, linux-input
In-Reply-To: <20190831030916.13172-2-peter@typeblog.net>
On Sat, Aug 31, 2019 at 11:09:15AM +0800, Peter Cai wrote:
> The firmware of GPD P2 Max could not handle panel resets although code
> is present in DSDT. The kernel needs to take on this job instead, but
> the DSDT does not provide _DSD, rendering kernel helpless when trying to
> find the respective GPIO pins.
>
> Fortunately, this time GPD has proper DMI vendor / product strings that
> we could match against. We simply apply an acpi_gpio_mapping table when
> GPD P2 Max is matched.
>
> Additionally, the DSDT definition of the irq pin specifies a wrong
> polarity. The new quirk introduced in the previous patch
> (ACPI_GPIO_QUIRK_OVERRIDE_POLARITY) is applied to correct this.
FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
though one comment below.
>
> Signed-off-by: Peter Cai <peter@typeblog.net>
> ---
>
> v2: removed '#ifdef CONFIG_ACPI' as per suggestion. The #ifdef guards
> for CONFIG_DMI is kept for consistency with the other dmi_system_id
> definition in the same file.
> ---
> drivers/input/touchscreen/goodix.c | 31 ++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
> index 5178ea8b5f30..df476f7dcd95 100644
> --- a/drivers/input/touchscreen/goodix.c
> +++ b/drivers/input/touchscreen/goodix.c
> @@ -144,6 +144,31 @@ static const struct dmi_system_id rotated_screen[] = {
> {}
> };
>
> +static const struct acpi_gpio_params irq_gpios_default = { 0, 0, false };
> +static const struct acpi_gpio_params reset_gpios_default = { 1, 0, false };
> +static const struct acpi_gpio_mapping gpio_mapping_force_irq_active_high[] = {
> + { "irq-gpios", &irq_gpios_default, 1, ACPI_GPIO_QUIRK_OVERRIDE_POLARITY },
> + { "reset-gpios", &reset_gpios_default, 1 },
> + {}
> +};
> +
> +/*
> + * Devices that need acpi_gpio_mapping to function correctly
> + */
> +static const struct dmi_system_id need_gpio_mapping[] = {
> +#if defined(CONFIG_DMI) && defined(CONFIG_X86)
> + {
> + .ident = "GPD P2 Max",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "GPD"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "P2 MAX")
> + },
> + .driver_data = &gpio_mapping_force_irq_active_high
> + },
> +#endif
> + {}
> +};
> +
> /**
> * goodix_i2c_read - read data from a register of the i2c slave device.
> *
> @@ -795,6 +820,12 @@ static int goodix_ts_probe(struct i2c_client *client,
> {
> struct goodix_ts_data *ts;
> int error;
> + struct dmi_system_id *dmi_match;
I guess it should be const as kbuild bot complained on v1.
And perhaps you want to keep reverse xmas tree order in definition block:
const struct dmi_system_id *dmi_match;
struct goodix_ts_data *ts;
int error;
> +
> + dmi_match = dmi_first_match(need_gpio_mapping);
> + if (dmi_match)
> + devm_acpi_dev_add_driver_gpios(&client->dev,
> + dmi_match->driver_data);
>
> dev_dbg(&client->dev, "I2C Address: 0x%02x\n", client->addr);
>
> --
> 2.23.0
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Applied "spi: ep93xx: Repair SPI CS lookup tables" to the spi tree
From: Mark Brown @ 2019-09-02 12:24 UTC (permalink / raw)
To: Alexander Sverdlin
Cc: Hartley Sweeten, Linus Walleij, linux-arm-kernel, linux-gpio,
linux-spi, Lukasz Majewski, Mark Brown, Russell King, stable
In-Reply-To: <20190831180402.10008-1-alexander.sverdlin@gmail.com>
The patch
spi: ep93xx: Repair SPI CS lookup tables
has been applied to the spi tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-5.4
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
From 4fbc485324d2975c54201091dfad0a7dd4902324 Mon Sep 17 00:00:00 2001
From: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Date: Sat, 31 Aug 2019 20:04:02 +0200
Subject: [PATCH] spi: ep93xx: Repair SPI CS lookup tables
The actual device name of the SPI controller being registered on EP93xx is
"spi0" (as seen by gpiod_find_lookup_table()). This patch fixes all
relevant lookup tables and the following failure (seen on EDB9302):
ep93xx-spi ep93xx-spi.0: failed to register SPI master
ep93xx-spi: probe of ep93xx-spi.0 failed with error -22
Fixes: 1dfbf334f1236 ("spi: ep93xx: Convert to use CS GPIO descriptors")
Cc: stable@vger.kernel.org
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Link: https://lore.kernel.org/r/20190831180402.10008-1-alexander.sverdlin@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
arch/arm/mach-ep93xx/edb93xx.c | 2 +-
arch/arm/mach-ep93xx/simone.c | 2 +-
arch/arm/mach-ep93xx/ts72xx.c | 4 ++--
arch/arm/mach-ep93xx/vision_ep9307.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index 1f0da76a39de..7b7280c21ee0 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -103,7 +103,7 @@ static struct spi_board_info edb93xx_spi_board_info[] __initdata = {
};
static struct gpiod_lookup_table edb93xx_spi_cs_gpio_table = {
- .dev_id = "ep93xx-spi.0",
+ .dev_id = "spi0",
.table = {
GPIO_LOOKUP("A", 6, "cs", GPIO_ACTIVE_LOW),
{ },
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c
index e2658e22bba1..8a53b74dc4b2 100644
--- a/arch/arm/mach-ep93xx/simone.c
+++ b/arch/arm/mach-ep93xx/simone.c
@@ -73,7 +73,7 @@ static struct spi_board_info simone_spi_devices[] __initdata = {
* v1.3 parts will still work, since the signal on SFRMOUT is automatic.
*/
static struct gpiod_lookup_table simone_spi_cs_gpio_table = {
- .dev_id = "ep93xx-spi.0",
+ .dev_id = "spi0",
.table = {
GPIO_LOOKUP("A", 1, "cs", GPIO_ACTIVE_LOW),
{ },
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 582e06e104fd..e0e1b11032f1 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -267,7 +267,7 @@ static struct spi_board_info bk3_spi_board_info[] __initdata = {
* goes through CPLD
*/
static struct gpiod_lookup_table bk3_spi_cs_gpio_table = {
- .dev_id = "ep93xx-spi.0",
+ .dev_id = "spi0",
.table = {
GPIO_LOOKUP("F", 3, "cs", GPIO_ACTIVE_LOW),
{ },
@@ -316,7 +316,7 @@ static struct spi_board_info ts72xx_spi_devices[] __initdata = {
};
static struct gpiod_lookup_table ts72xx_spi_cs_gpio_table = {
- .dev_id = "ep93xx-spi.0",
+ .dev_id = "spi0",
.table = {
/* DIO_17 */
GPIO_LOOKUP("F", 2, "cs", GPIO_ACTIVE_LOW),
diff --git a/arch/arm/mach-ep93xx/vision_ep9307.c b/arch/arm/mach-ep93xx/vision_ep9307.c
index a88a1d807b32..cbcba3136d74 100644
--- a/arch/arm/mach-ep93xx/vision_ep9307.c
+++ b/arch/arm/mach-ep93xx/vision_ep9307.c
@@ -242,7 +242,7 @@ static struct spi_board_info vision_spi_board_info[] __initdata = {
};
static struct gpiod_lookup_table vision_spi_cs_gpio_table = {
- .dev_id = "ep93xx-spi.0",
+ .dev_id = "spi0",
.table = {
GPIO_LOOKUP_IDX("A", 6, "cs", 0, GPIO_ACTIVE_LOW),
GPIO_LOOKUP_IDX("A", 7, "cs", 1, GPIO_ACTIVE_LOW),
--
2.20.1
^ permalink raw reply related
* [PATCH v3 1/2] gpio: acpi: add quirk to override GpioInt polarity
From: Peter Cai @ 2019-09-02 12:43 UTC (permalink / raw)
Cc: Peter Cai, Andy Shevchenko, Mika Westerberg, Linus Walleij,
Bartosz Golaszewski, Bastien Nocera, Dmitry Torokhov, linux-gpio,
linux-acpi, linux-kernel, linux-input
In-Reply-To: <20190831030916.13172-1-peter@typeblog.net>
On GPD P2 Max, the firmware could not reset the touch panel correctly.
The kernel needs to take on the job instead, but the GpioInt definition
in DSDT specifies ActiveHigh while the GPIO pin should actually be
ActiveLow.
We need to override the polarity defined by DSDT. The GPIO driver
already allows defining polarity in acpi_gpio_params, but the option is
not applied to GpioInt.
This patch adds a new quirk that enables the polarity specified in
acpi_gpio_params to also be applied to GpioInt.
Signed-off-by: Peter Cai <peter@typeblog.net>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: rebased to gpio/for-next, moved quirk out of the gpioint
conditional.
v3: no change, series update.
---
drivers/gpio/gpiolib-acpi.c | 9 +++++++++
include/linux/gpio/consumer.h | 6 ++++++
2 files changed, 15 insertions(+)
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index fdee8afa5339..ab16ea61a8fa 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -603,6 +603,15 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
lookup->info.flags = acpi_gpio_to_gpiod_flags(agpio);
lookup->info.polarity = lookup->active_low;
}
+
+ /*
+ * Override the polarity specified by GpioInt if
+ * ACPI_GPIO_QUIRK_OVERRIDE_POLARITY is set.
+ */
+ if (lookup->info.quirks & ACPI_GPIO_QUIRK_OVERRIDE_POLARITY) {
+ dev_warn(&lookup->info.adev->dev, FW_BUG "Incorrect polarity specified by GpioInt, overriding.\n");
+ lookup->info.polarity = lookup->active_low;
+ }
}
return 1;
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index b70af921c614..7e9f24ebb085 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -622,6 +622,12 @@ struct acpi_gpio_mapping {
* get GpioIo type explicitly, this quirk may be used.
*/
#define ACPI_GPIO_QUIRK_ONLY_GPIOIO BIT(1)
+/*
+ * Use the GPIO polarity (ActiveHigh / ActiveLow) from acpi_gpio_params
+ * for GpioInt as well. The default behavior is to use the one specified
+ * by GpioInt, which can be incorrect on some devices.
+ */
+#define ACPI_GPIO_QUIRK_OVERRIDE_POLARITY BIT(2)
unsigned int quirks;
};
--
2.23.0
^ permalink raw reply related
* [PATCH v3 2/2] touchscreen: goodix: define GPIO mapping for GPD P2 Max
From: Peter Cai @ 2019-09-02 12:43 UTC (permalink / raw)
Cc: Peter Cai, Andy Shevchenko, Mika Westerberg, Linus Walleij,
Bartosz Golaszewski, Bastien Nocera, Dmitry Torokhov, linux-gpio,
linux-acpi, linux-kernel, linux-input
In-Reply-To: <20190902124352.12291-1-peter@typeblog.net>
The firmware of GPD P2 Max could not handle panel resets although code
is present in DSDT. The kernel needs to take on this job instead, but
the DSDT does not provide _DSD, rendering kernel helpless when trying to
find the respective GPIO pins.
Fortunately, this time GPD has proper DMI vendor / product strings that
we could match against. We simply apply an acpi_gpio_mapping table when
GPD P2 Max is matched.
Additionally, the DSDT definition of the irq pin specifies a wrong
polarity. The new quirk introduced in the previous patch
(ACPI_GPIO_QUIRK_OVERRIDE_POLARITY) is applied to correct this.
Signed-off-by: Peter Cai <peter@typeblog.net>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: removed '#ifdef CONFIG_ACPI' as per suggestion. The #ifdef guards
for CONFIG_DMI is kept for consistency with the other dmi_system_id
definition in the same file.
v3: minor style adjustments. Added 'const' to dmi_match and moved it in
reverse xmas tree order as per suggestion.
---
drivers/input/touchscreen/goodix.c | 31 ++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index 5178ea8b5f30..49ce478c1134 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -144,6 +144,31 @@ static const struct dmi_system_id rotated_screen[] = {
{}
};
+static const struct acpi_gpio_params irq_gpios_default = { 0, 0, false };
+static const struct acpi_gpio_params reset_gpios_default = { 1, 0, false };
+static const struct acpi_gpio_mapping gpio_mapping_force_irq_active_high[] = {
+ { "irq-gpios", &irq_gpios_default, 1, ACPI_GPIO_QUIRK_OVERRIDE_POLARITY },
+ { "reset-gpios", &reset_gpios_default, 1 },
+ {}
+};
+
+/*
+ * Devices that need acpi_gpio_mapping to function correctly
+ */
+static const struct dmi_system_id need_gpio_mapping[] = {
+#if defined(CONFIG_DMI) && defined(CONFIG_X86)
+ {
+ .ident = "GPD P2 Max",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "GPD"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "P2 MAX")
+ },
+ .driver_data = &gpio_mapping_force_irq_active_high
+ },
+#endif
+ {}
+};
+
/**
* goodix_i2c_read - read data from a register of the i2c slave device.
*
@@ -793,9 +818,15 @@ static void goodix_disable_regulators(void *arg)
static int goodix_ts_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
+ const struct dmi_system_id *dmi_match;
struct goodix_ts_data *ts;
int error;
+ dmi_match = dmi_first_match(need_gpio_mapping);
+ if (dmi_match)
+ devm_acpi_dev_add_driver_gpios(&client->dev,
+ dmi_match->driver_data);
+
dev_dbg(&client->dev, "I2C Address: 0x%02x\n", client->addr);
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
--
2.23.0
^ permalink raw reply related
* Re: [PATCH v2 1/2] gpio: acpi: add quirk to override GpioInt polarity
From: Linus Walleij @ 2019-09-02 13:36 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Peter Cai, Rafael J. Wysocki, Len Brown, Mika Westerberg,
Bartosz Golaszewski, Bastien Nocera, Dmitry Torokhov,
open list:GPIO SUBSYSTEM, ACPI Devel Maling List,
linux-kernel@vger.kernel.org, Linux Input
In-Reply-To: <20190902100141.GW2680@smile.fi.intel.com>
On Mon, Sep 2, 2019 at 12:01 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Sat, Aug 31, 2019 at 11:09:14AM +0800, Peter Cai wrote:
> > On GPD P2 Max, the firmware could not reset the touch panel correctly.
> > The kernel needs to take on the job instead, but the GpioInt definition
> > in DSDT specifies ActiveHigh while the GPIO pin should actually be
> > ActiveLow.
> >
> > We need to override the polarity defined by DSDT. The GPIO driver
> > already allows defining polarity in acpi_gpio_params, but the option is
> > not applied to GpioInt.
> >
> > This patch adds a new quirk that enables the polarity specified in
> > acpi_gpio_params to also be applied to GpioInt.
>
> Thank you for an update!
>
> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> on the condition that Dmitry and other input / Goodix developers are okay with
> the approach in general.
Acked-by: Linus Walleij <linus.walleij@linaro.org>
In case Dmitry needs to merge this.
Or should I simply merge this patch to the GPIO tree?
Yours,
Linus Walleij
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox