Skip to contentSkip to conversation

Can g_midi run on musb_gadget?

Question Bryan Wu 2 participants 2 messages Nov 27, 2007

lore
Share & tools
lore

Bryan Wu

author
#0 lore raw

Hi folks,

I am still testing and trying to enable some gadget drivers over musb_gadget driver for Blackfin BF54x.

Does someone test g_midi over MUSB gadget driver?
Actually, current g_midi only supports full speed, then the MUSB gadget will make g_midi usb_gadget_register_driver (in musb_gadget.c) function call fail as below:
---

        if (!driver
                        || driver->speed != USB_SPEED_HIGH
                        || !driver->bind
                        || !driver->setup)
                return -EINVAL;

---

gmidi.c
---
static struct usb_gadget_driver gmidi_driver = {

        .speed          = USB_SPEED_FULL,
        .function       = (char *)longname,
        .bind           = gmidi_bind,
        .unbind         = gmidi_unbind,

.setup = gmidi_setup,
.disconnect = gmidi_disconnect,

.suspend = gmidi_suspend,
.resume = gmidi_resume,

.driver = {
.name = (char *)shortname,
.owner = THIS_MODULE,
},
};
---

So I modified the musb_gadget.c to enable the g_midi.ko on my BF54x hardware.

I got some question about the testing about the g_midi:

1. My Linux and Windows PC USB host can found the g_midi BF54x device, for example:
---

roc@roc-laptop:~$ aplaymidi -l
 Port    Client name                      Port name
 14:0    Midi Through                     Midi Through Port-0
 20:0    MIDI Gadget                      MIDI Gadget MIDI 1
---

There is an ALSA AD1980 AC97 audio hardware and driver on BF54x and I am sure it works well.
If I use "aplaymidi -p 20:0 ~/Desktop/onestop.mid" to try to play the midi file over USB, can I heard sound from the AD1980 sound output port? But I don't hear anything.

2. g_midi just provides an midi device, not a fully functional USB Audio Class device, right?
Because some customer wanna enable the BF54x as USB Audio Class device over musb_gadget driver.

3. Is there any URL or wiki about g_midi for developer as referrence?

Thanks a lot
-Bryan Wu

#1 lore raw
Quoted 6 lines · Bryan Wu

Hi folks,

I am still testing and trying to enable some gadget drivers over musb_gadget driver for Blackfin BF54x.

Does someone test g_midi over MUSB gadget driver?

Not I.

Quoted 3 lines

Actually, current g_midi only supports full speed, then the MUSB gadget will make g_midi usb_gadget_register_driver (in musb_gadget.c) function call fail as below:

Which is appropriate, it only has full speed descriptors.

Feel free to submit a patch teaching it how to do high speed...

- Dave