Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003AbbFBUsP (ORCPT ); Tue, 2 Jun 2015 16:48:15 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.163]:46327 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751597AbbFBUsG convert rfc822-to-8bit (ORCPT ); Tue, 2 Jun 2015 16:48:06 -0400 X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcKdUCnXG6JabOfSXKWrat5m8Tspw== X-RZG-CLASS-ID: mo00 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: [Gta04-owner] [PATCH 5/6] phy: twl4030-usb: add support for reading resistor on ID pin. From: "Dr. H. Nikolaus Schaller" In-Reply-To: <20150602201143.GA26412@amd> Date: Tue, 2 Jun 2015 22:47:57 +0200 Cc: Kishon Vijay Abraham I , NeilBrown , Tony Lindgren , LKML , NeilBrown , linux-omap , List for communicating with real GTA04 owners Content-Transfer-Encoding: 8BIT Message-Id: <2A59C20E-580D-4284-83BA-1C36E996BEDC@goldelico.com> References: <20150416075945.23307.24424.stgit@notabene.brown> <20150416080304.23307.41913.stgit@notabene.brown> <556C5FF4.3050603@ti.com> <20150602073731.26edbd3b@notabene.brown> <556DB481.3080906@ti.com> <20150602201143.GA26412@amd> To: Pavel Machek X-Mailer: Apple Mail (2.1878.6) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2447 Lines: 76 Hi, Am 02.06.2015 um 22:11 schrieb Pavel Machek : > On Tue 2015-06-02 16:06:47, Dr. H. Nikolaus Schaller wrote: >> Hi, >> >> Am 02.06.2015 um 15:49 schrieb Kishon Vijay Abraham I : >> >>> Hi, >>> >>> On Tuesday 02 June 2015 03:07 AM, NeilBrown wrote: >>>> On Mon, 1 Jun 2015 19:06:52 +0530 Kishon Vijay Abraham I >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> On Thursday 16 April 2015 01:33 PM, NeilBrown wrote: >>>>>> From: NeilBrown >>>>>> >>>>>> The twl4030 phy can measure, with low precision, the >>>>>> resistance-to-ground of the ID pin. >>>>>> >>>>>> Add a function to read the value, and export the result >>>>>> via sysfs. >>>>> >>>>> Little sceptical about adding new sysfs entries. Do you have a good reason to >>>>> add this? >>>> >>>> The hardware can report the value, so why not present it to user-space? >>>> >>>> I originally used this with a udev rule which would configure the maximum >>>> current based on the resistance measure - to work with the particular charger >>>> hardware I have. >>>> >>>> More recent patches try to do all of the max-current configuration in the >>>> kernel, so I could live without exporting the value via sysfs if that is a >>>> show-stopper. >>>> >>>> I can't see where the scepticism comes from though. It is a well defined >>>> and cleary documented feature of the hardware. Why not expose it? > > Is it well defined enough that it will work on other chargers, too? It reports the resistance of the charger?s ID pin. So that works for all chargers connected to a twl4030. As long as the ID pin goes to a 5 pin USB socket. Other charger drivers do not need to expose a similar attribute since each twl4030 has its unique path within the /sys tree. > >>> ABI can never be removed or modified later. So should be really careful before adding it. >> >> Is /sys considered ABI? > > Yes. You are right: https://lwn.net/Articles/172986/ But I am as well with my doubts: https://lwn.net/Articles/173093/ > >> User space developers are always reminded not to rely on /sys nodes. > > No. Then please explain why I have the impression that it is quite unstable. BR, Nikolaus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/