McBSP interface issues

Hi,

I am trying to communicate with an ADC (using frame-sync interface) via the McBSP.
I would like to get DMA going but for now, I am focussing on simply being able to do a single read from user-space.

I have found the driver files arch/arm/mach-omap2/mcbsp.c and arch/arm/plat-omap/mcbsp.c but I am not sure how to use them.
As far as I can the tell McBSP drivers do not make the device available through /dev/.
Would I have to write a my own character device driver on top of the existing?

Does anyone have a simple code example or can someone give a brief description on how to read data from McBSP?

I have had a look at the sound drivers sound/soc/omap/omap-mcbsp.c and sound/soc/omap/omap3beagle.c which use mcbsp but I am not familiar with how ALSA drivers work and find these very hard to understand or rip apart for my purposes.

I see also that arch/arm/mach-omap2/mcbsp.c says:

* Multichannel mode not supported.

Does this mean that only 1 of the 5 McBSPx on the OMAP can be used?

Any help will be much appreciated
Regards,
John

Hi,

I am trying to communicate with an ADC (using frame-sync interface) via the
McBSP.
I would like to get DMA going but for now, I am focussing on simply being
able to do a single read from user-space.

I have found the driver files arch/arm/mach-omap2/mcbsp.c and
arch/arm/plat-omap/mcbsp.c but I am not sure how to use them.
As far as I can the tell McBSP drivers do not make the device available
through /dev/.
Would I have to write a my own character device driver on top of the
existing?

Does anyone have a simple code example or can someone give a brief
description on how to read data from McBSP?

I have had a look at the sound drivers sound/soc/omap/omap-mcbsp.c and
sound/soc/omap/omap3beagle.c which use mcbsp but I am not familiar with how
ALSA drivers work and find these very hard to understand or rip apart for
my purposes.

The code in arch/arm/ are basically libraries/API's to configure and
transmit/receive using the McBSP. They are intended for use in kernel space
and _should_ (doesn't quite do it in reality) abstract away details of the
different variants of the McBSP on the different generations of the OMAPs.
The best working example is any of the variants of the sound driver. The
usage in rough pseudo code is -
- Allocate the McBSP
- Call to configure the McBSP
- Transmit and/or receive

They can be used in a poll mode or in an interrupt mode. The last I looked at
it, the poll mode sound usage code is broken for OMAP2/3. The fix was simple
if you look at it but I don't have that code anymore.

I see also that arch/arm/mach-omap2/mcbsp.c says:

* Multichannel mode not supported.

Does this mean that only 1 of the 5 McBSPx on the OMAP can be used?

IIRC, this refers to an option on the McBSP. Check the TRM.