RE: [PWM PATCH 2/5] Emulates PWM hardware using a high-resolution timer and a GPIO pin

2010-02-16 Thread H Hartley Sweeten
On Friday, February 12, 2010 9:27 AM, Bill Gatliff wrote: H Hartley Sweeten wrote: FWIW, the gpiolib API will accept any non-zero value to set a gpio pin and a zero value to clear the pin. It makes me sort of cringe to say this, but I'm going to assume that the API is intended to work

Re: [PWM PATCH 2/5] Emulates PWM hardware using a high-resolution timer and a GPIO pin

2010-02-12 Thread Geert Uytterhoeven
2010/2/12 Stanislav O. Bezzubtsev s...@lvk.cs.msu.su: The second strange thing is unsigned long name:1. I'm not sure but as far as I can remember the right way to define several-bits field is int name:1. But I might be mistaken. A bitfield of size 1 should not be signed, as there's no space

Re: [PWM PATCH 2/5] Emulates PWM hardware using a high-resolution timer and a GPIO pin

2010-02-12 Thread Pavel Machek
11.02.2010, ? 23:58, Pavel Machek ???(?): On Thu 2010-02-11 14:35:14, Bill Gatliff wrote: Pavel Machek wrote: +static void +gpio_pwm_work (struct work_struct *work) +{ +struct gpio_pwm *gp = container_of(work, struct gpio_pwm, work); + +if (gp-active) +

RE: [PWM PATCH 2/5] Emulates PWM hardware using a high-resolution timer and a GPIO pin

2010-02-12 Thread H Hartley Sweeten
Thursday, February 11, 2010 1:35 PM, Bill Gatliff wrote: Pavel Machek wrote: +static void +gpio_pwm_work (struct work_struct *work) +{ + struct gpio_pwm *gp = container_of(work, struct gpio_pwm, work); + + if (gp-active) + gpio_direction_output(gp-gpio, gp-polarity ? 1 : 0);

Re: [PWM PATCH 2/5] Emulates PWM hardware using a high-resolution timer and a GPIO pin

2010-02-11 Thread Pavel Machek
+static void +gpio_pwm_work (struct work_struct *work) +{ + struct gpio_pwm *gp = container_of(work, struct gpio_pwm, work); + + if (gp-active) + gpio_direction_output(gp-gpio, gp-polarity ? 1 : 0); + else + gpio_direction_output(gp-gpio, gp-polarity ?

Re: [PWM PATCH 2/5] Emulates PWM hardware using a high-resolution timer and a GPIO pin

2010-02-11 Thread Stanislav O. Bezzubtsev
11.02.2010, в 23:58, Pavel Machek написал(а): On Thu 2010-02-11 14:35:14, Bill Gatliff wrote: Pavel Machek wrote: +static void +gpio_pwm_work (struct work_struct *work) +{ + struct gpio_pwm *gp = container_of(work, struct gpio_pwm, work); + + if (gp-active) +

[PWM PATCH 2/5] Emulates PWM hardware using a high-resolution timer and a GPIO pin

2010-02-01 Thread Bill Gatliff
Signed-off-by: Bill Gatliff b...@billgatliff.com --- drivers/pwm/gpio.c | 307 1 files changed, 307 insertions(+), 0 deletions(-) create mode 100644 drivers/pwm/gpio.c diff --git a/drivers/pwm/gpio.c b/drivers/pwm/gpio.c new file mode