1. 09 9月, 2019 1 次提交
    • J
      ASoC: ams-delta: Take control over audio mute GPIO pins · 73681f4f
      Janusz Krzysztofik 提交于
      Since commit 1137ceee ("ARM: OMAP1: ams-delta: Don't request unused
      GPIOs"), on-board audio has appeared muted.  It has been discovered that
      believed to be unused GPIO pins "hookflash1" and "hookflash2" need to be
      set low for audible sound in handsfree and handset mode respectively.
      
      According to Amstrad E3 wiki, the purpose of both pins hasn't been
      clearly identified.  Original Amstrad software used to produce a high
      pulse on them when the phone was taken off hook or recall was pressed.
      With the current findings, we can assume the pins provide a kind of
      audio mute function, separately for handset and handsfree operation
      modes.
      
      Commit 2afdb4c4 ("ARM: OMAP1: ams-delta: Fix audio permanently
      muted") attempted to fix the issue temporarily by hogging the GPIO pin
      "hookflash1" renamed to "audio_mute", however the fix occurred
      incomplete as it restored audible sound only for handsfree mode.
      
      Stop hogging that pin, rename the pins to "handsfree_mute" and
      "handset_mute" respectively and implement appropriate DAPM event
      callbacks for "Speaker" and "Earpiece" DAPM widgets.
      
      Fixes: 1137ceee ("ARM: OMAP1: ams-delta: Don't request unused GPIOs")
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com>
      Link: https://lore.kernel.org/r/20190907111650.15440-1-jmkrzyszt@gmail.comSigned-off-by: NMark Brown <broonie@kernel.org>
      73681f4f
  2. 19 6月, 2019 1 次提交
  3. 16 4月, 2019 1 次提交
  4. 23 3月, 2019 1 次提交
  5. 06 2月, 2019 1 次提交
    • L
      regulator: fixed/gpio: Pull inversion/OD into gpiolib · 01dc79cd
      Linus Walleij 提交于
      This pushes the handling of inversion semantics and open drain
      settings to the GPIO descriptor and gpiolib. All affected board
      files are also augmented.
      
      This is especially nice since we don't have to have any
      confusing flags passed around to the left and right littering
      the fixed and GPIO regulator drivers and the regulator core.
      It is all just very straight-forward: the core asks the GPIO
      line to be asserted or deasserted and gpiolib deals with the
      rest depending on how the platform is configured: if the line
      is active low, it deals with that, if the line is open drain,
      it deals with that too.
      
      Cc: Alexander Shiyan <shc_work@mail.ru> # i.MX boards user
      Cc: Haojian Zhuang <haojian.zhuang@gmail.com> # MMP2 maintainer
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi> # OMAP1 maintainer
      Cc: Tony Lindgren <tony@atomide.com> # OMAP1,2,3 maintainer
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> # EM-X270 maintainer
      Cc: Robert Jarzmik <robert.jarzmik@free.fr> # EZX maintainer
      Cc: Philipp Zabel <philipp.zabel@gmail.com> # Magician maintainer
      Cc: Petr Cvek <petr.cvek@tul.cz> # Magician
      Cc: Robert Jarzmik <robert.jarzmik@free.fr> # PXA
      Cc: Paul Parsons <lost.distance@yahoo.com> # hx4700
      Cc: Daniel Mack <zonque@gmail.com> # Raumfeld maintainer
      Cc: Marc Zyngier <marc.zyngier@arm.com> # Zeus maintainer
      Cc: Geert Uytterhoeven <geert+renesas@glider.be> # SuperH pinctrl/GPIO maintainer
      Cc: Russell King <rmk+kernel@armlinux.org.uk> # SA1100
      Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Tested-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> #OMAP1 Amstrad Delta
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      01dc79cd
  6. 18 12月, 2018 1 次提交
  7. 14 12月, 2018 1 次提交
  8. 08 12月, 2018 1 次提交
    • J
      ARM: OMAP1: ams-delta: Fix audio permanently muted · 2afdb4c4
      Janusz Krzysztofik 提交于
      Since commit 1137ceee ("ARM: OMAP1: ams-delta: Don't request unused
      GPIOs"), on-board audio has appeared muted.  Believed to be unused GPIO
      pin "hookflash1", apparently set high regardless of the corresponding
      bit of "latch2" port attempted to be set low during .init_machine(),
      has been identified as the reason.
      
      According to Amstrad E3 wiki, the purpose of the pin hasn't been
      clearly identified.  Original Amstrad software used to produce a high
      pulse on it when the phone was taken off hook or recall was pressed.
      With the current finding, we can assume the pin provides a kind of
      audio mute function.
      
      Proper resolution of the issue should be done in two steps:
      - resolution of an issue with the pin state not reflecting the value
        the corresponding bit of the port was attempted to be initialized
        with,
      - extension of on-board audio driver with a new control.
      
      For now, rename the pin to "audio_mute" to reflect its function and,
      as a quick fix, hogg it as output low so on-board audio can produce
      audible sound again.
      
      Fixes: 1137ceee ("ARM: OMAP1: ams-delta: Don't request unused GPIOs")
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      2afdb4c4
  9. 07 12月, 2018 2 次提交
  10. 30 11月, 2018 4 次提交
  11. 09 11月, 2018 1 次提交
  12. 04 10月, 2018 1 次提交
  13. 21 9月, 2018 4 次提交
    • J
      ARM: OMAP1: ams-delta: Don't request unused GPIOs · 1137ceee
      Janusz Krzysztofik 提交于
      GPIOs with no kernel drivers can still be used from user space, don't
      request them from the board file.
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      1137ceee
    • J
      ARM: OMAP1: ams-delta: register MODEM device earlier · d3e952ad
      Janusz Krzysztofik 提交于
      Amstrad Delta MODEM device used to be initialized at arch_initcall
      before it was once moved to late_initcall by commit f7519d8c ("ARM:
      OMAP1: ams-delta: register latch dependent devices later"). The purpose
      of that change was to postpone initialization of devices which depended
      on latch2 pins until latch2 converted to GPIO device was ready.
      
      After recent fixes to GPIO handling, it was possible to moove
      registration of most of those device back to where they were before.
      The same can be safely done with the MODEM device as initialization
      of GPIO pins it depends on was moved to machine_init by preceding
      patch.
      
      Move registration of the MODEM device to arch_initcall_sync, not to
      arch_initcall, so it is never exposed to potential conflict in
      registration order hazard against OMAP serial ports.
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      d3e952ad
    • J
      ARM: OMAP1: ams-delta: initialize latch2 pins to safe values · 1464d031
      Janusz Krzysztofik 提交于
      Latch2 pins control a number of on-board devices, namely LCD, NAND,
      MODEM and CODEC.  Those pins used to be initialized with safe values
      from init_machine before that operation was:
      1) moved to late_initcall in preparation for conversion of latch2 to
      GPIO device - see commit f7519d8c ("ARM: OMAP1: ams-delta: register
      latch dependent devices later"),
      2) replaced with non-atomic initialization performed by means of
      gpio_request_array() - see commit 937eb4bb ("ARM: OMAP1: ams-delta:
      convert latches to basic_mmio_gpio"),
      3) made completely asynchronous by delegation of GPIO request
      operations performed on subsets of pins to respective device drivers in
      subsequent commits.
      
      One visible negative result of that disintegration was corrupt keyboard
      data reported by serio driver, recently fixed by commit 41f8fee3
      ("ARM: OMAP1: ams-delta: Hog "keybrd_dataout" GPIO pin").
      
      Moreover, initialization of LATCH2_PIN_MODEM_CODEC still performed with
      ams_delta_latch2_write() wrapper from late_init() is now done on not
      requested GPIO pin.
      
      Reintroduce atomic initialization of latch2 pins at machine_init to
      prevent from random values potentially corrupting NAND data or maybe
      even destroing other hardware.  Also take care of MODEM/CODEC related
      pins so MODEM device probe succeeds even if latch2 GPIO device or
      dependent regulator is not ready and CODEC can be reached over the
      MODEM even if audio driver doesn't take control over
      LATCH2_PIN_MODEM_CODEC.
      
      Once done, remove the no longer needed GPIO based implementation of
      ams_delta_latch_write() and its frontend macro.
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      [tony@atomide.com: updated for the header location to remove dependency]
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      1464d031
    • J
      ARM: OMAP1: ams-delta: assign MODEM IRQ from GPIO descriptor · 0812db94
      Janusz Krzysztofik 提交于
      Don't request MODEM IRQ GPIO by its global number in
      ams_delta_modem_init().  Instead, obtain its GPIO descriptor
      and assign related IRQ to the MODEM.  Do that from
      omap_gpio_deps_init(), where the chip is already looked up.  Then, in
      ams_delta_modem_init(), just check for the IRQ number having been
      already assigned.
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      0812db94
  14. 18 9月, 2018 1 次提交
    • L
      regulator: fixed: Convert to use GPIO descriptor only · efdfeb07
      Linus Walleij 提交于
      As we augmented the regulator core to accept a GPIO descriptor instead
      of a GPIO number, we can augment the fixed GPIO regulator to look up
      and pass that descriptor directly from device tree or board GPIO
      descriptor look up tables.
      
      Some boards just auto-enumerate their fixed regulator platform devices
      and I have assumed they get names like "fixed-regulator.0" but it's
      pretty hard to guess this. I need some testing from board maintainers to
      be sure. Other boards are straight forward, using just plain
      "fixed-regulator" (ID -1) or "fixed-regulator.1" hammering down the
      device ID.
      
      It seems the da9055 and da9211 has never got around to actually passing
      any enable gpio into its platform data (not the in-tree code anyway) so we
      can just decide to simply pass a descriptor instead.
      
      The fixed GPIO-controlled regulator in mach-pxa/ezx.c was confusingly named
      "*_dummy_supply_device" while it is a very real device backed by a GPIO
      line. There is nothing dummy about it at all, so I renamed it with the
      infix *_regulator_* as part of this patch set.
      
      Intel MID portions tested by Andy.
      
      Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Check the x86 BCM stuff
      Acked-by: Tony Lindgren <tony@atomide.com> # OMAP1,2,3 maintainer
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Reviewed-by: NMike Rapoport <rppt@linux.vnet.ibm.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      efdfeb07
  15. 03 7月, 2018 5 次提交
  16. 02 7月, 2018 6 次提交
  17. 07 6月, 2018 1 次提交
    • M
      regulator: gpio: Revert · e536700e
      Mark Brown 提交于
      regulator: fixed/gpio: Revert GPIO descriptor changes due to platform breakage
      
      Commit 6059577c "regulator: fixed: Convert to use GPIO descriptor
      only" broke at least the ams-delta platform since the lookup tables
      added to the board files use the function name "enable" while the driver
      uses NULL causing the regulator to not acquire and control the enable
      GPIOs.  Revert that and a couple of other commits that are caught up
      with it to fix the issue:
      
      2b6c00c1 "ARM: pxa, regulator: fix building ezx e680"
      6059577c "regulator: fixed: Convert to use GPIO descriptor only"
      37bed97f "regulator: gpio: Get enable GPIO using GPIO descriptor"
      Reported-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      e536700e
  18. 29 5月, 2018 1 次提交
    • L
      regulator: fixed: Convert to use GPIO descriptor only · 6059577c
      Linus Walleij 提交于
      As we augmented the regulator core to accept a GPIO descriptor instead
      of a GPIO number, we can augment the fixed GPIO regulator to look up
      and pass that descriptor directly from device tree or board GPIO
      descriptor look up tables.
      
      Some boards just auto-enumerate their fixed regulator platform devices
      and I have assumed they get names like "fixed-regulator.0" but it's
      pretty hard to guess this. I need some testing from board maintainers to
      be sure. Other boards are straight forward, using just plain
      "fixed-regulator" (ID -1) or "fixed-regulator.1" hammering down the
      device ID.
      
      The OMAP didn't have proper label names on its GPIO chips so I have fixed
      this with a separate patch to the GPIO tree, see
      commit 088413bc
      "gpio: omap: Give unique labels to each GPIO bank/chip"
      
      It seems the da9055 and da9211 has never got around to actually passing
      any enable gpio into its platform data (not the in-tree code anyway) so we
      can just decide to simply pass a descriptor instead.
      
      The fixed GPIO-controlled regulator in mach-pxa/ezx.c was confusingly named
      "*_dummy_supply_device" while it is a very real device backed by a GPIO
      line. There is nothing dummy about it at all, so I renamed it with the
      infix *_regulator_* as part of this patch set.
      
      For the patch hunk hitting arch/blackfin I would say I do not expect
      testing, review or ACKs anymore so if it works, it works.
      
      The hunk hitting the x86 BCM43xx driver is especially tricky as the number
      comes out of SFI which is a mystery to me. I definately need someone to
      look at this. (Hi Andy.)
      
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Check the x86 BCM stuff
      Cc: Alexander Shiyan <shc_work@mail.ru> # i.MX boards user
      Cc: Haojian Zhuang <haojian.zhuang@gmail.com> # MMP2 maintainer
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi> # OMAP1 maintainer
      Cc: Tony Lindgren <tony@atomide.com> # OMAP1,2,3 maintainer
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> # EM-X270 maintainer
      Cc: Robert Jarzmik <robert.jarzmik@free.fr> # EZX maintainer
      Cc: Philipp Zabel <philipp.zabel@gmail.com> # Magician maintainer
      Cc: Daniel Mack <zonque@gmail.com> # Raumfeld maintainer
      Cc: Marc Zyngier <marc.zyngier@arm.com> # Zeus maintainer
      Cc: Geert Uytterhoeven <geert+renesas@glider.be> # SuperH pinctrl/GPIO maintainer
      Cc: Russell King <rmk+kernel@armlinux.org.uk> # SA1100
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Acked-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      6059577c
  19. 24 5月, 2018 2 次提交
    • J
      ASoC: ams_delta: use GPIO lookup table · d65777d1
      Janusz Krzysztofik 提交于
      Now as the Amstrad Delta board provides GPIO lookup tables, switch from
      GPIO numbers to GPIO descriptors and use the table to locate required
      GPIO pins.
      
      The card uses two pins, one for jack and the other for voice modem
      codec DAI control.
      
      For jack pin, remove hardcoded GPIO number and use GPIO descriptor
      based variant of jack GPIO initialization.
      
      For modem_codec pin, declare static variable for storing its GPIO
      descriptor, obtain it on card initialization and replace obsolete
      ams_delta_latch2_write() with gpiod_set_value().  For that to work,
      don't request the modem_codec pin from the board init code anymore.
      
      If the modem_codec GPIO lookup fails, skip initialization of
      functionality of the card which depends on its availability.
      
      Pin naming used by the driver should be followed while respective GPIO
      lookup table is initialized by a board init code.
      
      Created and tested against linux-4.17-rc3, on top of patch 1/6 "ARM:
      OMAP1: ams-delta: add GPIO lookup tables"
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Acked-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      d65777d1
    • J
      ARM: OMAP1: ams-delta: add GPIO lookup tables · 04867389
      Janusz Krzysztofik 提交于
      Scope of the change is limited to GPIO pins used by board specific
      device drivers which will be updated by follow-up patches of the
      series. Those are some OMAP GPIO (gpio-0-15) and most of Amstrad Delta
      latch2 GPIO bank pins. Remaining pins of those banks, as well as
      Amstrad Delta latch1 pins, will be addressed later.
      
      Assign a label ("latch2") to the bank, enumerate its pins and put that
      information, together with OMAP GPIO bank pins, in GPIO lookup tables.
      Assign lookup tables to devices as soon as those devices are registered
      and their names can be obtained.
      
      A step froward in:
      - removal of hard-coded GPIO numbers from drivers,
      - removal of board mach includes from drivers,
      - switching to dynamically assigned GPIO numbers.
      
      Created and compile tested agains linux-4.17-rc3
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      04867389
  20. 03 10月, 2017 1 次提交
    • B
      ARM: omap1: add const and initconst to omap_lcd_config · d25c70cf
      Bhumika Goyal 提交于
      Make these const as they are only passed to a const argument of the function
      omapfb_set_lcd_config.
      Also, replace __initdata with __initconst to avoid section conflict error.
      Done using Coccinelle.
      
      @match disable optional_qualifier@
      identifier s;
      @@
      static struct omap_lcd_config s = {...};
      
      @ref@
      position p;
      identifier match.s;
      @@
      s@p
      
      @good1@
      identifier match.s;
      position ref.p;
      @@
      omapfb_set_lcd_config(&s@p,...)
      
      @bad depends on  !good1@
      position ref.p;
      identifier match.s;
      @@
      s@p
      
      @depends on forall !bad disable optional_qualifier@
      identifier match.s;
      @@
      static
      + const
      struct omap_lcd_config s;
      Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      d25c70cf
  21. 28 7月, 2017 1 次提交
    • A
      ARM: omap1/ams-delta: warn about failed regulator enable · 595a9f9a
      Arnd Bergmann 提交于
      The modem pm handler in the ams-delta board uses regulator_enable()
      but does not check for a successful return code:
      
      board-ams-delta.c:521:3: error: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Werror=unused-result]
      
      It is not easy to propagate that return code to the callers in
      uart_configure_port/uart_suspend_port/uart_resume_port, unless
      we change all UART drivers, and it is unclear what those would
      do with the return code.
      
      Instead, this patch uses a runtime warning to replace the
      compiletime warning. I have checked that the regulator in question
      is hardcoded to a fixed-voltage GPIO regulator, and that should
      never fail to get enabled if I understand the code right.
      Acked-by: NTony Lindgren <tony@atomide.com>
      Acked-by: NAaro Koskinen <aaro.koskinen@iki.fi>
      Link: https://patchwork.kernel.org/patch/8391981/Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      595a9f9a
  22. 05 1月, 2016 1 次提交
    • L
      gpio: generic: factor into gpio_chip struct · 0f4630f3
      Linus Walleij 提交于
      The separate struct bgpio_chip has been a pain to handle, both
      by being confusingly similar in name to struct gpio_chip and
      for being contained inside a struct so that struct gpio_chip
      is contained in a struct contained in a struct, making several
      steps of dereferencing necessary.
      
      Make things simpler: include the fields directly into
      <linux/gpio/driver.h>, #ifdef:ed for CONFIG_GENERIC_GPIO, and
      get rid of the <linux/basic_mmio_gpio.h> altogether. Prefix
      some of the member variables with bgpio_* and add proper
      kerneldoc while we're at it.
      
      Modify all users to handle the change and use a struct
      gpio_chip directly. And while we're at it: replace all
      container_of() dereferencing by gpiochip_get_data() and
      registering the gpio_chip with gpiochip_add_data().
      
      Cc: arm@kernel.org
      Cc: Alexander Shiyan <shc_work@mail.ru>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Sascha Hauer <kernel@pengutronix.de>
      Cc: Kukjin Kim <kgene@kernel.org>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: Brian Norris <computersforpeace@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
      Cc: Rabin Vincent <rabin@rab.in>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-omap@vger.kernel.org
      Cc: linux-samsung-soc@vger.kernel.org
      Cc: bcm-kernel-feedback-list@broadcom.com
      Acked-by: NGregory Fong <gregory.0xf0@gmail.com>
      Acked-by: NLiviu Dudau <Liviu.Dudau@arm.com>
      Acked-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Acked-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Acked-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      0f4630f3
  23. 02 12月, 2015 1 次提交