06 Apr, 2017

2 commits

  • sama5d2 can use the same atmel_pwm_data as sama5d3.

    Signed-off-by: Claudiu Beznea
    Acked-by: Rob Herring
    Reviewed-by: Boris Brezillon
    Signed-off-by: Thierry Reding

    Claudiu Beznea
     
  • The currently Atmel PWM controllers supported by this driver could
    change period or duty factor without channel disable, for regular
    channels (sama5d3 support this by using period or duty factor update
    registers, sam9rl support this by writing channel update register and
    select the corresponding update: period or duty factor). The chip
    doesn't support run time changings of signal polarity. To take advantage
    of atomic PWM framework and let controller works without glitches, in
    this patch only the duty factor could be changed without disabling PWM
    channel. For period and signal polarity the atomic PWM is simulated by
    disabling + enabling the right PWM channel.

    Signed-off-by: Claudiu Beznea
    Reviewed-by: Boris Brezillon
    Signed-off-by: Thierry Reding

    Claudiu Beznea
     

04 Jan, 2017

1 commit


11 Jul, 2016

3 commits


20 Jul, 2015

2 commits


12 Jun, 2015

2 commits

  • pwm-leds calls .config() and .disable() in a row. This exhibits that it
    may happen that the channel gets disabled before CDTY has been updated
    with CUPD. The issue gets quite worse with long periods. So, ensure that
    at least one period has past before disabling the channel by polling
    ISR.

    Signed-off-by: Alexandre Belloni
    Acked-by: Nicolas Ferre
    Tested-by: Gaël PORTAY
    Signed-off-by: Thierry Reding

    Alexandre Belloni
     
  • CUPD is not flushed before enabling the channel so it will update
    CDTY/CPRD just after one period. So we always set CUPD, even when the
    channel is not enabled.

    Signed-off-by: Alexandre Belloni
    Acked-by: Nicolas Ferre
    Signed-off-by: Thierry Reding

    Alexandre Belloni
     

25 Sep, 2014

1 commit

  • The prescale value used for calculating the period was incremented
    afterwards, thus the resulting prescale value is by one too high.
    This resulted in a PWM frequency only half as high as requested.

    This patch moves the 64 bit division out of the prescale loop to
    correct the above issue and make the calculation more efficient.

    Signed-off-by: Nikolaus Voss
    Tested-by: Bo Shen
    Acked-by: Bo Shen
    Signed-off-by: Thierry Reding

    Nikolaus Voss
     

21 May, 2014

1 commit


19 Mar, 2014

2 commits

  • From the datasheet, the actual duty cycle is:

    (period - (1 / clk) * CDTY) / period

    This actually correct the polarity of the PWM and solves the issue that
    pwm-leds exhibits: when setting a duty cycle of 0 and then disabling a
    channel, the level was wrong (1 when the polarity was normal and 0 when
    the polarity was inversed).

    Signed-off-by: Alexandre Belloni
    Acked-by: Nicolas Ferre
    Signed-off-by: Thierry Reding

    Alexandre Belloni
     
  • When atmel_pwm_config() calculates and then sets the prescaler, it is
    overwriting the channel's CMR register so we are losing the CPOL
    configuration.

    As atmel_pwm_config() is always called before enabling a channel,
    inverting the polarity doesn't work.

    Fix that by reading CMR first and only overwriting the prescaler bits.

    Signed-off-by: Alexandre Belloni
    Acked-by: Nicolas Ferre
    Signed-off-by: Thierry Reding

    Alexandre Belloni
     

20 Dec, 2013

1 commit


17 Dec, 2013

1 commit