This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3358: McASP configuration

Part Number: AM3358
Other Parts Discussed in Thread: PCM1681, PCM5102A

Tool/software: Linux

Hello ,

I have developed a custom board of AM3358 similar to the AM335x general purpose EVM.

In my board I have a requirement of interfacing the McASP with the McBSP of DSP.

The problem is I have seen people doing similar with around 32 channels in the forum, but for me the requirement is to TDM only a single channel.

What has to be done and how?

Kindly help me on this at the earliest.

Regards

Mad_hu

  • Hello

    I want to elaborate on this.

    I have a DSP which will have the digital audio data which it will get after demodulation and will forward that digital audio to my processor through its McBSP port. Now that McBSP of DSP is connected to the McASP of my processor and I need to receive those digital audio samples .
    So i don't need any codec activity in between these two like what is explained in most of the forums.
    I have seen that dummy codec driver being created and used in some of the forums. I don't know why that is being done ?


    Kindly help me at the earliest.

    Regards
    Mad_hu
  • Hi Madhu,

    From what I understand, you need to receive audio data on AM335x McASP port, from TI DSP McBSP module.

    Regarding AM335x McASP port data audio receive, yes, you should use dummy codec driver. Refer to the below wikis for details.

    processors.wiki.ti.com/.../Sitara_Linux_Audio_DAC_Example
    processors.wiki.ti.com/.../TI81XX_PSP_AUDIO_Driver_User_Guide

    Regards,
    Pavel
  • Hello pavel,

    After just having a glimpse of  the above I understood that I need to create a dummy codec driver and that will be done with the procedure mentioned in the links. But my concern now is how do I access the McASP ports in my application for both reading and writing data from/to DSP.

    For example we use fd=open(....) for i2c,spi etc . So what sort of thing needed to be done to read /write data to McASP.

    I was really confused because people are using aplay  etc to write data out to McASP but i dont have any file to use that utility . I have pure digital data in my hand.

    So kindly help me in reading data from the McASP and also writing data to McASP.

     

    Kindly help me at the earliest.

    Regards

    Mad_hu.

  • Madhu,

    There are two ways to access audio data at AM335x McASP module. One is user space tools (aplay/arecord), second is to use the ALSA API. Example ALSA API is snd_pcm_readi() function, which read interleaved frames from a PCM. For more info regarding ALSA API, check below links:

    processors.wiki.ti.com/.../Sitara_Linux_Audio_Introduction
    processors.wiki.ti.com/.../Sitara_SDK_Linux_Audio_ALSA_User_Space
    processors.wiki.ti.com/.../Sitara_Linux_Audio_Sample_Application_Overview
    processors.wiki.ti.com/.../AM335x_Audio_Driver's_Guide
    processors.wiki.ti.com/.../AM335x-PSP_04.06.00.11_Features_and_Performance_Guide
    www.equalarea.com/.../alsa-audio.html
    www.saunalahti.fi/.../Full Duplex ALSA

    There are also gstreamer and pulseaudio related to audio:

    processors.wiki.ti.com/.../Sitara_Linux_Audio_gstreamer
    processors.wiki.ti.com/.../Sitara_Linux_Audio_pulseaudio

    Regards,
    Pavel
  • Hello Pavel ,

    I have a codec Max9860 on my board so I thought of connecting MCASP lines to the I2S of the Codec IC to test whether my creation of driver is correct or not and now created a sound driver for the max9860 codec IC with the procedure given for dummy card.

    I could do everything except the kernel menuconfig .(Its throwing error saying no target of menuconfig defined and I too have checked make file . No such target defined)

    As I am not able to do in this way I have added my CONFIG_SND_SOC_MAX9860 in the defconfig file /arch/arm/configs and created snd-soc-max9860.ko

    Now tell me is this ko alone is sufficient or else I need to something else , because in the initial stages no sound card detected is coming and also when I am using aplay its throwing error saying no sound card detected.

    Regards
    Mad_hu
  • Hello Pavel .

    In the DAC example certain things are taken for granted as we are creating a dummy driver , but here we are creating a driver for the existing IC. Does that need any serious content modification in the davinci files?


    Regards
    Mad_hu
  • MADHU GANDEPALLI said:
    I could do everything except the kernel menuconfig .(Its throwing error saying no target of menuconfig defined and I too have checked make file . No such target defined)

    Please attach console log for analysis.

    MADHU GANDEPALLI said:
    Now tell me is this ko alone is sufficient or else I need to something else , because in the initial stages no sound card detected is coming and also when I am using aplay its throwing error saying no sound card detected.

    Please attach console log for analysis (boot up log + aplay log).

    Regards,
    Pavel

  • Hello Pavel

    Kindl find the belo log for boot up log + aplay log.

    Regards

    Mad_hu

    #
    U-Boot SPL 2017.01 (Feb 23 2019 - 15:22:13)
    Trying to boot from MMC1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    
    
    U-Boot 2017.01 (Feb 23 2019 - 15:22:13 +0530)
    
    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x EVM
    DRAM:  1 GiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    <ethaddr> not set. Validating first E-fuse MAC
    Net:   cpsw, usb_ether
    Hit any key to stop autoboot:  2 ### 1 ### 0 
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    3612408 bytes read in 444 ms (7.8 MiB/s)
    39417 bytes read in 22 ms (1.7 MiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff3000, end 8ffff9f8 ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 4.9.59-ga75d8e9305 (madhu@madhu-VirtualBox) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #91 PREEMPT Tue Mar 5 17:03:44 IST 2019
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] OF: fdt:Machine model: TI AM335x EVM
    [    0.000000] efi: Getting EFI parameters from FDT:
    [    0.000000] efi: UEFI not found.
    [    0.000000] cma: Reserved 48 MiB at 0xbd000000
    [    0.000000] Memory policy: Data cache writeback
    [    0.000000] CPU: All CPU(s) started in SVC mode.
    [    0.000000] AM335X ES2.1 (sgx neon)
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260416
    [    0.000000] Kernel command line: console=ttyO0,115200n8 root=PARTUUID=0002eec4-02 rw rootfstype=ext4 rootwait
    [    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
    [    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [    0.000000] Memory: 977356K/1048576K available (7168K kernel code, 280K rwdata, 2360K rodata, 1024K init, 280K bss, 22068K reserved, 49152K cma-reserved, 212992K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc0800000   (8160 kB)
    [    0.000000]       .init : 0xc0b00000 - 0xc0c00000   (1024 kB)
    [    0.000000]       .data : 0xc0c00000 - 0xc0c462d0   ( 281 kB)
    [    0.000000]        .bss : 0xc0c462d0 - 0xc0c8c534   ( 281 kB)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [    0.000000] Preemptible hierarchical RCU implementation.
    [    0.000000] 	Build-time adjustment of leaf fanout to 32.
    [    0.000000] NR_IRQS:16 nr_irqs:16 16
    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
    [    0.000018] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [    0.000046] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [    0.000059] OMAP clocksource: timer1 at 24000000 Hz
    [    0.000276] clocksource_probe: no matching clocksources found
    [    0.000481] Console: colour dummy device 80x30
    [    0.000512] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
    [    0.000522] This ensures that you still see kernel messages. Please
    [    0.000529] update your kernel commandline.
    [    0.000558] Calibrating delay loop... 597.60 BogoMIPS (lpj=2988032)
    [    0.118874] pid_max: default: 32768 minimum: 301
    [    0.119042] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.119059] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.120065] CPU: Testing write buffer coherency: ok
    [    0.120498] Setting up static identity map for 0x80100000 - 0x80100060
    [    0.121587] EFI services will not be available.
    [    0.123427] devtmpfs: initialized
    [    0.140126] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [    0.140557] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [    0.140589] futex hash table entries: 256 (order: -1, 3072 bytes)
    [    0.144889] pinctrl core: initialized pinctrl subsystem
    [    0.146439] NET: Registered protocol family 16
    [    0.148723] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.167672] omap_hwmod: debugss: _wait_target_disable failed
    [    0.248876] cpuidle: using governor ladder
    [    0.278867] cpuidle: using governor menu
    [    0.287230] OMAP GPIO hardware version 0.1
    [    0.306903] omap-gpmc 50000000.gpmc: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/nandflash_pins_s0, deferring probe
    [    0.311642] No ATAGs?
    [    0.311669] hw-breakpoint: debug architecture 0x4 unsupported.
    [    0.360466] edma 49000000.edma: TI EDMA DMA engine driver
    [    0.362496] reg-fixed-voltage regulator3: Failed to allocate supply name
    [    0.362534] reg-fixed-voltage: probe of regulator3 failed with error -12
    [    0.366908] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
    [    0.366980] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c2_pins, deferring probe
    [    0.367172] media: Linux media interface: v0.10
    [    0.367246] Linux video capture interface: v2.00
    [    0.367301] pps_core: LinuxPPS API ver. 1 registered
    [    0.367311] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    0.367341] PTP clock support registered
    [    0.367392] EDAC MC: Ver: 3.0.0
    [    0.368785] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
    [    0.369349] Advanced Linux Sound Architecture Driver Initialized.
    [    0.370887] clocksource: Switched to clocksource timer1
    [    0.385125] NET: Registered protocol family 2
    [    0.386098] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.386219] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.386329] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.386449] UDP hash table entries: 512 (order: 1, 8192 bytes)
    [    0.386487] UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
    [    0.386671] NET: Registered protocol family 1
    [    0.387196] RPC: Registered named UNIX socket transport module.
    [    0.387213] RPC: Registered udp transport module.
    [    0.387222] RPC: Registered tcp transport module.
    [    0.387230] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.388355] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
    [    0.391723] workingset: timestamp_bits=14 max_order=18 bucket_order=4
    [    0.402673] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [    0.403959] NFS: Registering the id_resolver key type
    [    0.404009] Key type id_resolver registered
    [    0.404019] Key type id_legacy registered
    [    0.404079] ntfs: driver 2.1.32 [Flags: R/O].
    [    0.406294] bounce: pool size: 64 pages
    [    0.406560] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
    [    0.406577] io scheduler noop registered
    [    0.406587] io scheduler deadline registered
    [    0.406789] io scheduler cfq registered (default)
    [    0.408550] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
    [    0.412947] backlight supply power not found, using dummy regulator
    [    0.497129] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled
    [    0.502387] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a 8250
    [    1.134614] console [ttyS0] enabled
    [    1.139507] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 159, base_baud = 3000000) is a 8250
    [    1.149662] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 160, base_baud = 3000000) is a 8250
    [    1.161114] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
    [    1.167951] [drm] Initialized
    [    1.172322] panel panel: found backlight
    [    1.177430] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
    [    1.184174] [drm] No driver support for vblank timestamp query.
    [    1.217080] Console: switching to colour frame buffer device 40x30
    [    1.225030] tilcdc 4830e000.lcdc: fb0:  frame buffer device
    [    1.269124] brd: module loaded
    [    1.280863] loop: module loaded
    [    1.289103] libphy: Fixed MDIO Bus: probed
    [    1.360938] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
    [    1.367084] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
    [    1.374214] libphy: 4a101000.mdio: probed
    [    1.378265] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver Atheros 8031 ethernet
    [    1.388581] cpsw 4a100000.ethernet: Detected MACID = a8:1b:6a:54:b6:85
    [    1.395421] cpsw 4a100000.ethernet: device node lookup for pps timer failed
    [    1.402605] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
    [    1.412264] mousedev: PS/2 mouse device common for all mice
    [    1.418332] i2c /dev entries driver
    [    1.424490] cpuidle: enable-method property 'ti,am3352' found operations
    [    1.494933] ledtrig-cpu: registered to indicate activity on CPUs
    [    1.506972] NET: Registered protocol family 10
    [    1.513452] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [    1.520473] NET: Registered protocol family 17
    [    1.525594] Key type dns_resolver registered
    [    1.530184] omap_voltage_late_init: Voltage driver support not added
    [    1.543995] omap-gpmc 50000000.gpmc: GPMC revision 6.0
    [    1.549195] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
    [    1.557480] nand: No NAND device found
    [    1.561474] omap2-nand 8000000.nand: scan failed, may be bus-width mismatch
    [    1.570127] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [    1.577275] i2c i2c-2: of_i2c: modalias failure on /ocp/i2c@4819c000/i2c@2
    [    1.584269] i2c i2c-2: Failed to create I2C device for /ocp/i2c@4819c000/i2c@2
    [    1.591572] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
    [    1.598307] hctosys: unable to open rtc device (rtc0)
    [    1.604247] vbat: disabling
    [    1.607118] lis3_reg: disabling
    [    1.610308] wlan-en-regulator: disabling
    [    1.614411] v3v3: disabling
    [    1.617255] ALSA device list:
    [    1.620304]   No soundcards found.
    [    1.624683] Waiting for root device PARTUUID=0002eec4-02...
    [    1.633049] mmc0: host does not support reading read-only switch, assuming write-enable
    [    1.645011] mmc0: new high speed SDHC card at address aaaa
    [    1.651582] mmcblk0: mmc0:aaaa SA08G 7.40 GiB 
    [    1.658777]  mmcblk0: p1 p2
    [    1.754192] random: fast init done
    [    1.758364] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [    1.766769] VFS: Mounted root (ext4 filesystem) on device 179:2.
    [    1.776680] devtmpfs: mounted
    [    1.781696] Freeing unused kernel memory: 1024K
    [    2.083941] systemd[1]: System time before build time, advancing clock.
    [    2.142336] systemd[1]: systemd 230 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN)
    [    2.161585] systemd[1]: Detected architecture arm.
    
    Welcome to #[1mArago 2017.10#[0m!
    
    [    2.203422] systemd[1]: Set hostname to <am335x-evm>.
    [    2.500867] systemd[1]: [/lib/systemd/system/gadget-init.service:15] Unknown lvalue 'ExecStopPre' in section 'Service'
    [    2.874511] systemd[1]: Listening on Journal Socket (/dev/log).
    [#[0;32m  OK  #[0m] Listening on Journal Socket (/dev/log).
    [    2.911505] systemd[1]: Listening on Syslog Socket.
    [#[0;32m  OK  #[0m] Listening on Syslog Socket.
    [    2.941183] systemd[1]: Reached target Remote File Systems.
    [#[0;32m  OK  #[0m] Reached target Remote File Systems.
    [    2.971542] systemd[1]: Listening on udev Control Socket.
    [#[0;32m  OK  #[0m] Listening on udev Control Socket.
    [    3.001549] systemd[1]: Listening on Journal Socket.
    [#[0;32m  OK  #[0m] Listening on Journal Socket.
    [    3.040135] systemd[1]: Listening on Process Core Dump Socket.
    [#[0;32m  OK  #[0m] Listening on Process Core Dump Socket.
    [#[0;32m  OK  #[0m] Started Dispatch Password Requests to Console Directory Watch.
    [#[0;32m  OK  #[0m] Reached target Swap.
    [#[0;32m  OK  #[0m] Created slice User and Session Slice.
    [#[0;32m  OK  #[0m] Listening on udev Kernel Socket.
    [#[0;32m  OK  #[0m] Listening on /dev/initctl Compatibility Named Pipe.
    [#[0;32m  OK  #[0m] Started Forward Password Requests to Wall Directory Watch.
    [#[0;32m  OK  #[0m] Reached target Paths.
    [#[0;32m  OK  #[0m] Listening on Network Service Netlink Socket.
    [#[0;32m  OK  #[0m] Created slice System Slice.
             Starting alignment.service...
             Starting Setup Virtual Console...
    [#[0;32m  OK  #[0m] Reached target Slices.
             Starting Load Kernel Modules...
             Starting Journal Service...
             Starting Create Static Device Nodes in /dev...
    [    3.519994] cryptodev: loading out-of-tree module taints kernel.
    [    3.532569] cryptodev: driver 1.8 loaded.
             Mounting Temporary Directory...
             Starting Remount Root and Kernel File Systems...
    [#[0;32m  OK  #[0m] Created slice system-getty.slice.
             Mounting POSIX Message Queue File System...
             Mounting Debug File System...
    [#[0;32m  OK  #[0m] Created slice system-serial\x2dgetty.slice.
    [    3.800484] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
    [#[0;32m  OK  #[0m] Mounted Debug File System.
    [#[0;32m  OK  #[0m] Mounted POSIX Message Queue File System.
    [#[0;32m  OK  #[0m] Mounted Temporary Directory.
    [#[0;32m  OK  #[0m] Started Journal Service.
    [#[0;32m  OK  #[0m] Started alignment.service.
    [#[0;32m  OK  #[0m] Started Setup Virtual Console.
    [#[0;32m  OK  #[0m] Started Load Kernel Modules.
    [#[0;32m  OK  #[0m] Started Create Static Device Nodes in /dev.
    [#[0;32m  OK  #[0m] Started Remount Root and Kernel File Systems.
             Starting udev Coldplug all Devices...
    [#[0;32m  OK  #[0m] Reached target Local File Systems (Pre).
             Mounting /media/ram...
             Mounting /var/volatile...
             Starting udev Kernel Device Manager...
             Starting Apply Kernel Variables...
             Mounting Configuration File System...
             Starting Flush Journal to Persistent Storage...
    [#[0;32m  OK  #[0m] Mounted Configuration File System.
    [#[0;32m  OK  #[0m] Mounted /var/volatile.
    [#[0;32m  OK  #[0m] Mounted /media/ram.
    [#[0;32m  OK  #[0m] Started Apply Kernel Variables.
    [#[0;32m  OK  #[0m] Started udev Kernel Device Manager.
    [    4.902829] systemd-journald[88]: Received request to flush runtime journal from PID 1
             Starting Load/Save Random Seed...
    [#[0;32m  OK  #[0m] Reached target Local File Systems.
    [#[0;32m  OK  #[0m] Started Flush Journal to Persistent Storage.
    [#[0;32m  OK  #[0m] Started Load/Save Random Seed.
             Starting Create Volatile Files and Directories...
    [#[0;32m  OK  #[0m] Started Create Volatile Files and Directories.
             Starting Update UTMP about System Boot/Shutdown...
             Starting Network Time Synchronization...
    [#[0;32m  OK  #[0m] Started Update UTMP about System Boot/Shutdown.
    [#[0;32m  OK  #[0m] Started Network Time Synchronization.
    [#[0;32m  OK  #[0m] Reached target System Time Synchronized.
    [#[0;32m  OK  #[0m] Created slice system-systemd\x2dbacklight.slice.
             Starting Load/Save Screen Backlight...htness of backlight:backlight...
    [    7.019686] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [#[0;32m  OK  #[0m] Started Load/Save Screen Backlight Brightness of backlight:backlight.
    [    7.206102] omap_rtc 44e3e000.rtc: already running
    [#[0;32m  OK  #[0m] Found device /dev/ttyS0.
    [    7.244279] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
    [    7.307453] spidev spi1.0: buggy DT: spidev listed directly in DT
    [    7.307464] ------------[ cut here ]------------
    [    7.307505] WARNING: CPU: 0 PID: 147 at /oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work-shared/am335x-evm/kernel-source/drivers/spi/spidev.c:757 spidev_probe+0x1ac/0x1cc [spidev]
    [    7.307537] Modules linked in: spidev(+) rtc_omap(+) musb_am335x ti_am335x_tscadc omap_wdt sch_fq_codel uio_module_drv(O) uio cryptodev(O)
    [    7.307553] CPU: 0 PID: 147 Comm: systemd-udevd Tainted: G           O    4.9.59-ga75d8e9305 #91
    [    7.307556] Hardware name: Generic AM33XX (Flattened Device Tree)
    [    7.307564] Backtrace: 
    [    7.307603] [<c010b790>] (dump_backtrace) from [<c010ba4c>] (show_stack+0x18/0x1c)
    [    7.307614]  r7:00000009 r6:00000000 r5:bf038484 r4:00000000
    [    7.307642] [<c010ba34>] (show_stack) from [<c03c0b74>] (dump_stack+0x24/0x28)
    [    7.307663] [<c03c0b50>] (dump_stack) from [<c012b5d0>] (__warn+0xe8/0x100)
    [    7.307676] [<c012b4e8>] (__warn) from [<c012b6a0>] (warn_slowpath_null+0x28/0x30)
    [    7.307689]  r9:00000000 r8:00000009 r7:bf038544 r6:00000000 r5:eec8dc00 r4:eec8dc00
    [    7.307709] [<c012b678>] (warn_slowpath_null) from [<bf037360>] (spidev_probe+0x1ac/0x1cc [spidev])
    [    7.307740] [<bf0371b4>] (spidev_probe [spidev]) from [<c0582220>] (spi_drv_probe+0x84/0xb4)
    [    7.307751]  r8:00000009 r7:bf038544 r6:00000000 r5:bf038534 r4:eec8dc00
    [    7.307766] [<c058219c>] (spi_drv_probe) from [<c051bf78>] (driver_probe_device+0x208/0x2d0)
    [    7.307775]  r7:bf038544 r6:00000000 r5:c0c82034 r4:eec8dc00
    [    7.307786] [<c051bd70>] (driver_probe_device) from [<c051c100>] (__driver_attach+0xc0/0xc4)
    [    7.307799]  r9:f0c1b000 r8:ee8f26c0 r7:00000000 r6:eec8dc34 r5:bf038544 r4:eec8dc00
    [    7.307820] [<c051c040>] (__driver_attach) from [<c051a108>] (bus_for_each_dev+0x70/0xa4)
    [    7.307829]  r7:00000000 r6:c051c040 r5:bf038544 r4:00000000
    [    7.307845] [<c051a098>] (bus_for_each_dev) from [<c051b938>] (driver_attach+0x24/0x28)
    [    7.307853]  r6:c0c328b8 r5:eefb0e80 r4:bf038544
    [    7.307867] [<c051b914>] (driver_attach) from [<c051b470>] (bus_add_driver+0x108/0x214)
    [    7.307881] [<c051b368>] (bus_add_driver) from [<c051cb00>] (driver_register+0x80/0xfc)
    [    7.307891]  r7:eef87dc0 r6:00000000 r5:bf03851c r4:bf038544
    [    7.307903] [<c051ca80>] (driver_register) from [<c058215c>] (__spi_register_driver+0x60/0x64)
    [    7.307909]  r5:bf03851c r4:bf038780
    [    7.307927] [<c05820fc>] (__spi_register_driver) from [<bf03a098>] (spidev_init+0x98/0xcc [spidev])
    [    7.307946] [<bf03a000>] (spidev_init [spidev]) from [<c010171c>] (do_one_initcall+0x4c/0x178)
    [    7.307954]  r6:bf0385c0 r5:ffffe000 r4:bf03a000
    [    7.307979] [<c01016d0>] (do_one_initcall) from [<c01b8eb0>] (do_init_module+0x68/0x3b0)
    [    7.307992]  r10:ee8f26e4 r9:f0c1b000 r8:ee8f26c0 r7:eef87dc0 r6:bf0385c0 r5:00000001
    [    7.307996]  r4:bf0385c0
    [    7.308015] [<c01b8e48>] (do_init_module) from [<c0194280>] (load_module+0x1df4/0x2180)
    [    7.308024]  r7:00000001 r6:bf0385c0 r5:00000001 r4:eeff5f44
    [    7.308037] [<c019248c>] (load_module) from [<c019482c>] (SyS_finit_module+0xb0/0xc0)
    [    7.308050]  r10:00000000 r9:eeff4000 r8:c0107e44 r7:0000017b r6:b6f2df60 r5:00000007
    [    7.308054]  r4:00000000
    [    7.308067] [<c019477c>] (SyS_finit_module) from [<c0107c80>] (ret_fast_syscall+0x0/0x3c)
    [    7.308075]  r6:00000000 r5:00000000 r4:004c31a0
    [    7.308080] ---[ end trace 3202f24899306e75 ]---
    [    8.594698] remoteproc remoteproc0: wkup_m3 is available
    [    9.060154] remoteproc remoteproc0: powering up wkup_m3
    [    9.084534] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 224268
    [    9.084816] remoteproc remoteproc0: remote processor wkup_m3 is now up
    [    9.084841] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192
    [#[0;32m  OK  #[0m] Started udev Coldplug all Devices.
    [    9.919473] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
    [    9.929224] PM: bootloader does not support rtc-only!
    [   10.025578] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
    [   10.107727] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
    [   10.108765] omap-aes 53500000.aes: will run requests pump with realtime priority
    [   10.191758] [drm] Initialized pvr 1.14.3699939 20110701 on minor 1
    [#[0;32m  OK  #[0m] Found device /dev/ttyS3.
    [#[0;32m  OK  #[0m] Reached target System Initialization.
    [#[0;32m  OK  #[0m] Listening on dropbear.socket.
    [#[0;32m  OK  #[0m] Listening on D-Bus System Message Bus Socket.
    [#[0;32m  OK  #[0m] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
    [#[0;32m  OK  #[0m] Listening on RPCbind Server Activation Socket.
    [#[0;32m  OK  #[0m] Reached target Sockets.
    [#[0;32m  OK  #[0m] Started Daily Cleanup of Temporary Directories.
    [#[0;32m  OK  #[0m] Reached target Timers.
    [#[0;32m  OK  #[0m] Reached target Basic System.
    [#[0;32m  OK  #[0m] Started System Logging Service.
             Starting Telephony service...
             Starting Login Service...
    [#[0;32m  OK  #[0m] Started Kernel Logging Service.
             Starting Avahi mDNS/DNS-SD Stack...
             Starting uim-sysfs.service...
             Starting Print notice about GPLv3 packages...
    [#[0;32m  OK  #[0m] Started D-Bus System Message Bus.
    [#[0;32m  OK  #[0m] Started Telephony service.
    [#[0;32m  OK  #[0m] Started Avahi mDNS/DNS-SD Stack.
             Starting Network Service...
    [   13.759364] Bluetooth: Core ver 2.22
    [   13.802974] NET: Registered protocol family 31
    [   13.851509] Bluetooth: HCI device and connection manager initialized
    [   13.914237] Bluetooth: HCI socket layer initialized
    [   13.962718] Bluetooth: L2CAP socket layer initialized
    [   13.967887] Bluetooth: SCO socket layer initialized
    [#[0;32m  OK  #[0m] Found device /dev/mmcblk0p1.
    [#[0;32m  OK  #[0m] Started Network Service.
    [   14.552001] net eth0: initializing cpsw version 1.12 (0)
    [   14.557376] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
    [   14.665407] cpsw 4a100000.ethernet: ALE Table size 1024
    [#[0;32m  OK  #[0m] Listening on Load/Save RF Kill Switch Status [   14.842018] Atheros 8031 ethernet 4a101000.mdio:00: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=4a101000.mdio:00, irq=-1)
    /dev/rfkill Watch.
    [#[0;32m  OK  #[0m] Reached target Network.
             Starting Simple Network Management Protocol (SNMP) Daemon....
    [   14.990043] libphy: PHY 4a101000.mdio:01 not found
             Starting Permit User Sessions...
    [   15.044420] net eth0: phy "4a101000.mdio:01" not found on slave 1, err -19
             Starting Lightning Fast Webserver With Light System Requirements...
    [#[0;32m  OK  #[0m] Started strongSwan IPsec IKEv1/IKEv2 daemon using ipsec.conf.
    [   15.206736] cpts ptp bc clkid 0
             Starting Enable and configure wl18xx bluetooth stack...
    [   15.331800] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
             Starting Network Name Resolution...
             Starting Start USB gadget...
    [#[0;32m  OK  #[0m] Started Permit User Sessions.
    [#[0;32m  OK  #[0m] Started Lightning Fast Webserver With Light System Requirements.
    [#[0;32m  OK  #[0m] Started Login Service.
    [#[0;32m  OK  #[0m] Started Getty on tty1.
    [#[0;32m  OK  #[0m] Started Serial Getty on ttyS3.
    [#[0;32m  OK  #[0m] Started Serial Getty on ttyS0.
    [   16.525372] udc-core: couldn't find an available UDC - added [g_multi] to list of pending drivers
    [#[0;32m  OK  #[0m] Started Network Name Resolution.
    [   17.075740] NET: Registered protocol family 15
    [#[0;32m  OK  #[0m] Started Enable and configure wl18xx bluetooth stack.
    [#[0;1;31mFAILED#[0m] Failed to start Start USB gadget.
    See 'systemctl status gadget-init.service' for details.
    [   18.688036] Initializing XFRM netlink socket
    [   18.702803] input: ti-tsc as /devices/platform/ocp/44e0d000.tscadc/TI-am335x-tsc/input/input0
    [#[0;32m  OK  #[0m] Started Simple Network Management Protocol (SNMP) Daemon..
    [   19.288812] 47401300.usb-phy supply vcc not found, using dummy regulator
    [   19.388533] usbcore: registered new interface driver usbfs
    [   19.388638] usbcore: registered new interface driver hub
    [   19.501225] usbcore: registered new device driver usb
    [   19.727714] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
    [   19.835463] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
    [   19.932280] hub 1-0:1.0: USB hub found
    [   19.993597] hub 1-0:1.0: 1 port detected
    [   20.145097] using random self ethernet address
    [   20.171515] using random host ethernet address
    [   20.176016] using host ethernet address: A8:1B:6A:54:B6:87[   20.300039] using random self ethernet address
    [   20.349837] using random host ethernet address
    [   20.419374] using host ethernet address: A8:1B:6A:54:B6:87[   20.475555] random: crng init done
    [   20.495943] usb0: HOST MAC a8:1b:6a:54:b6:87
    [   20.556849] usb0: MAC c2:c6:de:a5:bd:3c
    [   20.712407] Mass Storage Function, version: 2009/09/11
    [   20.717607] LUN: removable file: (no medium)
    [   20.809224] LUN: removable read only file: /dev/mmcblk0p1
    [   20.874414] Number of LUNs=1
    [   20.906905] g_multi gadget: Multifunction Composite Gadget
    [   20.989379] g_multi gadget: g_multi ready
    [   21.046885] 47401b00.usb-phy supply vcc not found, using dummy regulator
    [   21.203339] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
    [   21.297456] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 2
    [   21.436201] hub 2-0:1.0: USB hub found
    [   21.514597] hub 2-0:1.0: 1 port detected
    [   21.860655] ti-pruss 4a300000.pruss: creating PRU cores and other child platform devices
    [   21.959076] irq: no irq domain found for /ocp/pruss_soc_bus@4a326000/pruss@4a300000/intc@4a320000 !
    [   22.111292] irq: no irq domain found for /ocp/pruss_soc_bus@4a326000/pruss@4a300000/intc@4a320000 !
    [   22.124697] musb-hdrc musb-hdrc.1: VBUS_ERROR in a_wait_vrise (88, <AValid), retry #3, port1 0008010c
    
    
     _____                    _____           _         _   
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_ 
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            
    
    Arago Project http://arago-project.org am335x-evm ttyS0
    
    Arago 2017.10 am335x-evm ttyS0
    
    am335x-evm login: [   22.910312] remoteproc remoteproc1: 4a334000.pru0 is available
    [   22.981793] pru-rproc 4a334000.pru0: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a334000 probed successfully
    [   23.128543] remoteproc remoteproc2: 4a338000.pru1 is available
    [   23.202836] pru-rproc 4a338000.pru1: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a338000 probed successfully
    [   23.401336] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
    ***************************************************************
    ***************************************************************
    NOTICE: This file system contains the following GPLv3 packages:
    	autoconf
    	binutils
    	cifs-utils
    	cpp-symlinks
    	cpp
    	dosfstools
    	g++-symlinks
    	g++
    	gawk-dev
    	gawk
    	gcc-symlinks
    	gcc
    	gdb
    	gdbserver
    	glmark2
    	gstreamer1.0-libav
    	hidapi
    	libcairo-perf-utils
    	libgmp10
    	libidn11
    	libmpc3
    	libmpfr4
    	libreadline-dev
    	libreadline6
    	m4-dev
    	m4
    	make
    	nettle
    	swig-dev
    	swig
    
    If you do not wish to distribute GPLv3 components please remove
    the above packages prior to distribution.  This can be done using
    the opkg remove command.  i.e.:
        opkg remove <package>
    Where <package> is the name printed in the list above
    
    NOTE: If the package is a dependency of another package you
          will be notified of the dependent packages.  You should
          use the --force-removal-of-dependent-packages option to
          also remove the dependent packages as well
    ***************************************************************
    ***************************************************************
    [   27.565012] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]
    [   29.522216] cpsw 4a100000.ethernet eth0: Link is Up - 10Mbps/Full - flow control rx/tx
    [   29.540132] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    
    
     _____                    _____           _         _   
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_ 
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            
    
    Arago Project http://arago-project.org am335x-evm ttyS0
    
    Arago 2017.10 am335x-evm ttyS0
    
    am335x-evm login: root
    
    #7#[r#[999;999H#[6n#8root@am335x-evm:~# 
    root@am335x-evm:~# 
    root@am335x-evm:~# 
    root@am335x-evm:~# lsmod
    Module                  Size  Used by
    bc_example              7326  0
    pru_rproc              10584  0
    pruss_intc              7163  1 pru_rproc
    pruss                   9582  1 pru_rproc
    sha512_generic          9967  0
    sha512_arm             12252  0
    sha256_generic         10178  0
    sha1_generic            2864  0
    sha1_arm_neon           6261  0
    sha1_arm                3862  1 sha1_arm_neon
    md5                     2219  0
    usb_f_acm               5276  1
    u_serial               11171  3 usb_f_acm
    des_generic            17608  0
    cbc                     2388  0
    usb_f_ecm               6492  1
    musb_dsps               9734  0
    musb_hdrc              87874  1 musb_dsps
    usbcore               201869  1 musb_hdrc
    phy_am335x              2372  2
    phy_am335x_control      2937  1 phy_am335x
    phy_generic             5372  1 phy_am335x
    xfrm_user              22370  2
    ti_am335x_adc           7029  0
    ti_am335x_tsc           6029  0
    xfrm4_tunnel            2040  0
    ipcomp                  2257  0
    xfrm_ipcomp             4311  1 ipcomp
    esp4                    6402  0
    ah4                     5627  0
    af_key                 27032  0
    xfrm_algo               6989  5 xfrm_user,esp4,ah4,af_key,xfrm_ipcomp
    g_multi                 6145  0
    usb_f_mass_storage     37218  2 g_multi
    usb_f_rndis            15482  2 g_multi
    u_ether                13001  3 usb_f_ecm,g_multi,usb_f_rndis
    libcomposite           44446  5 usb_f_ecm,usb_f_acm,usb_f_mass_storage,g_multi,usb_f_rndis
    udc_core               19450  8 usb_f_ecm,usb_f_acm,usb_f_mass_storage,u_serial,musb_hdrc,u_ether,usb_f_rndis,libcomposite
    usb_common              4737  6 phy_am335x,udc_core,musb_hdrc,libcomposite,musb_dsps,usbcore
    bluetooth             337541  2
    pm33xx                  6433  0
    wkup_m3_ipc             8240  1 pm33xx
    wkup_m3_rproc           3670  1
    remoteproc             28645  3 pru_rproc,wkup_m3_rproc,wkup_m3_ipc
    pvrsrvkm              403500  3 bc_example
    omap_aes_driver        19334  0
    crypto_engine           7098  1 omap_aes_driver
    omap_sham              21950  0
    ti_emif_sram            5663  1 pm33xx
    pruss_soc_bus           4105  0
    spidev                  7197  0
    rtc_omap                9662  1
    musb_am335x             1426  0
    ti_am335x_tscadc        6290  2 ti_am335x_adc,ti_am335x_tsc
    omap_wdt                4634  0
    sch_fq_codel            9115  3
    uio_module_drv          7251  0
    uio                     9121  1 uio_module_drv
    cryptodev              38083  1
    root@am335x-evm:~# cd /lib/modules/4.9.59-ga75d8e9305/
    root@am335x-evm:/lib/modules/4.9.59-ga75d8e9305# ls
    extra                modules.builtin.bin  modules.softdep
    kernel               modules.dep          modules.symbols
    modules.alias        modules.dep.bin      modules.symbols.bin
    modules.alias.bin    modules.devname      snd-soc-max9860.ko
    modules.builtin      modules.order
    root@am335x-evm:/lib/modules/4.9.59-ga75d8e9305# insmod snd-soc-max9860.ko 
    root@am335x-evm:/lib/modules/4.9.59-ga75d8e9305# aplay /etc/XMPP-qt/male.wav 
    ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:767:(parse_card) cannot find card '0'
    ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
    ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:392:(snd_func_concat) error evaluating strings
    ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
    ALSA lib ../../alsa-lib-1.1.2/src/confmisc.c:1246:(snd_func_refer) error evaluating name
    ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4371:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib ../../alsa-lib-1.1.2/src/conf.c:4850:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib ../../../alsa-lib-1.1.2/src/pcm/pcm.c:2450:(snd_pcm_open_noupdate) Unknown PCM default
    aplay: main:786: audio open error: No such file or directory
    root@am335x-evm:/lib/modules/4.9.59-ga75d8e9305# 
  • Hello Pavel,

    The following is the complete patch for your reference.


    Regards
    Mad_hu.

    --- /media/madhu/Mad_hu/madoldfiles/codecs/Kconfig 2017-12-23 19:21:47.000000000 +0530
    +++ /home/madhu/ti-processor-sdk-linux-am335x-evm-04.02.00.09/board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/sound/soc/codecs/Kconfig 2019-03-05 14:29:19.692000000 +0530
    @@ -87,7 +87,9 @@
    select SND_SOC_MAX98925 if I2C
    select SND_SOC_MAX98926 if I2C
    select SND_SOC_MAX9850 if I2C
    - select SND_SOC_MAX9860 if I2C
    + select SND_SOC_MAX9860
    + select SND_SOC_MAX9860_I2C if I2C
    + select SND_SOC_PCM179X_SPI if SPI_MASTER
    select SND_SOC_MAX9768 if I2C
    select SND_SOC_MAX9877 if I2C
    select SND_SOC_MC13783 if MFD_MC13XXX


    --- /media/madhu/Mad_hu/madoldfiles/davinci-evm.c 2017-12-23 19:21:48.000000000 +0530
    +++ /home/madhu/ti-processor-sdk-linux-am335x-evm-04.02.00.09/board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/sound/soc/davinci/davinci-evm.c 2019-03-05 17:03:32.808000000 +0530
    @@ -20,14 +20,243 @@
    #include <sound/core.h>
    #include <sound/pcm.h>
    #include <sound/soc.h>
    -
    +#include </home/madhu/ti-processor-sdk-linux-am335x-evm-04.02.00.09/board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/sound/soc/codecs/max9860.h>
    #include <asm/dma.h>
    #include <asm/mach-types.h>
    +#include <linux/init.h>
    +#include <linux/module.h>
    +#include <linux/clk.h>
    +#include <linux/kernel.h>
    +#include <linux/pm_runtime.h>
    +#include <linux/regmap.h>
    +#include <linux/i2c.h>
    +#include <linux/regulator/consumer.h>
    +#include <sound/soc.h>
    +#include <sound/soc-dapm.h>
    +#include <sound/pcm_params.h>
    +#include <sound/tlv.h>

    struct snd_soc_card_drvdata_davinci {
    struct clk *mclk;
    unsigned sysclk;
    };
    +struct max9860_priv {
    + struct regmap *regmap;
    + struct regulator *dvddio;
    + struct notifier_block dvddio_nb;
    + u8 psclk;
    + unsigned long pclk_rate;
    + int fmt;
    +};
    +static int max9860_hw_params(struct snd_pcm_substream *substream,
    + struct snd_pcm_hw_params *params,
    + struct snd_soc_dai *dai)
    +{
    + struct snd_soc_codec *codec = dai->codec;
    + struct max9860_priv *max9860 = snd_soc_codec_get_drvdata(codec);
    + u8 master;
    + u8 ifc1a = 0;
    + u8 ifc1b = 0;
    + u8 sysclk = 0;
    + unsigned long n;
    + int ret;
    +
    + dev_dbg(codec->dev, "hw_params %u Hz, %u channels\n",
    + params_rate(params),
    + params_channels(params));
    +
    + if (params_channels(params) == 2)
    + ifc1b |= MAX9860_ST;
    +
    + switch (max9860->fmt & SND_SOC_DAIFMT_MASTER_MASK) {
    + case SND_SOC_DAIFMT_CBS_CFS:
    + master = 0;
    + break;
    + case SND_SOC_DAIFMT_CBM_CFM:
    + master = MAX9860_MASTER;
    + break;
    + default:
    + return -EINVAL;
    + }
    + ifc1a |= master;
    +
    + if (master) {
    + if (params_width(params) * params_channels(params) > 48)
    + ifc1b |= MAX9860_BSEL_64X;
    + else
    + ifc1b |= MAX9860_BSEL_48X;
    + }
    +
    + switch (max9860->fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
    + case SND_SOC_DAIFMT_I2S:
    + ifc1a |= MAX9860_DDLY;
    + ifc1b |= MAX9860_ADLY;
    + break;
    + case SND_SOC_DAIFMT_LEFT_J:
    + ifc1a |= MAX9860_WCI;
    + break;
    + case SND_SOC_DAIFMT_DSP_A:
    + if (params_width(params) != 16) {
    + dev_err(codec->dev,
    + "DSP_A works for 16 bits per sample only.\n");
    + return -EINVAL;
    + }
    + ifc1a |= MAX9860_DDLY | MAX9860_WCI | MAX9860_HIZ | MAX9860_TDM;
    + ifc1b |= MAX9860_ADLY;
    + break;
    + case SND_SOC_DAIFMT_DSP_B:
    + if (params_width(params) != 16) {
    + dev_err(codec->dev,
    + "DSP_B works for 16 bits per sample only.\n");
    + return -EINVAL;
    + }
    + ifc1a |= MAX9860_WCI | MAX9860_HIZ | MAX9860_TDM;
    + break;
    + default:
    + return -EINVAL;
    + }
    +
    + switch (max9860->fmt & SND_SOC_DAIFMT_INV_MASK) {
    + case SND_SOC_DAIFMT_NB_NF:
    + break;
    + case SND_SOC_DAIFMT_NB_IF:
    + switch (max9860->fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
    + case SND_SOC_DAIFMT_DSP_A:
    + case SND_SOC_DAIFMT_DSP_B:
    + return -EINVAL;
    + }
    + ifc1a ^= MAX9860_WCI;
    + break;
    + case SND_SOC_DAIFMT_IB_IF:
    + switch (max9860->fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
    + case SND_SOC_DAIFMT_DSP_A:
    + case SND_SOC_DAIFMT_DSP_B:
    + return -EINVAL;
    + }
    + ifc1a ^= MAX9860_WCI;
    + /* fall through */
    + case SND_SOC_DAIFMT_IB_NF:
    + ifc1a ^= MAX9860_DBCI;
    + ifc1b ^= MAX9860_ABCI;
    + break;
    + default:
    + return -EINVAL;
    + }
    +
    + dev_dbg(codec->dev, "IFC1A %02x\n", ifc1a);
    + ret = regmap_write(max9860->regmap, MAX9860_IFC1A, ifc1a);
    + if (ret) {
    + dev_err(codec->dev, "Failed to set IFC1A: %d\n", ret);
    + return ret;
    + }
    + dev_dbg(codec->dev, "IFC1B %02x\n", ifc1b);
    + ret = regmap_write(max9860->regmap, MAX9860_IFC1B, ifc1b);
    + if (ret) {
    + dev_err(codec->dev, "Failed to set IFC1B: %d\n", ret);
    + return ret;
    + }
    +
    + /*
    + * Check if Integer Clock Mode is possible, but avoid it in slave mode
    + * since we then do not know if lrclk is derived from pclk and the
    + * datasheet mentions that the frequencies have to match exactly in
    + * order for this to work.
    + */
    + if (params_rate(params) == 8000 || params_rate(params) == 16000) {
    + if (master) {
    + switch (max9860->pclk_rate) {
    + case 12000000:
    + sysclk = MAX9860_FREQ_12MHZ;
    + break;
    + case 13000000:
    + sysclk = MAX9860_FREQ_13MHZ;
    + break;
    + case 19200000:
    + sysclk = MAX9860_FREQ_19_2MHZ;
    + break;
    + default:
    + /*
    + * Integer Clock Mode not possible. Leave
    + * sysclk at zero and fall through to the
    + * code below for PLL mode.
    + */
    + break;
    + }
    +
    + if (sysclk && params_rate(params) == 16000)
    + sysclk |= MAX9860_16KHZ;
    + }
    + }
    +
    + /*
    + * Largest possible n:
    + * 65536 * 96 * 48kHz / 10MHz -> 30199
    + * Smallest possible n:
    + * 65536 * 96 * 8kHz / 20MHz -> 2517
    + * Both fit nicely in the available 15 bits, no need to apply any mask.
    + */
    + n = DIV_ROUND_CLOSEST_ULL(65536ULL * 96 * params_rate(params),
    + max9860->pclk_rate);
    +
    + if (!sysclk) {
    + /* PLL mode */
    + if (params_rate(params) > 24000)
    + sysclk |= MAX9860_16KHZ;
    +
    + if (!master)
    + n |= 1; /* trigger rapid pll lock mode */
    + }
    +
    + sysclk |= max9860->psclk;
    + dev_dbg(codec->dev, "SYSCLK %02x\n", sysclk);
    + ret = regmap_write(max9860->regmap,
    + MAX9860_SYSCLK, sysclk);
    + if (ret) {
    + dev_err(codec->dev, "Failed to set SYSCLK: %d\n", ret);
    + return ret;
    + }
    + dev_dbg(codec->dev, "N %lu\n", n);
    + ret = regmap_write(max9860->regmap,
    + MAX9860_AUDIOCLKHIGH, n >> 8);
    + if (ret) {
    + dev_err(codec->dev, "Failed to set NHI: %d\n", ret);
    + return ret;
    + }
    + ret = regmap_write(max9860->regmap,
    + MAX9860_AUDIOCLKLOW, n & 0xff);
    + if (ret) {
    + dev_err(codec->dev, "Failed to set NLO: %d\n", ret);
    + return ret;
    + }
    +
    + if (!master) {
    + dev_dbg(codec->dev, "Enable PLL\n");
    + ret = regmap_update_bits(max9860->regmap, MAX9860_AUDIOCLKHIGH,
    + MAX9860_PLL, MAX9860_PLL);
    + if (ret) {
    + dev_err(codec->dev, "Failed to enable PLL: %d\n", ret);
    + return ret;
    + }
    + }
    +
    + return 0;
    +}
    +
    +static int max9860_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
    +{
    + struct snd_soc_codec *codec = dai->codec;
    + struct max9860_priv *max9860 = snd_soc_codec_get_drvdata(codec);
    +
    + switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
    + case SND_SOC_DAIFMT_CBM_CFM:
    + case SND_SOC_DAIFMT_CBS_CFS:
    + max9860->fmt = fmt;
    + return 0;
    +
    + default:
    + return -EINVAL;
    + }
    +}

    static int evm_startup(struct snd_pcm_substream *substream)
    {
    @@ -82,6 +311,12 @@
    .shutdown = evm_shutdown,
    .hw_params = evm_hw_params,
    };
    +static struct snd_soc_ops max9860_dai_ops = {
    + //.hw_params = max9860_hw_params,
    + //.set_fmt = max9860_set_fmt,
    +.startup = evm_startup,
    + .shutdown = evm_shutdown,
    +};

    /* davinci-evm machine dapm widgets */
    static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = {
    @@ -242,6 +477,22 @@
    SND_SOC_DAIFMT_IB_NF,
    };

    +static struct snd_soc_dai_link max9860_evm_dai = {
    + .name = "MAX9860",
    + .stream_name = "AIC3X",
    + .cpu_dai_name= "davinci-mcasp.0",
    + .codec_dai_name = "max9860-hifi",
    + .codec_name = "max9860-codec.1",
    + .platform_name = "davinci-mcasp.0",
    + .init = evm_aic3x_init,
    + .ops = &max9860_dai_ops,
    + .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM |
    + SND_SOC_DAIFMT_IB_NF,SND_SOC_DAIFMT_CBS_CFS |
    + SND_SOC_DAIFMT_I2S ,
    +
    +};
    +
    +
    /* davinci dm6446 evm audio machine driver */
    /*
    * ASP0 in DM6446 EVM is clocked by U55, as configured by
    @@ -345,6 +596,13 @@
    .compatible = "ti,da830-evm-audio",
    .data = (void *) &evm_dai_tlv320aic3x,
    },
    + {
    + .compatible = "maxim,max9860",
    + .data = (void *) &max9860_evm_dai,
    + },
    +
    +
    +
    { /* sentinel */ }
    };
    MODULE_DEVICE_TABLE(of, davinci_evm_dt_ids);







    --- /media/madhu/Mad_hu/madoldfiles/Kconfig 2017-12-23 19:21:48.000000000 +0530
    +++ /home/madhu/ti-processor-sdk-linux-am335x-evm-04.02.00.09/board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/sound/soc/davinci/Kconfig 2019-03-05 16:36:15.124000000 +0530
    @@ -37,8 +37,12 @@

    config SND_DAVINCI_SOC_GENERIC_EVM
    tristate
    - select SND_SOC_TLV320AIC3X
    - select SND_DAVINCI_SOC_MCASP
    + #select SND_SOC_TLV320AIC3X
    + select SND_SOC_MAX9860
    + #select SND_DAVINCI_SOC_MCASP
    + #select SND_SOC_MAX9860
    +
    +

    config SND_AM33XX_SOC_EVM
    tristate "SoC Audio for the AM33XX chip based boards"
    @@ -50,6 +54,20 @@
    AM335X-EVMSK, and BeagelBone with AudioCape boards have this
    setup.

    +
    +config SND_AM33XX_SOC_MAX9860
    +tristate "SoC Audio support for MAX9860 on AM33XX chip based boards"
    + depends on SND_DAVINCI_SOC && SOC_AM33XX
    + select SND_SOC_MAX9860
    + select SND_DAVINCI_SOC_MCASP
    +
    +
    +
    +
    +
    +
    +
    +
    config SND_DAVINCI_SOC_EVM
    tristate "SoC Audio support for DaVinci DM6446, DM355 or DM365 EVM"
    depends on SND_EDMA_SOC && I2C





    --- /media/madhu/Mad_hu/madoldfiles/Makefile 2017-12-23 19:21:48.000000000 +0530
    +++ /home/madhu/ti-processor-sdk-linux-am335x-evm-04.02.00.09/board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/sound/soc/davinci/Makefile 2019-03-05 12:13:05.288000000 +0530
    @@ -13,3 +13,4 @@
    snd-soc-evm-objs := davinci-evm.o

    obj-$(CONFIG_SND_DAVINCI_SOC_GENERIC_EVM) += snd-soc-evm.o
    +obj-$(SND_AM33XX_SOC_MAX9860)+=snd-soc-max9860.o





    --- /media/madhu/Mad_hu/madoldfiles/davinci-mcasp.c 2017-12-23 19:21:48.000000000 +0530
    +++ /home/madhu/ti-processor-sdk-linux-am335x-evm-04.02.00.09/board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/sound/soc/davinci/davinci-mcasp.c 2019-03-05 11:35:40.308000000 +0530
    @@ -38,6 +38,7 @@
    #include <sound/dmaengine_pcm.h>
    #include <sound/omap-pcm.h>
    #include <dt-bindings/sound/ti-mcasp.h>
    +#include </home/madhu/ti-processor-sdk-linux-am335x-evm-04.02.00.09/board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/sound/soc/codecs/max9860.h>

    #include "edma-pcm.h"
    #include "davinci-mcasp.h"
    @@ -59,6 +60,14 @@
    DAVINCI_MCASP_RXTDM_REG,
    DAVINCI_MCASP_TXTDM_REG,
    };
    +struct max9860_priv {
    + struct regmap *regmap;
    + struct regulator *dvddio;
    + struct notifier_block dvddio_nb;
    + u8 psclk;
    + unsigned long pclk_rate;
    + int fmt;
    +};

    struct davinci_mcasp_context {
    u32 config_regs[ARRAY_SIZE(context_regs)];
    @@ -438,6 +447,16 @@
    /* No delay after FS */
    data_delay = 0;
    break;
    + //case SND_SOC_DAIFMT_CBS_CFS:
    + /*// codec is clock and frame slave */
    + //mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXE);
    + //mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, AFSXE);
    + //mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRE);
    + //mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, AFSRE);
    + //mcasp_set_bits(mcasp, DAVINCI_MCASP_PDIR_REG, ACLKX | ACLKR);
    + //mcasp_set_bits(mcasp, DAVINCI_MCASP_PDIR_REG, AFSX | AFSR);
    + //break;
    +
    default:
    ret = -EINVAL;
    goto out;
    @@ -1386,6 +1405,222 @@
    .set_tdm_slot = davinci_mcasp_set_tdm_slot,
    };

    +
    +static int max9860_hw_params(struct snd_pcm_substream *substream,
    + struct snd_pcm_hw_params *params,
    + struct snd_soc_dai *dai)
    +{
    + struct snd_soc_codec *codec = dai->codec;
    + struct max9860_priv *max9860 = snd_soc_codec_get_drvdata(codec);
    + u8 master;
    + u8 ifc1a = 0;
    + u8 ifc1b = 0;
    + u8 sysclk = 0;
    + unsigned long n;
    + int ret;
    +
    + dev_dbg(codec->dev, "hw_params %u Hz, %u channels\n",
    + params_rate(params),
    + params_channels(params));
    +
    + if (params_channels(params) == 2)
    + ifc1b |= MAX9860_ST;
    +
    + switch (max9860->fmt & SND_SOC_DAIFMT_MASTER_MASK) {
    + case SND_SOC_DAIFMT_CBS_CFS:
    + master = 0;
    + break;
    + case SND_SOC_DAIFMT_CBM_CFM:
    + master = MAX9860_MASTER;
    + break;
    + default:
    + return -EINVAL;
    + }
    + ifc1a |= master;
    +
    + if (master) {
    + if (params_width(params) * params_channels(params) > 48)
    + ifc1b |= MAX9860_BSEL_64X;
    + else
    + ifc1b |= MAX9860_BSEL_48X;
    + }
    +
    + switch (max9860->fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
    + case SND_SOC_DAIFMT_I2S:
    + ifc1a |= MAX9860_DDLY;
    + ifc1b |= MAX9860_ADLY;
    + break;
    + case SND_SOC_DAIFMT_LEFT_J:
    + ifc1a |= MAX9860_WCI;
    + break;
    + case SND_SOC_DAIFMT_DSP_A:
    + if (params_width(params) != 16) {
    + dev_err(codec->dev,
    + "DSP_A works for 16 bits per sample only.\n");
    + return -EINVAL;
    + }
    + ifc1a |= MAX9860_DDLY | MAX9860_WCI | MAX9860_HIZ | MAX9860_TDM;
    + ifc1b |= MAX9860_ADLY;
    + break;
    + case SND_SOC_DAIFMT_DSP_B:
    + if (params_width(params) != 16) {
    + dev_err(codec->dev,
    + "DSP_B works for 16 bits per sample only.\n");
    + return -EINVAL;
    + }
    + ifc1a |= MAX9860_WCI | MAX9860_HIZ | MAX9860_TDM;
    + break;
    + default:
    + return -EINVAL;
    + }
    +
    + switch (max9860->fmt & SND_SOC_DAIFMT_INV_MASK) {
    + case SND_SOC_DAIFMT_NB_NF:
    + break;
    + case SND_SOC_DAIFMT_NB_IF:
    + switch (max9860->fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
    + case SND_SOC_DAIFMT_DSP_A:
    + case SND_SOC_DAIFMT_DSP_B:
    + return -EINVAL;
    + }
    + ifc1a ^= MAX9860_WCI;
    + break;
    + case SND_SOC_DAIFMT_IB_IF:
    + switch (max9860->fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
    + case SND_SOC_DAIFMT_DSP_A:
    + case SND_SOC_DAIFMT_DSP_B:
    + return -EINVAL;
    + }
    + ifc1a ^= MAX9860_WCI;
    + /* fall through */
    + case SND_SOC_DAIFMT_IB_NF:
    + ifc1a ^= MAX9860_DBCI;
    + ifc1b ^= MAX9860_ABCI;
    + break;
    + default:
    + return -EINVAL;
    + }
    +
    + dev_dbg(codec->dev, "IFC1A %02x\n", ifc1a);
    + ret = regmap_write(max9860->regmap, MAX9860_IFC1A, ifc1a);
    + if (ret) {
    + dev_err(codec->dev, "Failed to set IFC1A: %d\n", ret);
    + return ret;
    + }
    + dev_dbg(codec->dev, "IFC1B %02x\n", ifc1b);
    + ret = regmap_write(max9860->regmap, MAX9860_IFC1B, ifc1b);
    + if (ret) {
    + dev_err(codec->dev, "Failed to set IFC1B: %d\n", ret);
    + return ret;
    + }
    +
    + /*
    + * Check if Integer Clock Mode is possible, but avoid it in slave mode
    + * since we then do not know if lrclk is derived from pclk and the
    + * datasheet mentions that the frequencies have to match exactly in
    + * order for this to work.
    + */
    + if (params_rate(params) == 8000 || params_rate(params) == 16000) {
    + if (master) {
    + switch (max9860->pclk_rate) {
    + case 12000000:
    + sysclk = MAX9860_FREQ_12MHZ;
    + break;
    + case 13000000:
    + sysclk = MAX9860_FREQ_13MHZ;
    + break;
    + case 19200000:
    + sysclk = MAX9860_FREQ_19_2MHZ;
    + break;
    + default:
    + /*
    + * Integer Clock Mode not possible. Leave
    + * sysclk at zero and fall through to the
    + * code below for PLL mode.
    + */
    + break;
    + }
    +
    + if (sysclk && params_rate(params) == 16000)
    + sysclk |= MAX9860_16KHZ;
    + }
    + }
    +
    + /*
    + * Largest possible n:
    + * 65536 * 96 * 48kHz / 10MHz -> 30199
    + * Smallest possible n:
    + * 65536 * 96 * 8kHz / 20MHz -> 2517
    + * Both fit nicely in the available 15 bits, no need to apply any mask.
    + */
    + n = DIV_ROUND_CLOSEST_ULL(65536ULL * 96 * params_rate(params),
    + max9860->pclk_rate);
    +
    + if (!sysclk) {
    + /* PLL mode */
    + if (params_rate(params) > 24000)
    + sysclk |= MAX9860_16KHZ;
    +
    + if (!master)
    + n |= 1; /* trigger rapid pll lock mode */
    + }
    +
    + sysclk |= max9860->psclk;
    + dev_dbg(codec->dev, "SYSCLK %02x\n", sysclk);
    + ret = regmap_write(max9860->regmap,
    + MAX9860_SYSCLK, sysclk);
    + if (ret) {
    + dev_err(codec->dev, "Failed to set SYSCLK: %d\n", ret);
    + return ret;
    + }
    + dev_dbg(codec->dev, "N %lu\n", n);
    + ret = regmap_write(max9860->regmap,
    + MAX9860_AUDIOCLKHIGH, n >> 8);
    + if (ret) {
    + dev_err(codec->dev, "Failed to set NHI: %d\n", ret);
    + return ret;
    + }
    + ret = regmap_write(max9860->regmap,
    + MAX9860_AUDIOCLKLOW, n & 0xff);
    + if (ret) {
    + dev_err(codec->dev, "Failed to set NLO: %d\n", ret);
    + return ret;
    + }
    +
    + if (!master) {
    + dev_dbg(codec->dev, "Enable PLL\n");
    + ret = regmap_update_bits(max9860->regmap, MAX9860_AUDIOCLKHIGH,
    + MAX9860_PLL, MAX9860_PLL);
    + if (ret) {
    + dev_err(codec->dev, "Failed to enable PLL: %d\n", ret);
    + return ret;
    + }
    + }
    +
    + return 0;
    +}
    +
    +static int max9860_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
    +{
    + struct snd_soc_codec *codec = dai->codec;
    + struct max9860_priv *max9860 = snd_soc_codec_get_drvdata(codec);
    +
    + switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
    + case SND_SOC_DAIFMT_CBM_CFM:
    + case SND_SOC_DAIFMT_CBS_CFS:
    + max9860->fmt = fmt;
    + return 0;
    +
    + default:
    + return -EINVAL;
    + }
    +}
    +
    +static const struct snd_soc_dai_ops max9860_dai_ops = {
    + .hw_params = max9860_hw_params,
    + .set_fmt = max9860_set_fmt,
    +};
    +
    static int davinci_mcasp_dai_probe(struct snd_soc_dai *dai)
    {
    struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai);
    @@ -1545,6 +1780,10 @@
    };

    static const struct of_device_id mcasp_dt_ids[] = {
    + //{
    + /// .compatible = "maxim,max9860",
    + // .data = &am33xx_mcasp_pdata,
    + //},
    {
    .compatible = "ti,dm646x-mcasp-audio",
    .data = &dm646x_mcasp_pdata,




    --- /media/madhu/Mad_hu/madoldfiles/tisdk_am335x-evm_defconfig 2017-12-23 19:36:18.000000000 +0530
    +++ /home/madhu/ti-processor-sdk-linux-am335x-evm-04.02.00.09/board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/configs/tisdk_am335x-evm_defconfig 2019-03-05 15:19:41.488000000 +0530
    @@ -3595,10 +3595,11 @@
    # CONFIG_SND_SOC_AMD_ACP is not set
    CONFIG_SND_ATMEL_SOC=m
    CONFIG_SND_EDMA_SOC=y
    -# CONFIG_SND_DAVINCI_SOC_I2S is not set
    -CONFIG_SND_DAVINCI_SOC_MCASP=y
    +CONFIG_SND_DAVINCI_SOC_I2S=m
    +CONFIG_SND_DAVINCI_SOC_MCASP=m
    CONFIG_SND_DAVINCI_SOC_GENERIC_EVM=m
    CONFIG_SND_AM33XX_SOC_EVM=m
    +CONFIG_SND_AM33XX_SOC_MAX9860=m
    # CONFIG_SND_DESIGNWARE_I2S is not set

    #
    @@ -3652,7 +3653,7 @@
    # CONFIG_SND_SOC_GTM601 is not set
    # CONFIG_SND_SOC_INNO_RK3036 is not set
    # CONFIG_SND_SOC_MAX98504 is not set
    -# CONFIG_SND_SOC_MAX9860 is not set
    + CONFIG_SND_SOC_MAX9860=m
    # CONFIG_SND_SOC_PCM1681 is not set
    # CONFIG_SND_SOC_PCM179X_I2C is not set
    # CONFIG_SND_SOC_PCM179X_SPI is not set
  • MADHU GANDEPALLI said:
    [ 1.617255] ALSA device list: [ 1.620304] No soundcards found.

    You should have something here, even when using dummy codec driver.

    In the DAC example (link below), we have ALSA dummy driver for the PCM5102a DAC and it is detected in kernel:

    [    5.852989] ALSA device list:
    [    5.856126]   #0: TI PCM5102A

    This is setup in main DTS file:

    sound {
    		compatible = "ti,pcm5102a-evm-audio";
    		ti,model = "TI PCM5102A";
    		ti,audio-codec = <&pcm5102a>;
    		ti,mcasp-controller = <&mcasp0>;
    		ti,codec-clock-rate = <24000000>;
    	};

    processors.wiki.ti.com/.../Sitara_Linux_Audio_DAC_Example

     

    Another example in BeagleBoneBlack board which is using dummy HDMI codec driver. See the below pointers for details:

    am335x-boneblack.dts

    Regards,
    Pavel

  • Regarding MAX9860 codec, check the below e2e thread:

    e2e.ti.com/.../368417

    Regards,
    Pavel
  • Hello pavel 

    That is what my concern is also.

    I think in the kernel menuconfig people are enabling this feature but for me , in my SDK   ,04.02.00.09  menuconfig option is not there in the Makefile.

    I have seen that tristate.conf and auto.conf of  ~/linux/board-support/linux-xxxxxx/include/configs/ are getting updated with configuration set somewhere. There I have been seeing that when building kernel our new SND_SOC_XXX is not getting populated.

    Kindly look in this direction and help me in getting the sound card available.

    Regards

    Mad_hu

  • Hello Pavel

    I have also observed that ti_sdk_am335xxxxxx_defconfig is the one that is deciding the kernel build.

    The patch of that file is available in the previous posts.

    Kindly look into that and help me.


    Regards
    Mad_hu.
  • Madhu,

    For building custom kernel, follow the below steps:

    1. export the AM335x PSDK toolchain compiler
    2. clean the kernel sources
    3. configure the kernel with tisdk_am335x-evm_defconfig (not ti_sdk_am335xxxxxx_defconfig)
    4. customize the configuration (menuconfig or else)
    5. compile the kernel
    6. compile dtb file (if needed)
    7. compile modules (if needed)
    8. install kernel, dtb and modules

    Refer to the below wiki page for details:

    processors.wiki.ti.com/.../Linux_Kernel_Users_Guide
    processors.wiki.ti.com/.../Linux_Core_Audio_User's_Guide

    Regards,
    Pavel
  • Hello Pavel,

    I was doing the same .
    By mistake the name of tisdk_am335x-evm_defconfig was typed wrong.

    I have kept some printk statements in the davinci_evm.c and davinci_mcasp.c . When Can I see those statements?
    I am not able to see those statements when booting and even when I do insmod of that ko


    Regards
    Mad_hu
  • MADHU GANDEPALLI said:
    I have kept some printk statements in the davinci_evm.c and davinci_mcasp.c . When Can I see those statements?
    I am not able to see those statements when booting and even when I do insmod of that ko

    You can see the printk statements after executing arecord/aplay commands or start ALSA application. See the below e2e thread for more details:

    Please let me know if you have another questions.

    Regards,
    Pavel

  • Hello Pavel,

    Audio DAC example seems to be not working for my SDK. As I said my SDK is 4.02.xx I have been failing continuously.

    So I started keeping kernel debug statements in the davinci_evm probe and davinci_mcasp probe functions. I found that davinci_evm is failing saying could not find any CPU dai davinci_mcasp.0.

    So I started debugging davinci_mcasp.c. Here I found they are trying to read values like tdm_slots ,  num_serializer etc from davinci_mcasp_pdata am33xx_mcasp_pdata where these values are not there and hence throwing error message saying no platform data.

    In comments it was said that those values will be loaded from dts but not being happening.

    Kindly help me at the earliest.

    Regards

    Mad_hu

  • Madhu,

    MADHU GANDEPALLI said:
    Audio DAC example seems to be not working for my SDK. As I said my SDK is 4.02.xx I have been failing continuously.

    Could you please clarify how exactly you test audio dac examples working or not? Do you have PCM5102a DAC chip on your custom board or not? If you do not have PCM5102a DAC chip, do you have something (DAC, ADC, codec, etc) attached to AM335x McASP?

    Please provide your latest boot log plus log of how exactly you test audio DAC examples.

    Regards,
    Pavel

  • Hello Pavel
    I have Max9860 attached to my Mcasp which I already mentioned in my previous posts.

    With lot of struggle I could achieve the sound card generated but setting the DAI fmt is failed. So after huge debugging came to know that I2c driver has to be called to do that and did the necessary changes in the dts file .

    Now the problem is I2c is coming after the sound card. I have used "depends on I2C" for SND_SOC_MAX9860 in the kconfig of /sound/soc/codecs/

    but still i2c is coming late. If I2c comes earlier my problem is solved.

    Kindly help me on this at the earliest.

    Regards
    Mad_hu
  • MADHU GANDEPALLI said:
    I have Max9860 attached to my Mcasp which I already mentioned in my previous posts.

    Your initial post is regarding connection of AM335x McASP to another DSP McBSP, and using dummy codec driver. If you still have questions regarding this configuration (McASP to McBSP, dummy codec driver), please let me know in this e2e thread.

    Now you have another configuration, AM335x McASP to MAX9860 codec. There is specific codec driver (max9860.c) for MAX9860 codec and dummy codec driver is not needed. Regarding questions related to your new configuration (McASP to MAX9860 codec), please open new e2e thread in Sitara forum.

    Regards,
    Pavel