Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-05-06 Thread Anton Vorontsov
On Sun, May 06, 2007 at 06:39:27PM -0700, David Brownell wrote: > On Thursday 12 April 2007, David Brownell wrote: > > > This driver used to stop code/logic duplication through different > > > machines we porting at handhelds.org. pda_power register machs' power > > > supplies, and will take care

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-05-06 Thread David Brownell
On Thursday 12 April 2007, David Brownell wrote: > > This driver used to stop code/logic duplication through different > > machines we porting at handhelds.org. pda_power register machs' power > > supplies, and will take care about notifying batteries about power > > changes through external power

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-05-06 Thread David Brownell
On Thursday 12 April 2007, David Brownell wrote: This driver used to stop code/logic duplication through different machines we porting at handhelds.org. pda_power register machs' power supplies, and will take care about notifying batteries about power changes through external power

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-05-06 Thread Anton Vorontsov
On Sun, May 06, 2007 at 06:39:27PM -0700, David Brownell wrote: On Thursday 12 April 2007, David Brownell wrote: This driver used to stop code/logic duplication through different machines we porting at handhelds.org. pda_power register machs' power supplies, and will take care about

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-16 Thread Anton Vorontsov
On Mon, Apr 16, 2007 at 09:16:15PM +0100, Russell King wrote: > On Fri, Apr 13, 2007 at 05:50:01PM +0400, Anton Vorontsov wrote: > > +/* > > + * include/linux/ioport.h does not provide flags for generic IRQ trigger > > + * types. So, we're using "ISA PnP IRQ specific bits", and converting them. >

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-16 Thread Russell King
On Fri, Apr 13, 2007 at 05:50:01PM +0400, Anton Vorontsov wrote: > +/* > + * include/linux/ioport.h does not provide flags for generic IRQ trigger > + * types. So, we're using "ISA PnP IRQ specific bits", and converting them. > + */ > +static unsigned int get_irq_flags(struct resource *res) > +{ >

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-16 Thread Russell King
On Fri, Apr 13, 2007 at 05:50:01PM +0400, Anton Vorontsov wrote: +/* + * include/linux/ioport.h does not provide flags for generic IRQ trigger + * types. So, we're using ISA PnP IRQ specific bits, and converting them. + */ +static unsigned int get_irq_flags(struct resource *res) +{ +

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-16 Thread Anton Vorontsov
On Mon, Apr 16, 2007 at 09:16:15PM +0100, Russell King wrote: On Fri, Apr 13, 2007 at 05:50:01PM +0400, Anton Vorontsov wrote: +/* + * include/linux/ioport.h does not provide flags for generic IRQ trigger + * types. So, we're using ISA PnP IRQ specific bits, and converting them. + */

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread Anton Vorontsov
On Thu, Apr 12, 2007 at 03:24:56AM +0400, Anton Vorontsov wrote: > This driver used to stop code/logic duplication through different > machines we porting at handhelds.org. pda_power register machs' power > supplies, and will take care about notifying batteries about power > changes through

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread Anton Vorontsov
On Fri, Apr 13, 2007 at 03:25:13AM -0700, David Brownell wrote: > On Friday 13 April 2007 2:52 am, Anton Vorontsov wrote: > > > > But I got the point, and yes I can't explain why it works correctly. > > > > > > It probably doesn't work correctly. But it's not broken enough to > > > fail badly. >

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread David Brownell
On Friday 13 April 2007 2:52 am, Anton Vorontsov wrote: > > > But I got the point, and yes I can't explain why it works correctly. > > > > It probably doesn't work correctly. But it's not broken enough to > > fail badly. > > Can that comment be an explanation? > > ---

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread Anton Vorontsov
On Fri, Apr 13, 2007 at 01:42:36AM -0700, David Brownell wrote: > On Friday 13 April 2007 12:36 am, Anton Vorontsov wrote: > > Hello David, > > > > > > - The API needs to say *how much power* can be drawn... > > > > > > - Sensing VBUS power is not the same thing as being allowed to consume > >

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread David Brownell
On Friday 13 April 2007 12:36 am, Anton Vorontsov wrote: > Hello David, > > > > - The API needs to say *how much power* can be drawn... > > > > - Sensing VBUS power is not the same thing as being allowed to consume > >it. Again, USB OTG devices are different: OTG hosts **SUPPLY** the > >

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread Anton Vorontsov
Hello David, On Thu, Apr 12, 2007 at 11:06:46PM -0700, David Brownell wrote: > > This driver used to stop code/logic duplication through different > > machines we porting at handhelds.org. pda_power register machs' power > > supplies, and will take care about notifying batteries about power > >

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread David Brownell
> This driver used to stop code/logic duplication through different > machines we porting at handhelds.org. pda_power register machs' power > supplies, and will take care about notifying batteries about power > changes through external power interface. It gets USB power management wrong though.

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread David Brownell
This driver used to stop code/logic duplication through different machines we porting at handhelds.org. pda_power register machs' power supplies, and will take care about notifying batteries about power changes through external power interface. It gets USB power management wrong though. Have

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread Anton Vorontsov
Hello David, On Thu, Apr 12, 2007 at 11:06:46PM -0700, David Brownell wrote: This driver used to stop code/logic duplication through different machines we porting at handhelds.org. pda_power register machs' power supplies, and will take care about notifying batteries about power changes

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread David Brownell
On Friday 13 April 2007 12:36 am, Anton Vorontsov wrote: Hello David, - The API needs to say *how much power* can be drawn... - Sensing VBUS power is not the same thing as being allowed to consume it. Again, USB OTG devices are different: OTG hosts **SUPPLY** the current,

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread Anton Vorontsov
On Fri, Apr 13, 2007 at 01:42:36AM -0700, David Brownell wrote: On Friday 13 April 2007 12:36 am, Anton Vorontsov wrote: Hello David, - The API needs to say *how much power* can be drawn... - Sensing VBUS power is not the same thing as being allowed to consume it. Again,

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread David Brownell
On Friday 13 April 2007 2:52 am, Anton Vorontsov wrote: But I got the point, and yes I can't explain why it works correctly. It probably doesn't work correctly. But it's not broken enough to fail badly. Can that comment be an explanation? --- drivers/usb/gadget/pxa2xx_udc.c:

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread Anton Vorontsov
On Fri, Apr 13, 2007 at 03:25:13AM -0700, David Brownell wrote: On Friday 13 April 2007 2:52 am, Anton Vorontsov wrote: But I got the point, and yes I can't explain why it works correctly. It probably doesn't work correctly. But it's not broken enough to fail badly. Can that

Re: [PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-13 Thread Anton Vorontsov
On Thu, Apr 12, 2007 at 03:24:56AM +0400, Anton Vorontsov wrote: This driver used to stop code/logic duplication through different machines we porting at handhelds.org. pda_power register machs' power supplies, and will take care about notifying batteries about power changes through external

[PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-11 Thread Anton Vorontsov
This driver used to stop code/logic duplication through different machines we porting at handhelds.org. pda_power register machs' power supplies, and will take care about notifying batteries about power changes through external power interface. This driver should be suitable for almost every

[PATCH 2/7] [RFC] Common power driver for Linux gadgets

2007-04-11 Thread Anton Vorontsov
This driver used to stop code/logic duplication through different machines we porting at handhelds.org. pda_power register machs' power supplies, and will take care about notifying batteries about power changes through external power interface. This driver should be suitable for almost every