Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2857531pxa; Tue, 25 Aug 2020 05:26:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyf/2Ufhn0fBYhOCoV2LAOwgWVqCTbdziEDePnOGbdPsSSdG/lmfBmIdEWVgdow/JVvJ1n/ X-Received: by 2002:a17:906:af45:: with SMTP id ly5mr796707ejb.327.1598358412320; Tue, 25 Aug 2020 05:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598358412; cv=none; d=google.com; s=arc-20160816; b=SuUAwixVGemAtvgNZwXIZOG1HS/ce5uZGaEA85u6dJ0Y3uiWSkfsgW804475Y3zNly Fe7lfcTPQg1pCdR/fSMzR7ofMjd9JFKl+57EzRJlrRYZLg1qCm+F6JDaljkGtnwYN673 NiOx+VhS3K70TsuekiXbYqK7HyJrZgV2x90JxC7AvIBNRJ6I73y0enyZmweqM7CbTlAa s5BtE9+0hMF3enTaJgE+9fFw2C4oo+pq4AP9u+cTFhNrRYq8oGm1FhcxUkTzLkyStuOO OwjxTbcpaCOgmLI2mhtNqouvDIqxPQbl+lBHQKtH/MrZ3IRgTQ2hNIagKLXZr3YW2jv8 1T6Q== 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=89yx6cZZLpORQougS6qytDdcNI/14e8vNGHS/0MWLQk=; b=QKatINl08cKY6THXEpxhr9z/UHeTwHVCh1OjHSPPmpV59bBN2fWJc1l3wziiYSEWbS iHofCPNMlJwC2geh/nCJIlXYIHr8Op4o2DRl7PhvjXQvmIUl27oyp6yAO4czZyQmPZlr 5FwlMxAwgWhFQHBZXsDj5aRdTlu8IgK5rZIuMvMzAgsGkymR7e1+Gug7M6Jo/ezk+BfE MGm0LW/2rHRA9rLyCyzC9cCcWMcN3ZV/iaU9r2u2gPaBVvxnMc4J65FRQ8T8+5+VQhQj VrpePTIccnj4vpx0I+m8SgJsjARU05pF2kZIlLcJsma7xUdqQNYMOk6+BwLw3DlymKeC gUnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tvoi3Cd+; 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 g21si3666529ejc.79.2020.08.25.05.26.27; Tue, 25 Aug 2020 05:26:52 -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=Tvoi3Cd+; 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 S1729838AbgHYKSy (ORCPT + 99 others); Tue, 25 Aug 2020 06:18:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729772AbgHYKSd (ORCPT ); Tue, 25 Aug 2020 06:18:33 -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 2A319C061574; Tue, 25 Aug 2020 03:18:33 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id ep8so993846pjb.3; Tue, 25 Aug 2020 03:18:33 -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=89yx6cZZLpORQougS6qytDdcNI/14e8vNGHS/0MWLQk=; b=Tvoi3Cd+GhzfJdhGcbR+Za137QeGhHkwTtX2Ah8CMRgWQNGdVcGn7G5AgZv8Nx1F5d beXn4Zi2DuCmXdDVR5FqHPDA6WeUCKTEZaRXsHXlHfG+2zPs0iMtZv0byLRBOvgOeKKK LWP+nXhmHI+EtCetztp++sBzvCtqihUNduhF79Gg4FZb5JvHKrC3QqBZTINfUTy43f4Y rJXX+LiI41/KnYvMnj8QgPKZ8KfvT+ot5k2KMC+wv+ybWlPeQEhnE2ES+bKsxRU0m3OV Z/35jaV1Wi5TU16fWxIxyCollHJOnjP5xLRt3Lkg+S93iqV4BLHY9SKlGJmynH0TFIsC p+hQ== 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=89yx6cZZLpORQougS6qytDdcNI/14e8vNGHS/0MWLQk=; b=NosaVSvkd768+sWySecg0KN+5ZmLQ5ZNHYEF7NCmos8mGlkpE+KEFB7q3n5r1rSWrs dHQzgKH01FnC7dLSYXt3zw5clhZoGBUhllytU0hUBtbAYd7S0axHqCyUEO6abWTgHsof 7vN2XMSSc8Rd56WWNT7reiNi/C3yri2cYIAn+hsOMHZvL81omzl2HsigOtOJDrbto//A 7D+ZBQmT2ByCODEyNzNFLEK4oiJxqQcITY/vno+N6OXy4mEnxKFmxPsDcice1YC/ynVw LNS6xkRJTbPWQFsodG4kHRLS4e3CHO9wh+xMQrHUNE8bCAbt7HMtZg+hAqsqTCkT1OUm y0Uw== X-Gm-Message-State: AOAM530UmQ9+vcWFWpha+jTRe8JZMw41pdjaBc3qy169aVB3Ywx9OAeP jZnk8kgg+I8+5pS7C191c6sCi087/BSx8w== X-Received: by 2002:a17:90a:2c06:: with SMTP id m6mr1034869pjd.129.1598350712776; Tue, 25 Aug 2020 03:18:32 -0700 (PDT) Received: from xiaomi.mioffice.cn ([43.224.245.179]) by smtp.gmail.com with ESMTPSA id 19sm1788911pjk.28.2020.08.25.03.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 03:18:32 -0700 (PDT) From: Qiwu Huang To: sre@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, Qiwu Huang Subject: [PATCH v10 4/4] power: supply: core: property to control reverse charge Date: Tue, 25 Aug 2020 18:16:17 +0800 Message-Id: X-Mailer: git-send-email 2.28.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. Signed-off-by: Qiwu Huang --- Documentation/ABI/testing/sysfs-class-power | 14 ++++++++++++++ drivers/power/supply/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 1 + 3 files changed, 16 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power index c3a547037d07..e0adb22a6648 100644 --- a/Documentation/ABI/testing/sysfs-class-power +++ b/Documentation/ABI/testing/sysfs-class-power @@ -780,3 +780,17 @@ Description: Access: Read-Only Valid values: 0 - 100 + +What: /sys/class/power_supply//reverse_chg_mode +Date: Jul 2020 +Contact: Fei Jiang +Description: + Some devices support wireless reverse charge function which + charge other devices.The property provider interface to + enable/disable wireless reverse charge.If enabled, start TX + mode and detect RX. Disabled when timeout or manual setting. + + Access: Read, Write + 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 64e6bdd91edf..403a1787fada 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -213,6 +213,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 496d1faecdd1..ee156492c566 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -174,6 +174,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.28.0