2008-03-12 02:16:55     How to add PCM1742 driver to BF531

Document created by Aaronwu Employee on Aug 5, 2013
Version 1Show Document
  • View in full screen mode

2008-03-12 02:16:55     How to add PCM1742 driver to BF531

Yi Li (CHINA)

Message: 52360    A question from a developer:

 

"

 

    My question is how to add the PCM1742 driver? I want to do it in following step, is that right? Do you have some suggestion?

    1. create pcm1742.c and .h files based on wm8731.c & .h in linux/sound/soc/codecs, because the wm8731 uses I2S interface too.

    2. create bf5xx-pcm1742.c based on bf5xx-wm8731.c in linux/sound/soc/blackfin

    3. modify pcm1742.c & .h and bf5xx-pcm1742 accroding to the pcm1742 datasheet.

 

    Is that OK?

 

    But I want to build the wm8731 driver, I got these error

 

    [zzq01@localhost uclinux-dist]$ make

    rm -f linux-2.6.x/usr/initramfs_data.cpio.gz

    make ARCH=blackfin   CROSS_COMPILE=bfin-uclinux- -j1 -C linux-2.6.x  || exit 1

    make[1]: Entering directory `/home/zzq01/embedded/bfin/blackfin-sources/uclinux-dist/linux-2.6.x'

      CHK     include/linux/version.h

      CHK     include/linux/utsrelease.h

      CALL    scripts/checksyscalls.sh

      CHK     include/linux/compile.h

      GEN     usr/initramfs_data.cpio.gz

      AS      usr/initramfs_data.o

      LD      usr/built-in.o

      CC      sound/soc/blackfin/bf5xx-pcm.o

      LD      sound/soc/blackfin/snd-soc-bf5xx.o

      LD      sound/soc/blackfin/snd-soc-bf5xx-i2s.o

      LD      sound/soc/blackfin/snd-soc-bf5xx-wm8731.o

      LD      sound/soc/blackfin/built-in.o

      LD      sound/soc/built-in.o

      LD      sound/built-in.o

      GEN     .version

      CHK     include/linux/compile.h

      UPD     include/linux/compile.h

      CC      init/version.o

      LD      init/built-in.o

      LD      .tmp_vmlinux1

    sound/built-in.o: In function `bf5xx_mmap_copy':

    sound/soc/blackfin/bf5xx-pcm.c:(.text+0x1ae8e): undefined reference to `bf5xx_ac97_pcm32_to_frame'

    sound/soc/blackfin/bf5xx-pcm.c:(.text+0x1aecc): undefined reference to `bf5xx_ac97_frame_to_pcm32'

    sound/built-in.o: In function `sport_tx_stop':

    (.text+0x1bd10): undefined reference to `bf5xx_ac97_write'

    sound/built-in.o: In function `sport_tx_stop':

    (.text+0x1bd1c): undefined reference to `bf5xx_ac97_write'

    sound/built-in.o: In function `sport_tx_start':

    (.text+0x1ccb0): undefined reference to `bf5xx_ac97_write'

    sound/built-in.o: In function `sport_tx_start':

    (.text+0x1ccba): undefined reference to `bf5xx_ac97_write'

    make[1]: *** [.tmp_vmlinux1] Error 1

    make[1]: Leaving directory `/home/zzq01/embedded/bfin/blackfin-sources/uclinux-dist/linux-2.6.x'

    make: *** [linux] Error

 

"

We need to know what is the toolchain and kernel version you are using. Please try 2008R1 branch or svn trunk.

QuoteReplyEditDelete

 

 

2008-03-12 04:32:25     Re: How to add PCM1742 driver to BF531

Zhi Qiang Zhang (CHINA)

Message: 52378   

 

The toolchain I am using is

Path: .

URL: svn://blackfin.uclinux.org/toolchain/trunk

Repository Root: svn://blackfin.uclinux.org/toolchain

Repository UUID: 2adf4935-75e9-4407-93b2-34b21a1880a4

Revision: 2182

Node Kind: directory

Schedule: normal

Last Changed Author: vapier

Last Changed Rev: 2182

Last Changed Date: 2008-02-27 15:58:02 +0800 (Wed, 27 Feb 2008)

 

Kernel is

URL: svn://blackfin.uclinux.org/uclinux-dist/trunk

Repository Root: svn://blackfin.uclinux.org/uclinux-dist

Repository UUID: 3e2a5524-39e8-4cb9-84a9-c49da69cba3a

Revision: 6334

Node Kind: directory

Schedule: normal

Last Changed Author: vapier

Last Changed Rev: 6333

Last Changed Date: 2008-03-02 11:32:12 +0800 (Sun, 02 Mar 2008)

 

 

Regards,

ZhangZQ

QuoteReplyEditDelete

 

 

2008-03-12 06:04:56     Re: How to add PCM1742 driver to BF531

Yi Li (CHINA)

Message: 52385    building bf5xx-pcm.c requires building bf5xx-ac97.

QuoteReplyEditDelete

 

 

2008-03-12 10:07:59     Re: How to add PCM1742 driver to BF531

Zhi Qiang Zhang (CHINA)

Message: 52390    Actually I am not concerned about how to correctly complile WM8731, what I really want to know is where is the proper place to start my PCM1742 driver? linux-2.6.x/sound/blackfin or linux-2.6.x/sound/soc/blackfin.

 

Regards,

ZhangZQ

QuoteReplyEditDelete

 

 

2008-03-12 11:02:45     Re: How to add PCM1742 driver to BF531

Robin Getz (UNITED STATES)

Message: 52391    Zhi Qiang:

 

What the best path depends on what you want to do - make an ASOC driver or just a standard ALSA driver?

 

-Robin

QuoteReplyEditDelete

 

 

2008-03-12 11:12:09     Re: How to add PCM1742 driver to BF531

Mike Frysinger (UNITED STATES)

Message: 52393    i dont think anyone should be creating standard ALSA drivers anymore for Blackfin ...

QuoteReplyEditDelete

 

 

2008-03-12 19:00:52     Re: How to add PCM1742 driver to BF531

Zhi Qiang Zhang (CHINA)

Message: 52412    Robin and Mike,

 

My requirement is very simple, just want to PCM1742 have the audio output, and my application using the OSS API to control the audio, I don't care the driver is ALSA or ASOC.

 

 

Regards,

ZhangZQ

QuoteReplyEditDelete

 

 

2008-03-12 19:30:07     Re: How to add PCM1742 driver to BF531

Mike Frysinger (UNITED STATES)

Message: 52413    if you dont care, then why are you asking for advice ?  you could just as easily (and more quickly) flip a coin and pick one

 

sound/blackfin/ is going away on our side ... no new drivers will be accepted by us for that directory.  the soc makes a lot more sense as it splits the logic between a driver for the codec and a driver for the interface hardware (generally a SPORT in the Blackfin case).

QuoteReplyEditDelete

 

 

2008-03-12 21:27:08     Re: How to add PCM1742 driver to BF531

Zhi Qiang Zhang (CHINA)

Message: 52416    Yes, I just concerned about the simplicity and found sound/blackfin is more easyer to understand than sound/soc/blackfin.

QuoteReplyEditDelete

 

 

2008-03-12 23:29:15     Re: How to add PCM1742 driver to BF531

Mike Frysinger (UNITED STATES)

Message: 52420    but in the long run, the harder to maintain and does not scale ... but it's your local driver, so that call is certainly yours to make

QuoteReplyEditDelete

 

 

2008-03-13 05:16:49     Re: How to add PCM1742 driver to BF531

Zhi Qiang Zhang (CHINA)

Message: 52445    I desided to make a ASOC driver for PCM1742, and skeleton had been done,

 

dvanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50 2006 UTC).

ASoC version 0.13.1

bfin-pcm1742: bf5xx_pcm1742_init

bfin-pcm1742: bf5xx_probe

dma_alloc_init: dma_page @ 0x01c6d000 - 256 pages at 0x01f00000

pcm1742: PCM1742 Audio Codec 0.13

pcm1742: spi register

 

pcm1742: spi probe

 

pcm1742: pcm1742_init

 

asoc: PCM1742 <-> bf5xx-i2s-0 mapping ok

bfin-pcm1742: bf5xx_pcm1742_init_dev

bfin-pcm1742: I am pcm1742 bf5xx_pcm1742_init

ALSA device list:

  #0: bf5xx_pcm1742 (PCM1742)

Attachments

    Outcomes