Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2419390ybt; Tue, 16 Jun 2020 05:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJfRTwO6sKkGvPqhAzKGHJMqcWnFzqrbXzbWD+HnMSN1et74a3A4k0ti5+lMdCAKpD+FGf X-Received: by 2002:a17:906:95c2:: with SMTP id n2mr2463024ejy.339.1592311684629; Tue, 16 Jun 2020 05:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592311684; cv=none; d=google.com; s=arc-20160816; b=C6F9SSei0emoJ0ZWLNQ+SkpGtAzlwcIXujWM8Ur0hQF2k3mDQG4CiMbJ+0hcbNTRiI uuUcQE5Ms2EoiYBPAmrvE2CFNzMqAxJL8LfF8HPGp1GBZcPlrta4XDqH6e3GgpV0NbkI rhcK8vVj3G52XCjLqs4cLXwr3DHRFGYbxLFDW/plrO2r0rWxerS99AZLhka+bdJc6864 ZGFDZrmLTeXKIzF97Nt+ZYb8O3SDCHiwiCsQXYMpvPs0VIMGt052ojiC/4EdGYqochjU Ei60mGt2HxpSGQsIm3EaO3pagDFjS47uuZ3+pG4zgwa3Xfu8e0/oxbxlNfgiO/lQKyyQ In7w== 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=cFT7b6H2LRT9dSPfnxzcUSZBaTbz+EV+Si2bOMAYrIw=; b=fYIx7e6cKFSt8+H15Qw9GkS78cqVtabMlRr72WvbYmdhGV+j+SjuM+R1kqp5hWBuQD TegQJX70nyUGqmmFnOsY8FiwOrTDYpN4OwnpwiazJCDyquzx0D6kkLXPs6eS/XJQBZfa MHmam8mKMgJu+Su1lJ89Ni/uoAaeza+fXuJRsuol4U2Ewk24cV5MhW6J7KtVsLKEbjBG nXBnSdET5GEAbhf55P6J29jqDIgJwD8R0m9n0OIPUkNOSGZugoEpl3eKUgvlk8Jr8P7U Uu4bs7c0/g//roTICtQoQmm+9eJCf4wXIfgKyhg0H7qPujkATazlDialdpkItFJBicYO 1JWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=CVLdvla8; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f19si11244818ejc.31.2020.06.16.05.47.41; Tue, 16 Jun 2020 05:48:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@mediatek.com header.s=dk header.b=CVLdvla8; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728785AbgFPMrL (ORCPT + 99 others); Tue, 16 Jun 2020 08:47:11 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:17214 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728782AbgFPMrL (ORCPT ); Tue, 16 Jun 2020 08:47:11 -0400 X-UUID: 8e5d8c1d343340709e227d0a63e6cc76-20200616 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=cFT7b6H2LRT9dSPfnxzcUSZBaTbz+EV+Si2bOMAYrIw=; b=CVLdvla8BrzOiM9OfMgIjTPXh4mzM2WqEjiOy2mRWxf8ypIYwlqIx8kL8kgdfE4XHVcYVWZPKFInxuYz8A7L7npcT9Qb6Rag7t3JYvVkO066bLMDG6SIkkW8DGcMBTXL/NjEUONSzfypvKeoJQCTqLZImcQB2pwyAER2Myidt1Y=; X-UUID: 8e5d8c1d343340709e227d0a63e6cc76-20200616 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1902203524; Tue, 16 Jun 2020 20:47:07 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 Jun 2020 20:47:03 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 16 Jun 2020 20:47:02 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , linux-mediatek , Shayne Chen Subject: [PATCH 4/4] mt76: mt7915: add support to read per-rate tx power from HW in debugfs Date: Tue, 16 Jun 2020 20:46:13 +0800 Message-ID: <05dcb80b4bac2e274f2b49479d030588f9dba326.1592276165.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <9ae2b6233284b60206e3513f7bf2eb03d2fbd724.1592276165.git.ryder.lee@mediatek.com> References: <9ae2b6233284b60206e3513f7bf2eb03d2fbd724.1592276165.git.ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 81AD79F399CF7952C93F3F0FD4020AFF4A34E91C3EFF498E24B5505F11A4EFE82000:8 X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org SW4gdGhlIHByZXZpb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