From patchwork Tue Oct 25 05:42:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10504 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp828475wru; Mon, 24 Oct 2022 23:00:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7woCgA/TlRj505B/3GhJzFZLtV+NLhlKqfpFxCGRUE8e6l2Y6ONNYVm2vXKB/zWoVPvPTs X-Received: by 2002:a17:902:ec92:b0:186:9fc6:868c with SMTP id x18-20020a170902ec9200b001869fc6868cmr10689190plg.12.1666677646088; Mon, 24 Oct 2022 23:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666677646; cv=none; d=google.com; s=arc-20160816; b=ABdzaaTXIPWV5lEd40uksH75Fuu5xMt2QwGDYhyvzhUV5Jju/k5qemqaDXztX0INiK 5Y9fZ04Y/DGPQrU3TtlVCkHQ941qTVD9JfQnuhqVgYxP3lx29tC6IVW7Yrdqgr0yG1No ZziaVKip2CkWRHj1lGTUUiPmgZ9VN0Y96w7kVf4ur0l+OhTyMt/gbCQTU8S6LuVFF/29 G253GDcmczWPGqI5X6/DdGvK9v+brInOsPAuYIYlmh24SxWg3u8Va+5PQiNfJ+QoHP3P HFvHtuQlbxprTu1chIvkfpm2CwcWlsjcxJmMu40J6ChnS/ujWnAFzGFdQLKhX6bcUW5j cTmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=XIEKHeBnDpf8qnQLc78wkKjbYdk1bbgIcbqYREQemf4=; b=yitzs2kJ0g+MxV8jI3/upQcnATq/1HS2Vf1jVnRqGKNXoN2ngGA1beEx+zGvrgV00x G7AMjJyprVdch/Irb5wy2D7ngMsgtXpa8s2vpmJWzmyFKZnRA68k3XxLwIYMEpdYh7mY xuHxIvOHcVcAU5PuW2xq5+X/8PdQZiNCPVOlPOhGhiIPSv+6HVDjzj00AgHu1Wv2oneL Ml5gQGEj6Qyilp+xpCZgNgsnuXHoXw2xauDdW7Io4bJ6frJOAqn1+smlIl8eUFQnku7M rloFvPqsNlO5lwLNrrWnPS6POnMkcxnm/DWbM2bfxIhgJ0asNiLfaLMifKVAfKVSjVGW YtYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=qAGmpm7e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p5-20020a17090ab90500b001fdd2a56d6dsi9923021pjr.43.2022.10.24.23.00.31; Mon, 24 Oct 2022 23:00:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=qAGmpm7e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230353AbiJYFmw (ORCPT + 99 others); Tue, 25 Oct 2022 01:42:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbiJYFms (ORCPT ); Tue, 25 Oct 2022 01:42:48 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B212C7062 for ; Mon, 24 Oct 2022 22:42:43 -0700 (PDT) X-UUID: 8caf731b86b142259e8db0faf5819e59-20221025 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=XIEKHeBnDpf8qnQLc78wkKjbYdk1bbgIcbqYREQemf4=; b=qAGmpm7edeIP5GS9s7QKsIsBD02FH8I1aboPf4W+deUjzrBZ2228h6VrEkIVTMBsOJfKQCZPPbcLZUeA7wxLgBszocEpmKVM+8GiYAcQeDXP+wtr9FwMYW9XVIOXPLr4EzKRoychbL6c59U/wbHX6fGGqeJCRwuOWVpZWXWDFK4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.12,REQID:18cf1d0b-b721-45d1-a344-55c2f096ec07,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.12,REQID:18cf1d0b-b721-45d1-a344-55c2f096ec07,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:62cd327,CLOUDID:3e3a006d-89d3-4bfa-baad-dc632a24bca3,B ulkID:221025134238KYBXWPNT,BulkQuantity:0,Recheck:0,SF:28|17|19|48,TC:nil, Content:0,EDM:-3,IP:nil,URL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 8caf731b86b142259e8db0faf5819e59-20221025 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 893644; Tue, 25 Oct 2022 13:42:36 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Tue, 25 Oct 2022 13:42:35 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Tue, 25 Oct 2022 13:42:34 +0800 From: Chunfeng Yun To: Vinod Koul CC: Chunfeng Yun , Kishon Vijay Abraham I , Matthias Brugger , , , , , AngeloGioacchino Del Regno , "Eddie Hung" Subject: [PATCH RESEND v3 1/2] phy: core: add debugfs root Date: Tue, 25 Oct 2022 13:42:32 +0800 Message-ID: <20221025054233.9763-1-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747638179242180714?= X-GMAIL-MSGID: =?utf-8?q?1747638179242180714?= Add a debugfs root for phy class, then phy drivers can add debugfs files under this folder. Signed-off-by: Chunfeng Yun --- v2~v3: no changes --- drivers/phy/phy-core.c | 6 ++++++ include/linux/phy/phy.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index d93ddf1262c5..2f9f69190519 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -1204,6 +1205,9 @@ void devm_of_phy_provider_unregister(struct device *dev, } EXPORT_SYMBOL_GPL(devm_of_phy_provider_unregister); +struct dentry *phy_debug_root; +EXPORT_SYMBOL_GPL(phy_debug_root); + /** * phy_release() - release the phy * @dev: the dev member within phy @@ -1233,6 +1237,8 @@ static int __init phy_core_init(void) phy_class->dev_release = phy_release; + phy_debug_root = debugfs_create_dir("phy", NULL); + return 0; } device_initcall(phy_core_init); diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index b1413757fcc3..c398749d49b9 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -205,6 +205,8 @@ struct phy_lookup { #define devm_of_phy_provider_register_full(dev, children, xlate) \ __devm_of_phy_provider_register(dev, children, THIS_MODULE, xlate) +extern struct dentry *phy_debug_root; + static inline void phy_set_drvdata(struct phy *phy, void *data) { dev_set_drvdata(&phy->dev, data);