summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt4
-rw-r--r--drivers/pwm/pwm-omap-dmtimer.c12
2 files changed, 11 insertions, 5 deletions
diff --git a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
index 5befb538db95..2e53324fb720 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
@@ -9,6 +9,10 @@ Required properties:
9 9
10Optional properties: 10Optional properties:
11- ti,prescaler: Should be a value between 0 and 7, see the timers datasheet 11- ti,prescaler: Should be a value between 0 and 7, see the timers datasheet
12- ti,clock-source: Set dmtimer parent clock, values between 0 and 2:
13 - 0x00 - high-frequency system clock (timer_sys_ck)
14 - 0x01 - 32-kHz always-on clock (timer_32k_ck)
15 - 0x02 - external clock (timer_ext_ck, OMAP2 only)
12 16
13Example: 17Example:
14 pwm9: dmtimer-pwm@9 { 18 pwm9: dmtimer-pwm@9 {
diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
index 3e95090cd7cf..5ad42f33e70c 100644
--- a/drivers/pwm/pwm-omap-dmtimer.c
+++ b/drivers/pwm/pwm-omap-dmtimer.c
@@ -245,7 +245,7 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
245 struct pwm_omap_dmtimer_chip *omap; 245 struct pwm_omap_dmtimer_chip *omap;
246 struct pwm_omap_dmtimer_pdata *pdata; 246 struct pwm_omap_dmtimer_pdata *pdata;
247 pwm_omap_dmtimer *dm_timer; 247 pwm_omap_dmtimer *dm_timer;
248 u32 prescaler; 248 u32 v;
249 int status; 249 int status;
250 250
251 pdata = dev_get_platdata(&pdev->dev); 251 pdata = dev_get_platdata(&pdev->dev);
@@ -306,10 +306,12 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
306 if (pm_runtime_active(&omap->dm_timer_pdev->dev)) 306 if (pm_runtime_active(&omap->dm_timer_pdev->dev))
307 omap->pdata->stop(omap->dm_timer); 307 omap->pdata->stop(omap->dm_timer);
308 308
309 /* setup dmtimer prescaler */ 309 if (!of_property_read_u32(pdev->dev.of_node, "ti,prescaler", &v))
310 if (!of_property_read_u32(pdev->dev.of_node, "ti,prescaler", 310 omap->pdata->set_prescaler(omap->dm_timer, v);
311 &prescaler)) 311
312 omap->pdata->set_prescaler(omap->dm_timer, prescaler); 312 /* setup dmtimer clock source */
313 if (!of_property_read_u32(pdev->dev.of_node, "ti,clock-source", &v))
314 omap->pdata->set_source(omap->dm_timer, v);
313 315
314 omap->chip.dev = &pdev->dev; 316 omap->chip.dev = &pdev->dev;
315 omap->chip.ops = &pwm_omap_dmtimer_ops; 317 omap->chip.ops = &pwm_omap_dmtimer_ops;