29 Apr, 2013

6 commits

  • Due to rounding errors in clockevents core (in conversions between ticks
    and nsecs), it might happen that the set_next_event callback gets called
    with cycles = 0, causing the code to incorrectly program the PWM timer.

    This patch modifies the callback to program the timer for 1 tick, if
    received tick count value is 0.

    Signed-off-by: Tomasz Figa
    Signed-off-by: Kyungmin Park
    Reviewed-by: Arnd Bergmann
    Acked-by: Kukjin Kim
    Signed-off-by: Olof Johansson

    Tomasz Figa
     
  • In current code, the tick count value programmed to the hardware is
    always decremented by one. This is reasonable for periodic mode, since
    there is one extra tick between 0 and COUNT (after reloading), but it
    makes oneshot events happen 1 tick earlier than requested, because the
    interrupt is triggered on transition from 1 to 0.

    This patch removes the decrementation from PWM channel setup code and
    moves it instead to periodic timer setup, to make both periodic and
    oneshot modes work correctly.

    Signed-off-by: Tomasz Figa
    Signed-off-by: Kyungmin Park
    Reviewed-by: Arnd Bergmann
    Acked-by: Kukjin Kim
    Signed-off-by: Olof Johansson

    Tomasz Figa
     
  • This patch replaces hardcoded -1 argument passed to
    clockevents_config_and_register() with tcnt_max calculated based on
    variant data.

    This fixes invalid max delta configuration for 16-bit timers of s3c24xx.

    Signed-off-by: Tomasz Figa
    Signed-off-by: Kyungmin Park
    Reviewed-by: Arnd Bergmann
    Acked-by: Kukjin Kim
    Signed-off-by: Olof Johansson

    Tomasz Figa
     
  • This patch extends the driver to support platforms that still use legacy
    ATAGS-based boot, without device tree, by providing an exported function
    that can be used from platform code to initialize the clocksource.

    Signed-off-by: Tomasz Figa
    Signed-off-by: Kyungmin Park
    Reviewed-by: Arnd Bergmann
    Acked-by: Kukjin Kim
    Signed-off-by: Olof Johansson

    Tomasz Figa
     
  • This patch modifies the driver to keep all its private data consistently
    in a single struct, instead of keeping part as separate variables.

    Signed-off-by: Tomasz Figa
    Signed-off-by: Kyungmin Park
    Reviewed-by: Arnd Bergmann
    Acked-by: Kukjin Kim
    Signed-off-by: Olof Johansson

    Tomasz Figa
     
  • This patch makes the PWM spinlock global and exports it to allow using
    it in Samsung PWM driver (will be reworked to use proper synchronization
    in further patches).

    Signed-off-by: Tomasz Figa
    Signed-off-by: Kyungmin Park
    Reviewed-by: Arnd Bergmann
    Acked-by: Kukjin Kim
    Signed-off-by: Olof Johansson

    Tomasz Figa
     

21 Apr, 2013

1 commit

  • This adds a new clocksource driver for the PWM timer that is
    present in most Samsung SoCs, based on the existing driver in
    arch/arm/plat-samsung/samsung-time.c and many changes implemented by
    Tomasz Figa.

    Originally, the conversion of all Samsung machines to the new driver was
    planned for 3.10, but that work ended up being too late and too invasive
    just before the merge window.

    Unfortunately, other changes in the Exynos platform resulted in some
    Exynos4 setups, particularly the Universal C210 board to be broken. In
    order to fix that with minimum risk, so we now leave the existing pwm
    clocksource driver in place for all older platforms and use the new
    driver only for device tree enabled boards. This way, we can get the
    broken machines running again using DT descriptions.

    All clocksource changes were implemented by Tomasz, while the DT
    registration was rewritten by Arnd.

    Signed-off-by: Arnd Bergmann
    Cc: Tomasz Figa
    Cc: Kyungmin Park
    Cc: Kukjin Kim
    Cc: Ben Dooks
    Cc: John Stultz
    Cc: Thomas Gleixner

    Tomasz Figa