SGTL5000 register access WEC2013

We develop on the Colibri IMX6 module under WEC2013 operating system and we would like to control the left/right channel volume of the SGTL5000 microphone input/ line input/ line output independently.
Possible to access all register of the SGTL5000 codec in any way?

Dear @vighbalazs

There are two options to modify the SGTL5000 registers:

1. Through i2c

The SGTL is connected to an internal i2c bus. Using our Toradex CE Libraries, you get access to the SGTL5000 by opening the port L"I2C9". The 7-bit slave address of the SGTL5000 is 0x0A = 0001010(R/W).

The touch controller is connected to the same i2c bus, so if you are heavily communicating with the SGTL5000, this might slow down the touch response.

2. Through AC97

There are simple calls to waveOutMessage() which can be used to modify the SGTL registers. You can find some sample code in the following developer page article:

Regards, Andy

Dear Andy,

Thank you your answer.

I tried both way.

  1. With I2CTool the communication working well with instance I2C2. But when i using the I2C library (i2c_imx6.h) I can just read the SGTL5000 registers. The write is ineffective, but everything seems fine, no error. My code works well with other external I2C device (24c16 EEPROM). Is there anything that can blocks the SGTL5000 register writing? Or does the Imx6I2c_Write() function have 16bit data mode setting?

  2. The waveOutMessage() function always return with 8.

Dear @vighbalazs,

Thank you for your reply.

  1. I just quickly checked random write using I2c libraries API, it works. Please refer to this sample code. Maybe you need to check Little endian and big endian data format. Let us know if you still see the issue.
  2. The wavOutMessage() will work on iMX6 only in the next image release. In the current image, this is not yet implemented.

I found the issue. I used the toradex VS2015 I2C demo project. This includes the 1.7 version of I2C library. With the newest I2C library (2.2) everything working well.