Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp724447ybn; Wed, 2 Oct 2019 05:18:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmo3CurpGmTis+a5NPcQdwnJUuWSeBqPkS23NScNGSOSBUFLhCDEMu23JeGtOJf9CTahdK X-Received: by 2002:a50:ef12:: with SMTP id m18mr3440118eds.18.1570018701562; Wed, 02 Oct 2019 05:18:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570018701; cv=none; d=google.com; s=arc-20160816; b=IUE1xWc7/VHb+cuHgCoWWuOvc28sJgOssYnlb4CHgDrKxnSDkFQ25MbLeLCRJcm6nF KRGrOAm2xgpGjWDORRV9lbegXvKOZckfzWugMohL7qUjfcWIikW0ieyme+Wlgu4j+jBh L/KQdrR49HFWHCkn413UhW7URtngd624dBbfPROodEHp1qdAvA9c8DKS1dhOPJLXXTRb OMIxG2TobZ0+P8VnpNukv4+M2fDKKPsVVkRQ2RN3aJr1Mr7RowENdw4O5qBqMl4D/i4s OHA31KOe8tZRK19eE6fGB4DASPm+ndVN3AteOme2cCNCJdmD04ohNOSYzfsBYsAowRZw Dbxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DSoI+kTvI+FIfJZPlK83Wg6gcs8LD9Mpek5EASa2Nw0=; b=umbLoh94FoDa7fD5gIdre73ep/Tj3cLcji3BvZSkQTKZ2GNFLnxtxOsgK0DjHbYhwU EKn+lufhx1clVgDTU9xvxOFQnyqYjnDBQtUEZ/0+70wQ8BDGSW+7JhoYa26aoIyRqT0Q MK8jd3e/vJT9gUj0WSERMs3sRyPsWnnoaJ/6bZ0mE4wYGQwzroIBzNKup+bLSdqT7bUj 744O8888kF9TfElB02+FDgf/DKkdjNgQYb7DvOEyXhv7oIZqbz2VJJ88htcxS7DOn95h jdeUUrqao34wVxRJDKeGooM/AR0QHOakmv/kaP/sxmWVQPTdPU50yeeb0yvPXoXF0Ume AYzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q35si12181125eda.122.2019.10.02.05.17.57; Wed, 02 Oct 2019 05:18:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728178AbfJBL0s (ORCPT + 99 others); Wed, 2 Oct 2019 07:26:48 -0400 Received: from hermes.aosc.io ([199.195.250.187]:42439 "EHLO hermes.aosc.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbfJBL0s (ORCPT ); Wed, 2 Oct 2019 07:26:48 -0400 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id DE8DE82D37; Wed, 2 Oct 2019 11:26:45 +0000 (UTC) From: Icenowy Zheng To: Sebastian Reichel , Chen-Yu Tsai Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Icenowy Zheng Subject: [PATCH 1/2] power: supply: axp20x_usb_power: enable USB BC detection on AXP813 Date: Wed, 2 Oct 2019 19:25:44 +0800 Message-Id: <20191002112545.58481-2-icenowy@aosc.io> In-Reply-To: <20191002112545.58481-1-icenowy@aosc.io> References: <20191002112545.58481-1-icenowy@aosc.io> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The AXP813 PMIC has support for detection of USB Battery Charging specification, and it will limit the current to 500mA by default when the detection is not enabled or the detection result is SDP. Enable the BC detection to allow correctly selection of the current. Signed-off-by: Icenowy Zheng --- drivers/power/supply/axp20x_usb_power.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c index dc4c316eff81..5f0a5722b19e 100644 --- a/drivers/power/supply/axp20x_usb_power.c +++ b/drivers/power/supply/axp20x_usb_power.c @@ -48,6 +48,8 @@ #define AXP20X_VBUS_MON_VBUS_VALID BIT(3) +#define AXP813_BC_EN BIT(0) + /* * Note do not raise the debounce time, we must report Vusb high within * 100ms otherwise we get Vbus errors in musb. @@ -495,6 +497,12 @@ static int axp20x_usb_power_probe(struct platform_device *pdev) return -EINVAL; } + if (power->axp20x_id == AXP813_ID) { + /* Enable USB Battery Charging specification detection */ + regmap_update_bits(axp20x->regmap, AXP288_BC_GLOBAL, + AXP813_BC_EN, AXP813_BC_EN); + } + psy_cfg.of_node = pdev->dev.of_node; psy_cfg.drv_data = power; -- 2.21.0