All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Sebastien Alaiwan <sebastien.alaiwan@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][ALSA] usbmidi support for Access Music synths.
Date: Wed, 10 Feb 2010 09:56:26 +0100	[thread overview]
Message-ID: <4B7274BA.3040801@ladisch.de> (raw)
In-Reply-To: <4B726306.8070506@gmail.com>

Sebastien Alaiwan wrote:
> here's a patch that adds MIDI support through USB for one of the
> Access Music synths, the VirusTI. 

Thanks!

Please run the checkpatch script on your patch.

> +	u8 seq[] = { 0x4e, 0x73, 0x52, 0x01 }; // "midi send" enable
> +
> +	err = usb_interrupt_msg(dev, usb_sndintpipe(dev, 0x05), seq,
> +			ARRAY_SIZE(seq), &actual_length, 1000);

There are architectures where doing DMA with data on the stack is not
possible.  Have a look at send_bulk_static_data.

>  /*
> + * Detects the endpoints for Access Music Virus TI
> + */
> +static int snd_usbmidi_detect_two_cables_per_endpoint(struct snd_usb_midi* umidi,
> +    struct snd_usb_midi_endpoint_info* endpoints)
> +{
> +	int err, i;
> +
> +	err = snd_usbmidi_detect_endpoints(umidi, endpoints, MIDI_MAX_ENDPOINTS);
> +	for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) {
> +		if (endpoints[i].in_ep) {
> +			printk("Creating two in cables for input EP 0x%.2X\n", endpoints[i].in_ep);

If this is just for debugging, use snd_printdd.

> +			endpoints[i].in_cables = 0x0003;
> +		}
> +		if (endpoints[i].out_ep) {
> +			printk("Creating two out cables for output EP 0x%.2X\n", endpoints[i].out_ep);
> +			endpoints[i].out_cables = 0x0003;
> +		}
> +	}
> +	return err;
> +}

Does this device use more than one endpoint per direction?  If not, this
could be done with QUIRK_MIDI_FIXED_ENDPOINT.

> +++ b/sound/usb/usbquirks.h
> @@ -2105,6 +2105,28 @@
>  	}
>  },
>  
> +/* Access Music devices */
> +{
> +	/* VirusTI Desktop */
> +	USB_DEVICE_VENDOR_SPEC(0x133e, 0x0815),

Please keep the list sorted (as much as possible).

> +		.vendor_name = "AccessMusic",
> +		.product_name = "Virus TI",

These are needed only if the device hasn't vendor/product strings.

> +				// "Virus TI MIDI" and "Virus TI Synth"

If these are port names, put them into the snd_usbmidi_port_info array.


Regards,
Clemens

WARNING: multiple messages have this Message-ID (diff)
From: Clemens Ladisch <clemens@ladisch.de>
To: Sebastien Alaiwan <sebastien.alaiwan@gmail.com>
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
	Takashi Iwai <tiwai@suse.de>
Subject: Re: [PATCH][ALSA] usbmidi support for Access Music synths.
Date: Wed, 10 Feb 2010 09:56:26 +0100	[thread overview]
Message-ID: <4B7274BA.3040801@ladisch.de> (raw)
In-Reply-To: <4B726306.8070506@gmail.com>

Sebastien Alaiwan wrote:
> here's a patch that adds MIDI support through USB for one of the
> Access Music synths, the VirusTI. 

Thanks!

Please run the checkpatch script on your patch.

> +	u8 seq[] = { 0x4e, 0x73, 0x52, 0x01 }; // "midi send" enable
> +
> +	err = usb_interrupt_msg(dev, usb_sndintpipe(dev, 0x05), seq,
> +			ARRAY_SIZE(seq), &actual_length, 1000);

There are architectures where doing DMA with data on the stack is not
possible.  Have a look at send_bulk_static_data.

>  /*
> + * Detects the endpoints for Access Music Virus TI
> + */
> +static int snd_usbmidi_detect_two_cables_per_endpoint(struct snd_usb_midi* umidi,
> +    struct snd_usb_midi_endpoint_info* endpoints)
> +{
> +	int err, i;
> +
> +	err = snd_usbmidi_detect_endpoints(umidi, endpoints, MIDI_MAX_ENDPOINTS);
> +	for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) {
> +		if (endpoints[i].in_ep) {
> +			printk("Creating two in cables for input EP 0x%.2X\n", endpoints[i].in_ep);

If this is just for debugging, use snd_printdd.

> +			endpoints[i].in_cables = 0x0003;
> +		}
> +		if (endpoints[i].out_ep) {
> +			printk("Creating two out cables for output EP 0x%.2X\n", endpoints[i].out_ep);
> +			endpoints[i].out_cables = 0x0003;
> +		}
> +	}
> +	return err;
> +}

Does this device use more than one endpoint per direction?  If not, this
could be done with QUIRK_MIDI_FIXED_ENDPOINT.

> +++ b/sound/usb/usbquirks.h
> @@ -2105,6 +2105,28 @@
>  	}
>  },
>  
> +/* Access Music devices */
> +{
> +	/* VirusTI Desktop */
> +	USB_DEVICE_VENDOR_SPEC(0x133e, 0x0815),

Please keep the list sorted (as much as possible).

> +		.vendor_name = "AccessMusic",
> +		.product_name = "Virus TI",

These are needed only if the device hasn't vendor/product strings.

> +				// "Virus TI MIDI" and "Virus TI Synth"

If these are port names, put them into the snd_usbmidi_port_info array.


Regards,
Clemens

  reply	other threads:[~2010-02-10  8:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-10  7:40 [PATCH][ALSA] usbmidi support for Access Music synths Sebastien Alaiwan
2010-02-10  8:56 ` Clemens Ladisch [this message]
2010-02-10  8:56   ` Clemens Ladisch
2010-02-11  8:01   ` Sebastien Alaiwan
2010-02-11  8:46     ` Clemens Ladisch
2010-02-11 19:39       ` Sebastien Alaiwan
2010-02-12  9:24         ` Clemens Ladisch
2010-02-12  9:24           ` Clemens Ladisch
2010-02-16  7:40           ` Sebastien Alaiwan
2010-02-16  8:34             ` Clemens Ladisch
2010-02-16  8:34               ` Clemens Ladisch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B7274BA.3040801@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sebastien.alaiwan@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.