Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754618Ab2KHBZ3 (ORCPT ); Wed, 7 Nov 2012 20:25:29 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:34639 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750720Ab2KHBZ2 (ORCPT ); Wed, 7 Nov 2012 20:25:28 -0500 X-AuditID: cbfee61b-b7f616d00000319b-36-509b0a0627ec Message-id: <509B0A0F.5000406@samsung.com> Date: Thu, 08 Nov 2012 10:25:35 +0900 From: Chanwoo Choi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-version: 1.0 To: "Tc, Jenny" Cc: "myungjoo.ham@samsung.com" , "linux-kernel@vger.kernel.org" , anish kumar , myunjoo.ham@gmail.com Subject: Re: [PATCH] extcon : callback function to read cable property References: <1349864628-21479-1-git-send-email-jenny.tc@intel.com> <1349880328.22926.2.camel@anish-Inspiron-N5050> <20ADAB092842284E95860F279283C56439BC4A@BGSMSX101.gar.corp.intel.com> <1349963260.8329.1.camel@anish-Inspiron-N5050> <20ADAB092842284E95860F279283C5643BA10D@BGSMSX101.gar.corp.intel.com> In-reply-to: <20ADAB092842284E95860F279283C5643BA10D@BGSMSX101.gar.corp.intel.com> Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMIsWRmVeSWpSXmKPExsVy+t8zHV02rtkBBluWGFtc3jWHzYHR4/Mm uQDGKC6blNSczLLUIn27BK6MTw3n2Qo2SVac/KvewPhZpIuRk0NCwETixNO37BC2mMSFe+vZ uhi5OIQEljFK9D+9wwxX9OAnI0RiOqPEs7VPoaq6mCT+X1/BClLFK6Al8fX5NLBRLAKqEn93 72MCsdmA4vtf3ABq4OAQFYiQ+NXPAVEuKPFj8j0WEFtEQEViast3JpCZ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e4hRgoNZSYR3ypFZAUK8KYmVValF+fFFpTmpxYcYfYBBMJFZSjQ5 H5gO8kriDY1NzIwsjcyMTcyNjXEIK4nzNnukBAgJpCeWpGanphakFsGMY+LglGpgbHz85gt/ QO7hB6qNp86rXlxjskhSNofh/fQ3K/dXrwgvOGe/bM6NWks/m5eBZuZ1Xr6r17Ne3W3/XUg7 +G1P3zvP6ZZtxta/Kgy+8ny8Y704ctLsyBlPPMPM3BnXdUhqHwxxqde4yr74wcLlP6+uOjxZ 5toS4Sk6Z3YtNWT+dnCpx3OFrXGchUosxRmJhlrMRcWJAFvAL2rmAgAA X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3424 Lines: 76 On 10/17/2012 03:34 PM, Tc, Jenny wrote: >>>> Subject: Re: [PATCH] extcon : callback function to read cable >>>> property >>>> >>>> I think the reason why we have extcon is in first place is to only >>>> notify the clients of cable connection and disconnection and it is >>>> up to the client to decide what else to do with the cable such as >>>> finding which state it is in and other details. >>>> So I feel this should not be handled in the extcon. >>>> >>>> However it is up to the maintainer to decide. >>> >>> Once the consumer gets the notification, it needs to take some action. >>> One of the action is to read the cable properties. This can be done by >>> proprietary calls which is known both to the consumer and the provider. >>> My intention is to avoid this proprietary calls. Since both the >>> provider and consumer are communicating with the extcon subsystem , I >>> feel having a callback function of this kind would help to avoid the >>> use of proprietary calls. Also I agree that extcon notifier chains are >>> used to notify the cable state (attach/detach). But if a cable has >>> more than two states (like the charger cable) how do we support it without >> having a callback function like this? >>> Let the maintainer take the final decision. >> Well this use case will keep on growing if we start factor in this kind of >> changes and that is why I am opposed to adding any other state. >> Maintainer? >>> I think that the role of extcon subsystem notify changed state(attached/detached) of cable to notifiee, but if you want to add property feature of cable, you should solve ambiguous issues. First, This patch only support the properties of charger cable but, never support property of other cable. The following structure depend on only charger cable. We can check it the following structure: struct extcon_chrg_cbl_props { enum extcon_chrgr_cbl_stat cable_state; unsigned long mA; }; I think that the patch have to support all of cables for property feature. Second, Certainly, you should define common properties of all cables and specific properties of each cable. The properties of charger cable should never be defined only. Third, If we finish to decide the properties for all cables, I'd like to see a example code. You explained following changed state of USB according to Host state on other patch. --------------------------- For USB2.0 1) CONNECT (100mA)->UPDATE(500mA)->DISCONNECT(0mA) 2) CONNECT (100mA)->UPDATE(500mA)->HOST SUSPEND(2.5mA/500mA)->DISCONNECT(0mA) 3) CONNECT (100mA)->UPDATE(500mA)->HOST SUSPEND(2.5mA/500mA)->HOST RESUME(500mA)->DISCONNECT(0mA) For USB 3.0 4) CONNECT (150mA)->UPDATE(900mA)->DISCONNECT(0mA) 5) CONNECT (150mA)->UPDATE(900mA)-> HOST SUSPEND(2.5mA/900mA)->DISCONNECT(0mA) 6) CONNECT (100mA)->UPDATE(900mA)->HOST SUSPEND(2.5mA/900mA)->HOST RESUME(900mA)->DISCONNECT(0mA) --------------------------- I have a question. Can the provider device driver(e.g., extcon-max77693.c/ extcon-max8997.c) detect the changed state of host? I'd like to see the example device driver that the provider device driver detect changed state of host. Could you provide example device driver? Thanks, Chanwoo Choi -- 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/