From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753095AbbJYIiC (ORCPT ); Sun, 25 Oct 2015 04:38:02 -0400 Received: from sauhun.de ([89.238.76.85]:44756 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751311AbbJYIh4 (ORCPT ); Sun, 25 Oct 2015 04:37:56 -0400 Date: Sun, 25 Oct 2015 09:37:48 +0100 From: Wolfram Sang To: Vaibhav Hiremath Cc: linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, robert.jarzmik@free.fr, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org Subject: Re: [PATCH-v5 RESEND 4/5] Documentation: binding: add sclk adjustment properties to i2c-pxa Message-ID: <20151025083748.GC2159@katana> References: <1440395978-9065-1-git-send-email-vaibhav.hiremath@linaro.org> <1440395978-9065-5-git-send-email-vaibhav.hiremath@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DSayHWYpDlRfCAAQ" Content-Disposition: inline In-Reply-To: <1440395978-9065-5-git-send-email-vaibhav.hiremath@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --DSayHWYpDlRfCAAQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 24, 2015 at 11:29:37AM +0530, Vaibhav Hiremath wrote: > With addition of PXA910 family of devices, the TWSI module supports > new feature which allows us to adjust SCLK. i2c-pxa driver takes input > configuration in nsec and converts it to respective bit-fields, >=20 > - i2c-sclk-low-time-ns : SCLK low time (tlow) > This property is used along with mode selection. > - i2c-sclk-high-time-ns : SCLK high time (thigh) > - i2c-start-hold-time-ns : Used in case of high speed mode for start bit > hold/setup wait counter. > - i2c-stop-hold-time-ns : Used in case of high speed mode for stop bit > hold/setup wait counter. > - i2c-sda-hold-time-ns : Used to calculate hold/setup wait counter for > standard and fast mode. >=20 > Signed-off-by: Vaibhav Hiremath Ooookay, after checking some datasheets, I finally stumbled over the fact that this driver is not using "clock-frequency" to determine the bus speed. However, this is the standard way of defining that in DT, so this driver should adhere to that, too, and not invent something new. Previously, I was under the impression that the above parameters were needed for fine-tuning and couldn't fully grasp why. But this is for defining the bus speed which is a no-go. It looks to me that older PXA only have a bit to select between 100 and 400kHz while this newer one can have arbitrary frequencies. Correct? So, what the driver should do: - Keep support for the old "mrvl,i2c-fast-mode" binding which should be marked as deprecated - get the value of the standard property "clock-frequency" - for old PXAs, complain if not 100 or 400kHz, otherwise set the bit accordingly - for new PXAs, calculate the ilcr and iwcr values from "clock-frequency" Makes sense? Regards, Wolfram --DSayHWYpDlRfCAAQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWLJTcAAoJEBQN5MwUoCm2bKQQAI86+iqOqYdyg9wvn5p5j3AS qm4C78K+60FlPbuJ08IqNwUasWNgOzuMbFczu7pJACkIYCj5ZQvlTh+WUWYXIQ68 vQGs7x4A4Hjvd5C4DTvOWuroa/Kx/unBbaDTLdOpiaFeA1KXTD/TIlTlwfoLFWgL 2mFf8hSdv3dU3a9XXTcMXQbc6EEX1gxO36AT8H1f5UrfKpcQzYCE3pUXEvPjQBdp g7WumB5LwtmPL22/d7Y8Yofk5v6QrAHjQY57ElYx45xZhHAlu9rbuEuOX7Qccbhb EleZDa+Un6Wgd6qTaEW004FdCVn/XRyNXYYWvExavWSwmOE9ZmYBA8coDMBXxRmg 8aDs1kVhvWi340+SB/8JCJXJTQ9vadakbtf7Z/nhPceHdRQhXxx/r198Z6fZFxZI mfUhn/Fm7eM7FT/n/a8bzq6gBQxkChbGX5zzBIBUX4pzpHhj0HFo+1nD8ukocJY9 Fa5PMMnfVmU/eSwefk5A+9hd3duZyeInvHk8ShGdVzd36Tehdqd+fgjiNmbo3ilv kIH+zPEbrpEQG1Ihiu/si+/ZnCPtZ4GAc16eYI1K/Sfcw15dLCZsuXU4CG9yubcx uO0eqR6mlHu5zD4xpDMiPU8qvuIhZWuZqqk6c618zCGDZPUrsnadlKS8psFAUysP DQCFwFBIXD8hdSWR6SzV =/J2e -----END PGP SIGNATURE----- --DSayHWYpDlRfCAAQ--