20 Mar, 2018

1 commit

  • When changing or retrieving clock parents, the caller is in a sleepable
    state (like prepare) so the GPIO operation need not be atomic. Replace
    gpiod_{g|s}et_value with gpiod_{g|s}et_value_cansleep in the {g|s}et_parent
    calls for the GPIO based clock mux.

    This fixes a "slowpath" warning when the GPIO controller is an I2C expander
    or something similar.

    Signed-off-by: Mike Looijmans
    Signed-off-by: Stephen Boyd

    Mike Looijmans
     

02 Nov, 2017

2 commits

  • 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
    Cc: Jyri Sarha
    Signed-off-by: Linus Walleij
    Signed-off-by: Stephen Boyd

    Linus Walleij
     
  • 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
    Cc: Jyri Sarha
    Signed-off-by: Linus Walleij
    Signed-off-by: Stephen Boyd

    Linus Walleij
     

20 Apr, 2016

1 commit


27 Feb, 2016

1 commit


19 Feb, 2016

2 commits

  • * clk-fixes:
    clk: gpio: Really allow an optional clock= DT property
    Revert "clk: qcom: Specify LE device endianness"

    Stephen Boyd
     
  • 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: 7ed88aa2efa5 ("clk: fix clk-gpio.c with optional clock= DT property")
    Cc: Russell King
    Cc: Michael Turquette
    Signed-off-by: Stephen Boyd

    Stephen Boyd
     

07 Feb, 2016

1 commit

  • 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: Jyri Sarha
    Cc: Sergej Sawazki
    Cc: Russell King
    Cc: Fabio Estevam
    Cc: Jon Nettleton
    Cc: Shawn Guo
    Signed-off-by: Stephen Boyd

    Stephen Boyd
     

30 Jan, 2016

1 commit


03 Jan, 2016

1 commit

  • 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: 80eeb1f0f757 ("clk: add gpio controlled clock multiplexer")
    Signed-off-by: Russell King
    Signed-off-by: Michael Turquette

    Russell King
     

01 Jan, 2016

2 commits


19 Nov, 2015

1 commit

  • 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: Jyri Sarha
    Cc: Sergej Sawazki
    Fixes: 0a4807c2f9a4 ("clk: Make of_clk_get_parent_name() robust with #clock-cells = 1")
    Signed-off-by: Stephen Boyd

    Jyri Sarha
     

29 Jul, 2015

2 commits


07 Jul, 2015

1 commit