Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp53276ybh; Tue, 14 Jul 2020 17:40:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2yzZ7xFWnQwFCK3eNzkNkmUE++43Db4aGrF3+EgQtkcAZSqeiRjww68p0T8i1g9jrJ/yK X-Received: by 2002:a17:907:72cf:: with SMTP id du15mr6672202ejc.151.1594773618636; Tue, 14 Jul 2020 17:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594773618; cv=none; d=google.com; s=arc-20160816; b=Ap0PyEi7F4uOztW1DX57AjOYelwASZcGIfETYLSJjSimNEc8C7LMPTCNbnv+ZPOSRP aqPLso/Y9quoEVH7sroO/adnjNQtC/W89RRxM0+tnUdeSo5dflj7GBxYNX1AYn+FD10n hc2kcKqsRFW9wUytpdedQfFimLd1JhT4SIusqMcBwsHNt0DTp+adjKQr9QnMlPu1hL4b JOa0n17qhXXAfektwie+VGlS73Ub9gO0VvxbEMnvyqQW8ipX13iXAO5prGF7Qr+VTJOJ s81S14xEaZ/X7HnOitzqzmyYs9Y4tCKEYKOrOvME6IKdWPXrFOKODZKhibsdSsXcn8PG UUCg== 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=v31UIEz3Dwtg5YacEjDmu57JbCXcygtQk9X1DgLN9BA=; b=gEQzSbZZksF7rqDYxownJXPpPjpAzyNUcHDlKGmioJayl3C39lg1SeOp6IulHyVSRf zYpwXOqmX+tZOCwZLftKcV8lvcaYnPx7dEBC9U8BT73RXNcJ/RKJRInWs5zr+NRNY1oJ 0PrLtP1FgnvMOQdsbwPoYRFLZ0MANKzwJGOGNuLRXHXK7t56pNxxfWhGKhZ/0I05b83T Z3QhsOyQIGpV1a8qH0upwlaPh3omkn/MRzcUT3FdA+A5mK0HntbQRCbBeknBzokPOLmJ ncnh5nhtaWgEmfwg/f6gT4dsWuFgMhRO7gKb7A1Sc75u5VV9FkwgYNHjLBfnUTctY6+6 7E0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MJSxcvEt; 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 s25si244714edx.197.2020.07.14.17.39.55; Tue, 14 Jul 2020 17:40:18 -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=MJSxcvEt; 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 S1728131AbgGOAiA (ORCPT + 99 others); Tue, 14 Jul 2020 20:38:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbgGOAiA (ORCPT ); Tue, 14 Jul 2020 20:38:00 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBF6DC061755; Tue, 14 Jul 2020 17:37:59 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id a24so415407pfc.10; Tue, 14 Jul 2020 17:37:59 -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=v31UIEz3Dwtg5YacEjDmu57JbCXcygtQk9X1DgLN9BA=; b=MJSxcvEtp3Y7p+hcrYq1rjGXkaZBgyQWEYJsNvHJANRqI7O6Z5BGS+FbwUdXzCgY+d Wyz0O7PPgSIaV/Bv8N5Fg1bJ+frtJknNAnZlp9phkKvyLCaVdqqGMIq4po1eGkEDqStX Jc4qCE3IHBGNsfeIA2359MNtSDS30hCC/QDVO0Lu6DsB+HCdjGE3QVRc/ZEQd/KXu1zm yy6t7VOdf9ufa9+PUJAqtXN5TW6e2RTtkrUJu60W+uZFK29QGOj0TvszRLHTYnAfCfJ3 XykCKHlOLurgGGm7vv/WuvCBOgW+bdmnlv1wTAQzRnvFukX/4cO0MsA+Q2LGjnbOTIFm Y1Qw== 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=v31UIEz3Dwtg5YacEjDmu57JbCXcygtQk9X1DgLN9BA=; b=JCFhKl91JIGOgvffmQ3zeP/RdKaRaTWqopgRV5qu7ozNWWnCmCPAK5hqEN1beUFpv2 wGji0vX8vevMJvL5Rt4qTYgJ/NQUSMQn7F/LaLUUSmzFzmwhp1nldiKCND60YNGIttE4 XolnGZnwHiG5eDdhyEA+7xLVeRn3ph4dk/r3HvMwYxHToyPzulBgx5nAmAwgSRGOUNvn l4IhXEd4MKGAxh2z/Y7Ky0V63Y4S+CF751/5iFfXp3Wx9macBJ8hLo3Co5FF5iog28dj arUZU43R3x3yTpq7XPx2oQCLIWu1ngzXqBf1+vTvgN/e5Z+XCmbVfn69kDhjtSdgGH1J rVrw== X-Gm-Message-State: AOAM531NSB+ZTlXfwPSCQY1VY7oIb0UQAvpyNdOq00QgJbPzBLpDb2Wx 43OazUVes828KipnnO0odUhoBmOjtc/fWqXD X-Received: by 2002:a65:64d8:: with SMTP id t24mr5742788pgv.286.1594773479515; Tue, 14 Jul 2020 17:37:59 -0700 (PDT) Received: from xiaomi.mioffice.cn ([43.224.245.179]) by smtp.gmail.com with ESMTPSA id t126sm266156pfd.214.2020.07.14.17.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 17:37:59 -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 3/5] power: supply: core: add wireless signal strength property Date: Wed, 15 Jul 2020 08:35:21 +0800 Message-Id: <460b4176d1ef7001cecdf84682c9d39ac676b8bd.1594726859.git.huangqiwu@xiaomi.com> 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 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 | 10 ++++++++++ drivers/power/supply/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 1 + 3 files changed, 12 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power index 03ab449fae8a..75ec7de2fe78 100644 --- a/Documentation/ABI/testing/sysfs-class-power +++ b/Documentation/ABI/testing/sysfs-class-power @@ -757,3 +757,13 @@ 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. + + 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 0bbdec1630a4..346c6c9c0737 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.27.0