Commit fec3c03f authored by Linus Torvalds's avatar Linus Torvalds

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
parents f753c4ec b817bf5c
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.
If unsure, say N.
Generic Pulse-Width Modulation (PWM) support.
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
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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);
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment