Lines Matching refs:omap

53 static void pwm_omap_dmtimer_start(struct pwm_omap_dmtimer_chip *omap)  in pwm_omap_dmtimer_start()  argument
63 omap->pdata->enable(omap->dm_timer); in pwm_omap_dmtimer_start()
64 omap->pdata->write_counter(omap->dm_timer, DM_TIMER_LOAD_MIN); in pwm_omap_dmtimer_start()
65 omap->pdata->disable(omap->dm_timer); in pwm_omap_dmtimer_start()
67 omap->pdata->start(omap->dm_timer); in pwm_omap_dmtimer_start()
73 struct pwm_omap_dmtimer_chip *omap = to_pwm_omap_dmtimer_chip(chip); in pwm_omap_dmtimer_enable() local
75 mutex_lock(&omap->mutex); in pwm_omap_dmtimer_enable()
76 pwm_omap_dmtimer_start(omap); in pwm_omap_dmtimer_enable()
77 mutex_unlock(&omap->mutex); in pwm_omap_dmtimer_enable()
85 struct pwm_omap_dmtimer_chip *omap = to_pwm_omap_dmtimer_chip(chip); in pwm_omap_dmtimer_disable() local
87 mutex_lock(&omap->mutex); in pwm_omap_dmtimer_disable()
88 omap->pdata->stop(omap->dm_timer); in pwm_omap_dmtimer_disable()
89 mutex_unlock(&omap->mutex); in pwm_omap_dmtimer_disable()
96 struct pwm_omap_dmtimer_chip *omap = to_pwm_omap_dmtimer_chip(chip); in pwm_omap_dmtimer_config() local
106 mutex_lock(&omap->mutex); in pwm_omap_dmtimer_config()
110 mutex_unlock(&omap->mutex); in pwm_omap_dmtimer_config()
114 fclk = omap->pdata->get_fclk(omap->dm_timer); in pwm_omap_dmtimer_config()
182 timer_active = pm_runtime_active(&omap->dm_timer_pdev->dev); in pwm_omap_dmtimer_config()
184 omap->pdata->stop(omap->dm_timer); in pwm_omap_dmtimer_config()
186 omap->pdata->set_load(omap->dm_timer, true, load_value); in pwm_omap_dmtimer_config()
187 omap->pdata->set_match(omap->dm_timer, true, match_value); in pwm_omap_dmtimer_config()
192 omap->pdata->set_pwm(omap->dm_timer, in pwm_omap_dmtimer_config()
199 pwm_omap_dmtimer_start(omap); in pwm_omap_dmtimer_config()
201 mutex_unlock(&omap->mutex); in pwm_omap_dmtimer_config()
206 mutex_unlock(&omap->mutex); in pwm_omap_dmtimer_config()
215 struct pwm_omap_dmtimer_chip *omap = to_pwm_omap_dmtimer_chip(chip); in pwm_omap_dmtimer_set_polarity() local
221 mutex_lock(&omap->mutex); in pwm_omap_dmtimer_set_polarity()
222 omap->pdata->set_pwm(omap->dm_timer, in pwm_omap_dmtimer_set_polarity()
226 mutex_unlock(&omap->mutex); in pwm_omap_dmtimer_set_polarity()
244 struct pwm_omap_dmtimer_chip *omap; in pwm_omap_dmtimer_probe() local
306 omap = devm_kzalloc(&pdev->dev, sizeof(*omap), GFP_KERNEL); in pwm_omap_dmtimer_probe()
307 if (!omap) { in pwm_omap_dmtimer_probe()
312 omap->pdata = pdata; in pwm_omap_dmtimer_probe()
313 omap->dm_timer = dm_timer; in pwm_omap_dmtimer_probe()
314 omap->dm_timer_pdev = timer_pdev; in pwm_omap_dmtimer_probe()
320 if (pm_runtime_active(&omap->dm_timer_pdev->dev)) in pwm_omap_dmtimer_probe()
321 omap->pdata->stop(omap->dm_timer); in pwm_omap_dmtimer_probe()
324 omap->pdata->set_prescaler(omap->dm_timer, v); in pwm_omap_dmtimer_probe()
328 omap->pdata->set_source(omap->dm_timer, v); in pwm_omap_dmtimer_probe()
330 omap->chip.dev = &pdev->dev; in pwm_omap_dmtimer_probe()
331 omap->chip.ops = &pwm_omap_dmtimer_ops; in pwm_omap_dmtimer_probe()
332 omap->chip.base = -1; in pwm_omap_dmtimer_probe()
333 omap->chip.npwm = 1; in pwm_omap_dmtimer_probe()
334 omap->chip.of_xlate = of_pwm_xlate_with_flags; in pwm_omap_dmtimer_probe()
335 omap->chip.of_pwm_n_cells = 3; in pwm_omap_dmtimer_probe()
337 mutex_init(&omap->mutex); in pwm_omap_dmtimer_probe()
339 ret = pwmchip_add(&omap->chip); in pwm_omap_dmtimer_probe()
342 omap->pdata->free(omap->dm_timer); in pwm_omap_dmtimer_probe()
346 platform_set_drvdata(pdev, omap); in pwm_omap_dmtimer_probe()
353 struct pwm_omap_dmtimer_chip *omap = platform_get_drvdata(pdev); in pwm_omap_dmtimer_remove() local
355 if (pm_runtime_active(&omap->dm_timer_pdev->dev)) in pwm_omap_dmtimer_remove()
356 omap->pdata->stop(omap->dm_timer); in pwm_omap_dmtimer_remove()
358 omap->pdata->free(omap->dm_timer); in pwm_omap_dmtimer_remove()
360 mutex_destroy(&omap->mutex); in pwm_omap_dmtimer_remove()
362 return pwmchip_remove(&omap->chip); in pwm_omap_dmtimer_remove()