Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2686801pxa; Mon, 24 Aug 2020 23:44:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvbN3SnIEVYnbJsmTVEZiLuO1Wu6FfPlDmzSFB+8j3mXBSLM24vwMiw0EywT5SA8sJCXcM X-Received: by 2002:a17:906:819:: with SMTP id e25mr9448651ejd.95.1598337856256; Mon, 24 Aug 2020 23:44:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598337856; cv=none; d=google.com; s=arc-20160816; b=WnU+IhSzGW3ueTGD7xZVVy1ZEM8Ah/Fjgy4ABqj/0IcO9NU2WKIZ7It1k5Vd1VkJbE jM3VKyQXD8+PB201XpCyUvJveLU+mDgCQyO4VYmPfl754PAQ1cY6ibJEc3BnZhfvu8yk Dm+ANo2yv+fY3QJP3TuQC7OogqUYnGJrvjlZ9hU4tAAI7gQMpe3Ja2efw6KxiZGUgGid w6xMf3lY5hcN7KnGfSh8CnvE2KktHSnwnsqzXHv6hRulmjCNp0qtI76LDoJSlug08R1W MPQtSef7LJBtlZ+dAWNvDAySz00aSUnI33VyBUFuG7nq4akjZxg93yqz1V0ytNxf+hPb GCWw== 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=Vq8VrvDZDnyF2Zh3awLs7OB7VEuN+RNqZyCqVxEY1Zo=; b=vbSeePbm6pjsdJMKfUCgMrxAnMfhF9tzbp+IcJQpY+IMktqOxVQdLzTEWnnKi8OQ7m ic/l5c+odIIXxraviBxhlTRY0Ln2F5pHLFqBujXIrSJtL2bjhz8T5NeSRj4jrFur/O2k T+bVOf3fOApn37CqeXMsgs7QyzEEhctmgjcntuwa5pkz8fUdWpS4yBdN3C+j26/08o0Z jLZ1GAM2cM7bWrOgrZGf71jRk87+VvUtk7LRRoZQW44MqPElsY2mumitO1i3oauN+Oh1 VpInHwakr73L2qhiogwYERqFT/+hjEBH5aZ0QlmNWufUmBK7I6Y2OunTPrJGvMSEieev RcLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=USyUfQrp; 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 s19si8557039eja.499.2020.08.24.23.43.53; Mon, 24 Aug 2020 23:44:16 -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=USyUfQrp; 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 S1729154AbgHYGk1 (ORCPT + 99 others); Tue, 25 Aug 2020 02:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729068AbgHYGkP (ORCPT ); Tue, 25 Aug 2020 02:40:15 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E7AFC061755; Mon, 24 Aug 2020 23:40:15 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id 31so3880944pgy.13; Mon, 24 Aug 2020 23:40:15 -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=Vq8VrvDZDnyF2Zh3awLs7OB7VEuN+RNqZyCqVxEY1Zo=; b=USyUfQrpK/4m4wnRxHSiWWvGFAdJ05ICWKl1iSCqImXNEUVDkch//fXKVgJvQvNpbP GS3apgwV4zJ2oSj3/0DGA9ejo+UGCWiGl8JOHB/vIK3Crdgv1UMHLI2c4u4UilZ4K6NM cRkaUX4d9SMPxjKugPkzz7YJ776n/ucCtJbzR4msTvuCBMGg5WY280i0Q/hEY1e9Vl2e NfNDoQ+adgcFCr1j33DGNxYjG2Drx7oibS5WppD1/HgSfW+N/ul7CG7/4BLr69/4lq9x CvbdxhjXwoZoMm7b/9bUGiFowoGrsz0r/D3AEaqx9y513ttIqnxFmgrH/7How42KIU76 Ma6Q== 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=Vq8VrvDZDnyF2Zh3awLs7OB7VEuN+RNqZyCqVxEY1Zo=; b=j9M+sKQqbJSf4wpzuY52ZI1VXTHIYpKQUd5Y8eOIKobPHaL55c62s4zon1lstulEZY iUwMljrWOZg4BIb5c5xIpYw8paCmmTFhVgMqW5qpiS+oEzzK8RDI8X5djJsQ0p2ivkBg 5nCRRsDk4Rix4S4RLen2slT5A/cKhYgKhafqpSqnHZ0Gr1eUd4z7tNDJvzgn1AbEHPOf I6u57uS1t+yJbrwvsI2FHKU0V4lybWAbEHjlfYdUiZJ2iourSinZ5iLlMB5CXgXuaIDB p0/Z8DxZmQiiwFqDPvO/2WUXbvZszg6x/PrceeDjJorucCMk9h97TFMdt6y/3Jyb3xq7 yO7w== X-Gm-Message-State: AOAM530ZyiMlI4gBK3At/7HuymOERM5Q5bQ4k7fKC3Fe/QA96WJSyklM eObS+kG9/aWh9FzJWcMCm+A= X-Received: by 2002:a65:6882:: with SMTP id e2mr5941334pgt.290.1598337614586; Mon, 24 Aug 2020 23:40:14 -0700 (PDT) Received: from xiaomi.mioffice.cn ([43.224.245.179]) by smtp.gmail.com with ESMTPSA id z2sm14197283pfq.46.2020.08.24.23.40.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 23:40:14 -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 v9 3/4] power: supply: core: add wireless signal strength property Date: Tue, 25 Aug 2020 14:37:58 +0800 Message-Id: <7b38a519d85ad526cee8d25a00ad8de1a98fb04f.1598337073.git.huangqiwu@xiaomi.com> 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 reports wireless signal strength. The value show degree of coupling between tx and rx. Signed-off-by: Qiwu Huang --- Documentation/ABI/testing/sysfs-class-power | 22 +++++++++++++++++++++ drivers/power/supply/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 1 + 3 files changed, 24 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power index 03ab449fae8a..4459b720feb2 100644 --- a/Documentation/ABI/testing/sysfs-class-power +++ b/Documentation/ABI/testing/sysfs-class-power @@ -757,3 +757,25 @@ Description: 13: ADAPTER_VOICE_BOX, 14: ADAPTER_PRIVATE_PD_50W. +What: /sys/class/power_supply//signal_strength +Date: Jul 2020 +Contact: Fei Jiang +Description: + In PING phase, RX transmits a signal strength packet as the + first communication packet to instruct the base to keep power + signal on.The value reports wireless signal strength and show + degree of coupling. + + The Qi Wireless Power Transfer System is published by the + Wireless Power Consortium.The ping phase is the necessary stage + for matching transmitter and receiver. In this phase,the Power + Transmitter executes a Digital Ping, and listens for a response. + If the Power Transmitter discovers a Power Receiver, the Power + Transmitter may extend the Digital Ping,i.e. maintain the Power + Signal at the level of the Digital Ping. This causes the system + to proceed to the identification & configuration phase. If the + Power Transmitter does not extend the Digital Ping, the system + shall revert to the selection phase. + + Access: Read-Only + Valid values: 0 - 100 diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index f2458e21d02b..e420a453095e 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -208,6 +208,7 @@ static struct power_supply_attr power_supply_attrs[] = { POWER_SUPPLY_ATTR(SERIAL_NUMBER), POWER_SUPPLY_ATTR(QUICK_CHARGE_TYPE), POWER_SUPPLY_ATTR(TX_ADAPTER), + POWER_SUPPLY_ATTR(SIGNAL_STRENGTH), }; static struct attribute * diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 00254e096a4a..747338118fa1 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -169,6 +169,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_SERIAL_NUMBER, POWER_SUPPLY_PROP_QUICK_CHARGE_TYPE, POWER_SUPPLY_PROP_TX_ADAPTER, + POWER_SUPPLY_PROP_SIGNAL_STRENGTH, }; enum power_supply_type { -- 2.28.0