Skip to content

Commit fec3c03

Browse files
committed
Merge tag 'for-3.6-rc3' of git://gitorious.org/linux-pwm/linux-pwm
Pull pwm fixes from Thierry Reding: "These patches fix the Samsung PWM driver and perform some minor cleanups like fixing checkpatch and sparse warnings. Two redundant error messages are removed and the Kconfig help text for the PWM subsystem is made more descriptive." * tag 'for-3.6-rc3' of git://gitorious.org/linux-pwm/linux-pwm: pwm: Improve Kconfig help text pwm: core: Fix coding style issues pwm: vt8500: Fix coding style issue pwm: Remove a redundant error message when devm_request_and_ioremap fails pwm: samsung: add missing device pointer to struct pwm_chip pwm: Add missing static storage class specifiers in core.c file
2 parents f753c4e + b817bf5 commit fec3c03

File tree

7 files changed

+36
-22
lines changed

7 files changed

+36
-22
lines changed

drivers/pwm/Kconfig

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
11
menuconfig PWM
2-
bool "PWM Support"
2+
bool "Pulse-Width Modulation (PWM) Support"
33
depends on !MACH_JZ4740 && !PUV3_PWM
44
help
5-
This enables PWM support through the generic PWM framework.
6-
You only need to enable this, if you also want to enable
7-
one or more of the PWM drivers below.
8-
9-
If unsure, say N.
5+
Generic Pulse-Width Modulation (PWM) support.
6+
7+
In Pulse-Width Modulation, a variation of the width of pulses
8+
in a rectangular pulse signal is used as a means to alter the
9+
average power of the signal. Applications include efficient
10+
power delivery and voltage regulation. In computer systems,
11+
PWMs are commonly used to control fans or the brightness of
12+
display backlights.
13+
14+
This framework provides a generic interface to PWM devices
15+
within the Linux kernel. On the driver side it provides an API
16+
to register and unregister a PWM chip, an abstraction of a PWM
17+
controller, that supports one or more PWM devices. Client
18+
drivers can request PWM devices and use the generic framework
19+
to configure as well as enable and disable them.
20+
21+
This generic framework replaces the legacy PWM framework which
22+
allows only a single driver implementing the required API. Not
23+
all legacy implementations have been ported to the framework
24+
yet. The framework provides an API that is backward compatible
25+
with the legacy framework so that existing client drivers
26+
continue to work as expected.
27+
28+
If unsure, say no.
1029

1130
if PWM
1231

drivers/pwm/core.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ static int pwm_device_request(struct pwm_device *pwm, const char *label)
129129
return 0;
130130
}
131131

132-
static struct pwm_device *of_pwm_simple_xlate(struct pwm_chip *pc,
133-
const struct of_phandle_args *args)
132+
static struct pwm_device *
133+
of_pwm_simple_xlate(struct pwm_chip *pc, const struct of_phandle_args *args)
134134
{
135135
struct pwm_device *pwm;
136136

@@ -149,7 +149,7 @@ static struct pwm_device *of_pwm_simple_xlate(struct pwm_chip *pc,
149149
return pwm;
150150
}
151151

152-
void of_pwmchip_add(struct pwm_chip *chip)
152+
static void of_pwmchip_add(struct pwm_chip *chip)
153153
{
154154
if (!chip->dev || !chip->dev->of_node)
155155
return;
@@ -162,7 +162,7 @@ void of_pwmchip_add(struct pwm_chip *chip)
162162
of_node_get(chip->dev->of_node);
163163
}
164164

165-
void of_pwmchip_remove(struct pwm_chip *chip)
165+
static void of_pwmchip_remove(struct pwm_chip *chip)
166166
{
167167
if (chip->dev && chip->dev->of_node)
168168
of_node_put(chip->dev->of_node);
@@ -527,7 +527,7 @@ void __init pwm_add_table(struct pwm_lookup *table, size_t num)
527527
struct pwm_device *pwm_get(struct device *dev, const char *con_id)
528528
{
529529
struct pwm_device *pwm = ERR_PTR(-EPROBE_DEFER);
530-
const char *dev_id = dev ? dev_name(dev): NULL;
530+
const char *dev_id = dev ? dev_name(dev) : NULL;
531531
struct pwm_chip *chip = NULL;
532532
unsigned int index = 0;
533533
unsigned int best = 0;
@@ -609,7 +609,7 @@ void pwm_put(struct pwm_device *pwm)
609609
mutex_lock(&pwm_lock);
610610

611611
if (!test_and_clear_bit(PWMF_REQUESTED, &pwm->flags)) {
612-
pr_warning("PWM device already freed\n");
612+
pr_warn("PWM device already freed\n");
613613
goto out;
614614
}
615615

drivers/pwm/pwm-samsung.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ static int s3c_pwm_probe(struct platform_device *pdev)
225225

226226
/* calculate base of control bits in TCON */
227227
s3c->tcon_base = id == 0 ? 0 : (id * 4) + 4;
228+
s3c->chip.dev = &pdev->dev;
228229
s3c->chip.ops = &s3c_pwm_ops;
229230
s3c->chip.base = -1;
230231
s3c->chip.npwm = 1;

drivers/pwm/pwm-tegra.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,8 @@ static int tegra_pwm_probe(struct platform_device *pdev)
187187
}
188188

189189
pwm->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
190-
if (!pwm->mmio_base) {
191-
dev_err(&pdev->dev, "failed to ioremap() region\n");
190+
if (!pwm->mmio_base)
192191
return -EADDRNOTAVAIL;
193-
}
194192

195193
platform_set_drvdata(pdev, pwm);
196194

drivers/pwm/pwm-tiecap.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,8 @@ static int __devinit ecap_pwm_probe(struct platform_device *pdev)
192192
}
193193

194194
pc->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
195-
if (!pc->mmio_base) {
196-
dev_err(&pdev->dev, "failed to ioremap() registers\n");
195+
if (!pc->mmio_base)
197196
return -EADDRNOTAVAIL;
198-
}
199197

200198
ret = pwmchip_add(&pc->chip);
201199
if (ret < 0) {

drivers/pwm/pwm-tiehrpwm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,8 @@ static int __devinit ehrpwm_pwm_probe(struct platform_device *pdev)
371371
}
372372

373373
pc->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
374-
if (!pc->mmio_base) {
375-
dev_err(&pdev->dev, "failed to ioremap() registers\n");
374+
if (!pc->mmio_base)
376375
return -EADDRNOTAVAIL;
377-
}
378376

379377
ret = pwmchip_add(&pc->chip);
380378
if (ret < 0) {

drivers/pwm/pwm-vt8500.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static inline void pwm_busy_wait(void __iomem *reg, u8 bitmask)
4141
cpu_relax();
4242

4343
if (unlikely(!loops))
44-
pr_warning("Waiting for status bits 0x%x to clear timed out\n",
44+
pr_warn("Waiting for status bits 0x%x to clear timed out\n",
4545
bitmask);
4646
}
4747

0 commit comments

Comments
 (0)