aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pwm/pwm-renesas-tpu.c19
-rw-r--r--include/linux/platform_data/pwm-renesas-tpu.h16
2 files changed, 3 insertions, 32 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);
diff --git a/include/linux/platform_data/pwm-renesas-tpu.h b/include/linux/platform_data/pwm-renesas-tpu.h
deleted file mode 100644
index a7220b10ddab..000000000000
--- a/include/linux/platform_data/pwm-renesas-tpu.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#ifndef __PWM_RENESAS_TPU_H__
2#define __PWM_RENESAS_TPU_H__
3
4#include <linux/pwm.h>
5
6#define TPU_CHANNEL_MAX 4
7
8struct tpu_pwm_channel_data {
9 enum pwm_polarity polarity;
10};
11
12struct tpu_pwm_platform_data {
13 struct tpu_pwm_channel_data channels[TPU_CHANNEL_MAX];
14};
15
16#endif /* __PWM_RENESAS_TPU_H__ */