diff options
author | Lee Jones <lee.jones@linaro.org> | 2016-08-16 05:34:58 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2016-09-08 04:55:07 -0400 |
commit | 09022e61d53c135ad967bb61c0b6ba957f216b70 (patch) | |
tree | f24e3cc4338bf877389f8ee6cb80fee5cb2c7b31 | |
parent | 055beac1317900fa5e860b13d60109e76cf55733 (diff) |
pwm: sti: Rename channel => device
This is to bring the terminology used in the STi PWM driver more
into line with the PWM subsystem.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
-rw-r--r-- | drivers/pwm/pwm-sti.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/pwm/pwm-sti.c b/drivers/pwm/pwm-sti.c index 92abbd56b9f7..7cd7e4be7623 100644 --- a/drivers/pwm/pwm-sti.c +++ b/drivers/pwm/pwm-sti.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
22 | #include <linux/time.h> | 22 | #include <linux/time.h> |
23 | 23 | ||
24 | #define STI_DS_REG(ch) (4 * (ch)) /* Channel's Duty Cycle register */ | 24 | #define STI_DS_REG(ch) (4 * (ch)) /* Device's Duty Cycle register */ |
25 | #define STI_PWMCR 0x50 /* Control/Config register */ | 25 | #define STI_PWMCR 0x50 /* Control/Config register */ |
26 | #define STI_INTEN 0x54 /* Interrupt Enable/Disable register */ | 26 | #define STI_INTEN 0x54 /* Interrupt Enable/Disable register */ |
27 | #define PWM_PRESCALE_LOW_MASK 0x0f | 27 | #define PWM_PRESCALE_LOW_MASK 0x0f |
@@ -40,7 +40,7 @@ enum { | |||
40 | 40 | ||
41 | struct sti_pwm_compat_data { | 41 | struct sti_pwm_compat_data { |
42 | const struct reg_field *reg_fields; | 42 | const struct reg_field *reg_fields; |
43 | unsigned int num_chan; | 43 | unsigned int num_devs; |
44 | unsigned int max_pwm_cnt; | 44 | unsigned int max_pwm_cnt; |
45 | unsigned int max_prescale; | 45 | unsigned int max_prescale; |
46 | }; | 46 | }; |
@@ -130,13 +130,13 @@ static int sti_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, | |||
130 | 130 | ||
131 | /* Allow configuration changes if one of the | 131 | /* Allow configuration changes if one of the |
132 | * following conditions satisfy. | 132 | * following conditions satisfy. |
133 | * 1. No channels have been configured. | 133 | * 1. No devices have been configured. |
134 | * 2. Only one channel has been configured and the new request | 134 | * 2. Only one device has been configured and the new request |
135 | * is for the same channel. | 135 | * is for the same device. |
136 | * 3. Only one channel has been configured and the new request is | 136 | * 3. Only one device has been configured and the new request is |
137 | * for a new channel and period of the new channel is same as | 137 | * for a new device and period of the new device is same as |
138 | * the current configured period. | 138 | * the current configured period. |
139 | * 4. More than one channels are configured and period of the new | 139 | * 4. More than one devices are configured and period of the new |
140 | * requestis the same as the current period. | 140 | * requestis the same as the current period. |
141 | */ | 141 | */ |
142 | if (!ncfg || | 142 | if (!ncfg || |
@@ -201,7 +201,7 @@ static int sti_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) | |||
201 | int ret = 0; | 201 | int ret = 0; |
202 | 202 | ||
203 | /* | 203 | /* |
204 | * Since we have a common enable for all PWM channels, | 204 | * Since we have a common enable for all PWM devices, |
205 | * do not enable if already enabled. | 205 | * do not enable if already enabled. |
206 | */ | 206 | */ |
207 | mutex_lock(&pc->sti_pwm_lock); | 207 | mutex_lock(&pc->sti_pwm_lock); |
@@ -259,11 +259,11 @@ static int sti_pwm_probe_dt(struct sti_pwm_chip *pc) | |||
259 | const struct reg_field *reg_fields; | 259 | const struct reg_field *reg_fields; |
260 | struct device_node *np = dev->of_node; | 260 | struct device_node *np = dev->of_node; |
261 | struct sti_pwm_compat_data *cdata = pc->cdata; | 261 | struct sti_pwm_compat_data *cdata = pc->cdata; |
262 | u32 num_chan; | 262 | u32 num_devs; |
263 | 263 | ||
264 | of_property_read_u32(np, "st,pwm-num-chan", &num_chan); | 264 | of_property_read_u32(np, "st,pwm-num-chan", &num_devs); |
265 | if (num_chan) | 265 | if (num_devs) |
266 | cdata->num_chan = num_chan; | 266 | cdata->num_devs = num_devs; |
267 | 267 | ||
268 | reg_fields = cdata->reg_fields; | 268 | reg_fields = cdata->reg_fields; |
269 | 269 | ||
@@ -330,7 +330,7 @@ static int sti_pwm_probe(struct platform_device *pdev) | |||
330 | cdata->reg_fields = &sti_pwm_regfields[0]; | 330 | cdata->reg_fields = &sti_pwm_regfields[0]; |
331 | cdata->max_prescale = 0xff; | 331 | cdata->max_prescale = 0xff; |
332 | cdata->max_pwm_cnt = 255; | 332 | cdata->max_pwm_cnt = 255; |
333 | cdata->num_chan = 1; | 333 | cdata->num_devs = 1; |
334 | 334 | ||
335 | pc->cdata = cdata; | 335 | pc->cdata = cdata; |
336 | pc->dev = dev; | 336 | pc->dev = dev; |
@@ -362,7 +362,7 @@ static int sti_pwm_probe(struct platform_device *pdev) | |||
362 | pc->chip.dev = dev; | 362 | pc->chip.dev = dev; |
363 | pc->chip.ops = &sti_pwm_ops; | 363 | pc->chip.ops = &sti_pwm_ops; |
364 | pc->chip.base = -1; | 364 | pc->chip.base = -1; |
365 | pc->chip.npwm = pc->cdata->num_chan; | 365 | pc->chip.npwm = pc->cdata->num_devs; |
366 | pc->chip.can_sleep = true; | 366 | pc->chip.can_sleep = true; |
367 | 367 | ||
368 | ret = pwmchip_add(&pc->chip); | 368 | ret = pwmchip_add(&pc->chip); |
@@ -381,7 +381,7 @@ static int sti_pwm_remove(struct platform_device *pdev) | |||
381 | struct sti_pwm_chip *pc = platform_get_drvdata(pdev); | 381 | struct sti_pwm_chip *pc = platform_get_drvdata(pdev); |
382 | unsigned int i; | 382 | unsigned int i; |
383 | 383 | ||
384 | for (i = 0; i < pc->cdata->num_chan; i++) | 384 | for (i = 0; i < pc->cdata->num_devs; i++) |
385 | pwm_disable(&pc->chip.pwms[i]); | 385 | pwm_disable(&pc->chip.pwms[i]); |
386 | 386 | ||
387 | clk_unprepare(pc->clk); | 387 | clk_unprepare(pc->clk); |