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.

TLV320ADC5140: Ti pcmdevice-core.c does not compiles with kernel-5.10.158

Part Number: TLV320ADC5140

Hi Team,

We are trying to integrate tlv320adc5140 to renesas based rzg2h board and we are using kernel-5.10.158.

We followed instruction given in the file Guideline\ for\ PCMDEVICE\ driver\ on\ Linux.pdf.

we followed below step:

1) copy the src into sound/soc/codecs and named as pcmdevice

2) Modified the Kconfig file to incude pcmdevice

3)Made the changes in Makefile

While Compilling the source we are getting the below error:

NOTE: Executing Tasks
ERROR: linux-renesas-5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1 do_compile: oe_runmake failed
ERROR: linux-renesas-5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1 do_compile: Execution of '/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/temp/run.do_compile.18774' failed with exit code 1
ERROR: Logfile of failure stored in: /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/temp/log.do_compile.18774
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: KBUILD_BUILD_TIMESTAMP: Sat Feb 27 02:21:18 UTC 2021
| NOTE: make -j 8 HOSTCC=gcc  -isystem/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/usr/include -O2 -pipe -L/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/usr/lib                         -L/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/lib                         -Wl,--enable-new-dtags                         -Wl,-rpath-link,/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/usr/lib                         -Wl,-rpath-link,/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/lib                         -Wl,-rpath,/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/usr/lib                         -Wl,-rpath,/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/lib                         -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 HOSTCPP=gcc  -E HOSTCXX=g++  -isystem/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/usr/include -O2 -pipe -L/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/usr/lib                         -L/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/lib                         -Wl,--enable-new-dtags                         -Wl,-rpath-link,/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/usr/lib                         -Wl,-rpath-link,/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/lib                         -Wl,-rpath,/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/usr/lib                         -Wl,-rpath,/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native/lib                         -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 Image CC=aarch64-poky-linux-gcc   -fuse-ld=bfd -fmacro-prefix-map=/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1=/usr/src/debug/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1                      -fdebug-prefix-map=/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1=/usr/src/debug/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1                      -fdebug-prefix-map=/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot=                      -fdebug-prefix-map=/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot-native=  -fdebug-prefix-map=/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source=/usr/src/kernel -fdebug-prefix-map=/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-build-artifacts=/usr/src/kernel  --sysroot=/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot   LD=aarch64-poky-linux-ld.bfd    --sysroot=/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/recipe-sysroot
|   GEN     Makefile
|   CALL    /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source/scripts/atomic/check-atomics.sh
|   CALL    /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source/scripts/checksyscalls.sh
|   CHK     include/generated/compile.h
|   CC      sound/soc/codecs/pcmdevice/pcmdevice-core.o
| /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source/sound/soc/codecs/pcmdevice/pcmdevice-core.c:1796:12: error: initialization of 'int (*)(struct i2c_client *, const struct i2c_device_id *)' from incompatible pointer type 'int (*)(struct i2c_client *)' [-Werror=incompatible-pointer-types]
|   .probe  = pcmdevice_i2c_probe,
|             ^~~~~~~~~~~~~~~~~~~
| /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source/sound/soc/codecs/pcmdevice/pcmdevice-core.c:1796:12: note: (near initialization for 'pcmdevice_i2c_driver.probe')
| /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source/sound/soc/codecs/pcmdevice/pcmdevice-core.c:1797:13: error: initialization of 'int (*)(struct i2c_client *)' from incompatible pointer type 'void (*)(struct i2c_client *)' [-Werror=incompatible-pointer-types]
|   .remove  = pcmdevice_i2c_remove,
|              ^~~~~~~~~~~~~~~~~~~~
| /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source/sound/soc/codecs/pcmdevice/pcmdevice-core.c:1797:13: note: (near initialization for 'pcmdevice_i2c_driver.remove')
| cc1: some warnings being treated as errors
| /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source/scripts/Makefile.build:286: recipe for target 'sound/soc/codecs/pcmdevice/pcmdevice-core.o' failed
| make[5]: *** [sound/soc/codecs/pcmdevice/pcmdevice-core.o] Error 1
| /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source/scripts/Makefile.build:503: recipe for target 'sound/soc/codecs/pcmdevice' failed
| make[4]: *** [sound/soc/codecs/pcmdevice] Error 2
| /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source/scripts/Makefile.build:503: recipe for target 'sound/soc/codecs' failed
| make[3]: *** [sound/soc/codecs] Error 2
| /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source/scripts/Makefile.build:503: recipe for target 'sound/soc' failed
| make[2]: *** [sound/soc] Error 2
| /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source/Makefile:1837: recipe for target 'sound' failed
| make[1]: *** [sound] Error 2
| make[1]: *** Waiting for unfinished jobs....
| /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work-shared/hihope-rzg2n/kernel-source/Makefile:185: recipe for target '__sub-make' failed
| make: *** [__sub-make] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/tmp/work/hihope_rzg2n-poky-linux/linux-renesas/5.10.158-cip22+gitAUTOINC+4f3d2d21ad-r1/temp/run.do_compile.18774' failed with exit code 1
ERROR: Task (/mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/../meta-renesas/meta-rz-common/recipes-kernel/linux/linux-renesas_5.10.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 604 tasks of which 603 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /mnt/aaca1e4c-d375-4756-bfc4-45e0e60b70d4/nags/rzg2n-303/user_work/build/../meta-renesas/meta-rz-common/recipes-kernel/linux/linux-renesas_5.10.bb:do_compile
Summary: There were 3 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

Looks like it is not compilling with kernel-5.10.158 , please suggest workarounf for this error:

OR

IS there a 5.10.158 version source available, please guide us.

Thanks and regards,
Nagaraja

  • Hi Shenghao Ding,

    We don't have tasdevice-core-i2c.c in the source folder

    My source folder is:

    adc5120-irq.c  Makefile       pcm6240-irq.c  pcm6260-reg.h  pcmd31x0-irq.c    pcmdevice.h       pcmdevice-ops.c     pcmdevice-regbin.h  taa5412-irq.c adc5120-reg.h  pcm186x-irq.c  pcm6240-reg.h  pcm9211-irq.c  pcmd31x0-reg.h    pcmdevice-node.c  pcmdevice-ops.h     pcmdevice-rw.c      taa5412-reg.h  Kconfig        pcm186x-reg.h  pcm6260-irq.c  pcm9211-reg.h  pcmdevice-core.c  pcmdevice-node.h  pcmdevice-regbin.c  pcmdevice-rw.h.

    Am I using the correct source or not please guide us.

    Thanks and regards,

    Nagaraja

  • there's an example on how to modify probe and remove function to adapt kernel-5.10.158 in tasdevice-core-i2c.c 

  • Hi Shenghao Ding,

    Thanks for the reply , now we are able to compile the driver,

    My dts entries is as below: IT was working with default device driver tlv320adcx140.c but I was not able set the volume because it was very low, so

    I integrated pcmdevice driver as per your suggestion.


    tlv320adc5140_snd: sound {
    compatible = "simple-audio-card";
    simple-audio-card,name = "rcar_sound";
    #address-cells = <1>;
    #size-cells = <0>;

    simple-audio-card,widgets = "Microphone", "Mic";

    simple-audio-card,audio-routing =
    "MIC1P", "Mic",
    "MIC1M", "Mic",
    "MIC2P", "Mic",
    "MIC2M", "Mic",
    "MIC3P", "Mic",
    "MIC3M", "Mic",
    "MIC4P", "Mic",
    "MIC4M", "Mic";

    simple-audio-card,dai-link@0 {
              reg = <0>;
             format = "i2s";

             bitclock-master = <&codec_dai>;
             frame-master = <&codec_dai>;
             mclk-fs = <256>;
            cpu_dai: cpu {
                         sound-dai = <&rcar_sound 1>;
            };

           codec_dai: codec {
                            sound-dai = <&tlv320adc5140>;
                            clocks = <&audio_mclock>;
           };
    };

    &i2c0 {
             pinctrl-0 = <&i2c0_pins>;
             pinctrl-names = "default";
             clock-frequency = <100000>;
             status = "okay";

            #address-cells = <1>;
            #size-cells = <0>;
             tlv320adc5140: tlv320adc5140@4c {
                                   #sound-dai-cells = <0>;
                                   compatible = "ti,tlv320adc5140";
                                   reg = <0x4c>;
                        ti,mic-bias-source = <0>; /* 0 - Mic bias is set to VREF */
                        ti,pdm-edge-select = <1 1 1 1>;
                        ti,gpio-config = <10 0>;
                        ti,gpi-config = <4 5 6 7>;
                        ti,gpo-config-1 = <4 1>;
                        ti,gpo-config-2 = <4 1>;
                        ti,gpo-config-3 = <4 1>;
                        ti,gpo-config-4 = <4 1>;
                        ti,slot-mapping = <0 1 2 3>;
                        ti,asi-tx-driver = <0>;

                       reset-gpios = <&gpio6 11 GPIO_ACTIVE_HIGH>;
            };
            port@0 {
                        tlv320adc5140_endpoint: endpoint {
                        remote-endpoint = <&rsnd_endpoint3>;
            };
       };

    };

    &rcar_sound {
               pinctrl-0 = <&sound_clk_pins &sound_pins1>;
               pinctrl-names = "default";
               status = "okay";
               #sound-dai-cells = <0>;
              #clock-cells = <0>;
              clock-frequency = <6144000>; /* 48 kHz groups [(C) clock] */
              ports{

                     rsnd_port3: port@1 {
                                   rsnd_endpoint3: endpoint {
                                            remote-endpoint = <&tlv320adc5140_endpoint>;

                                            dai-format = "i2s";
                                            bitclock-master = <&rsnd_endpoint3>;
                                            frame-master = <&rsnd_endpoint3>;
                                            /* [CAPTURE] */
                                           capture = <&ssi8>;
                                  };
                       };

              };
    };

    With Above setting in my dtsi I was able to record an audio with command below

    arecord -D plughw:0,0 -r44100 -f S16_LE -c 1 -d 5 reccord704.wav.

    As I posted in the forum audio volume was very low and I was not able to increase it.

    Is there any changes required in dtsi   entries above for  pcmdevice driver to work. Now we are not able to record after the integration of  pcmdevice driver.. Please guide us how do I go about it. Is there any document available with details and steps.

    Thanks and regards,

    Nagaraja

        

  • Sample code for volume kcontrol is in the following patches, kindly focus on adc5120_analog_gain_ctl and adc5120_digi_gain_ctl in v9-0001, study how they are referenced.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/6/v9_2D00_0000_2D00_cover_2D00_letter.patch

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/6/v9_2D00_0001_2D00_ASoc_2D00_PCM6240_2D00_Create_2D00_PCM6240_2D00_Family_2D00_driver_2D00_code.patch

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/6/v9_2D00_0002_2D00_ASoc_2D00_PCM6240_2D00_Create_2D00_header_2D00_file_2D00_for_2D00_PCM6240_2D00_Famil.patch

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/6/v9_2D00_0003_2D00_ASoc_2D00_PCM6240_2D00_Add_2D00_compile_2D00_item_2D00_for_2D00_PCM6240_2D00_Family_2D00_.patch

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/6/v9_2D00_0004_2D00_ASoc_2D00_dt_2D00_bindings_2D00_PCM6240_2D00_Add_2D00_initial_2D00_DT_2D00_binding.patch

  • Hi Shenghao Ding,

    As I mailed earlier we are able to integrate pcmdevice-linux-driver from Ti as guided by you. Now after loading the firmware file pcm5140-1dev-gen.bin.

    We are getting below messages:

    root@hihope-rzg2n:/sys/bus/i2c/devices/0-004c# echo>fwload
    [ 51.335349] pcmdevice-codec 0-004c: fwload: count = 1
    root@hihope-rzg2n:/sys/bus/i2c/devices/0-004c# [ 51.344560] pcmdevice-codec 0-004c: pcmdev: regbin_ready start
    [ 51.350909] pcmdevice-codec 0-004c: ndev = 1
    [ 51.356341] pcmdevice-codec 0-004c: nconfig = 2
    [ 51.361413] pcmdevice-codec 0-004c: img_sz = 572 total_config_sz = 280 offset = 292
    [ 51.369688] pcmdevice-codec 0-004c: Firmware init complete

    root@hihope-rzg2n:/sys/bus/i2c/devices/0-004c#

    When I trying to record I am getting below error and the file is not growing:

    Please help us to resolve this issues:


    root@hihope-rzg2n:~# arecord -c 2 -f S16_LE -r 48000 -d 15 --device="hw:0,0" i2s-16b-test.wav
    Recording WAVE '[ 475.009055] pcmdevice-codec 0-004c: pcmdevice_set_dai_sysclk: clk_id = 0, freq = 12288000, CLK direction IN
    [ 475.020191] pcmdevice-codec 0-004c: pcmdevice_hw_params: Capture
    i2s-16b-test.wav' : Sign[ 475.027014] pcmdevice-codec 0-004c: pcmdevice_hw_params: BCLK rate = 1536000 Channel = 2Sample rate = 48000 slot width = 16
    ed 16 bit Little[ 475.039736] pcmdevice-codec 0-004c: select_cfg_blk: profile_conf_id = 0
    Endian, Rate 48[ 475.047469] pcmdevice-codec 0-004c: select_cfg_blk: conf 0, block type:PRE_POWER_UP device idx = 0x00
    000 Hz, Stereo
    arecord: pcm_rea[ 485.096597] rcar_sound ec500000.sound: ssi[8] status check failed
    d:2151: read err[ 485.102797] pcmdevice-codec 0-004c: select_cfg_blk: profile_conf_id = 0
    or: Input/output[ 485.110789] pcmdevice-codec 0-004c: select_cfg_blk: conf 0, block type:PRE_SHUTDOWN device idx = 0x00
    error
    [ 485.121989] pcmdevice-codec 0-004c: pcmdevice_set_dai_sysclk: clk_id = 0, freq = 0, CLK direction IN
    root@hihope-rzg2n:~# ls
    i2s-16b-test.wav reccord704.wav v4l2-init.sh
    root@hihope-rzg2n:~# ls -l
    total 12
    -rw-r--r-- 1 root root 44 Sep 20 10:51 i2s-16b-test.wav
    -rw-r--r-- 1 root root 44 Sep 20 10:47 reccord704.wav
    -rwxr--r-- 1 root root 2787 Mar 9 2018 v4l2-init.sh
    root@hihope-rzg2n:~#

    Thanks and regards,

    Nagaraja

  • Kindly use scope to measure the blk and WS clk and upload the waveform here. One more thing, kindly also dump the registers. 

  • Hi Shenghao Ding,

    We are not getting blk and WS clk

    Below is the i2cdump

    root@hihope-rzg2n:/sys/bus/i2c/devices/0-004c# i2cdump -y -f 0 0x4c
    No size specified (using byte-data access)
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: 00 00 00 00 00 05 00 30 00 00 00 00 01 02 03 04 .....?.0....????
    10: 05 06 07 02 48 ff 10 10 04 20 02 08 00 00 02 40 ????H.??? ??..?@
    20: 00 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ."..............
    30: 00 00 00 ff 00 00 00 00 00 00 00 00 00 00 c9 80 ..............??
    40: 00 00 00 c9 80 00 00 00 c9 80 00 00 00 c9 80 00 ...??...??...??.
    50: 00 00 c9 80 00 00 00 c9 80 00 00 00 c9 80 00 00 ..??...??...??..
    60: 00 c9 80 00 00 00 00 00 00 00 00 01 40 7b 00 00 .??........?@{..
    70: e7 00 00 f0 00 00 00 80 00 00 ff 00 ff 8c 00 00 ?..?...?.....?..
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    root@hihope-rzg2n:/sys/bus/i2c/devices/0-004c#

    Please guide me what am i missing here,

    Thanks and regards,

    Nagaraja.

  • Hi Guy

    clk is very important for acd5140. because adc5140 is a slave device in your project according to the dts setting you offered, which depend on the bck and ws clks from your platform. Without both of the clk, adc5140 can't work.

  • Hi Shenghao Ding,

    The dts setting above is working with kernel-5.10.158 when I use  tlv320adcx140.c

    which comes with main stream kernel:( Only problem i had was volume or very low in this case so i migrated to pcmdevice package as per your advice)

    So I have few thing to know:

    1) How should I configure adc5140 :  is it suppose to be slave OR Master

    2) If I integrate pcmdevice packages from TI, do I need to disable tlv320adcx140 driver in the kernel menuconfig or we still need it.

    3) What should be the dts entries: (please send me any working dts for reference)

    compatible = "ti,tlv320adc5140";

    or
    compatible = "ti,pcm5140";

    4) what is the advantage of pcmdevice packages over main stream kernel driver

    tlv320adcx140.c

    Thanks and regards

    Nagaraja

  • Hi Guy

    The same arch as pcmdevice has been upstream into Linux-next, it will be merged into mainline soon. pcm6240.c « codecs « soc « sound - kernel/git/next/linux-next.git - The linux-next integration testing tree

    The code can support one piece, two pieces, even multiple pieces in one driver code, and all registers has been set into the bin file.

    You won't recompile the code because of a single code change.

    the same code can support different chips.

    In your old dts setting, you set5140 as slave.

    Now, which code do you decide to use?