1. 09 7月, 2020 1 次提交
  2. 08 7月, 2020 10 次提交
    • L
      Merge branch 'lee-fixes' into devel · a6175e89
      Linus Walleij 提交于
      a6175e89
    • L
      gpio: gpio-mlxbf2.c: Provide __releases() annotation to stop confusing Sparse · a7a9ad23
      Lee Jones 提交于
      Sparse cannot peer into other functions to see when and if locks are
      acquired and released, thus it simply warns that a 'context imbalance'
      is detected instead.  Let's be kind to Sparse and let it know that
      this behaviour is intentional.
      
       drivers/gpio/gpio-mlxbf2.c:125:12: warning: context imbalance in 'mlxbf2_gpio_lock_acquire' - different lock contexts for basic block
       drivers/gpio/gpio-mlxbf2.c:151:13: warning: context imbalance in 'mlxbf2_gpio_lock_release' - unexpected unlock
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Reviewed-by: NAsmaa Mnebhi <asmaa@mellanox.com>
      Cc: Asmaa Mnebhi <Asmaa@mellanox.com>
      Link: https://lore.kernel.org/r/20200630133345.2232932-11-lee.jones@linaro.orgSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
      a7a9ad23
    • L
      gpio: gpio-mlxbf2: Tell the compiler that ACPI functions may not be use · 2f9bce5f
      Lee Jones 提交于
      ... as is the case when !CONFIG_ACPI.
      
      Fixes the following W=1 kernel build warning:
      
       drivers/gpio/gpio-mlxbf2.c:312:36: warning: ‘mlxbf2_gpio_acpi_match’ defined but not used [-Wunused-const-variable=]
       312 | static const struct acpi_device_id mlxbf2_gpio_acpi_match[] = {
       | ^~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Reviewed-by: NAsmaa Mnebhi <asmaa@mellanox.com>
      Cc: Asmaa Mnebhi <Asmaa@mellanox.com>
      Link: https://lore.kernel.org/r/20200630133345.2232932-10-lee.jones@linaro.orgSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
      2f9bce5f
    • L
      gpio: gpio-mlxbf: Tell the compiler that ACPI functions may not be used · 6ac2de95
      Lee Jones 提交于
      ... as is the case when !CONFIG_ACPI.
      
      Fixes the following W=1 kernel build warning:
      
       drivers/gpio/gpio-mlxbf.c:130:36: warning: ‘mlxbf_gpio_acpi_match’ defined but not used [-Wunused-const-variable=]
       130 | static const struct acpi_device_id mlxbf_gpio_acpi_match[] = {
       | ^~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Cc: Shravan Kumar Ramani <sramani@mellanox.com>
      Link: https://lore.kernel.org/r/20200630133345.2232932-9-lee.jones@linaro.orgSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
      6ac2de95
    • L
      gpio: gpio-it87: Fix formatting issues which confuse kerneldoc · 4e291290
      Lee Jones 提交于
      Kerneldoc expects struct properties to be documented using the syntax
      '@.*: ', but no ':' has been provided in 'struct it87_gpio's
      header.  Add them to stop confusing kerneldoc.
      
      Fixes the following W=1 warnings:
      
       drivers/gpio/gpio-it87.c:69: warning: Function parameter or member 'chip' not described in 'it87_gpio'
       drivers/gpio/gpio-it87.c:69: warning: Function parameter or member 'lock' not described in 'it87_gpio'
       drivers/gpio/gpio-it87.c:69: warning: Function parameter or member 'io_base' not described in 'it87_gpio'
       drivers/gpio/gpio-it87.c:69: warning: Function parameter or member 'io_size' not described in 'it87_gpio'
       drivers/gpio/gpio-it87.c:69: warning: Function parameter or member 'output_base' not described in 'it87_gpio'
       drivers/gpio/gpio-it87.c:69: warning: Function parameter or member 'simple_base' not described in 'it87_gpio'
       drivers/gpio/gpio-it87.c:69: warning: Function parameter or member 'simple_size' not described in 'it87_gpio'
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Cc: "Diego Elio Pettenò" <flameeyes@flameeyes.eu>
      Link: https://lore.kernel.org/r/20200630133345.2232932-8-lee.jones@linaro.orgSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
      4e291290
    • L
      gpio: gpio-syscon: Fix formatting issues which confuse kerneldoc · 5f3beb67
      Lee Jones 提交于
      Kerneldoc expects struct properties to be documented using the syntax
      '@.*: ', but no '@' has been provided in 'struct syscon_gpio_data's
      header.  Add them to stop confusing kerneldoc.
      
      Fixes the following W=1 warnings:
      
       drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'compatible' not described in 'syscon_gpio_data'
       drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'flags' not described in 'syscon_gpio_data'
       drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'bit_count' not described in 'syscon_gpio_data'
       drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'dat_bit_offset' not described in 'syscon_gpio_data'
       drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'dir_bit_offset' not described in 'syscon_gpio_data'
       drivers/gpio/gpio-syscon.c:48: warning: Function parameter or member 'set' not described in 'syscon_gpio_data'
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Cc: Alexander Shiyan <shc_work@mail.ru>
      Link: https://lore.kernel.org/r/20200630133345.2232932-7-lee.jones@linaro.orgSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
      5f3beb67
    • L
      gpio: gpio-sama5d2-piobu: Demote all kerneldoc headers to basic comment blocks · 392a5846
      Lee Jones 提交于
      No attempt has been made to provide proper descriptions for each of
      the function arguments throughout the file.  Simply demote all
      kerneldoc headers to basic function headers.
      
      Fixes the following W=1 kernel build warnings:
      
       drivers/gpio/gpio-sama5d2-piobu.c:59: warning: Function parameter or member 'chip' not described in 'sama5d2_piobu_setup_pin'
       drivers/gpio/gpio-sama5d2-piobu.c:59: warning: Function parameter or member 'pin' not described in 'sama5d2_piobu_setup_pin'
       drivers/gpio/gpio-sama5d2-piobu.c:81: warning: Function parameter or member 'chip' not described in 'sama5d2_piobu_write_value'
       drivers/gpio/gpio-sama5d2-piobu.c:81: warning: Function parameter or member 'pin' not described in 'sama5d2_piobu_write_value'
       drivers/gpio/gpio-sama5d2-piobu.c:81: warning: Function parameter or member 'mask' not described in 'sama5d2_piobu_write_value'
       drivers/gpio/gpio-sama5d2-piobu.c:81: warning: Function parameter or member 'value' not described in 'sama5d2_piobu_write_value'
       drivers/gpio/gpio-sama5d2-piobu.c:97: warning: Function parameter or member 'chip' not described in 'sama5d2_piobu_read_value'
       drivers/gpio/gpio-sama5d2-piobu.c:97: warning: Function parameter or member 'pin' not described in 'sama5d2_piobu_read_value'
       drivers/gpio/gpio-sama5d2-piobu.c:97: warning: Function parameter or member 'mask' not described in 'sama5d2_piobu_read_value'
       drivers/gpio/gpio-sama5d2-piobu.c:116: warning: Function parameter or member 'chip' not described in 'sama5d2_piobu_get_direction'
       drivers/gpio/gpio-sama5d2-piobu.c:116: warning: Function parameter or member 'pin' not described in 'sama5d2_piobu_get_direction'
       drivers/gpio/gpio-sama5d2-piobu.c:131: warning: Function parameter or member 'chip' not described in 'sama5d2_piobu_direction_input'
       drivers/gpio/gpio-sama5d2-piobu.c:131: warning: Function parameter or member 'pin' not described in 'sama5d2_piobu_direction_input'
       drivers/gpio/gpio-sama5d2-piobu.c:140: warning: Function parameter or member 'chip' not described in 'sama5d2_piobu_direction_output'
       drivers/gpio/gpio-sama5d2-piobu.c:140: warning: Function parameter or member 'pin' not described in 'sama5d2_piobu_direction_output'
       drivers/gpio/gpio-sama5d2-piobu.c:140: warning: Function parameter or member 'value' not described in 'sama5d2_piobu_direction_output'
       drivers/gpio/gpio-sama5d2-piobu.c:154: warning: Function parameter or member 'chip' not described in 'sama5d2_piobu_get'
       drivers/gpio/gpio-sama5d2-piobu.c:154: warning: Function parameter or member 'pin' not described in 'sama5d2_piobu_get'
       drivers/gpio/gpio-sama5d2-piobu.c:174: warning: Function parameter or member 'chip' not described in 'sama5d2_piobu_set'
       drivers/gpio/gpio-sama5d2-piobu.c:174: warning: Function parameter or member 'pin' not described in 'sama5d2_piobu_set'
       drivers/gpio/gpio-sama5d2-piobu.c:174: warning: Function parameter or member 'value' not described in 'sama5d2_piobu_set'
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com>
      Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
      Cc: Andrei Stefanescu <andrei.stefanescu@microchip.com>
      Link: https://lore.kernel.org/r/20200630133345.2232932-6-lee.jones@linaro.orgSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
      392a5846
    • L
      gpio: gpio-pmic-eic-sprd: Fix incorrectly named property 'map' · 3cd7f770
      Lee Jones 提交于
      A good attempt has been made to properly document 'struct
      sprd_pmic_eic', but 'map' has been incorrectly described as
      'regmap' since the driver's inception in 2018.
      
      Fixes the following W=1 kernel build warning:
      
       drivers/gpio/gpio-pmic-eic-sprd.c:65: warning: Function parameter or member 'map' not described in 'sprd_pmic_eic'
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Reviewed-by: NBaolin Wang <baolin.wang7@gmail.com>
      Cc: Orson Zhai <orsonzhai@gmail.com>
      Cc: Baolin Wang <baolin.wang7@gmail.com>
      Cc: Chunyan Zhang <zhang.lyra@gmail.com>
      Link: https://lore.kernel.org/r/20200630133345.2232932-5-lee.jones@linaro.orgSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
      3cd7f770
    • L
      gpio: gpio-altera: Add missing kerneldoc entry and demote comment · 670647d7
      Lee Jones 提交于
      'struct altera_gpio_chip's 'irq_chip' property is undocumented.  So
      add property description to the struct's kerneldoc header.  Also
      demote comment block which is clearly not in kerneldoc format.
      
      Fixes the following W=1 warnings:
      
       drivers/gpio/gpio-altera.c:34: warning: Function parameter or member 'irq_chip' not described in 'altera_gpio_chip'
       drivers/gpio/gpio-altera.c:78: warning: Function parameter or member 'd' not described in 'altera_gpio_irq_set_type'
       drivers/gpio/gpio-altera.c:78: warning: Function parameter or member 'type' not described in 'altera_gpio_irq_set_type'
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Cc: Joyce Ooi <joyce.ooi@intel.com>
      Cc: Tien Hock Loh <thloh@altera.com>
      Link: https://lore.kernel.org/r/20200630133345.2232932-3-lee.jones@linaro.orgSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
      670647d7
    • L
      gpio: gpiolib-of: Provide documentation for of_gpio_spi_cs_get_count() · c5a66b97
      Lee Jones 提交于
      Descriptions for of_gpio_spi_cs_get_count()'s 2 arguments are
      missing.  Document both 'dev' and 'con_id'.
      
      Fixes the following W=1 kernel build warnings:
      
       drivers/gpio/gpiolib-of.c:36: warning: Function parameter or member 'dev' not described in 'of_gpio_spi_cs_get_count'
       drivers/gpio/gpiolib-of.c:36: warning: Function parameter or member 'con_id' not described in 'of_gpio_spi_cs_get_count'
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
      Link: https://lore.kernel.org/r/20200630133345.2232932-2-lee.jones@linaro.orgSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
      c5a66b97
  3. 07 7月, 2020 3 次提交
  4. 01 7月, 2020 1 次提交
    • L
      Merge tag 'gpio-updates-for-v5.9-part1' of... · b239e445
      Linus Walleij 提交于
      Merge tag 'gpio-updates-for-v5.9-part1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel
      
      gpio updates for v5.9
      
      - use kobj_to_dev() in sysfs interface
      - kerneldoc and documentation fixes
      - relax the interrupt flags in gpio-mpc8xxx
      - support new model in gpio-pca953x
      - remove a redundant check from gpio-max732x
      - support a new platform in gpio-zynq (+ some minor fixes)
      - don't depend on GPIOLIB when already inside the "if GPIOLIB" in Kconfig
      - support PM ops for suspend in gpio-omap
      - minor tweaks in gpiolib
      b239e445
  5. 30 6月, 2020 2 次提交
  6. 27 6月, 2020 1 次提交
  7. 24 6月, 2020 8 次提交
  8. 23 6月, 2020 2 次提交
  9. 21 6月, 2020 8 次提交
  10. 16 6月, 2020 4 次提交
    • A
      gpio: pca953x: disable regmap locking for automatic address incrementing · ec3decd2
      Andy Shevchenko 提交于
      It's a repetition of the commit aa58a21a
        ("gpio: pca953x: disable regmap locking")
      which states the following:
      
        This driver uses its own locking but regmap silently uses
        a mutex for all operations too. Add the option to disable
        locking to the regmap config struct.
      
      Fixes: bcf41dc4 ("gpio: pca953x: fix handling of automatic address incrementing")
      Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Reviewed-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      ec3decd2
    • A
      gpio: pca953x: Fix direction setting when configure an IRQ · 0b22c25e
      Andy Shevchenko 提交于
      The commit 0f25fda8 ("gpio: pca953x: Zap ad-hoc reg_direction cache")
      seems inadvertently made a typo in pca953x_irq_bus_sync_unlock().
      
      When the direction bit is 1 it means input, and the piece of code in question
      was looking for output ones that should be turned to inputs.
      
      Fix direction setting when configure an IRQ by injecting a bitmap complement
      operation.
      
      Fixes: 0f25fda8 ("gpio: pca953x: Zap ad-hoc reg_direction cache")
      Depends-on: 35d13d94 ("gpio: pca953x: convert to use bitmap API")
      Cc: Marek Vasut <marek.vasut@gmail.com>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      0b22c25e
    • A
      gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2 · ba8c90c6
      Andy Shevchenko 提交于
      ACPI table on Intel Galileo Gen 2 has wrong pin number for IRQ resource
      of one of the I²C GPIO expanders. Since we know what that number is and
      luckily have GPIO bases fixed for SoC's controllers, we may use a simple
      DMI quirk to match the platform and retrieve GpioInt() pin on it for
      the expander in question.
      
      Mika suggested the way to avoid a quirk in the GPIO ACPI library and
      here is the second, almost rewritten version of it.
      
      Fixes: f32517bf ("gpio: pca953x: support ACPI devices found on Galileo Gen2")
      Depends-on: 25e3ef89 ("gpio: acpi: Split out acpi_gpio_get_irq_resource() helper")
      Suggested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      ba8c90c6
    • A
      gpio: pca953x: Synchronize interrupt handler properly · 064c73af
      Andy Shevchenko 提交于
      Since the commit aa58a21a ("gpio: pca953x: disable regmap locking")
      the locking of regmap is disabled and that immediately introduces
      a synchronization issue. It's easy to see when we try to monitor
      more than one interrupt from the same chip.
      
      It seems that the problem exists from the day one and even commit
      6e20fb18 ("drivers/gpio/pca953x.c: add a mutex to fix race condition")
      missed this.
      
      Below are the traces and shell reproducers before and after proposed change.
      Note duplicates in the IRQ events. /proc/interrupts also shows a deviation,
      i.e. sum of children interrupts higher than parent's one.
      
      When locking is disabled for regmap and no protection in IRQ handler
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       ...
       gpioset-194          regmap_hw_write_start: i2c-INT3491:02 reg=2 count=1
       irq/31-i2c-INT3-139  regmap_hw_read_start: i2c-INT3491:02 reg=4c count=2
       gpioset-194          regmap_hw_write_done: i2c-INT3491:02 reg=2 count=1
       gpioset-194          regmap_reg_read_cache: i2c-INT3491:02 reg=6 val=f5
       gpioset-194          regmap_reg_write: i2c-INT3491:02 reg=6 val=f5
       gpioset-194          regmap_hw_write_start: i2c-INT3491:02 reg=6 count=1
       irq/31-i2c-INT3-139  regmap_hw_read_done: i2c-INT3491:02 reg=4c count=2
       ...
      
       % gpiomon gpiochip3 0 &
       % gpioset gpiochip3 1=0
       % gpioset gpiochip3 1=1
       event:  RISING EDGE offset: 0 timestamp: [     302.782583765]
       % gpiomon gpiochip3 2 &
       % gpioset gpiochip3 1=0
       event:  RISING EDGE offset: 2 timestamp: [     312.033148829]
       event: FALLING EDGE offset: 0 timestamp: [     312.022757525]
       % gpioset gpiochip3 1=1
       event:  RISING EDGE offset: 2 timestamp: [     316.201148473]
       event:  RISING EDGE offset: 0 timestamp: [     316.191759599]
      
      When locking is disabled for regmap and protection in IRQ handler
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       ...
       gpioset-202          regmap_hw_write_start: i2c-INT3491:02 reg=2 count=1
       gpioset-202          regmap_hw_write_done: i2c-INT3491:02 reg=2 count=1
       gpioset-202          regmap_reg_read_cache: i2c-INT3491:02 reg=6 val=fd
       gpioset-202          regmap_reg_write: i2c-INT3491:02 reg=6 val=fd
       gpioset-202          regmap_hw_write_start: i2c-INT3491:02 reg=6 count=1
       gpioset-202          regmap_hw_write_done: i2c-INT3491:02 reg=6 count=1
       irq/31-i2c-INT3-139  regmap_hw_read_start: i2c-INT3491:02 reg=4c count=2
       irq/31-i2c-INT3-139  regmap_hw_read_done: i2c-INT3491:02 reg=4c count=2
       ...
      
       % gpiomon gpiochip3 0 &
       % gpioset gpiochip3 1=0
       event: FALLING EDGE offset: 0 timestamp: [     531.330078107]
       % gpioset gpiochip3 1=1
       event:  RISING EDGE offset: 0 timestamp: [     532.912239128]
       % gpiomon gpiochip3 2 &
       % gpioset gpiochip3 1=0
       event: FALLING EDGE offset: 0 timestamp: [     539.633669484]
       % gpioset gpiochip3 1=1
       event:  RISING EDGE offset: 0 timestamp: [     542.256978461]
      
      Fixes: 6e20fb18 ("drivers/gpio/pca953x.c: add a mutex to fix race condition")
      Depends-on: 35d13d94 ("gpio: pca953x: convert to use bitmap API")
      Depends-on: 49427232 ("gpio: pca953x: Perform basic regmap conversion")
      Cc: Marek Vasut <marek.vasut@gmail.com>
      Cc: Roland Stigge <stigge@antcom.de>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      064c73af