diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-03-31 10:59:47 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@avionic-design.de> | 2013-04-02 05:30:57 -0400 |
commit | 72da70e77f885ec9a79af9c13ff1c79b6136b75f (patch) | |
tree | f3597e5e1e9d813bf82cd5242caa80bded0cabee /drivers/pwm/pwm-imx.c | |
parent | d5714e8b9de5d3a82347fe37a9038373c44afce0 (diff) |
pwm: imx: Remove enabled field from struct imx_chip
We can test PWMF_ENABLED bit to know if pwm is enabled or not.
Thus remove enabled field from struct imx_chip.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Diffstat (limited to 'drivers/pwm/pwm-imx.c')
-rw-r--r-- | drivers/pwm/pwm-imx.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c index 3f5677b7690e..ec287989eafc 100644 --- a/drivers/pwm/pwm-imx.c +++ b/drivers/pwm/pwm-imx.c | |||
@@ -43,7 +43,6 @@ struct imx_chip { | |||
43 | struct clk *clk_per; | 43 | struct clk *clk_per; |
44 | struct clk *clk_ipg; | 44 | struct clk *clk_ipg; |
45 | 45 | ||
46 | int enabled; | ||
47 | void __iomem *mmio_base; | 46 | void __iomem *mmio_base; |
48 | 47 | ||
49 | struct pwm_chip chip; | 48 | struct pwm_chip chip; |
@@ -135,7 +134,7 @@ static int imx_pwm_config_v2(struct pwm_chip *chip, | |||
135 | MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN | | 134 | MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN | |
136 | MX3_PWMCR_DBGEN | MX3_PWMCR_CLKSRC_IPG_HIGH; | 135 | MX3_PWMCR_DBGEN | MX3_PWMCR_CLKSRC_IPG_HIGH; |
137 | 136 | ||
138 | if (imx->enabled) | 137 | if (test_bit(PWMF_ENABLED, &pwm->flags)) |
139 | cr |= MX3_PWMCR_EN; | 138 | cr |= MX3_PWMCR_EN; |
140 | 139 | ||
141 | writel(cr, imx->mmio_base + MX3_PWMCR); | 140 | writel(cr, imx->mmio_base + MX3_PWMCR); |
@@ -186,8 +185,6 @@ static int imx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) | |||
186 | 185 | ||
187 | imx->set_enable(chip, true); | 186 | imx->set_enable(chip, true); |
188 | 187 | ||
189 | imx->enabled = 1; | ||
190 | |||
191 | return 0; | 188 | return 0; |
192 | } | 189 | } |
193 | 190 | ||
@@ -198,7 +195,6 @@ static void imx_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) | |||
198 | imx->set_enable(chip, false); | 195 | imx->set_enable(chip, false); |
199 | 196 | ||
200 | clk_disable_unprepare(imx->clk_per); | 197 | clk_disable_unprepare(imx->clk_per); |
201 | imx->enabled = 0; | ||
202 | } | 198 | } |
203 | 199 | ||
204 | static struct pwm_ops imx_pwm_ops = { | 200 | static struct pwm_ops imx_pwm_ops = { |