Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753238AbdGCIyl (ORCPT ); Mon, 3 Jul 2017 04:54:41 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:38126 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752411AbdGCIyj (ORCPT ); Mon, 3 Jul 2017 04:54:39 -0400 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Date: Mon, 3 Jul 2017 09:53:23 +0100 From: Charles Keepax To: Baolin Wang CC: , , , , , , , , , , , , Subject: Re: [PATCH v2 3/3] power: wm831x_power: Support USB charger current limit management Message-ID: <20170703085323.ph5drwiisjxmfhri@localhost.localdomain> References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1707030147 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1340 Lines: 36 On Mon, Jul 03, 2017 at 02:07:15PM +0800, Baolin Wang wrote: > Integrate with the newly added USB charger interface to limit the current > we draw from the USB input based on the input device configuration > identified by the USB stack, allowing us to charge more quickly from high > current inputs without drawing more current than specified from others. > > Signed-off-by: Mark Brown > Signed-off-by: Baolin Wang > --- > /********************************************************************* > * Battery properties > *********************************************************************/ > @@ -607,6 +647,22 @@ static int wm831x_power_probe(struct platform_device *pdev) > } > } > > + power->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, > + "usb-phy", 0); > + if (IS_ERR(power->usb_phy)) { > + ret = PTR_ERR(power->usb_phy); > + dev_err(&pdev->dev, "Failed to find USB phy: %d\n", ret); > + goto err_bat_irq; > + } > + We should probably update the binding documentation for this as well: mfd/wm831x.txt Also I am not sure this needs to be implemented now, but what is the plan regarding pdata systems? Generally the driver supports both and it would be nice to know there is a way forward for that even if we don't implement it yet. Thanks, Charles