Lines Matching full:tpu

3  * R-Mobile TPU PWM driver
72 struct tpu_device *tpu; member
73 unsigned int channel; /* Channel number in the TPU */
94 void __iomem *base = pwm->tpu->base + TPU_CHANNEL_OFFSET in tpu_pwm_write()
105 dev_dbg(&pwm->tpu->pdev->dev, "%u: configuring pin as %s\n", in tpu_pwm_set_pin()
132 spin_lock_irqsave(&pwm->tpu->lock, flags); in tpu_pwm_start_stop()
133 value = ioread16(pwm->tpu->base + TPU_TSTR); in tpu_pwm_start_stop()
140 iowrite16(value, pwm->tpu->base + TPU_TSTR); in tpu_pwm_start_stop()
141 spin_unlock_irqrestore(&pwm->tpu->lock, flags); in tpu_pwm_start_stop()
150 pm_runtime_get_sync(&pwm->tpu->pdev->dev); in tpu_pwm_timer_start()
151 ret = clk_prepare_enable(pwm->tpu->clk); in tpu_pwm_timer_start()
153 dev_err(&pwm->tpu->pdev->dev, "cannot enable clock\n"); in tpu_pwm_timer_start()
182 dev_dbg(&pwm->tpu->pdev->dev, "%u: TGRA 0x%04x TGRB 0x%04x\n", in tpu_pwm_timer_start()
200 clk_disable_unprepare(pwm->tpu->clk); in tpu_pwm_timer_stop()
201 pm_runtime_put(&pwm->tpu->pdev->dev); in tpu_pwm_timer_stop()
212 struct tpu_device *tpu = to_tpu_device(chip); in tpu_pwm_request() local
222 pwm->tpu = tpu; in tpu_pwm_request()
249 struct tpu_device *tpu = to_tpu_device(chip); in tpu_pwm_config() local
261 clk_rate = clk_get_rate(tpu->clk); in tpu_pwm_config()
271 dev_err(&tpu->pdev->dev, "clock rate mismatch\n"); in tpu_pwm_config()
284 dev_dbg(&tpu->pdev->dev, in tpu_pwm_config()
306 dev_dbg(&tpu->pdev->dev, "%u: TGRA 0x%04x\n", pwm->channel, in tpu_pwm_config()
385 struct tpu_device *tpu; in tpu_probe() local
389 tpu = devm_kzalloc(&pdev->dev, sizeof(*tpu), GFP_KERNEL); in tpu_probe()
390 if (tpu == NULL) in tpu_probe()
393 spin_lock_init(&tpu->lock); in tpu_probe()
394 tpu->pdev = pdev; in tpu_probe()
398 tpu->base = devm_ioremap_resource(&pdev->dev, res); in tpu_probe()
399 if (IS_ERR(tpu->base)) in tpu_probe()
400 return PTR_ERR(tpu->base); in tpu_probe()
402 tpu->clk = devm_clk_get(&pdev->dev, NULL); in tpu_probe()
403 if (IS_ERR(tpu->clk)) { in tpu_probe()
405 return PTR_ERR(tpu->clk); in tpu_probe()
409 platform_set_drvdata(pdev, tpu); in tpu_probe()
411 tpu->chip.dev = &pdev->dev; in tpu_probe()
412 tpu->chip.ops = &tpu_pwm_ops; in tpu_probe()
413 tpu->chip.of_xlate = of_pwm_xlate_with_flags; in tpu_probe()
414 tpu->chip.of_pwm_n_cells = 3; in tpu_probe()
415 tpu->chip.base = -1; in tpu_probe()
416 tpu->chip.npwm = TPU_CHANNEL_MAX; in tpu_probe()
420 ret = pwmchip_add(&tpu->chip); in tpu_probe()
432 struct tpu_device *tpu = platform_get_drvdata(pdev); in tpu_remove() local
435 ret = pwmchip_remove(&tpu->chip); in tpu_remove()
444 { .compatible = "renesas,tpu-r8a73a4", },
445 { .compatible = "renesas,tpu-r8a7740", },
446 { .compatible = "renesas,tpu-r8a7790", },
447 { .compatible = "renesas,tpu", },
458 .name = "renesas-tpu-pwm",
466 MODULE_DESCRIPTION("Renesas TPU PWM Driver");
468 MODULE_ALIAS("platform:renesas-tpu-pwm");