dect
/
linux-2.6
Archived
13
0
Fork 0

pwm: fixes for v3.6-rc3

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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJQNJEVAAoJEN0jrNd/PrOhuWMP+QHfkkRRetJXrBUq8YOISln3
 zPFh0oRgbd9679dIQ23Gzm8iFlD5bN8e4JBOleRGitv5ar6btqoS4F/AFRyCncOv
 cn7s2qdEQvXRF73gZwzUgwiTRBkf3dcYOdc2Y1GymzfQapIaEjsleC4nO3E0kkNf
 XpjaZGQZa1PNmrb93QsSuzuJtcemjFs9d2QA5YcB/EMJ/kCsz2/rpYv+q457rddS
 m/xBJyG4Q+CVSq7WxaK7X+opVx1amhALawUj+OgroW7y28HJhHt6UTZI1/zhL22B
 gZqxsdjKpU66CxHUUOz3olprGAXd2YIU3VFsRV8IcU1pZpCyJS3uGMueXwS21VC0
 OS3TxnaKNgOREidO22J6C3c5N2NZm9ERBLY3PMYVW0KWdeWzxJvwLRwpQoCUj0fm
 OpvmzqwxIKLcNgzppTEKXzFikwZcZZQ+zrZycoHxKSqu2YJtimrP59oqDUX69Wp3
 PBGrAZRU+uz9Zq18csidyL5DbLtIwEOILmMO/MnTuAQQ2z2avDTQ0xVzRPq51A/W
 QyYhStguxR0e4rHmD//lf695HywilZPUlj3aqVm4kCGaasWlRyinIOwPDuOUZuEw
 FcMb8+1tdNfu6mU0NgW8z3WajvG/p/pNPCMhtfsdwJTkHK5aB6sJJzFOJm7iVD8W
 F/IbEubPBu0k4RrQ/BIf
 =oTl5
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2012-08-22 10:27:12 -07:00
commit fec3c03fb0
7 changed files with 35 additions and 21 deletions

View File

@ -1,12 +1,31 @@
menuconfig PWM
bool "PWM Support"
bool "Pulse-Width Modulation (PWM) Support"
depends on !MACH_JZ4740 && !PUV3_PWM
help
This enables PWM support through the generic PWM framework.
You only need to enable this, if you also want to enable
one or more of the PWM drivers below.
Generic Pulse-Width Modulation (PWM) support.
If unsure, say N.
In Pulse-Width Modulation, a variation of the width of pulses
in a rectangular pulse signal is used as a means to alter the
average power of the signal. Applications include efficient
power delivery and voltage regulation. In computer systems,
PWMs are commonly used to control fans or the brightness of
display backlights.
This framework provides a generic interface to PWM devices
within the Linux kernel. On the driver side it provides an API
to register and unregister a PWM chip, an abstraction of a PWM
controller, that supports one or more PWM devices. Client
drivers can request PWM devices and use the generic framework
to configure as well as enable and disable them.
This generic framework replaces the legacy PWM framework which
allows only a single driver implementing the required API. Not
all legacy implementations have been ported to the framework
yet. The framework provides an API that is backward compatible
with the legacy framework so that existing client drivers
continue to work as expected.
If unsure, say no.
if PWM

View File

@ -129,8 +129,8 @@ static int pwm_device_request(struct pwm_device *pwm, const char *label)
return 0;
}
static struct pwm_device *of_pwm_simple_xlate(struct pwm_chip *pc,
const struct of_phandle_args *args)
static struct pwm_device *
of_pwm_simple_xlate(struct pwm_chip *pc, const struct of_phandle_args *args)
{
struct pwm_device *pwm;
@ -149,7 +149,7 @@ static struct pwm_device *of_pwm_simple_xlate(struct pwm_chip *pc,
return pwm;
}
void of_pwmchip_add(struct pwm_chip *chip)
static void of_pwmchip_add(struct pwm_chip *chip)
{
if (!chip->dev || !chip->dev->of_node)
return;
@ -162,7 +162,7 @@ void of_pwmchip_add(struct pwm_chip *chip)
of_node_get(chip->dev->of_node);
}
void of_pwmchip_remove(struct pwm_chip *chip)
static void of_pwmchip_remove(struct pwm_chip *chip)
{
if (chip->dev && chip->dev->of_node)
of_node_put(chip->dev->of_node);
@ -527,7 +527,7 @@ void __init pwm_add_table(struct pwm_lookup *table, size_t num)
struct pwm_device *pwm_get(struct device *dev, const char *con_id)
{
struct pwm_device *pwm = ERR_PTR(-EPROBE_DEFER);
const char *dev_id = dev ? dev_name(dev): NULL;
const char *dev_id = dev ? dev_name(dev) : NULL;
struct pwm_chip *chip = NULL;
unsigned int index = 0;
unsigned int best = 0;
@ -609,7 +609,7 @@ void pwm_put(struct pwm_device *pwm)
mutex_lock(&pwm_lock);
if (!test_and_clear_bit(PWMF_REQUESTED, &pwm->flags)) {
pr_warning("PWM device already freed\n");
pr_warn("PWM device already freed\n");
goto out;
}

View File

@ -225,6 +225,7 @@ static int s3c_pwm_probe(struct platform_device *pdev)
/* calculate base of control bits in TCON */
s3c->tcon_base = id == 0 ? 0 : (id * 4) + 4;
s3c->chip.dev = &pdev->dev;
s3c->chip.ops = &s3c_pwm_ops;
s3c->chip.base = -1;
s3c->chip.npwm = 1;

View File

@ -187,10 +187,8 @@ static int tegra_pwm_probe(struct platform_device *pdev)
}
pwm->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
if (!pwm->mmio_base) {
dev_err(&pdev->dev, "failed to ioremap() region\n");
if (!pwm->mmio_base)
return -EADDRNOTAVAIL;
}
platform_set_drvdata(pdev, pwm);

View File

@ -192,10 +192,8 @@ static int __devinit ecap_pwm_probe(struct platform_device *pdev)
}
pc->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
if (!pc->mmio_base) {
dev_err(&pdev->dev, "failed to ioremap() registers\n");
if (!pc->mmio_base)
return -EADDRNOTAVAIL;
}
ret = pwmchip_add(&pc->chip);
if (ret < 0) {

View File

@ -371,10 +371,8 @@ static int __devinit ehrpwm_pwm_probe(struct platform_device *pdev)
}
pc->mmio_base = devm_request_and_ioremap(&pdev->dev, r);
if (!pc->mmio_base) {
dev_err(&pdev->dev, "failed to ioremap() registers\n");
if (!pc->mmio_base)
return -EADDRNOTAVAIL;
}
ret = pwmchip_add(&pc->chip);
if (ret < 0) {

View File

@ -41,7 +41,7 @@ static inline void pwm_busy_wait(void __iomem *reg, u8 bitmask)
cpu_relax();
if (unlikely(!loops))
pr_warning("Waiting for status bits 0x%x to clear timed out\n",
pr_warn("Waiting for status bits 0x%x to clear timed out\n",
bitmask);
}