Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752526Ab2KTJ1g (ORCPT ); Tue, 20 Nov 2012 04:27:36 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:51113 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752367Ab2KTJ1d (ORCPT ); Tue, 20 Nov 2012 04:27:33 -0500 Date: Tue, 20 Nov 2012 01:24:19 -0800 From: Anton Vorontsov To: "Tc, Jenny" Cc: Chanwoo Choi , anish singh , "myungjoo.ham@samsung.com" , "linux-kernel@vger.kernel.org" , "myunjoo.ham@gmail.com" , "lockwood@android.com" , "peterhuewe@gmx.de" , "broonie@opensource.wolfsonmicro.com" , "gregkh@linuxfoundation.org" , "lars@metafoo.de" , "jic23@kernel.org" , "Pallala, Ramakrishna" Subject: Re: [PATCH] extcon : callback function to read cable property Message-ID: <20121120092419.GA27280@lizard> References: <509B0A0F.5000406@samsung.com> <20ADAB092842284E95860F279283C5644017F6@BGSMSX101.gar.corp.intel.com> <1352521082.1526.230.camel@anish-Inspiron-N5050> <20ADAB092842284E95860F279283C56442034B@BGSMSX101.gar.corp.intel.com> <20ADAB092842284E95860F279283C56444A584@BGSMSX101.gar.corp.intel.com> <50AAEB15.6000703@samsung.com> <20ADAB092842284E95860F279283C56444A6A1@BGSMSX101.gar.corp.intel.com> <50AB1ECA.5020005@samsung.com> <20ADAB092842284E95860F279283C56444C915@BGSMSX101.gar.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20ADAB092842284E95860F279283C56444C915@BGSMSX101.gar.corp.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2987 Lines: 65 On Tue, Nov 20, 2012 at 09:14:41AM +0000, Tc, Jenny wrote: [...] > > For example, > > Firstly, the power_supply charging framework check state of charger cable > > whether attached or detached cable. Second, when power_supply charging > > framework receive the changed state of host system from 'Host system > > notifier', change charging current of charger cable. > > Not just SUSPEND, but we need to handle RESUME , UPDATE etc. Also this doesn’t help us to > define a standard interface for the charger cable state/properties. IMHO it's not right > to provide different interfaces for different cables. This doesn't help us to standardize > the charger cable interface. > > This thread has been running for a quite long time. Unfortunately we couldn't make an > agreement on the final solution. I would like to recap the overall requirement and > would like to propose alternate solutions. The requirements is to > "Provide a generic interface for charger cable states and charger cable properties" > > Even though extcon subsystem handles charger cable states, it's not enough to handle > all kind of charger cable states. It can handle just 2 states CONNECT/DISCONNECT. > But there are scenarios where we need to handle more than 2 states > (eg. USB SUSPEND/RESUME/UPDATE etc). Also extcon doesn't have any mechanism to > read cable properties in a generic way. Extcon charger-cable consumer driver > implementations (eg charger-manager), defines charger cable properties statically (current in mA) > inside the consumer driver. This is not enough, since the charger cable properties may change dynamically > > In existing form extcon cannot support different charger cable states and their > properties in a generic way. Also we couldn't find a final solution on how to modify the > extcon to support these requirements. From the whole discussion what I conclude is > * extcon is not designed to support cable properties The idea of using union seemed good to me, what happened to it? I mean, MyungJoo Ham wrote: | We may have: | enum extcon_cable_type { | EXTCON_CT_REGULATOR, | EXTCON_CT_PSY, | EXTCON_CT_CHARGER_CB, | ... | }; | and have the following included at struct extcon_cable: | union { | struct regulator *reg; | struct power_supply *psy; | struct charger_cable *charger_cb; | ... | } cable data; | enum extcon_cable_type cable_type; This sounds good to me... > * extcon is not designed to support any cable state other than CONNECT/DISCONNECT Dunno for this one. Can we get these additional states via "properties" as described above? Thanks, Anton. -- 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/