On 8/3/2019 2:42 AM, Linus Walleij wrote:
On Fri, Aug 2, 2019 at 4:51 AM Timur Tabi timur@kernel.org wrote:
On 7/31/19 12:58 PM, Jeffrey Hugo wrote:
static int gpiochip_alloc_valid_mask(struct gpio_chip *gc) { if (IS_ENABLED(CONFIG_OF_GPIO)) gc->need_valid_mask = of_gpio_need_valid_mask(gc); if (!gc->need_valid_mask) return 0;
So this seems wrong on a system with OF and ACPI. It assumes that OF takes priority over ACPI if both are enabled, and that's not true in general. If anything, it's the other way around.
IS_ENABLED(CONFIG_OF_GPIO) is not the correct test to see if OF should be used. I think this should be replaced with the OF equivalent of has_acpi_companion(), but even that might not be enough. Basically, of_gpio_need_valid_mask() should return three values, 0 = don't need it, 1 = does need it, -1 = gpio info is not in OF.
You're absolutely right.
Sboyd hacked up a patch to that effect and I applied it.
I haven't heard if QDF2400 is working again but I'd love to know!
Sorry, was on vacation. Per kernelci[1], looks like things are working.
[1] https://kernelci.org/boot/qcom-qdf2400/