Other Parts Discussed in Thread: AM3358, ADS127L01, TMDXEVM3358, TLV320AIC3106, PCM5102A, PCM5102
Tool/software: Linux
We are using an external ADC chip (TI ADS127L01) with McASP connection to an Octavo part with AM3358 processor. We are using the ADC chip as a McASP Master (AM335x as slave) and we are struggling to find any reference for both setup of the device tree and an example user mode app for McASP FIFO read. The ADC is being used to measure voltage from an analog accelerometer.
Our board is utilizing the following McASP0 to ADC pin mapping:
(B12) mcasp0_aclkr for SCLK (AM335x input from ADC bit clock)
(C13) mcasp0_fsr for Frame Sync ((AM335x input from ADC word clock)
(D13) mcasp0_axr1 for Data (AM35x input from ADC DOUT).
Note that we are not using the ADC DIN line as no ADC codec control is required, we will simply enable the chip to start streaming (handled via GPIO - which we have full control of now).
First - the device tree. This is the last board peripheral that we will interface to. We have been using a BBBW ref BSP elements. All device tree entries are within the am335x-bone-common.dtsi file. Specific entries for McASP0 are:
{
cpus {
cpu@0 {
cpu0-supply = <&dcdc2_reg>;
};
};
memory {
device_type = "memory";
reg = <0x80000000 0x10000000>; /* 256 MB */
};
vmmcsd_fixed: fixedregulator@0 {
compatible = "regulator-fixed";
regulator-name = "vmmcsd_fixed";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};
ocp {
mcasp0: mcasp@48038000 {
compatible = "ti,am33xx-mcasp-audio";
ti,hwmods = "mcasp0";
reg = <0x48038000 0x2000>,
<0x46000000 0x400000>;
reg-names = "mpu", "dat";
interrupts = <81>;
interrupts-names = "rx";
status = "okay";
op-mode = <0>; /* operational mode - 0 -> I2S mode, used for I2S, PCM and TDM protocols */
tdm-slots = <2>; /* Number of TDM slots */
num-serializer = <4>;
serial-dir = <0 2 0 0>; /* 0:INACTIVE, 1:TX, 2:RX */
rx-num-evt = <8>;
dmas = <&edma 9>;
dma-names = "rx";
};
};
};
&am33xx_pinmux {
pinctrl-names = "default";
pinctrl-0 = <&clkout2_pin>;
...
mcasp0_pins: mcasp0_pins {
pinctrl-single,pins = <
0x1a0 ( PIN_INPUT_PULLDOWN | MUX_MODE0 ) /* (B12) mcasp0_aclkr.mcasp0_aclkr */
0x1a4 ( PIN_INPUT_PULLDOWN | MUX_MODE0 ) /* (C13) mcasp0_fsr.mcasp0_fsr */
0x1a8 ( PIN_INPUT_PULLDOWN | MUX_MODE0 ) /* (D13) mcasp0_axr1.mcasp0_axr1 */
>;
};
};
&mcasp0 {
pinctrl-names = "default";
pinctrl-0 = <&mcasp0_pins>;
status = "okay";
};
The above entries compile just fine (to dtb file), but without user mode code to execute, it is difficult to say if it works.
All referenceable ALSA examples that I can find utilize an audio codec driver as shown in the TI Sitara Audio Driver Overview here:
http://processors.wiki.ti.com/index.php/Sitara_Linux_Audio_Driver_Overview
... but these codecs all support both a Control Interface (Codec Driver) and Data Transfer Interface (Platform Driver). Our circumstance is unique in that we will only use the Platform Driver API.
The same Sitara Audio Driver site lists the following Platform Driver interface:
... but I cannot find any example client that uses this API.
It would be extremely helpful to:
1. Understand if a better approach makes sense (considering our single, unidirectional McASP connection with no control interface).
2. Understand if our device tree makes sense (we cannot find an example without control interface elements).
3. If our approach is OK, where can we find a referecable user mode example for reading an incoming FIFO from the Platform Driver API.
Thanks in advance to any repliers.
Regards,
Mark J