mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 3/3] pwm: samsung: replace pwm_id with hwpwm memeber of pwm_device
@ 2012-08-03  6:47 Jingoo Han
  0 siblings, 0 replies; only message in thread
From: Jingoo Han @ 2012-08-03  6:47 UTC (permalink / raw)
  To: 'Thierry Reding'
  Cc: linux-kernel, linux-samsung-soc, 'Jingoo Han'

This patch replaces pwm_id with hwpwm memeber of pwm_device.
The pwm_id of struct s3c_chip is unncessary, since hwpwm can
do same thing.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
Tested on SMDKV310 board
 drivers/pwm/pwm-samsung.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c
index aa0fe6b..8888841 100644
--- a/drivers/pwm/pwm-samsung.c
+++ b/drivers/pwm/pwm-samsung.c
@@ -39,7 +39,6 @@ struct s3c_chip {
 	unsigned int		 duty_ns;
 
 	unsigned char		 tcon_base;
-	unsigned char		 pwm_id;
 	struct pwm_chip		 chip;
 };
 
@@ -138,8 +137,8 @@ static int s3c_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
 	/* The TCMP and TCNT can be read without a lock, they're not
 	 * shared between the timers. */
 
-	tcmp = __raw_readl(S3C2410_TCMPB(s3c->pwm_id));
-	tcnt = __raw_readl(S3C2410_TCNTB(s3c->pwm_id));
+	tcmp = __raw_readl(S3C2410_TCMPB(pwm->hwpwm));
+	tcnt = __raw_readl(S3C2410_TCNTB(pwm->hwpwm));
 
 	period = NS_IN_HZ / period_ns;
 
@@ -182,8 +181,8 @@ static int s3c_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
 
 	local_irq_save(flags);
 
-	__raw_writel(tcmp, S3C2410_TCMPB(s3c->pwm_id));
-	__raw_writel(tcnt, S3C2410_TCNTB(s3c->pwm_id));
+	__raw_writel(tcmp, S3C2410_TCMPB(pwm->hwpwm));
+	__raw_writel(tcnt, S3C2410_TCNTB(pwm->hwpwm));
 
 	tcon = __raw_readl(S3C2410_TCON);
 	tcon |= pwm_tcon_manulupdate(s3c);
-- 
1.7.1



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-08-03  6:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-03  6:47 [PATCH v2 3/3] pwm: samsung: replace pwm_id with hwpwm memeber of pwm_device Jingoo Han

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®