History log of /drivers/pwm/pwm-atmel-tcb.c
Revision Date Author Comments
4930d247af29f849cd1bddd65be2400684dc886e 06-Sep-2014 Gaël PORTAY <gael.portay@gmail.com> ARM: at91/tclib: move initialization from alloc to probe

Move resource retrieval from atmel_tc_alloc to tc_probe to avoid lately
reporting resource related issues when a TC block user request a TC block.

Moreover, resources retrieval are usually done in the probe function,
thus moving them add some consistency with other drivers.

Initialization is done once, ie not every time a tc block is requested.
If it fails, the device is not appended to the list of tc blocks.

Furhermore, the device id is retrieved at probe as well, avoiding parsing
DT every time the user requests of tc block.

Signed-off-by: Gaël PORTAY <gael.portay@gmail.com>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
ceb12f939809b3445d0b2118d4b07638bb07afa6 18-Sep-2013 Boris BREZILLON <b.brezillon@overkiz.com> pwm: atmel-tcb: fix max time computation for slow clk source

Use the the tcb counter width to compute the maximum time that can be
represented using the slow clock source instead of the static 16 bit width.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
f3a82170aef72bf57f03e5c154fc94fad54968b1 18-Sep-2013 Boris BREZILLON <b.brezillon@overkiz.com> pwm: atmel-tcb: add missing clk source config

Clock source changes are never applied to the CMR register.
This may lead to wrong period/duty cycle configuration.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
3dd0a909479c1d372341d749b4ff94cd638b57da 12-Jun-2013 Thierry Reding <thierry.reding@gmail.com> pwm: Fill in missing .owner fields

Some drivers don't set the .owner fields of the struct device_driver or
struct pwm_ops, which causes the module usage count to become wrong.

Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
8796f9c5656dedd186eda88c07db6a58d1985938 07-Jun-2013 Boris BREZILLON <b.brezillon@overkiz.com> pwm: atmel-tcb: prepare clk before calling enable

Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
83c80dc5358270a665666ea5b9ddd24351d86354 31-Mar-2013 Axel Lin <axel.lin@ingics.com> pwm: atmel-tcb: Add .owner to struct pwm_ops

Add missing .owner of struct pwm_ops. This prevents the module from being
removed from underneath its users.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
9421bade0765d8ffb86b8a99213b611278a3542a 08-Jan-2013 Boris BREZILLON <linux-arm@overkiz.com> pwm: atmel: add Timer Counter Block PWM driver

This patch adds a PWM driver based on Atmel Timer Counter Block. The
Timer Counter Block is used in Waveform generator mode.

A Timer Counter Block provides up to 6 PWM devices grouped by 2:
* group 0 = PWM 0 and 1
* group 1 = PWM 2 and 3
* group 2 = PMW 4 and 5

PWM devices in a given group must be configured with the same period
value. If a PWM device in a group tries to change the period value and
the other device is already configured with a different value an error
will be returned.

This driver requires device tree support. The Timer Counter Block number
used to create a PWM chip is given by the tc-block field in an
"atmel,tcb-pwm" compatible node.

This patch was tested on kizbox board (at91sam9g20 SoC) with pwm-leds.

Signed-off-by: Boris BREZILLON <linux-arm@overkiz.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>