19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

18 Aug, 2017

6 commits


06 Apr, 2017

1 commit

  • If the PWM was not enabled at U-Boot loader, PWM could not work for
    clock always disabled at PWM driver. The PWM clock is enabled at
    beginning of pwm_apply(), but disabled at end of pwm_apply().

    If the PWM was enabled at U-Boot loader, PWM clock is always enabled
    unless closed by ATF. The pwm-backlight might turn off the power at
    early suspend, should disable PWM clock for saving power consume.

    It is important to provide opportunity to enable/disable clock at PWM
    driver, the PWM consumer should ensure correct order to call PWM enable
    and disable, and PWM driver ensure state of PWM clock synchronized with
    PWM enabled state.

    Fixes: 2bf1c98aa5a4 ("pwm: rockchip: Add support for atomic update")
    Cc: stable@vger.kernel.org
    Signed-off-by: David Wu
    Reviewed-by: Boris Brezillon
    Signed-off-by: Thierry Reding

    David Wu
     

11 Jul, 2016

4 commits

  • Implement the ->apply() function to add support for atomic update.

    Signed-off-by: Boris Brezillon
    Tested-by: Heiko Stuebner
    Reviewed-by: Brian Norris
    Tested-by: Brian Norris
    Signed-off-by: Thierry Reding

    Boris Brezillon
     
  • The current logic will disable the PWM clk even if the PWM was left
    enabled by the bootloader (because it's controlling a critical device
    like a regulator for example).
    Keep the PWM clk enabled if the PWM is enabled to avoid any glitches.

    Signed-off-by: Boris Brezillon
    Reviewed-by: Brian Norris
    Tested-by: Brian Norris
    Tested-by: Heiko Stuebner
    Signed-off-by: Thierry Reding

    Boris Brezillon
     
  • Implement the ->get_state() function to expose initial state.

    Signed-off-by: Boris Brezillon
    Reviewed-by: Brian Norris
    Tested-by: Brian Norris
    Tested-by: Heiko Stuebner
    Signed-off-by: Thierry Reding

    Boris Brezillon
     
  • The current implementation always round down the duty and period values,
    while it would be better to round them to the closest integer.

    These changes are needed in preparation of atomic update support to
    prevent a period/duty cycle drift when executing several times the
    'pwm_get_state() / modify / pwm_apply_state()' sequence.

    Say you have an expected period of 3.333 us and a clk rate of
    112.666667 MHz -- the clock frequency doesn't divide evenly, so the
    period (stashed in nanoseconds) shrinks when we convert to the register
    value and back, as follows:

    pwm_apply_state(): register = period * 112666667 / 1000000000;
    pwm_get_state(): period = register * 1000000000 / 112666667;

    or in other words:

    period = period * 112666667 / 1000000000 * 1000000000 / 112666667;

    which yields a sequence like:

    3333 -> 3328
    3328 -> 3319
    3319 -> 3310
    3310 -> 3301
    3301 -> 3292
    3292 -> ... (etc) ...

    With this patch, we'd see instead:

    period = div_round_closest(period * 112666667, 1000000000) *
    1000000000 / 112666667;

    which yields a stable sequence:

    3333 -> 3337
    3337 -> 3337
    3337 -> ... (etc) ...

    Signed-off-by: Boris Brezillon
    Reviewed-by: Brian Norris
    Tested-by: Brian Norris
    Tested-by: Heiko Stuebner
    Signed-off-by: Thierry Reding

    Boris Brezillon
     

20 Jul, 2015

1 commit


26 Aug, 2014

1 commit


08 Aug, 2014

1 commit


11 Jul, 2014

1 commit