1. 21 Feb, 2019 1 commit
    • Thomas Petazzoni's avatar
      clk: clk-gpio: add support for sleeping GPIOs in gpio-gate-clk · c0189fee
      Thomas Petazzoni authored
      
      The current implementation of gpio-gate-clk enables/disables the clock
      using the GPIO in the ->enable() and ->disable() clock callbacks. This
      requires the GPIO to be configurable in atomic contexts. While it is
      the case for most memory-mapped GPIO controllers, it is not the case
      for GPIO expanders on I2C or SPI.
      
      This commit extends the gpio-gate-clk to check whether the GPIO calls
      require sleeping or not. If sleeping is not required, the current
      implementation based on ->enable()/->disable() is kept. However, if
      sleeping is needed, we instead implement the logic in the ->prepare()
      and ->unprepare() hooks. Thanks to this, a gate clock connected to a
      GPIO on a GPIO expander can be controlled with the existing driver.
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
      [sboyd@kernel.org: Mark clk ops static]
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      c0189fee
  2. 11 Dec, 2018 1 commit
  3. 30 Aug, 2018 1 commit
    • Rob Herring's avatar
      clk: Convert to using %pOFn instead of device_node.name · e665f029
      Rob Herring authored
      
      In preparation to remove the node name pointer from struct device_node,
      convert printf users to use the %pOFn format specifier.
      
      Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: linux-clk@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-renesas-soc@vger.kernel.org
      Cc: linux-omap@vger.kernel.org
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      e665f029
  4. 19 Mar, 2018 1 commit
  5. 02 Nov, 2017 2 commits
    • Linus Walleij's avatar
      clk: clk-gpio: Request GPIO descriptor as LOW · 1b5d1a58
      Linus Walleij authored
      
      Requesting the GPIOD_OUT_LOW low will make sure the GPIO is
      deasserted when requested. The gpiolib core will make sure that
      if the GPIO line is active low, it will be logically driven high
      when deasserted, see drivers/gpiolib.c gpiod_configure_flags().
      
      Cc: Sergej Sawazki <ce3a@gmx.de>
      Cc: Jyri Sarha <jsarha@ti.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      1b5d1a58
    • Linus Walleij's avatar
      clk: clk-gpio: Make GPIO clock provider use descriptors only · 908a543a
      Linus Walleij authored
      
      After som grep:ing it turns out nothing in the kernel is really calling
      clk_[hw_]_register_gpio_[gate|mux](). All existing instances are just
      created directly from the device tree probe functions at the bottom of
      the clk-gpio.c clock provider file.
      
      This means we can change the signature of the function without any
      consequences! Everyone should be using GPIO descriptors now, so let's
      just go in and enforce that.
      
      This saves a bit of code since GPIO descriptors know inherently if they
      are active low so no need for the code keeping track of that.
      
      We leave it to the caller to come up with the GPIO descriptor. It is
      nowadays possible to do that even without a corresponding device, so
      no excuse not to pass them around. The one in-kernel user lifecycles
      it using devm_gpiod_get() in gpio_clk_driver_probe().
      
      Cc: Sergej Sawazki <ce3a@gmx.de>
      Cc: Jyri Sarha <jsarha@ti.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      908a543a
  6. 19 Apr, 2016 1 commit
  7. 27 Feb, 2016 1 commit
  8. 19 Feb, 2016 1 commit
    • Stephen Boyd's avatar
      clk: gpio: Really allow an optional clock= DT property · 4462b4bb
      Stephen Boyd authored
      We mis-merged the original patch from Russell here and so the
      patch went almost all the way, except that we still failed to
      probe when there wasn't a clocks property in the DT node. Allow
      that case by making a negative value from
      of_clk_get_parent_count() into "no parents", like the original
      patch did.
      
      Fixes: 7ed88aa2
      
       ("clk: fix clk-gpio.c with optional clock= DT property")
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      4462b4bb
  9. 07 Feb, 2016 1 commit
    • Stephen Boyd's avatar
      clk: gpio: Make into a platform driver · 14b04f28
      Stephen Boyd authored
      
      clk_get() for DT based clks already returns EPROBE_DEFER when the
      OF clk provider is not present. So having all this code in the
      clk provider to return EPROBE_DEFER when the gpio isn't ready yet
      can be replaced with a platform driver that doesn't add the clk
      provider until the gpio can be requested. Get rid of the
      OF_CLK_DECLARE and convert this to a platform driver instead.
      Tested-by: default avatarJyri Sarha <jsarha@ti.com>
      Cc: Sergej Sawazki <ce3a@gmx.de>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Jon Nettleton <jon@solid-run.com>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      14b04f28
  10. 29 Jan, 2016 1 commit
  11. 03 Jan, 2016 1 commit
    • Russell King's avatar
      clk: fix clk-gpio.c with optional clock= DT property · 7ed88aa2
      Russell King authored
      When the clock DT property is not given, of_clk_get_parent_count()
      returns -ENOENT, which then tries to allocate -2 x 4 bytes of memory,
      which of course fails, causing the whole driver to fail to create
      the clock.
      
      This causes the SolidRun platforms to fail probing the SDHCI1 interface
      which is connected to the WiFi.
      
      Fix this by detecting errno codes, skipping the allocation, and fixing
      of_clk_gpio_gate_delayed_register_get() to handle a NULL parent_names
      array.
      
      Fixes: 80eeb1f0
      
       ("clk: add gpio controlled clock multiplexer")
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarMichael Turquette <mturquette@baylibre.com>
      7ed88aa2
  12. 01 Jan, 2016 2 commits
  13. 19 Nov, 2015 1 commit
    • Jyri Sarha's avatar
      clk: gpio: Get parent clk names in of_gpio_clk_setup() · f66541ba
      Jyri Sarha authored
      
      Get parent clk names in of_gpio_clk_setup() and store the names
      in struct clk_gpio_delayed_register_data instead of doing it from
      the clk provider's get() callback. of_clk_get_parent_name() can't
      be called in struct of_clk_provider's get() callback since it may
      make a call to of_clk_get_from_provider() and this in turn tries
      to recursively lock of_clk_mutex.
      Signed-off-by: default avatarJyri Sarha <jsarha@ti.com>
      Cc: Sergej Sawazki <ce3a@gmx.de>
      Fixes: 0a4807c2
      
       ("clk: Make of_clk_get_parent_name() robust with #clock-cells = 1")
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      f66541ba
  14. 28 Jul, 2015 2 commits
  15. 07 Jul, 2015 2 commits
  16. 06 Jul, 2015 2 commits
  17. 15 May, 2015 1 commit
  18. 11 Apr, 2015 1 commit
  19. 30 Sep, 2014 1 commit
  20. 26 Sep, 2014 1 commit