From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754738AbbIHNZ1 (ORCPT ); Tue, 8 Sep 2015 09:25:27 -0400 Received: from fallback6.mail.ru ([94.100.181.147]:48835 "EHLO fallback6.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754553AbbIHNZZ (ORCPT ); Tue, 8 Sep 2015 09:25:25 -0400 X-Greylist: delayed 2205 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Sep 2015 09:25:24 EDT Subject: Re: [PATCH v3 1/4] i2c: tegra: implement slave mode To: Wolfram Sang References: <1437424546-30405-1-git-send-email-danindrey@mail.ru> <1437424546-30405-2-git-send-email-danindrey@mail.ru> <20150724092720.GA1597@katana> <55B210F4.6030700@mail.ru> <20150724105251.GA22787@katana> <55D5C4AA.2000307@mail.ru> <20150908114621.GB15793@katana> Cc: Stephen Warren , devicetree@vger.kernel.org, devel@linuxdriverproject.org, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, ac100@lists.launchpad.net, Laxman Dewangan , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Thierry Reding , Alexandre Courbot , Greg Kroah-Hartman , Julian Andres Klode , Marc Dietrich From: Andrey Danin Message-ID: <55EED52B.8080701@mail.ru> Date: Tue, 8 Sep 2015 15:31:39 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150908114621.GB15793@katana> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Mras: Ok Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wolfram, thanks! On 08.09.2015 14:46, Wolfram Sang wrote: > >> Sorry for the long delay. I tried to analyze the issue. Attached patch works >> on AC100 (Misha Komarovsky helped me with testing). >> >> Wolfram could you please try the patch with your environment? > > No change, sadly. I don't get slave interrupts. Slave ISR is called only if slave device is registered on a bus. Do you get master interrupts ? >> Init function is called multuple times. If I2C controller works >> in slave mode, then driver must keep slave registers otherwise >> slave configuration will be reseted. > > This patch does not tackle the main issue, though. There should not be a > "slave mode" for the controller. Looks like my commit message is not clear enough :( >> If I2C controller works in slave mode, then ... I mean something like this: "If slave functionality is enabled, then ..." > It can be a master and slave > simultaneously and should do the right thing depending on what's > happening on the bus. The Tegra2 manual I have says "The Master can > address the internal slave (for basic testing) or an external 7-bit or > 10-bit addressed Slave device." So even a loopback should be possible > (if we trust the manual ;)). Slave logic is not enabled by default (we don't set up proper configuration and slave address). We can enable it by default but it is useless without driver that will handle requests. We used i2cdetect on the I2C bus where master NVEC controller is connected. i2cdetect found devices on the bus. Also keyboard and mouse was running fine after that (slave logic was not disabled).