linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Freescale imx35: sgtl5000 codec not working over i2c
@ 2013-05-02 18:00 Johannes Braun
  2013-05-02 18:18 ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Braun @ 2013-05-02 18:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hello @all,

I hope this is the right place for my problem. Currently I am trying to
get a sigmatel sgtl5000 codec to work on a Freescale imx35 based board.
I am using a vanilla kernel 3.7.10. The codec is connected via i2c. I
configured the i2c device in /arch/arm/mach-imx/mach-proxmobil2.c.
Proxmobil2 is the name of our device. Here is the part which configures
the i2c device and the bus.

static const struct imxi2c_platform_data mx35_prox2_i2c0_data
	__initconst = {
        .bitrate = 100000,
};

imx35_add_imx_i2c0(&mx35_prox2_i2c0_data);

static struct i2c_board_info __initdata i2c_devices_prox2[] = {
        {
                I2C_BOARD_INFO("imx-audio-sgtl5000", 0x0a),
        },
};

i2c_register_board_info(0, i2c_devices_prox2,
	ARRAY_SIZE(i2c_devices_prox2));


The i2c bus is working correctly. I can scan the bus in uboot and in
linux with i2cdetect. In both cases a device with the address 0x0a is
found. This is the address of the sgtl5000 codec. The device is also
present in /sys/bus/i2c/devices.The audio codec is the only device on
the bus.

I tested the data and clock line with a oszilloscope while booting
linux. There was no activity. But when I scan the bus via uboot or via
i2cdetect I can seen that there is action on the bus. Also the power
supply for the codec looks good. I measured 3.3 V. So I think it is not
a problem with the wiring. 

The problem I is that the driver imx-audio-sgtl5000 does not start. I
tested it with some printk outputs in its probe method. But the probe
method is never called.

Then I thought, maybe it is a it is a problem with my board
configuration file. So I tested the codec on the Freescale imx35 3stack
eval board. But without success. This try ends with the same result. No
driver was loaded, alsa did not detect a soundcard and so on.

The result is a non working audio codec on the board. Shure I can use
the Freescale kernel. But this kernel I to old. I think it is a
2.6.28 kernel. I want to use an actual kernel with the board. So maybe
someone has a running sgtl5000 code in combination with a imx35 board.
I am grateful for tips. Thanks for reading.

---
Johannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Freescale imx35: sgtl5000 codec not working over i2c
  2013-05-02 18:00 Freescale imx35: sgtl5000 codec not working over i2c Johannes Braun
@ 2013-05-02 18:18 ` Sascha Hauer
  2013-05-02 18:40   ` Johannes Braun
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2013-05-02 18:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 02, 2013 at 08:00:24PM +0200, Johannes Braun wrote:
> Hello @all,
> 
> I hope this is the right place for my problem. Currently I am trying to
> get a sigmatel sgtl5000 codec to work on a Freescale imx35 based board.
> I am using a vanilla kernel 3.7.10. The codec is connected via i2c. I
> configured the i2c device in /arch/arm/mach-imx/mach-proxmobil2.c.
> Proxmobil2 is the name of our device. Here is the part which configures
> the i2c device and the bus.
> 
> static const struct imxi2c_platform_data mx35_prox2_i2c0_data
> 	__initconst = {
>         .bitrate = 100000,
> };
> 
> imx35_add_imx_i2c0(&mx35_prox2_i2c0_data);
> 
> static struct i2c_board_info __initdata i2c_devices_prox2[] = {
>         {
>                 I2C_BOARD_INFO("imx-audio-sgtl5000", 0x0a),
>         },

The driver matches "sgtl5000", not "imx-audio-sgtl5000".

You should use devicetree support for new boards. The platform support
will vanish sooner or later.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Freescale imx35: sgtl5000 codec not working over i2c
  2013-05-02 18:18 ` Sascha Hauer
@ 2013-05-02 18:40   ` Johannes Braun
  2013-05-03  9:39     ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Braun @ 2013-05-02 18:40 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Sascha,

> On Thu, May 02, 2013 at 08:00:24PM +0200, Johannes Braun wrote:
> > Hello @all,
> > 
> > I hope this is the right place for my problem. Currently I am
> > trying to get a sigmatel sgtl5000 codec to work on a Freescale
> > imx35 based board. I am using a vanilla kernel 3.7.10. The codec is
> > connected via i2c. I configured the i2c device
> > in /arch/arm/mach-imx/mach-proxmobil2.c. Proxmobil2 is the name of
> > our device. Here is the part which configures the i2c device and
> > the bus.
> > 
> > static const struct imxi2c_platform_data mx35_prox2_i2c0_data
> > 	__initconst = {
> >         .bitrate = 100000,
> > };
> > 
> > imx35_add_imx_i2c0(&mx35_prox2_i2c0_data);
> > 
> > static struct i2c_board_info __initdata i2c_devices_prox2[] = {
> >         {
> >                 I2C_BOARD_INFO("imx-audio-sgtl5000", 0x0a),
> >         },
> 
> The driver matches "sgtl5000", not "imx-audio-sgtl5000".

I tried "sgtl5000" and "fsl", both without success.

> 
> You should use devicetree support for new boards. The platform support
> will vanish sooner or later.
> 

As I wrote before, my board is based on the very old imx35 processor
platform and I think this processor type does not support device tree
out of the box? Or is it possible to use a device tree with an imx35?
Haven`t seen this before. Is the problem realy the missing device tree
support? 

There are much reasons why I don`t want to spend that much time with
this old product. We had so much problems with this board and probably
in summer there is a new board coming. Maybe an im6q.

---
Johannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Freescale imx35: sgtl5000 codec not working over i2c
  2013-05-02 18:40   ` Johannes Braun
@ 2013-05-03  9:39     ` Sascha Hauer
  2013-05-03 11:56       ` Johannes Braun
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2013-05-03  9:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 02, 2013 at 08:40:20PM +0200, Johannes Braun wrote:
> Hello Sascha,
> 
> > On Thu, May 02, 2013 at 08:00:24PM +0200, Johannes Braun wrote:
> > > Hello @all,
> > > 
> > > I hope this is the right place for my problem. Currently I am
> > > trying to get a sigmatel sgtl5000 codec to work on a Freescale
> > > imx35 based board. I am using a vanilla kernel 3.7.10. The codec is
> > > connected via i2c. I configured the i2c device
> > > in /arch/arm/mach-imx/mach-proxmobil2.c. Proxmobil2 is the name of
> > > our device. Here is the part which configures the i2c device and
> > > the bus.
> > > 
> > > static const struct imxi2c_platform_data mx35_prox2_i2c0_data
> > > 	__initconst = {
> > >         .bitrate = 100000,
> > > };
> > > 
> > > imx35_add_imx_i2c0(&mx35_prox2_i2c0_data);
> > > 
> > > static struct i2c_board_info __initdata i2c_devices_prox2[] = {
> > >         {
> > >                 I2C_BOARD_INFO("imx-audio-sgtl5000", 0x0a),
> > >         },
> > 
> > The driver matches "sgtl5000", not "imx-audio-sgtl5000".
> 
> I tried "sgtl5000" and "fsl", both without success.

With "sgtl5000" at least sgtl5000_i2c_probe should be called. Is the
i.MX I2C driver registered correctly. What's in /sys/bus/i2c/devices/?

> 
> As I wrote before, my board is based on the very old imx35 processor
> platform and I think this processor type does not support device tree
> out of the box? Or is it possible to use a device tree with an imx35?

you won't need much more than something similar to
arch/arm/mach-imx/imx25-dt.c and an auxdata table for the clock lookups.
There even is pinctrl support.

That said, your actual problem won't be related to that.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Freescale imx35: sgtl5000 codec not working over i2c
  2013-05-03  9:39     ` Sascha Hauer
@ 2013-05-03 11:56       ` Johannes Braun
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Braun @ 2013-05-03 11:56 UTC (permalink / raw)
  To: linux-arm-kernel

> With "sgtl5000" at least sgtl5000_i2c_probe should be called.

Ok my fault. I did not see the i2c probe mehtod. I checked whether
sgtl5000_i2c_probe is called or not and I can confirm that the method
was passed successfully. I tested it with several kernel log messages.

> Is the i.MX I2C driver registered correctly. What's in /sys/bus/i2c/devices/?

I think so. The following devices are shown:
ls -la /sys/bus/i2c/devices/
lrwxrwxrwx 1 root root 0 Jan  1  1970 0-000a ->
../../../devices/platform/imx-i2c.0/i2c-0/0-000a/
lrwxrwxrwx 1 root root 0 Jan  1  1970 i2c-0 ->
../../../devices/platform/imx-i2c.0/i2c-0/
lrwxrwxrwx 1 root root 0 Jan  1  1970 i2c-2 ->
../../../devices/platform/imx-i2c.2/i2c-2/

Also I am able to probe the bus via i2cdetect. This is the result:
root at generic-armv6:~$ i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n]
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- UU -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

UU shows that this device is use by a driver.

> you won't need much more than something similar to
> arch/arm/mach-imx/imx25-dt.c and an auxdata table for the clock lookups.
> There even is pinctrl support.

I will check this out.

---
Johannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-03 11:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-02 18:00 Freescale imx35: sgtl5000 codec not working over i2c Johannes Braun
2013-05-02 18:18 ` Sascha Hauer
2013-05-02 18:40   ` Johannes Braun
2013-05-03  9:39     ` Sascha Hauer
2013-05-03 11:56       ` Johannes Braun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).