Date:2012-09-02 15:02:14 (8 years 2 months ago)
Author:Maarten ter Huurne
Commit:0ab6ec84e32fb7b3e281e96d17aba8c81492c753
Message:pwm: JZ4740: Include PWM0 and PWM1

This ensures that the numbering that the pwm core and the hardware use
is the same, to avoid confusion.

Also, the original code didn't actually work because the core pwm number
was also used as a timer number and was therefore 2 too low.
Files: drivers/pwm/pwm-jz4740.c (2 diffs)

Change Details

drivers/pwm/pwm-jz4740.c
2424#include <asm/mach-jz4740/gpio.h>
2525#include <timer.h>
2626
27#define NUM_PWM 6
27#define NUM_PWM 8
2828
2929static const unsigned int jz4740_pwm_gpio_list[NUM_PWM] = {
30    JZ_GPIO_PWM0,
31    JZ_GPIO_PWM1,
3032    JZ_GPIO_PWM2,
3133    JZ_GPIO_PWM3,
3234    JZ_GPIO_PWM4,
...... 
5052    unsigned int gpio = jz4740_pwm_gpio_list[pwm->hwpwm];
5153    int ret;
5254
55    /*
56     * Timer 0 and 1 are used for system tasks, so they are unavailable
57     * for use as PWMs.
58     */
59    if (pwm->hwpwm < 2)
60        return -EBUSY;
61
5362    ret = gpio_request(gpio, pwm->label);
5463
5564    if (ret) {

Archive Download the corresponding diff file



interactive