Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp54251ybh; Tue, 14 Jul 2020 17:42:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyS4oEOgum+z3TeVi4VrWlT/P4H6sr6VnduRHxopAvr1O9mY5mAhqduv7vuNGBgxf7Be3OJ X-Received: by 2002:a17:906:7a46:: with SMTP id i6mr6593628ejo.475.1594773732777; Tue, 14 Jul 2020 17:42:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594773732; cv=none; d=google.com; s=arc-20160816; b=frWsIUQJ0VTrE1P2wbAcOsdALizEsPbmWWK3XSeEJVxxTrumAG5nXs721+oj8vQC0R fi7Vas6eDJLnQbl8eKBccJsQUkscOQ0htdQ/0StbTxYBDKkEz1pE+fhZAWZmXK90RKGa 04PoYe7/OPhgEWYrdHf+Ks5EKk/rLi++etmbdES+BTBOjEX49f1wb83UE+K8lUx3vpzB Mjc70t3Nd12gK5bL9zPj+QwiCAp5urng5YsF2UPcyAY0AY4Ym843IRNDIdCh5/6uZbvj YSsz98LWjyqO+BXH/hkzJ6HIuyB5dRFnAA5wLgV0ROn7JKg/V1FbhkbROmqT2rIsiZqo Fanw== 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=t92GQr0XF5La/5NkzWo2FgB8DyYAH3MheL1mKcdDKSg8NV17mOC4J3/61MC7bDygOI IyY3X2231AkFSYRwuSE6eL1VyIZGkF+Z8X5sBd2OkIfZJqgKT+puk6QRVFW+NXrzBkKv NmFf/AS8R1rIpzEt9AWl7q+WW1qfNUZX27MTCa4McHstiKLjLGvaEt8jXWNnRD8gwI8G ub9esQ7KNVTqYQ89q+pA4kQiUff3lBLfc0HLvstoOCboGJW6tbKJX6OTbgn+7xq1Uexy lQ3gFotBVu057zNtaxXoYtsc0YbsvAx7JdgeGWLpsgEK9xdtTvAi1NULMQIb7Az3OXGY mfQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hAuSkYWL; 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 h5si263099ejy.226.2020.07.14.17.41.50; Tue, 14 Jul 2020 17:42:12 -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=hAuSkYWL; 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 S1728162AbgGOAiE (ORCPT + 99 others); Tue, 14 Jul 2020 20:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbgGOAiD (ORCPT ); Tue, 14 Jul 2020 20:38:03 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A9FCC061755; Tue, 14 Jul 2020 17:38:03 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id s189so557181pgc.13; Tue, 14 Jul 2020 17:38:03 -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=hAuSkYWLpepL/JQgoD2wPZ71HnWhAGnjXtBKgydftWueHQEOy8ys0qOvIfFgP6jV0M swauscu1gklSi/6BK7BrXT2fsdAbQPflj6noB804Gbe3+uvwMg98lli1Uvf/xQQtXLzC h/aBHaIrHgN74ZUzSc+qZBmP4K09djxQwyHvRdUEgAW8vp6X/zbG97egV8883SyRTFrP /CZpB8srEAPBNuQ3Y3dYr+C9+Fg2GMc4xTQT3Lp4RVYCvdRLUIfw1ZVxIvSZ5xsDgs0u 001e1oT9mO92eywqfzr3XLCMPNN6STp9OPfkP/qzvtYocFK+s7b2J0bJ/oQjcEzX9C3X 4orA== 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=CkMTS5R34KHSM2aO6mKyq7Djd9B/NWyx0P1ZjkB1INtkdq8hxj12yqEpVPNHqX77Ji +UTYMJ0hpW7wgwF1T9R3kKJeZhVtwkeYs9Xj1ksWvYQOLfFMUVd7F2Aa+ZhCUQa27eY+ FM/Ob0J49t1BcuYzVbj7wkvml80IbiS2zourVsdJOd8ZHH2Po56hmZ9n4yqKhqwW3bwa h45RveY2buFtMjgQl5kXjD9b3aHAaQ5GiNg7w6YLsBRbaCuFcqs4rCdWQzHmmb0+eYIO LPftAOmSzdCwOwT6Lotvepn/uwexeuSLKbHHOUMnYsy2XiKqIjM6T9RU11FdGhWO0LMm +ISQ== X-Gm-Message-State: AOAM533BSl0leORFl6JTb1VOxUt2o6Hgdj+2TAQy7ULlQuFufSCeZJFV a84DwkV6ru8g3ORh41SCTz0= X-Received: by 2002:a63:e04c:: with SMTP id n12mr5278646pgj.388.1594773483237; Tue, 14 Jul 2020 17:38:03 -0700 (PDT) Received: from xiaomi.mioffice.cn ([43.224.245.179]) by smtp.gmail.com with ESMTPSA id t126sm266156pfd.214.2020.07.14.17.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 17:38:02 -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 v3 4/5] power: supply: core: property to control reverse charge Date: Wed, 15 Jul 2020 08:35:22 +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