Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp468793ybh; Mon, 20 Jul 2020 23:05:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd+v6TF/lVz0R8PIFMg6+eWQXfPHVBDn7NrThthh8myz1i8pkB8Pe4zOoYqSpEjyDhhPT6 X-Received: by 2002:a05:6402:3048:: with SMTP id bu8mr25373535edb.367.1595311529876; Mon, 20 Jul 2020 23:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595311529; cv=none; d=google.com; s=arc-20160816; b=YHWHRUjo+C34QHMFqDGnsPAlvfqJ2meS24sb+Qsoly/62SlWX3YglnZWeo5duh0eab I2JLGw643BHMAmedsQDx8hnWQkpaWj/Zyz26DocNkD5TuzIGCJ9Xs7H5D8fMzSCBLo1m ntcUKxdzIIx4vGvLFDJAL0QisdLB+oayJZjjIh3QxyXVed0cOgkaWZvuAU2xrVYEku2i t99a4T1ZVuAMEx4vr/sh4NtnAm70ay6QVedZMF2jjcOt9o+5Z+W6LbwpPIS68xpXcKtg X+bLrflh9VfbESyfFlRAqWOV+JQYX8whxMgro6y8bNtlwbDBF3D4jaUjnIIahPIQuMRZ q4Mg== 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=LFopRiZ2wKLof6oriyQ74auAniuu6AjJIeSmfdmrsNksxOFF9W2bjIY16Pk2qqGBKA u24YxazemjR/wdT5WXoD5iEGtutwNR6kYUs6ATrHUsr3p+2vgCcTOheaZtriDp9kvCIs lMr2GUgh5n6RVA7QCw98MGfiIIPlkbKkgm3H0zu/oCOHRU0XOyjXo8pCU1UzE7kCRn3J RIMPCueDEO7KXbHDoOL0CRRPaHxLWVq2iOT7BvmVlkjArPp6wyzcCgqMCd/ronywXpVh l3fK9P47OEPej3T4xKLjLXlYXwG4oe1k0jwAfd1BoNus21QYCTR1E53vRGahDQcQ19By LqRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kT+OXrwk; 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 da8si11848321edb.564.2020.07.20.23.05.06; Mon, 20 Jul 2020 23:05:29 -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=kT+OXrwk; 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 S1728413AbgGUGCB (ORCPT + 99 others); Tue, 21 Jul 2020 02:02:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728369AbgGUGB4 (ORCPT ); Tue, 21 Jul 2020 02:01:56 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BC5EC061794; Mon, 20 Jul 2020 23:01:56 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id z5so11448562pgb.6; Mon, 20 Jul 2020 23:01:56 -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=kT+OXrwkEGS0+Ojb/6qOa0SIOtWehMYks820nIZ3eTq6LzaNnAWPJcH9KdSIIsxZC3 z0etdpEAxLgyi8c9Wbf1aPs792Dr3yWd5BbSdqI47OiY8ozyZgY5clhT2qRswVlmOPOC aRPjEu+3v28+UMIjrR9kZMVVtIsb3EbOJwhZqyer5kejhjzL/PfJ1CuMRJ/OUP7+MLd4 MUmrNxp0hE3clKfk8UJi0obw2MSli1Q5rrrfbabL6eu5iP/yMQrK5FNtVsF1JH8M2g1b ceA4TGoqPFPSY3jG1u6Z62pBna1qKLGPGZRBXLFD8zXYyAbOONzRcNuYeqd0dvWWbyzM +bIA== 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=b2Gl0/cg1+NS/xqK28QqeSfb4rik7ir54C+VeQT0wXP54qgJh5Tg173jU01B8NaP/m QGJkwNSxe8G4aQCpinDn+FRgJb1BsTgG/hsQFyigVGBWoYhV1MXqc0zfzv9qnW+5I2J/ n4cezs3rO32xlkhoVw90WkOaI7BOQDVsFzxlH+bRTO+TyfbnDHAJQnqUTv+AXkOEvxA8 QR6wfWqTctVdktyhFnuZ6e+BgoZfCXU5/67uO8wxbpmlrZkmZU0H1SP1em53q+yDQZ7J N73z7DeNRAyXeg+ZjD6BTW+1/pvk2Sfc92gFxjcIc2jSg+pPv44AaYlsQXweURT1n6TC XYyg== X-Gm-Message-State: AOAM532szm/v+ZBQ6HWfdKOEezroGiPIhB0J/JEEX3dbrJY00kwCjvkM G6Zyk9gzg4gkXzMWvb/p1BiKzmVv9RQCZw== X-Received: by 2002:a62:e206:: with SMTP id a6mr22659012pfi.24.1595311315868; Mon, 20 Jul 2020 23:01:55 -0700 (PDT) Received: from xiaomi.mioffice.cn ([209.9.72.214]) by smtp.gmail.com with ESMTPSA id 129sm18368833pfv.161.2020.07.20.23.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2020 23:01:55 -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 v5 4/4] power: supply: core: property to control reverse charge Date: Tue, 21 Jul 2020 13:59:37 +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