Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2788131pxa; Tue, 25 Aug 2020 03:22:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL867g1XaEOT9OP6kviBTzG4Yz7RqR8WoO2dmowZtKSqZ6eS56k4h1KPbWF6vwlR+2Ccyv X-Received: by 2002:a17:906:7d90:: with SMTP id v16mr9728173ejo.27.1598350922163; Tue, 25 Aug 2020 03:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598350922; cv=none; d=google.com; s=arc-20160816; b=nQ0bKZ/Xacln5sh1EVu23qnsHpunl9AVdGxF+2GZpaKwIhGMwUa6TLbC4U7XoLaXV6 4q4xprhGefCjQObTjqp66N8jmiD9uzf3SVJRiTo1uNsc1SZ204cfudhJ4zMHf/PxW3Vb p0vcf/a3KxT8e0miqu8GrUFNWC+71d/ewzWvzNsNu+hEhUXvo5HDcnO72Sret85xCZfC 13Eg9kj0lcPr4jYfF7RLMLazHqfR3TgIDGD2yYwHBO1RamckYWodSWq32iMnz7241z5o 4jb5m4NRW5MTRh3lw+It1NedIF/h9md5fsgn0NDZQYaZ6hyGrdtYkC/cs3q9h/voxsLN tKUw== 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=1yYDGduReawbGncTrfFLyBmV4+qoSFljqqIYwSpLPpY=; b=CxxFdzR6PeszSYICFX/AQPxJ0A9jkv2VA1ND66SXT9Sv3Zi/7FSY8IBWaWhBYhpShY ZSZmVvp3GBnvbMOaSnrHsB7/4leWZIwAnkJa2xKFisE/lLq2xw+5wwIitc9dchl/HMVz 8oUxUpXmackvKQlGRswuZr9UJK6JNueQbLcIVfY3g0nNK/gaO+7w+CsLS5HsGriZ6fP3 ya+YncMarAkh6amz+w4/8n50XUUf5xXssgJH2beciCh97zuZaq4sFsUx9TVo3Qc8CPxb F/9efR/jc5BkOb2ZrDU2awgA5K1eIfpCL/FaLbI6v+QK5Qqsb+n7K9C0zvxr3PI4T4Io UB1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=c9DMslMR; 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 ay9si4748772edb.150.2020.08.25.03.21.39; Tue, 25 Aug 2020 03:22:02 -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=c9DMslMR; 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 S1729829AbgHYKSt (ORCPT + 99 others); Tue, 25 Aug 2020 06:18:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729723AbgHYKSb (ORCPT ); Tue, 25 Aug 2020 06:18:31 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8D46C061795; Tue, 25 Aug 2020 03:18:30 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id kx11so559069pjb.5; Tue, 25 Aug 2020 03:18:30 -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=1yYDGduReawbGncTrfFLyBmV4+qoSFljqqIYwSpLPpY=; b=c9DMslMRvwZIcO0IAfrrs4x3HqgMAnvrS5e+oKSxOePa8sEX4AiTU3GjwITbj8z8jh hLZpQ8QPaLk7E8mPSfav24HXzZJXbQtrIhwiuAOfEOzkfpoKQPxbcnQm0JSkprHcBhKe v1EickWioCyRU2TSwi0WRVGAPkFLu+5WV4wM8D1SG2mDhTpDeesmXxLsqNrDhpBSO0ZH Vc0QCeaHgVnB25iyUAYBC+rrmGna69byppxXKMBnvthpdbnGgug+TlOwDBzkez3rC5Xj oweebkBXvHfrnYX4zCogJwA+0BxldP0Ws8vn8UenRHnMpBuGK1Ok7YLoYvA7tRYgZb0E NT4w== 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=1yYDGduReawbGncTrfFLyBmV4+qoSFljqqIYwSpLPpY=; b=KLIqghgTZrHSy7gjFkIbKR3vIGOhctkZqr0eYk+uoZfXpSK4NrwkTYL8eM4V7RUESd 3BqeAG+wYP+LUE3iS/lPmENeIev9V+Efkkzfodc6uTKEa/I54b6FkxZqSRGd/7pMd7Im 0lcVSAffoO1EI+F+wFjq65O5nY2n0wyRgIOadUwZ02Ej0pLfci0cqpjnF6UWy2TWVuGj qE8F2ee+Gm0myJpgjTVw5OVfgRD6dnIYRVL19VZjidSCJ55xRBViRKS3TqK1FNCNfCS3 Ij+6TH7sXnfKQgNB+nhYBrqlJMCo0XKeBFrt5RgJyMvIwxmYJ44BXy2iaEeXQE8H25fm 7jMQ== X-Gm-Message-State: AOAM532GGFfvIRal09+je+7NULXYV/V+I2X/28pknpW2qBPtCgeQs4b+ Xrn5NspkfqurQwHOjtwLNjA= X-Received: by 2002:a17:90a:df82:: with SMTP id p2mr1058792pjv.55.1598350710415; Tue, 25 Aug 2020 03:18:30 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 03:18:29 -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 3/4] power: supply: core: add wireless signal strength property Date: Tue, 25 Aug 2020 18:16:16 +0800 Message-Id: <4290093486eb640e851bf2f4cdc579676855a479.1598349907.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 2850adbc8c58..c3a547037d07 100644 --- a/Documentation/ABI/testing/sysfs-class-power +++ b/Documentation/ABI/testing/sysfs-class-power @@ -758,3 +758,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 76de6ae199d3..64e6bdd91edf 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -212,6 +212,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 4e161d8961c1..496d1faecdd1 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -173,6 +173,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