Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1617006 > unrolled thread

[PATCH 0/4] pwm: tegra: Pin configuration in suspend/resume and cleanups

Started byLaxman Dewangan <ldewangan@nvidia.com>
First post2017-04-05 16:40 +0200
Last post2017-04-05 16:40 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/4] pwm: tegra: Pin configuration in suspend/resume and cleanups Laxman Dewangan <ldewangan@nvidia.com> - 2017-04-05 16:40 +0200
    [PATCH 1/4] pwm: tegra: Use DIV_ROUND_CLOSEST_ULL() instead of local implementation Laxman Dewangan <ldewangan@nvidia.com> - 2017-04-05 16:40 +0200

#1617006 — [PATCH 0/4] pwm: tegra: Pin configuration in suspend/resume and cleanups

FromLaxman Dewangan <ldewangan@nvidia.com>
Date2017-04-05 16:40 +0200
Subject[PATCH 0/4] pwm: tegra: Pin configuration in suspend/resume and cleanups
Message-ID<tsUgi-3Nd-3@gated-at.bofh.it>
This patch series have following fixes:
- Add more precession in PWM period register value calculation
  for lower pwm frequency.
- Add support to configure PWM pins in different state in the
  suspend/resume.

Laxman Dewangan (4):
  pwm: tegra: Use DIV_ROUND_CLOSEST_ULL() instead of local
    implementation
  pwm: tegra: Increase precision in pwm rate calculation
  pwm: tegra: Add DT binding details to configure pin in suspends/resume
  pwm: tegra: Add support to configure pin state in suspends/resume

 .../devicetree/bindings/pwm/nvidia,tegra20-pwm.txt | 43 ++++++++++++
 drivers/pwm/pwm-tegra.c                            | 77 ++++++++++++++++++++--
 2 files changed, 116 insertions(+), 4 deletions(-)

-- 
2.1.4

[toc] | [next] | [standalone]


#1617008 — [PATCH 1/4] pwm: tegra: Use DIV_ROUND_CLOSEST_ULL() instead of local implementation

FromLaxman Dewangan <ldewangan@nvidia.com>
Date2017-04-05 16:40 +0200
Subject[PATCH 1/4] pwm: tegra: Use DIV_ROUND_CLOSEST_ULL() instead of local implementation
Message-ID<tsUgj-3Nd-29@gated-at.bofh.it>
In reply to#1617006
Use macro DIV_ROUND_CLOSEST_ULL() for 64bit division to closet one
instead of implementing the same locally. This increase readability.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
 drivers/pwm/pwm-tegra.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
index e464784..0a688da 100644
--- a/drivers/pwm/pwm-tegra.c
+++ b/drivers/pwm/pwm-tegra.c
@@ -85,8 +85,7 @@ static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
 	 * nearest integer during division.
 	 */
 	c *= (1 << PWM_DUTY_WIDTH);
-	c += period_ns / 2;
-	do_div(c, period_ns);
+	c = DIV_ROUND_CLOSEST_ULL(c, period_ns);
 
 	val = (u32)c << PWM_DUTY_SHIFT;
 
-- 
2.1.4

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web