imx6ulevk platform sgtl5000 Driver porting problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6ulevk platform sgtl5000 Driver porting problem

2,072 Views
ferdi
Contributor I

My DTS configuration is as follows:

clocks {

            codec_osc: codec_osc {

                #clock-cells = <0>;

                compatible = "fixed-clock";

                clock-frequency = <12000000>;

        };

    };

vgen4_reg: vgen4 {

            regulator-min-microvolt = <1800000>;

            regulator-max-microvolt = <3300000>;

            regulator-always-on;

        };

        reg_3p3v: 3p3v {

            compatible = "regulator-fixed";

            regulator-name = "3P3V";

            regulator-min-microvolt = <3300000>;

            regulator-max-microvolt = <3300000>;

            regulator-always-on;

        };

sound-sgtl5000 {

                compatible = "fsl,imx6ul-arm2-sgtl5000",

                           "fsl,imx-audio-sgtl5000";

                model = "imx6ul-arm2-sgtl5000";

        cpu-dai = <&sai2>;

        audio-codec = <&codec>;

                audio-routing =

                        "LINE_IN", "Line In Jack",

                        "Headphone Jack", "HP_OUT";

        };

&i2c1 {

codec: sgtl5000@0a {

        compatible = "fsl,sgtl5000";

        reg = <0x0a>;

        clocks = <&codec_osc>;

        VDDA-supply = <&vgen4_reg>;

        VDDIO-supply = <&reg_3p3v>;

    };

}

&sai2 {

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_sai2>;

    assigned-clocks = <&clks IMX6UL_CLK_SAI2_SEL>,

              <&clks IMX6UL_CLK_SAI2>;

    assigned-clock-parents = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>;

    assigned-clock-rates = <0>, <12288000>;

    status = "okay";

};

Why every time you start to make an error, leading to sgtl5000 registration failed, The error function occurs in the read I2C function,Functions are as follows:

/* read chip information */

    ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ID, &reg);

    if (ret)

   goto disable_clk;

I2C on the other devices work properly, what is the cause of the failure of the sgtl5000 registration? Thank you!

Labels (4)
Tags (1)
0 Kudos
4 Replies

983 Views
sourabhdas
Contributor III

Hi igor,

I am facing the same issue in our imx6ul target board with sgtl5000 audio codec. MCLK is not coming from SOC. Please suggest me some solution.

Hi Ferdi,

please share the changes if you've already fixed this issue.

0 Kudos

983 Views
ferdi
Contributor I

Below for log information

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

sgtl5000_i2c_probe addr:a, name:sgtl5000

sgtl5000: probe of 0-000a failed with error -5

fsl-asrc 2034000.asrc: driver registered

imx6ul-pinctrl 20e0000.iomuxc: pin MX6UL_PAD_GPIO1_IO08 already requested by 20e0000.iomuxc; cannot claim for 2004000.spdif

imx6ul-pinctrl 20e0000.iomuxc: pin-31 (2004000.spdif) status -22

imx6ul-pinctrl 20e0000.iomuxc: could not request pin 31 (MX6UL_PAD_GPIO1_IO08) from group spdifgrp  on device 20e0000.iomuxc

fsl-spdif-dai 2004000.spdif: Error applying setting, reverse things back

imx-sgtl5000 sound-sgtl5000.15: ASoC: CODEC (null) not registered

imx-sgtl5000 sound-sgtl5000.15: snd_soc_register_card failed (-517)

platform sound-sgtl5000.15: Driver imx-sgtl5000 requests probe deferral

8021q: 802.1Q VLAN Support v1.8

Key type dns_resolver registered

cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)

gpio_dvfs: disabling

vref-3v3: disabling

can-3v3: disabling

SD2_SPWR: disabling

SD1_SPWR: disabling

regulator-dummy: disabling

imx mcc test is registered.

imx-sgtl5000 sound-sgtl5000.15: ASoC: CODEC (null) not registered

imx-sgtl5000 sound-sgtl5000.15: snd_soc_register_card failed (-517)

platform sound-sgtl5000.15: Driver imx-sgtl5000 requests probe deferral

snvs_rtc 20cc034.snvs-rtc-lp: setting system clock to 1970-01-01 00:00:01 UTC (1)

imx-sgtl5000 sound-sgtl5000.15: ASoC: CODEC (null) not registered

imx-sgtl5000 sound-sgtl5000.15: snd_soc_register_card failed (-517)

ALSA device list:

platform sound-sgtl5000.15: Driver imx-sgtl5000 requests probe deferral

  No soundcards found.

kjournald starting.  Commit interval 5 seconds

EXT3-fs (mmcblk1p2): using internal journal

EXT3-fs (mmcblk1p2): recovery complete

EXT3-fs (mmcblk1p2): mounted filesystem with ordered data mode

VFS: Mounted root (ext3 filesystem) on device 179:2.

devtmpfs: mounted

Freeing unused kernel memory: 388K (809a3000 - 80a04000)

INIT: version 2.88 booting

scsi 0:0:0:0: Direct-Access     Generic  Flash Disk       8.07 PQ: 0 ANSI: 4

sd 0:0:0:0: [sda] 1966080 512-byte logical blocks: (1.00 GB/960 MiB)

imx-sgtl5000 sound-sgtl5000.15: ASoC: CODEC (null) not registered

imx-sgtl5000 sound-sgtl5000.15: snd_soc_register_card failed (-517)

0 Kudos

983 Views
igorpadykov
NXP Employee
NXP Employee

Hi ferdi

for sgtl5000 i2c failure on can check its erratum

http://cache.freescale.com/files/analog/doc/errata/SGTL5000ER.pdf

and if SION bit is set in pinctrl, then test with oscilloscope i2c signals,

add some printfs to probe function. For dts example one can use

i.MX6SX, as it has the same sai module

linux-2.6-imx.git - Freescale i.MX Linux Tree

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

983 Views
ferdi
Contributor I

Hi igor:

I refer to the above method, but there is no signal MCLK, how do we want to change?

Best regards!

Ferdi

0 Kudos