aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2014-05-19 16:42:34 -0400
committerThierry Reding <thierry.reding@gmail.com>2014-05-21 05:19:29 -0400
commitdc671157139918eaf61f73db1bd6dd02960b66e2 (patch)
tree1952411a956a50790e3bc86bb42fb85d94d1e5ba /drivers/pwm
parentb16001d745fbc900cc96c8ca2cd2cd08e738c421 (diff)
pwm: renesas-tpu: remove unused struct tpu_pwm_platform_data
The struct is not used anymore and the polarity initialization will be done using the PWM lookup table (or device tree). Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/pwm-renesas-tpu.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/pwm/pwm-renesas-tpu.c b/drivers/pwm/pwm-renesas-tpu.c
index cc13ff4cfab0..3b71b42e89d5 100644
--- a/drivers/pwm/pwm-renesas-tpu.c
+++ b/drivers/pwm/pwm-renesas-tpu.c
@@ -21,13 +21,14 @@
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/mutex.h> 22#include <linux/mutex.h>
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/platform_data/pwm-renesas-tpu.h>
25#include <linux/platform_device.h> 24#include <linux/platform_device.h>
26#include <linux/pm_runtime.h> 25#include <linux/pm_runtime.h>
27#include <linux/pwm.h> 26#include <linux/pwm.h>
28#include <linux/slab.h> 27#include <linux/slab.h>
29#include <linux/spinlock.h> 28#include <linux/spinlock.h>
30 29
30#define TPU_CHANNEL_MAX 4
31
31#define TPU_TSTR 0x00 /* Timer start register (shared) */ 32#define TPU_TSTR 0x00 /* Timer start register (shared) */
32 33
33#define TPU_TCRn 0x00 /* Timer control register */ 34#define TPU_TCRn 0x00 /* Timer control register */
@@ -87,7 +88,6 @@ struct tpu_pwm_device {
87 88
88struct tpu_device { 89struct tpu_device {
89 struct platform_device *pdev; 90 struct platform_device *pdev;
90 enum pwm_polarity polarities[TPU_CHANNEL_MAX];
91 struct pwm_chip chip; 91 struct pwm_chip chip;
92 spinlock_t lock; 92 spinlock_t lock;
93 93
@@ -229,7 +229,7 @@ static int tpu_pwm_request(struct pwm_chip *chip, struct pwm_device *_pwm)
229 229
230 pwm->tpu = tpu; 230 pwm->tpu = tpu;
231 pwm->channel = _pwm->hwpwm; 231 pwm->channel = _pwm->hwpwm;
232 pwm->polarity = tpu->polarities[pwm->channel]; 232 pwm->polarity = PWM_POLARITY_NORMAL;
233 pwm->prescaler = 0; 233 pwm->prescaler = 0;
234 pwm->period = 0; 234 pwm->period = 0;
235 pwm->duty = 0; 235 pwm->duty = 0;
@@ -388,16 +388,6 @@ static const struct pwm_ops tpu_pwm_ops = {
388 * Probe and remove 388 * Probe and remove
389 */ 389 */
390 390
391static void tpu_parse_pdata(struct tpu_device *tpu)
392{
393 struct tpu_pwm_platform_data *pdata = tpu->pdev->dev.platform_data;
394 unsigned int i;
395
396 for (i = 0; i < ARRAY_SIZE(tpu->polarities); ++i)
397 tpu->polarities[i] = pdata ? pdata->channels[i].polarity
398 : PWM_POLARITY_NORMAL;
399}
400
401static int tpu_probe(struct platform_device *pdev) 391static int tpu_probe(struct platform_device *pdev)
402{ 392{
403 struct tpu_device *tpu; 393 struct tpu_device *tpu;
@@ -411,9 +401,6 @@ static int tpu_probe(struct platform_device *pdev)
411 spin_lock_init(&tpu->lock); 401 spin_lock_init(&tpu->lock);
412 tpu->pdev = pdev; 402 tpu->pdev = pdev;
413 403
414 /* Initialize device configuration from platform data. */
415 tpu_parse_pdata(tpu);
416
417 /* Map memory, get clock and pin control. */ 404 /* Map memory, get clock and pin control. */
418 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 405 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
419 tpu->base = devm_ioremap_resource(&pdev->dev, res); 406 tpu->base = devm_ioremap_resource(&pdev->dev, res);