Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp91981pxa; Thu, 13 Aug 2020 20:50:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjPabKZLhzTwOFTUDpcmPmAKQU7o7W+/kCSv95BqUmIELZw6QeoRlfOO10JdPDRDDB4MLm X-Received: by 2002:a50:fa94:: with SMTP id w20mr513923edr.82.1597377023389; Thu, 13 Aug 2020 20:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597377023; cv=none; d=google.com; s=arc-20160816; b=mPHMoJA74sH+YlA261JNLYmvsTNoPbRluFGCpgQxhmlNgzHFr5Vu6kcs43f7PbZtO/ rYuhJb0hj2U7+j8n8XGK8EmnaNE5Nyqjh6L6eRCEInpYcYmj9vm4BlUL46vUHPP9C4Jq 0wVTKlOVStSMW79UOjnaS2LdjxNjqteYa6NPAP5vZ08ID/Yw/k1zw+wCE0Uu7VS5uzkY I/lRqKuEwwinSfWYbmlgOn6PO0zZWlNP7FB1OAjaWRvPRkSknt66A+fpbLdUPJWC2VLR jp5p/DZ/ibkn+yM1iDjbzW60LUSkX70Dj6wCi4tlIdCGhg6+vHAbc/1JLC1zW2KrRSWQ MwAw== 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=GMHd/t+lrkDP5DResEtg8bRzSj37C+MZr3bDugORXbdVhUph2XQlRG8zi75aaeiyBN uSyr+Ld0YbzDpM/HV3M91nk2m6BWc/9Ypopeji2dvPLCTHHMtSWQnCzh/dNbiWgNIv1Y IMKtZcwDrw/t3gV1pfxB18tXfpazJdFotCv73vEufJVQfHfX93bRLPh5NZB45RVCHD2h 5pyNMbZrTm34qYm4d1f1UljGjek0hSb9UqOtwBoIkYyZqApcX7tvMxE4V4lN6QDb2/AY nLqCvaK39ff68/AAiJtDtqBZl13jd1ic4vggKAV0mfmbsAs2DnisOMv350W/MwEb9XdC DzJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EuMum0AB; 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 j17si4684922ejk.360.2020.08.13.20.50.00; Thu, 13 Aug 2020 20:50:23 -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=EuMum0AB; 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 S1726709AbgHNDtU (ORCPT + 99 others); Thu, 13 Aug 2020 23:49:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726567AbgHNDtR (ORCPT ); Thu, 13 Aug 2020 23:49:17 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 883A1C061757; Thu, 13 Aug 2020 20:49:17 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id i92so5095107pje.0; Thu, 13 Aug 2020 20:49:17 -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=EuMum0ABMVFIJnP9Ihd84HBQAuUgrUpF1ipxe+RfSXkoVOYh9hDDtMDuni8wxHHqRd YNVMj0q1a6cIDS9xBRBjRx98X7pe5rUtD4VXwJP0A4exuQvn58e347r0a0V/QxvkqI3b a10edfO8y5qNbBoNjaGb0+w7SxGxQPsXYlqU6k804W8L2Vg//zqzNAJxi4Wzo14l/7tL eV+h9pCUa1EESO5GCOpBfdhKvPjYLA6nJA0JeOlK3GwAL0XhB+PO4G229ULndQxfGkec nK/Q+18cuUFojZSSShQm7vGe+xdNGDSbVyyyWZRLyyI/BQKG166jrKZsz4jcRH0CE+CT 4+NQ== 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=AxzdtpITeg9AaciJXyOPUBIk9rJb2aFNjmGceDti9Om6xh0EyPG2t2geOiHKIZ7cq1 fCv/k1k9wlpwoowK9suSva7CY/3OTUoyuv0+tMiLLF/jx1pFkHhLWLwhTaFu2AIK85Iz eec6aik7O1N9ITfagqVp+rfmO/C1JCi2CgNkR2OIErrgDWkyWwIAEqNaOQez4bIzSnIM n4PpIHJjjc+M+Cx1evKfHA81u2YRguteRKLtZeWtBRk4jqb/Zl4AWHKB5de8D0medosw +61/aaeySroxLB2zMyDPdDBtmiP5l9OU55u6k2KY8wiHTu/mZtOIj99Lb53/3fM05Pu4 b3Wg== X-Gm-Message-State: AOAM530L6ZH61dOsY9/ql+YaZiBOJoPAY14TfzcTKEbo+rdbjiVALwC5 qJJ4UC9TB326qfjDsRZcuVpyRxf5wTE= X-Received: by 2002:a17:90b:4acd:: with SMTP id mh13mr711419pjb.147.1597376957120; Thu, 13 Aug 2020 20:49:17 -0700 (PDT) Received: from xiaomi.mioffice.cn ([209.9.72.214]) by smtp.gmail.com with ESMTPSA id n26sm7253385pff.30.2020.08.13.20.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2020 20:49:16 -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 v8 3/4] power: supply: core: add wireless signal strength property Date: Fri, 14 Aug 2020 11:46:56 +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 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