Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751500AbdGYLTm (ORCPT ); Tue, 25 Jul 2017 07:19:42 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:39642 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750839AbdGYLTj (ORCPT ); Tue, 25 Jul 2017 07:19:39 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 542B36072C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=mgautam@codeaurora.org Subject: Re: [PATCH v3 2/3] usb: phy: Add USB charger support To: Baolin Wang , balbi@kernel.org, gregkh@linuxfoundation.org, sre@kernel.org, lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: jun.li@nxp.com, peter.chen@freescale.com, broonie@kernel.org, john.stultz@linaro.org, neilb@suse.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, devicetree@vger.kernel.org References: <0bfc4d3534a7cc735ef213da8d280a4a79629c0d.1500968745.git.baolin.wang@linaro.org> From: Manu Gautam Message-ID: Date: Tue, 25 Jul 2017 16:49:31 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <0bfc4d3534a7cc735ef213da8d280a4a79629c0d.1500968745.git.baolin.wang@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1442 Lines: 35 Hi, On 7/25/2017 1:30 PM, Baolin Wang wrote: > This patch introduces the usb charger support based on usb phy that > makes an enhancement to a power driver. The basic conception of the > usb charger is that, when one usb charger is added or removed by > reporting from the extcon device state change, the usb charger will > report to power user to set the current limitation. > > Power user can register a notifiee on the usb phy by issuing > usb_register_notifier() to get notified by charger status changes > or charger current changes. Why can't we use power_supply framework for this? Power user can register usb power_supply and USB PHY driver can update charging current using - power_supply_set_property(). > we can notify what current to be drawn to power user according to > different charger type, and now we have 2 methods to get charger type. > One is get charger type from extcon subsystem, which also means the > charger state changes. Another is we can get the charger type from > USB controller detecting or PMIC detecting, and the charger state > changes should be told by issuing usb_phy_set_charger_state(). > > Signed-off-by: Baolin Wang > --- > drivers/usb/phy/phy.c | 272 +++++++++++++++++++++++++++++++++++++++++++++++ > include/linux/usb/phy.h | 49 +++++++++ -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project