Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp662302ybh; Tue, 21 Jul 2020 05:02:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxw4MN5UlHfNDomwopRvJYTovWdcYquoJQsZFX/+N4TH1h4jjwggJg0Nl3k3c+OeAy3lfc4 X-Received: by 2002:a05:6402:1597:: with SMTP id c23mr24635231edv.243.1595332955615; Tue, 21 Jul 2020 05:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595332955; cv=none; d=google.com; s=arc-20160816; b=KjD5XR2xYvwOxoutdaow4UHs0j9sdZV2K2Jt1Mxuolg0tBzFcuocMdFjRlKzbq9apW RWQNucThiRAWL49k7OgfN/9Vyk5MTfxdABOKK1+cQ7zdEz2SoxM3wwosb190dyO0ycrE W/b/4FMgtyLTNIOxIpATSbnZGLKQaTWm0pm4VYnQF3KTdAzBC/eHlUOPZ/dPpTk4v222 w7NH44BZjG+8xsHHQf09RXx1V6Tp+51AOlk6pOU6JYJpt3+z8zlEYBArOjaaL1jz8yn5 LR6CT7cMLJJ1/rrdEt9QEgB76KGOYEMJnGwW2OdE1Ds56U59g03k4D06siVFRzgA+XgP 2w7g== 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=sZlxIlYMO7HwxnRaFGsIzOSb76wV/Tp+2rRqojyDdA8=; b=hc4ryB+ld+tLOBG1Xh1baX26ZWB5RHh81S9wNsMcuRNnQBRMwugZDjWWDkicKn4jw6 dtawuPUs9AwxEGSdTTRQujyUE36p0VRjjAnrNIgY7R5oc5K1zaK3paT76hFZaYB7MXrs 5TOu6IWdoKt22bEw4UKzRfW67q9FIepIamFPmewCgvnMNeJblIcKEnvTWnEvWEohnSvL KYIq2G8Vxza6SvfQ8RjOQmRrlRNbFQ0pDjzfUabFgfwszO9AQJzt+J0UNc3jZS04xlfc kfIKhkhX1VDszYRHAOf9Ag39tDVHINZT4gOxYK3bkKQWOO3R9O1aq6um1SObFuTu37Po lqQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=X5e+iQ0V; 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 cq21si12081407edb.353.2020.07.21.05.02.12; Tue, 21 Jul 2020 05:02:35 -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=X5e+iQ0V; 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 S1729875AbgGUMB6 (ORCPT + 99 others); Tue, 21 Jul 2020 08:01:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729833AbgGUMB5 (ORCPT ); Tue, 21 Jul 2020 08:01:57 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35BB6C061794; Tue, 21 Jul 2020 05:01:57 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d7so1395014plq.13; Tue, 21 Jul 2020 05:01:57 -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=sZlxIlYMO7HwxnRaFGsIzOSb76wV/Tp+2rRqojyDdA8=; b=X5e+iQ0Vdh5ViWxc75pLhsPCdvwjqL+lcF3QagdZv13/sciOVcd4vLRFxNwNzd2+vk y/WHQ7RWtaJDrR2/wLl6jDK/wYojQRCGocZ1FNFhmRXBf+zw0n0QuiyC8v9vtTgffM0H O1ZbuEiV3VSKYszHNmCH6IrQ/E20wAZ7eTvBKcoczoXImXC2rRxzFaY3s8cfMANaRF7q vw5bxXfAgcDflxwNrVzj4gm9npP+XhGzcRjXycZdIrbZ7oU+YJaLVgIt47Qzx4eZJxtt w05YMLhvdgTZ6nvof6z0F5jYSQFyE8F0FxRSU34rTvbjbo5F9UaSAkutZHhsFVo1MyIS EG9g== 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=sZlxIlYMO7HwxnRaFGsIzOSb76wV/Tp+2rRqojyDdA8=; b=qCfu5yk6Amur8f63TvMl28YrlOc63TArHoEIlqyTcDxXiwGWstYZ7NBXYE+TGvcPtx r96cOeSz2reKuvs0VrztHmHaHvzvnm4+7Hl78Te8QTnpybrKUU1XKUXljjraw/jU+3Ov h2K6tJjkyM+tpoXoVmgHP1TQOLQ5jiE+szC7NKhtdUSDQzqbfBPgJVSY23optAktPVhr e3s4AYc+ZGWCyTD7tgepsQso2nJyCapHomE3XdM/IePocM9IEMSKo5kCgAmeOCC2hY/O EmobyW0i6D6vJ9wxxKLwvp84IIr0qouFICG44pLxrtY1NAsZSVeBKDsJV4d2FU+PBhEt 7Z0g== X-Gm-Message-State: AOAM531S0e4cWE/Isk+F4GpVGcbsp1x5borXWCKsXLBRWwVVYkm4R2fH 1/yQEAMQDWjwfB3chCnMji4= X-Received: by 2002:a17:90a:6705:: with SMTP id n5mr4878967pjj.67.1595332916717; Tue, 21 Jul 2020 05:01:56 -0700 (PDT) Received: from xiaomi.mioffice.cn ([209.9.72.214]) by smtp.gmail.com with ESMTPSA id t73sm20542041pfc.78.2020.07.21.05.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 05:01:56 -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 v7 3/4] power: supply: core: add wireless signal strength property Date: Tue, 21 Jul 2020 19:59:41 +0800 Message-Id: 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 | 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 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