On Friday 06 May 2005 9:15 pm, mike lee wrote:
> David Brownell wrote:
> >>On Wednesday 04 May 2005 7:34 pm, mike lee wrote:
> >>  
> >>>>    I just finish my draft version gadget controller driver on imx
> >>>>platform, 
> >>
> >>Great!  If that'll be generally available, I'll mention i.MX on
> >>the webpage.
>
>     It still need to debug more, and only support PIO control and bulk.
> Int endpoint is now under debug.

Bulk and interrupt can be identical ... though maybe the hardware
cuts some corners on interrupt endpoints, like limiting FIFO size
and not supporting double buffering.  DMA should be a big win on
something like an i.MX though.


>     Also i found that there is a bcddevice no in all gadget drivers. Do
> i need to register officially?

That is, to fit into blocks of code like:

        } else if (gadget_is_omap (gadget)) {
                device_desc.bcdDevice = __constant_cpu_to_le16 (0x0208);
        } else if (gadget_is_lh7a40x(gadget)) {
                device_desc.bcdDevice = __constant_cpu_to_le16 (0x0209);
        ...
        } else if (gadget_is_at91(gadget)) {
                device_desc.bcdDevice = __constant_cpu_to_le16 (0x0213);

Why don't you use "0x214", and send me the patch for "gadget.h" and all
the gadget drivers.  You can do that before you post the driver, and
having that stuff merged now will simplify things later.

(Those blocks of code have two purposes.  One is that sometimes they
need to do chip-specific things, usually to cope with chips trying
to dictate things like endpoint or altsetting numbers, or to handle
limitations in endpoint type or number.  The other is so that the
host side has a hook to do similar things.)


> >>>>but how can i benefit from the hotplug function provided from 
> >>>>kernel? Do i need to provide the hotplug function in my driver, and
> >>>>example for hotplugging gadget?
> >>
> >>The gadget framework itself doesn't currently use hotplug for anything,
> >>though of course layers above it can certainly do so.  There's been no
> >>reported need for "hot" reconfiguration.
> >>
> >>What were you thinking hotplug should do?  
>
>     Actually, upgrading the firmware and backup storage functions are
> the main purposes to use usb. My idea to upgrading firmware is that
> firmware download thought backup storage gadget and when the cable
> unplug or press a key, a daemon copy the file to my flash.

It might be better to look at using the DFU class spec; that's something
that can reasonably be done with a simple gadgetfs driver writing to
the relevant /dev/mtd/N partition for the kernel, rootfs, or whatever.

Of course the really tricky bit about firmare updates is that you need
to have some way to prevent "bricking" your device ... end users are
not going to have JTAG access to reprogram things in case the write to
that MTD partition breaks, and turns the device (cell phone or whatever)
into a brick.


>    So, i wanna know if there is a method or example on how to signal
> hotplugging to the daemon

You can just call_usermodehelper() directly if you really want that,
but it doesn't seem to me like hotplug is a good match for what you've
described.  In particular, unplugging a cable can happen at any time;
it shouldn't be treated the same as an affirmative user direction
that it's now _safe_ to do something potentially dangerups.

- Dave



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to