- Nov 16, 2020
-
-
Andy Shevchenko authored
It appears that we are using similar code excerpts for ACPI OpRegion and event handling. Deduplicate those excerpts by extracting a new acpi_request_own_gpiod() helper. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
GpioInt() implies input configuration of the pin. Add this to the acpi_gpio_to_gpiod_flags() and make usable for GpioInt(). Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Vasile-Laurentiu Stanimir authored
GpioIo() resources don't contain an initial value for the output pin. Therefore instead of deducting its value solely based on bias field we should deduce that value from the polarity and the bias fields. Typical scenario is, when pin is defined in the table and its polarity, specified in _DSD or via platform code, is defined as active low, in the following call chain: -> acpi_populate_gpio_lookup() -> acpi_gpio_to_gpiod_flags() it will return GPIOD_OUT_HIGH if bias is set no matter if polarity is GPIO_ACTIVE_LOW, so it will return the current level instead of the logical level. Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by:
Vasile-Laurentiu Stanimir <vasile-laurentiu.stanimir@windriver.com> Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
Move acpi_gpio_to_gpiod_flags() upper in the code to allow further refactoring. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
Mika noticed that some code is run under mutex when it doesn't require the lock, like an error code assignment. Move non-critical code outside of critical section. Suggested-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
We didn't take into account the debounce settings supplied by ACPI. This change is targeting the mentioned gap. Reported-by:
Coiby Xu <coiby.xu@gmail.com> Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
Use named item instead of plain integer for enum gpiod_flags to make it clear that even 0 has its own meaning. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
In some cases the GpioInt() resource is coming with bias settings which may affect system functioning. Respect bias settings for GpioInt() resource by calling acpi_gpio_update_gpiod_*flags() API in acpi_dev_gpio_irq_get(). Reported-by:
Jamie McClymont <jamie@kwiius.com> Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
In some cases we would like to have debounce setter which doesn't fail when a feature is not supported by a controller. Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com>
-
Andy Shevchenko authored
This function is useful for internal use in the GPIO library. There will be new user coming, prepare a helper for the new comer and the existing ones. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
Move bias related code from gpio_set_config() to gpio_set_bias(). Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
In the future we will need to have a separate function that takes an arbitrary argument value. Extract gpio_set_config_with_argument() for that purpose. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
Instead of open coded macro use, call pinconf_to_config_packed(). Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
It's no difference in the functionality, but after the change the code is less error prone to various checkers. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
Replace unsigned by unsigned int in GPIO library code. Note, legacy API left untouched. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
intel-pinctrl for v5.10-2 * Respect bias setting when comes from ACPI The following is an automated git shortlog grouped by driver: intel: - Set default bias in case no particular value given - Fix 2 kOhm bias which is 833 Ohm
-
- Nov 12, 2020
-
-
Linus Walleij authored
-
- Nov 11, 2020
-
-
Damien Le Moal authored
Fix the check on the number of IRQs to allow up to the maximum (32) instead of only the maximum minus one. Fixes: 96868dce ("gpio/sifive: Add GPIO driver for SiFive SoCs") Cc: stable@vger.kernel.org Signed-off-by:
Damien Le Moal <damien.lemoal@wdc.com> Link: https://lore.kernel.org/r/20201107081420.60325-10-damien.lemoal@wdc.com Signed-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
- Nov 10, 2020
-
-
Linus Walleij authored
Merge tag 'gpio-fixes-for-v5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into fixes gpio fixes for v5.10-rc3 - fix missing conversion to gpiolib irqchip in gpio-dwapb - fix bank properties for ast2600 variant in gpio-aspeed - make sysfs work again when the character device is disabled - fix interrupt handling in gpio-pcie-idio-24
-
- Nov 06, 2020
-
-
Arnaud de Turckheim authored
This enables the PEX8311 internal PCI wire interrupt and the PEX8311 local interrupt input so the local interrupts are forwarded to the PCI. Fixes: 58556204 ("gpio: Add GPIO support for the ACCES PCIe-IDIO-24 family") Cc: stable@vger.kernel.org Signed-off-by:
Arnaud de Turckheim <quarium@gmail.com> Reviewed-by:
William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Arnaud de Turckheim authored
This fixes the COS Enable Register value for enabling/disabling the corresponding IRQs bank. Fixes: 58556204 ("gpio: Add GPIO support for the ACCES PCIe-IDIO-24 family") Cc: stable@vger.kernel.org Signed-off-by:
Arnaud de Turckheim <quarium@gmail.com> Reviewed-by:
William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Arnaud de Turckheim authored
Fix the bitwise operation to remove only the corresponding bit from the mask. Fixes: 58556204 ("gpio: Add GPIO support for the ACCES PCIe-IDIO-24 family") Cc: stable@vger.kernel.org Signed-off-by:
Arnaud de Turckheim <quarium@gmail.com> Reviewed-by:
William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
- Nov 05, 2020
-
-
Kent Gibson authored
In gpiochip_setup_dev() the call to gpiolib_cdev_register() indirectly calls device_add(). This is still required for the sysfs even when CONFIG_GPIO_CDEV is not selected in the build. Replace the stubbed functions in gpiolib-cdev.h with macros in gpiolib.c that perform the required device_add() and device_del() when CONFIG_GPIO_CDEV is not selected. Fixes: d143493c (gpiolib: make cdev a build option) Reported-by:
Nicolas Schichan <nschichan@freebox.fr> Signed-off-by:
Kent Gibson <warthog618@gmail.com> Tested-by:
Nicolas Schichan <nschichan@freebox.fr> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
- Oct 29, 2020
-
-
Deepak R Varma authored
Address code indentation warning messages by checkpatch script. Combine split function parameters on one line. This also resolves the "use tabs instead of space" warning by checkpatch script. Signed-off-by:
Deepak R Varma <mh12gx2825@gmail.com> Link: https://lore.kernel.org/r/20201013190212.GA85788@ubuntu204 Signed-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
- Oct 28, 2020
-
-
Tony Lindgren authored
This reverts commit 579ced8f . Turns out I was overly optimistic about cpu_pm blocking idle being a solution for handling edge interrupts. While it helps in preventing entering idle states that potentially lose context, we can still get an edge interrupt triggering while entering idle. So we need to also add back the workaround for seeing if there are any pending edge interrupts when waking up. Signed-off-by:
Tony Lindgren <tony@atomide.com> Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: Grygorii Strashko <grygorii.strashko@ti.com> Cc: Keerthy <j-keerthy@ti.com> Cc: Ladislav Michl <ladis@linux-mips.org> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Russell King <rmk+kernel@armlinux.org.uk> Cc: Tero Kristo <t-kristo@ti.com> Link: https://lore.kernel.org/r/20201028060556.56038-1-tony@atomide.com Signed-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Linus Walleij authored
We actually handle the gpio_irq_chip set-up properly now despite what the comment says. Also assign this pointer along with the rest of the gpio_irq_chip setup code. Signed-off-by:
Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20201019134429.65563-1-linus.walleij@linaro.org
-
Linus Walleij authored
Now that all gpiolib irqchip users have been over to use the irqchip template, we can finally retire the old code path and leave just one way in to the irqchip: set up the template when registering the gpio_chip. For a while we had two code paths for this which was a bit confusing. This brings this work to a conclusion, there is now one way of doing this. Signed-off-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Thierry Reding <thierry.reding@gmail.com> Link: https://lore.kernel.org/r/20201019134046.65101-1-linus.walleij@linaro.org
-
Andy Shevchenko authored
Use the new compat_need_64bit_alignment_fixup() helper to avoid ugly ifdeffery in IOCTL compatibility code. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by:
Kent Gibson <warthog618@gmail.com> Depends-on: 527c4125 ("compat: add a compat_need_64bit_alignment_fixup() helper") Link: https://lore.kernel.org/r/20201014103315.82662-1-andriy.shevchenko@linux.intel.com Signed-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Andy Shevchenko authored
First of all, bias has a special type as being a part of enum pin_config_param. Second, 0 is also defined bias which is equivalent to BUS_HOLD. Taking into account above, change type of bias variable and refactor gpio_set_bias() in a way that it doesn't use BUS_HOLD as a place holder. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20201009184359.16427-1-andriy.shevchenko@linux.intel.com Signed-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Kent Gibson authored
Clarify that a char array containing a string is considered 'empty' if the first character is the null terminator. The remaining characters are not relevant to this determination. Signed-off-by:
Kent Gibson <warthog618@gmail.com> Reviewed-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20201005070329.21055-6-warthog618@gmail.com Signed-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Kent Gibson authored
Remove leading whitespace in ABI v1 comment. Signed-off-by:
Kent Gibson <warthog618@gmail.com> Reviewed-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20201005070329.21055-5-warthog618@gmail.com Signed-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Kent Gibson authored
Add kernel-doc formatting to all references to structs, enums, fields and constants, and move deprecation warnings into the Note section of the deprecated struct. Replace 'OR:ed' with 'added', as the former looks odd. Signed-off-by:
Kent Gibson <warthog618@gmail.com> Reviewed-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20201005070329.21055-4-warthog618@gmail.com Signed-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Kent Gibson authored
Make debounce_period_us field documentation consistent with other fields in the union. Signed-off-by:
Kent Gibson <warthog618@gmail.com> Reviewed-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20201005070329.21055-3-warthog618@gmail.com Signed-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
Kent Gibson authored
Fix kernel-doc warnings, specifically gpioline_info_changed.padding is not documented and 'GPIO event types' describes defines, which are not documented by kernel-doc. Signed-off-by:
Kent Gibson <warthog618@gmail.com> Reviewed-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20201005070329.21055-2-warthog618@gmail.com Signed-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
- Oct 26, 2020
-
-
Billy Tsai authored
GPIO_T is mapped to the most significant byte of input/output mask, and the byte in "output" mask should be 0 because GPIO_T is input only. All the other bits need to be 1 because GPIO_Q/R/S support both input and output modes. Fixes: ab4a8553 ("gpio: aspeed: Add in ast2600 details to Aspeed driver") Signed-off-by:
Billy Tsai <billy_tsai@aspeedtech.com> Reviewed-by:
Tao Ren <rentao.bupt@gmail.com> Reviewed-by:
Joel Stanley <joel@jms.id.au> Reviewed-by:
Andrew Jeffery <andrew@aj.id.au> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Jia He authored
Commit 0ea68393 ("gpio: dwapb: Convert driver to using the GPIO-lib-based IRQ-chip") missed the case in dwapb_irq_set_wake(). Without this fix, probing the dwapb gpio driver will hit a error: "address between user and kernel address ranges" on a Ampere armv8a server and cause a panic. Fixes: 0ea68393 ("gpio: dwapb: Convert driver to using the GPIO-lib-based IRQ-chip") Signed-off-by:
Jia He <justin.he@arm.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by:
Serge Semin <fancer.lancer@gmail.com> Signed-off-by:
Bartosz Golaszewski <bgolaszewski@baylibre.com>
-
Andy Shevchenko authored
When GPIO library asks pin control to set the bias, it doesn't pass any value of it and argument is considered boolean (and this is true for ACPI GpioIo() / GpioInt() resources, by the way). Thus, individual drivers must behave well, when they got the resistance value of 1 Ohm, i.e. transforming it to sane default. In case of Intel pin control hardware the 5 kOhm sounds plausible because on one hand it's a minimum of resistors present in all hardware generations and at the same time it's high enough to minimize leakage current (will be only 200 uA with the above choice). Fixes: e57725ea ("pinctrl: intel: Add support for hardware debouncer") Reported-by:
Jamie McClymont <jamie@kwiius.com> Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Andy Shevchenko authored
2 kOhm bias was never an option in Intel GPIO hardware, the available matrix is: 000 none 001 1 kOhm (if available) 010 5 kOhm 100 20 kOhm As easy to get the 3 resistors are gated separately and according to parallel circuits calculations we may get combinations of the above where the result is always strictly less than minimal resistance. Hence, additional values can be: 011 ~833.3 Ohm 101 ~952.4 Ohm 110 ~4 kOhm 111 ~800 Ohm That said, convert TERM definitions to be the bit masks to reflect the above. While at it, enable the same setting for pull down case. Fixes: 7981c001 ("pinctrl: intel: Add Intel Sunrisepoint pin controller and GPIO support") Cc: Jamie McClymont <jamie@kwiius.com> Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Mika Westerberg <mika.westerberg@linux.intel.com>
-
Linus Torvalds authored
-
Joe Perches authored
Use a more generic form for __section that requires quotes to avoid complications with clang and gcc differences. Remove the quote operator # from compiler_attributes.h __section macro. Convert all unquoted __section(foo) uses to quoted __section("foo"). Also convert __attribute__((section("foo"))) uses to __section("foo") even if the __attribute__ has multiple list entry forms. Conversion done using the script at: https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.camel@perches.com/2-convert_section.pl Signed-off-by:
Joe Perches <joe@perches.com> Reviewed-by:
Nick Desaulniers <ndesaulniers@gooogle.com> Reviewed-by:
Miguel Ojeda <ojeda@kernel.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-