Changeset 3219


Ignore:
Timestamp:
Aug 23, 2012, 8:20:15 PM (3 years ago)
Author:
wmb
Message:

OLPC ARM - Changed the representation of the audio device in the device tree, for compatibility with Linux's alsa soc framework.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/olpc/sound.fth

    r3203 r3219  
    1 [ifdef] olpc-cl4
    2 0 0  " c0ffd800"  " /" begin-package
    3 [else]
    4 0 0  " d42a0800"  " /" begin-package
    5 [then]
     10 0  " 1a" " /i2c@d4011000" begin-package  \ TWSI1
     2   " audio-codec" name
     3   " realtek,alc5631" +compatible
     4   " realtek,rt5631" +compatible
     5   my-address my-space 1 reg
     6   " rt5631-hifi" " dai-name" string-property  \ snd_soc_dai_link.codec_dai_name
     7end-package
     8
     9: +audio  ( offset -- address )
     10   [ifdef] mmp3  h# c0ffd000  [else]  h# d42a0000  [then]  +
     11;
     12
     13dev /
     14new-device
     15   " adma" device-name
     16   h# 800 +audio  h# 100 reg
     17   d# 47 " interrupts" integer-property
     18   current-device  ( adma0-ph )
     19finish-device
     20
     21new-device
     22   " adma" device-name
     23   h# 900 +audio  h# 100 reg
     24   d# 48 " interrupts" integer-property
     25   current-device  ( adma0-ph adma1-ph )
     26finish-device
     27
     28new-device
     29   " asram" device-name
     30   audio-sram-pa /audio-sram reg
     31
     32   \ We call this the platform driver, a single point that collects
     33   \ the Audio DMA resources
     34   " mrvl,mmp-pcm-audio" +compatible   \ snd_soc_dai_link.cpu_dai_of_node
     35
     36   ( adma0-ph adma1-ph )
     37   encode-int rot encode-int encode+  " adma-nodes" property
     38finish-device
     39
     40new-device
     41   " sspa" name
     42   h# d00 +audio  h# 100 reg
     43
     44   " mrvl,mmp-sspa-dai" +compatible
     45
     46   " /pmua" encode-phandle d# 20 encode-int encode+ " clocks" property
     47   d# 3 " interrupts" integer-property
     48finish-device
     49
     50new-device
     51
    652" audio" name
    7 my-space h# 800 reg
     53h# c00 +audio  h# 100 reg
     54
     55" mrvl,mmp-sspa-dai" +compatible
    856
    957" /pmua" encode-phandle d# 20 encode-int encode+ " clocks" property
     
    607655\ Reinstate audio-clock-off when Linux turns on its own clock
    608656\   audio-clock-off
    609    adma-base h# 800 " map-out" $call-parent
     657   adma-base h# 100 " map-out" $call-parent
     658   sspa-base h# 100 " map-out" $call-parent
    610659   0 to adma-base  0 to sspa-base
    611660;
     
    613662: open  ( -- flag )
    614663   open-count 0=  if
    615       my-space h# 800 " map-in" $call-parent to adma-base
    616       adma-base h# 400 + to sspa-base
     664      my-unit h# 400 -  h# 100 " map-in" $call-parent to adma-base
     665      my-unit           h# 100 " map-in" $call-parent to sspa-base
    617666      audio-clock-on  if  (close) false exit  then
    618667      init-codec
     
    661710warning !
    662711
    663 end-package
     712finish-device
     713
     714device-end
    664715
    665716: (watch-dc)  ( bias? -- )
     
    671722: watch-dc-unbiased  ( -- )  false  (watch-dc)  ;
    672723
     724
     7250 0 " "  " /"  begin-package
     726   " audio-complex" device-name
     727   " olpc,mmp-audio" +compatible
     728
     729   \ The name that was hardcoded in the Linux driver was OLPC XO-1.75
     730   " OLPC XO" " model" string-property
     731
     732   : +string  encode-string encode+  ;
     733
     734   0 0 encode-bytes
     735      " Headphone Jack" +string " HPOL"     +string
     736      " Headphone Jack" +string " HPOR"     +string
     737      " MIC2"           +string " Mic Jack" +string
     738   " audio-routing" property
     739
     740   " /audio-codec"  encode-phandle  " codec-node"    property
     741   " /audio"        encode-phandle  " cpu-dai-node"  property
     742   " /asram"        encode-phandle  " platform-node" property
     743
     744   \ SND_SOC_DAIFTM_xxx:
     745   \ 4000 is ..CBS_CFS - the codec is the slave for clk and FRM
     746   \ 0100 is ..NB_NF   - non-inverted BCLK and FRM
     747   \ 0001 is ..I2S     - standard I2S bit positions
     748   h# 4101  " dai-format" encode-int
     749end-package
    673750
    674751\ LICENSE_BEGIN
Note: See TracChangeset for help on using the changeset viewer.