Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1498668ybh; Sun, 19 Jul 2020 22:51:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVC6f3VEvqyjjMCpM13/BpV9q1sr1kXJFXb6v9xuI/OzVSuF4adNiWSQfv3bVb8AOeU99Q X-Received: by 2002:aa7:d7cf:: with SMTP id e15mr20412671eds.236.1595224267133; Sun, 19 Jul 2020 22:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595224267; cv=none; d=google.com; s=arc-20160816; b=K4+DFU6kDpslvqbCEgwz2DQ061BtU3UXpUR837LHQZsMP99vlDOAZyT9ZaItmDHUPD 3f4hF77+a/f3sURYXPKl0Ng6/ktKGgH/MzDCSxHYy5hVyk3VtRSBupf683WtwzsABNLp u46lZc+1wcqKQtxF3e2l/aI+fO4qkXZ3KLAPdlzhovEgMzvCLh0NSlagm2gs3Qe9Ecqt 4YCOsSHchgLUi2rYAN41ZSaEROylSj7nfVGA/MMKyPCFR8aZxqRtJP/IukBEl6Ve5BfW lmb1GwNdVIlLnLcOtrrZGQm8QpBnpvZaaVkxHFPg/+jEWgXgLDElvYswLPnEpQOKOzpI BM1A== 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 :dkim-signature; bh=rt6OILtoXvarYoblULhOIeiZp6zLUqn8NzrZ6DwL+ac=; b=BqAlmoXoLf3ocVqGQoJocwI4bGa8dUiz62/kousd65b0ghWLWjV47pca+0C1ZrXnUn 0fBR8yz5d4auggfPBRxOw3PHpvNx5l1X1ilUD5SBxPRjltAweQXhV4rthWES8uBb6xKN eNJ5l9ogBTcKyDO1BExbhvnwh3qaNF7mPwNFJZWWVy6GCgBT+6FJfLoTYHaAQ6FC+uC2 rDs9Jpcef3o2L/ThXCnHB23K9okhrEt+Xsn51AvOz4RJ/NsA9Ye6OKyiBf/RzWPeG5N5 OePDiEUdH28BETNWHiexU0T3JIqXnA3Ft3VvcW9KhQY6ImfmDBxYBWMeUlPK6eCP/97t mfEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RUh908du; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v20si9774945eja.474.2020.07.19.22.50.44; Sun, 19 Jul 2020 22:51:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RUh908du; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726842AbgGTFtj (ORCPT + 99 others); Mon, 20 Jul 2020 01:49:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbgGTFtf (ORCPT ); Mon, 20 Jul 2020 01:49:35 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 151D5C0619D2; Sun, 19 Jul 2020 22:49:35 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id ch3so9628850pjb.5; Sun, 19 Jul 2020 22:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rt6OILtoXvarYoblULhOIeiZp6zLUqn8NzrZ6DwL+ac=; b=RUh908du2UYyA6IAU3v8E23q04X07RbU6Iqf+AENKn17x7WSb6pMDGM+KXsWBnPVDJ Ig6+AyqAKKhSwOdViBOzzeGhuxX4Q1MdzQsDcd7jrW5D0YS9/YUqWo7YGzkG9zhInVWN m7Q5kroEBQHDw23B8F2h640vEP3HQWs6gcUUPnVFy32/u7TXEe3lrLn3Rsvfrir28Dgw cwaA7fkP6yndWgBGzOYL5yGQC1QT38DPnblesWeabs7qBMnu0SsghDgTaHZ2eTefLLOf hTpjorNWOTqaCDQe1n0R5IcNlITeyBrKsZEAPrjLr+/hsz/AWHT3UTlL5012NJFslBtK Yl/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rt6OILtoXvarYoblULhOIeiZp6zLUqn8NzrZ6DwL+ac=; b=IutbSYQfg3d2L8MtwgFc6dH9G2lkfKrRJRFMNYzoq4tk+Dc103o9v0hwpEiyWT6RQ2 ceOrdZm1hpbSvMIJGAvyIu7XUFFU1s7CeKBrFAq9svXvxlyW9zUr625yKKuipydq8/HF qPtpsc6hoGNLtvQvqqcDKqib6CdV/w5eyqh48gn9H8/D8w6tqO6yomVpTPYpq3vsdmMF IvDWlPFP64/35kwtaXtxIe1Zdypnkj/QSChZ0EuFwFmlR8DWtNtSx2+6ljuZrG3L1oC7 IhfMei055Ozx7hiq2ejGOV332XbzERzkeqGUM88eK4SQAuvGsm507omQYevO5EN4pn0t dKsw== X-Gm-Message-State: AOAM533vFkhn85fW7Y85zS/Im/G273oigsD9SuAtk7X6fsgduP9MKrvU yYI+v+QOTdxAifqdkPISvuQ= X-Received: by 2002:a17:90a:f007:: with SMTP id bt7mr21843561pjb.214.1595224174619; Sun, 19 Jul 2020 22:49:34 -0700 (PDT) Received: from xiaomi.mioffice.cn ([209.9.72.214]) by smtp.gmail.com with ESMTPSA id i7sm13627833pgh.58.2020.07.19.22.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jul 2020 22:49:34 -0700 (PDT) From: Qiwu Huang To: sre@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, jiangfei1@xiaomi.com, Qiwu Huang Subject: [PATCH v4 4/4] power: supply: core: property to control reverse charge Date: Mon, 20 Jul 2020 13:47:17 +0800 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: 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 From: Qiwu Huang Interface to control wireless reverse charge. Supply reverse charge function when enabled. Signed-off-by: Qiwu Huang --- Documentation/ABI/testing/sysfs-class-power | 12 ++++++++++++ drivers/power/supply/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 1 + 3 files changed, 14 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power index 75ec7de2fe78..54647d6995d3 100644 --- a/Documentation/ABI/testing/sysfs-class-power +++ b/Documentation/ABI/testing/sysfs-class-power @@ -767,3 +767,15 @@ Description: Access: Read-Only Valid values: 0 - 100 + +What: /sys/class/power_supply//reverse_chg_mode +Date: Jul 2020 +Contact: Fei Jiang +Description: + Some phones support wireless reverse charge function which charge other phones. + The property supply interface to control wireless reverse charge. + If enabled, start TX mode and detect RX. Disabled when timeout or manual setting. + + Valid values: + - 1: enabled + - 0: disabled diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index e420a453095e..81916b6b6ccf 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -209,6 +209,7 @@ static struct power_supply_attr power_supply_attrs[] = { POWER_SUPPLY_ATTR(QUICK_CHARGE_TYPE), POWER_SUPPLY_ATTR(TX_ADAPTER), POWER_SUPPLY_ATTR(SIGNAL_STRENGTH), + POWER_SUPPLY_ATTR(REVERSE_CHG_MODE), }; static struct attribute * diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 346c6c9c0737..a87ae1fff8d1 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -170,6 +170,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_QUICK_CHARGE_TYPE, POWER_SUPPLY_PROP_TX_ADAPTER, POWER_SUPPLY_PROP_SIGNAL_STRENGTH, + POWER_SUPPLY_PROP_REVERSE_CHG_MODE, }; enum power_supply_type { -- 2.27.0