1. 06 Dec, 2022 33 commits
  2. 29 Nov, 2022 3 commits
  3. 23 Nov, 2022 2 commits
  4. 11 Nov, 2022 1 commit
    • Steven Price's avatar
      pwm: tegra: Fix 32 bit build · dd1f1da4
      Steven Price authored
      The value of NSEC_PER_SEC << PWM_DUTY_WIDTH doesn't fix within a 32 bit
      integer causing a build warning/error (and the value truncated):
      
        drivers/pwm/pwm-tegra.c: In function ‘tegra_pwm_config’:
        drivers/pwm/pwm-tegra.c:148:53: error: result of ‘1000000000 << 8’ requires 39 bits to represent, but ‘long int’ only has 32 bits [-Werror=shift-overflow=]
          148 |   required_clk_rate = DIV_ROUND_UP_ULL(NSEC_PER_SEC << PWM_DUTY_WIDTH,
              |                                                     ^~
      
      Explicitly cast to a u64 to ensure the correct result.
      
      Fixes: cfcb68817fb3 ("pwm: tegra: Improve required rate calculation")
      Signed-off-by: default avatarSteven Price <steven.price@arm.com>
      Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Reviewed-by: default avatarJon Hunter <jonathanh@nvidia.com>
      dd1f1da4
  5. 09 Nov, 2022 1 commit
    • Jon Hunter's avatar
      pwm: tegra: Ensure the clock rate is not less than needed · 5eccd0d9
      Jon Hunter authored
      When dynamically scaling the PWM clock, the function
      dev_pm_opp_set_rate() may set the PWM clock to a rate that is lower than
      what is required. The clock rate requested when calling
      dev_pm_opp_set_rate() is the minimum clock rate that is needed to drive
      the PWM to achieve the required period. Hence, if the actual clock
      rate is less than the requested clock rate, then the required period
      cannot be achieved and configuring the PWM fails. Fix this by
      calling clk_round_rate() to check if the clock rate that will be provided
      is sufficient and if not, double the required clock rate to ensure the
      required period can be attained.
      
      Fixes: 8c193f47 ("pwm: tegra: Optimize period calculation")
      Signed-off-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      5eccd0d9