Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751893AbcDRI51 (ORCPT ); Mon, 18 Apr 2016 04:57:27 -0400 Received: from mail-yw0-f176.google.com ([209.85.161.176]:34541 "EHLO mail-yw0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751535AbcDRI5Z (ORCPT ); Mon, 18 Apr 2016 04:57:25 -0400 MIME-Version: 1.0 In-Reply-To: References: <6b323d5168c10ccb47882687b1251c31b6cad587.1460029375.git.baolin.wang@linaro.org> Date: Mon, 18 Apr 2016 16:57:24 +0800 Message-ID: Subject: Re: [PATCH v10 1/4] gadget: Introduce the usb charger framework From: Baolin Wang To: Jun Li Cc: "balbi@kernel.org" , "gregkh@linuxfoundation.org" , "sre@kernel.org" , "dbaryshkov@gmail.com" , "dwmw2@infradead.org" , "peter.chen@freescale.com" , "stern@rowland.harvard.edu" , "r.baldyga@samsung.com" , "yoshihiro.shimoda.uh@renesas.com" , "lee.jones@linaro.org" , "broonie@kernel.org" , "ckeepax@opensource.wolfsonmicro.com" , "patches@opensource.wolfsonmicro.com" , "linux-pm@vger.kernel.org" , "linux-usb@vger.kernel.org" , "device-mainlining@lists.linuxfoundation.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1426 Lines: 40 Hi Jun, On 18 April 2016 at 16:27, Jun Li wrote: >> >> >> >> But another issue is some users may need to get the charger type from >> >> power supply by "power_supply_get_property()" function, we need to >> >> integrate with the power supply things in the usb charger framework, >> >> not user to implement that. >> > >> > Why this user(your case) can't put the charger type get by >> > "power_supply_get_property()" in its uchger->charger_detect(), any >> > special reason prevent you doing it? I am not sure if this case is >> > very common, even if it is, you also can put it in >> > usb_charger_detect_type() >> > >> > usb_charger_detect_type() >> > { >> > If can get from power_supply_get_property() >> > ... >> > else if uchger->charger_detect >> > uchger->charger_detect(); >> > ... >> > } >> >> If user want to implement above method, they need to get the >> 'power_supply' structure to do this action, which maybe can not get in >> some contexts. So we need to integrate with the power supply things to >> avoid this situation. IIRC, Felipe suggested me to flesh out the charger >> getting method. >> > > Okay, then I agree with you to let user do that with more flexibility, > I tried to enable usb charger detection on one NXP i.mx platform based on > this framework, works fine, thanks! That's great. Thanks. -- Baolin.wang Best Regards