Skip to contentSkip to conversation

pwm: samsung: replace pwm_id with hwpwm memeber of pwm_device

PATCH Applied Jingoo Han 1 participant 1 message Aug 3, 2012

Subsystems (2)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH v2 3/3 pwm: samsung: replace pwm_id with hwpwm memeber of pwm_device

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.

---
Tested on SMDKV310 board

 drivers/pwm/pwm-samsung.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/pwm/pwm-samsung.c +4 -5
index aa0fe6b..8888841 100644
@@ -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);
Signature · 1 line
1.7.1