Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755783AbcCQHyU (ORCPT ); Thu, 17 Mar 2016 03:54:20 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:49100 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752582AbcCQHyR (ORCPT ); Thu, 17 Mar 2016 03:54:17 -0400 Subject: Re: Nokia N900 - audio TPA6130A2 problems To: Ivaylo Dimitrov , Grygorii Strashko , Sebastian Reichel , =?UTF-8?Q?Pali_Roh=c3=a1r?= References: <201507251228.27128@pali> <201601050034.12810@pali> <20160306152339.GA428@earth> <201603121342.33099@pali> <56E68B71.2030202@ti.com> <20160316133319.GR8413@pali> <20160316144709.GA3389@earth> <56E9A42B.3010209@gmail.com> <56E9A6D9.7000003@ti.com> <56E9B910.7000904@gmail.com> CC: Jarkko Nikula , Tony Lindgren , Lars-Peter Clausen , , , Pavel Machek , Aaro Koskinen , Nishanth Menon , From: Peter Ujfalusi Message-ID: <56EA6282.5050501@ti.com> Date: Thu, 17 Mar 2016 09:53:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <56E9B910.7000904@gmail.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5421 Lines: 112 On 03/16/16 21:50, Ivaylo Dimitrov wrote: > Hi, > > On 16.03.2016 20:32, Grygorii Strashko wrote: >> >> No-no :) take a look on i2c-omap.c >> >> r = i2c_add_numbered_adapter(adap); >> >> ^^^^ here you see messages from tpa6130a2 (create i2c devices & probe if >> drivers are ready) >> >> if (r) { >> dev_err(omap->dev, "failure adding adapter\n"); >> goto err_unuse_clocks; >> } >> >> dev_info(omap->dev, "bus %d rev%d.%d at %d kHz\n", adap->nr, >> major, minor, omap->speed); >> >> ^^^^ and here "omap_i2c 48072000.i2c: bus 2 rev3.3 at 100 kHz" >> >> so everything is ok with probe order >> > > Sorry for the noise then :) > > here is the log with dump_stack() in tpa6130a2_i2c_write: > > Jan 1 06:01:43 Nokia-N900 kernel: [ 6.947998] omap_i2c 48070000.i2c: bus 1 > rev3.3 at 2200 kHz > Jan 1 06:01:43 Nokia-N900 kernel: [ 6.960632] tpa6130a2 2-0060: Write failed > Jan 1 06:01:43 Nokia-N900 kernel: [ 6.965026] CPU: 0 PID: 6 Comm: > kworker/u2:0 Not tainted 4.5.0-rc5+ #26 > Jan 1 06:01:43 Nokia-N900 kernel: [ 6.972106] Hardware name: Nokia RX-51 > board > Jan 1 06:01:43 Nokia-N900 kernel: [ 6.976684] Workqueue: deferwq > deferred_probe_work_func > Jan 1 06:01:43 Nokia-N900 kernel: [ 6.982299] [] > (unwind_backtrace) from [] (show_stack+0x10/0x14) > Jan 1 06:01:43 Nokia-N900 kernel: [ 6.990570] [] (show_stack) > from [] (tpa6130a2_i2c_write+0x58/0x90) > Jan 1 06:01:43 Nokia-N900 kernel: [ 6.999114] [] > (tpa6130a2_i2c_write) from [] (tpa6130a2_power+0xac/0x1c4) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.008239] [] > (tpa6130a2_power) from [] (tpa6130a2_probe+0x144/0x234) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.017059] [] > (tpa6130a2_probe) from [] (i2c_device_probe+0x170/0x1b8) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.025939] [] > (i2c_device_probe) from [] (driver_probe_device+0x120/0x2b0) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.035247] [] > (driver_probe_device) from [] (bus_for_each_drv+0x48/0x8c) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.044311] [] > (bus_for_each_drv) from [] (__device_attach+0x88/0xf8) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.053009] [] > (__device_attach) from [] (bus_probe_device+0x28/0x80) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.061737] [] > (bus_probe_device) from [] (device_add+0x3c0/0x55c) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.070159] [] (device_add) > from [] (i2c_new_device+0xf8/0x198) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.078308] [] > (i2c_new_device) from [] (i2c_register_adapter+0x2d0/0x47c) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.087432] [] > (i2c_register_adapter) from [] (omap_i2c_probe+0x54c/0x64c) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.096618] [] > (omap_i2c_probe) from [] (platform_drv_probe+0x58/0xa0) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.105438] [] > (platform_drv_probe) from [] (driver_probe_device+0x120/0x2b0) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.114929] [] > (driver_probe_device) from [] (bus_for_each_drv+0x48/0x8c) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.123962] [] > (bus_for_each_drv) from [] (__device_attach+0x88/0xf8) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.132659] [] > (__device_attach) from [] (bus_probe_device+0x28/0x80) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.141357] [] > (bus_probe_device) from [] (deferred_probe_work_func+0x58/0x84) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.150939] [] > (deferred_probe_work_func) from [] (process_one_work+0x1c4/0x324) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.160705] [] > (process_one_work) from [] (worker_thread+0x314/0x4a8) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.169433] [] (worker_thread) > from [] (kthread+0xcc/0xe0) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.177154] [] (kthread) from > [] (ret_from_fork+0x14/0x3c) > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.184783] tpa6130a2 2-0060: Failed to > initialize chip > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.190551] tpa6130a2: probe of 2-0060 > failed with error -121 > Jan 1 06:01:43 Nokia-N900 kernel: [ 7.197174] omap_i2c 48072000.i2c: bus 2 > rev3.3 at 100 kHz > > now, the only thing I can think of remaining to test is the reset gpio set-up - > I wonder if it is possible to be set in safe mode(or input, or... ?), so the > reset is never deasserted. can you try this: diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index 11d85c5c787a..7f5881bff5d9 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c @@ -386,6 +386,8 @@ static int tpa6130a2_probe(struct i2c_client *client, data->power_gpio = pdata->power_gpio; } else if (np) { data->power_gpio = of_get_named_gpio(np, "power-gpio", 0); + if (data->power_gpio == -EPROBE_DEFER) + return data->power_gpio; } else { dev_err(dev, "Platform data not set\n"); dump_stack(); -- P?ter