Re: [PATCH] pwm: don't allow duty cycle higher than period

2016-05-27 Thread Brian Norris
On Fri, May 27, 2016 at 09:39:43AM -0700, Brian Norris wrote: > On Fri, May 27, 2016 at 06:38:14PM +0200, Boris Brezillon wrote: > > On Fri, 27 May 2016 09:35:33 -0700 > > Brian Norris wrote: > > > On Fri, May 27, 2016 at 09:34:39AM +0200, Boris Brezillon wrote: > > > Now that you mention it, I th

Re: [PATCH] pwm: don't allow duty cycle higher than period

2016-05-27 Thread Brian Norris
Hi Boris, On Fri, May 27, 2016 at 09:34:39AM +0200, Boris Brezillon wrote: > On Thu, 26 May 2016 14:05:30 -0700 > Brian Norris wrote: > > > It doesn't make sense to allow the duty cycle to be larger than the > > period. I can see this behavior by, e.g.: > > > > # echo 1 > /sys/class/pwm/pwmch

Re: [PATCH] pwm: don't allow duty cycle higher than period

2016-05-27 Thread Boris Brezillon
On Fri, 27 May 2016 18:38:14 +0200 Boris Brezillon wrote: > On Fri, 27 May 2016 09:35:33 -0700 > Brian Norris wrote: > > > Hi Boris, > > > > On Fri, May 27, 2016 at 09:34:39AM +0200, Boris Brezillon wrote: > > > On Thu, 26 May 2016 14:05:30 -0700 > > > Brian Norris wrote: > > > > > > >

Re: [PATCH] pwm: don't allow duty cycle higher than period

2016-05-27 Thread Brian Norris
On Fri, May 27, 2016 at 06:38:14PM +0200, Boris Brezillon wrote: > On Fri, 27 May 2016 09:35:33 -0700 > Brian Norris wrote: > > On Fri, May 27, 2016 at 09:34:39AM +0200, Boris Brezillon wrote: > > Now that you mention it, I think you've also dropped some signed > > (negative value) checking in pwm

Re: [PATCH] pwm: don't allow duty cycle higher than period

2016-05-27 Thread Boris Brezillon
On Fri, 27 May 2016 09:35:33 -0700 Brian Norris wrote: > Hi Boris, > > On Fri, May 27, 2016 at 09:34:39AM +0200, Boris Brezillon wrote: > > On Thu, 26 May 2016 14:05:30 -0700 > > Brian Norris wrote: > > > > > It doesn't make sense to allow the duty cycle to be larger than the > > > period. I

Re: [PATCH] pwm: don't allow duty cycle higher than period

2016-05-27 Thread Boris Brezillon
Hi Brian, On Thu, 26 May 2016 14:05:30 -0700 Brian Norris wrote: > It doesn't make sense to allow the duty cycle to be larger than the > period. I can see this behavior by, e.g.: > > # echo 1 > /sys/class/pwm/pwmchip0/export > # cat /sys/class/pwm/pwmchip0/pwm1/period > 100 > # echo 101

[PATCH] pwm: don't allow duty cycle higher than period

2016-05-26 Thread Brian Norris
It doesn't make sense to allow the duty cycle to be larger than the period. I can see this behavior by, e.g.: # echo 1 > /sys/class/pwm/pwmchip0/export # cat /sys/class/pwm/pwmchip0/pwm1/period 100 # echo 101 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle [... driver may or may not reject the