From patchwork Thu Oct 15 10:05:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 317766 Delivered-To: patch@linaro.org Received: by 2002:a92:d603:0:0:0:0:0 with SMTP id w3csp300394ilm; Thu, 15 Oct 2020 02:39:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdxY/DQG5/zzY/OrLpHYr/FpnClkk30GTBGh36hJIYzmSRp35ruo3T+CzfmcDh48kIiywh X-Received: by 2002:a17:906:2749:: with SMTP id a9mr3587292ejd.457.1602754757610; Thu, 15 Oct 2020 02:39:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1602754757; cv=pass; d=google.com; s=arc-20160816; b=SN8oi/or0S5PBRwZft7GAtyiD3R590WW5a7pKzS08Zik9RVKfuw/2jJ753c2BiBRa0 gVOskz9Pi09YvPtlM5dqH8xFssgFSPUQlKLZoF+sEKqvtoygZDq9Rt5m7Br+zCJQ+xn8 /UW/mOotQUdcM6Us5wzuJaf55b0xhX7HvPfvYqN/Jw0TVz3dsCrP/1hYP94/6oS+IryX WwhVjJK6pYS6QAr6+TWODUPe6dpzKZjzL44LfutAjLyVtJjgod44aidguyZYIbH0p2iV Z48LKbmj7ihZ8lSnqqaBNv66oW9NbQEhmxC3mUwMniJ/7cLHELQBMhHlYwDhHCun6zWL WPag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature; bh=GUdeqUq5GAt7PsNCnX8aMlmcWV10X+BYGxOmVmDHXZ4=; b=zkT4TPM4fZn4zYTZsbdzVcyr17p2YmETppi3WRJASojYQcAt12UOtA9bwtt271XIQO ANmy7+PIdbMOOo/x21uDzOBe68VvGPdtjJrUHOf+rAFS43q1GXh6y9yOFiUHaiZ3THeR UUFIQiSYIhcbQHhGZqkXhPKdhPvagnQ3Z7czmGxEfEBmEP163JDNojT2G+hf+InZuvsR k7s4Uh0yIIYjTuvU+eAzy1leRnON5widgm7jmmeCP9Q9+pWyyhcOJGh7/w2t4say3aSq GYJKw0d9mcyLCCF7kqbJaCrENwWw53c/2FPCxqee6zuILs9Xbx2qpGP/qhlW6S6+LSK/ 7o8A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=sBiyFaai; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id lr11si1850004ejb.116.2020.10.15.02.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2020 02:39:17 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=sBiyFaai; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E01CA81281; Thu, 15 Oct 2020 11:39:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="sBiyFaai"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DDCE38158B; Thu, 15 Oct 2020 11:39:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::61b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7DE95806C5 for ; Thu, 15 Oct 2020 11:39:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GTrHdSSVxAwvj7aSdJn1k9wRY+59sU0Z5cwMmNHlF/Cy/aboGeMVoHjr4XQWXbj0syZWfI0vj0dgcrjER80gK9MTL1WgCMehjYjkc7GhocLO/RsYtjGQachX3dsXXDEvhtNITuLyH+Ht5T6LamFEEKWwsJ3oaEKLRuyx0BNCK0AcSXcz+7212SSIfz6EUMLDiOWm4f2L1NZQij0jTQznQQZT+Lsc6HVfnPjQDEb1jRvPQ5NyOcy+AgIqmLbqP2sP8CWuZQCduR9GKuEenmIzker2I3aAOO14DZv1b3XjNoffjIhVYAGHfh6r81WJw7d3SaKDX1JfcfIg0hDxPDriJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GUdeqUq5GAt7PsNCnX8aMlmcWV10X+BYGxOmVmDHXZ4=; b=iSs3n7ad4vuMYx2NCVKhg6ukCsWCvZTqvPISyl3jur36IEtSNy/0y+gh+YiGd5Z9vVnHaVysOpfOtmlODgcmNpAFvX1BmoAbcOvhhpNRikbDT5tRwPk0WMsWKalHgoMh6h87jtpQU9orJuQHh0VMKFhGvq2Q/Pkfc2dc8c5l0anEIY9V9oXHQdf9pLLRuJnRdRI3X9kzehECWDdve9FviqGNo5DXDMDK0YughI8UI0zHFPe0U55PY8bDv/0/Ajz5ZlRbpt0H315mZ1CwQcbVtjxBkvOIfbBZhq0f42Bhim+GWHpDucskJPeMEIljlRj40VdxD+rYtVhCFer5XvFryA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GUdeqUq5GAt7PsNCnX8aMlmcWV10X+BYGxOmVmDHXZ4=; b=sBiyFaaieU9KdW6EAVDqahxEE+4lFQrtRvWUoAM4uEukYfc7hR1rJm2yARt1aU+JZOO+7dx9tAHqR6x6PK8TUIN1bn965b6rTwtNS/CRD2qsArxmrKhp1oOm2Mqw/W0CzqP8dVgv1X3I6OKBX8qObytnkaIP+d8QLGeKRlhdGbM= Authentication-Results: denx.de; dkim=none (message not signed) header.d=none;denx.de; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB7050.eurprd04.prod.outlook.com (2603:10a6:10:129::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.24; Thu, 15 Oct 2020 09:39:11 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::35c5:8c71:91f3:6bc6]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::35c5:8c71:91f3:6bc6%12]) with mapi id 15.20.3455.031; Thu, 15 Oct 2020 09:39:10 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com, trini@konsulko.com Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Peng Fan Subject: [PATCH] phy: nop-phy: add clk bulk Date: Thu, 15 Oct 2020 18:05:58 +0800 Message-Id: <20201015100558.2476-1-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR0601CA0002.apcprd06.prod.outlook.com (2603:1096:3::12) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR0601CA0002.apcprd06.prod.outlook.com (2603:1096:3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Thu, 15 Oct 2020 09:39:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9cc72032-892b-4f0b-38b3-08d870ee2b64 X-MS-TrafficTypeDiagnostic: DB8PR04MB7050: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:212; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tE8j9nL7yomgh7pkZR0tqgqLg5BMTA7He3fAmgqMgM+mE5Z2HlcBKI+wIPg6wQZEkI/xS4L5lKBRos7JQlkzPK9uBDmXSfQr97vmtfvITjywwWJ4xqYcQ942SVZPu1W8vw24aaEIf4ns9N39alHjxItQR7VqDZd4clyIW6zhf5zOlQw9Fh3AkuNH3D/Xxxei+EabFbZH3YxltPJDyd5cQQ/oVVhu6A65vvtdy32e/1VFT8wLafploKgAeC5uuAH89RMXNFbG9ErGaFZE968DQrr0Az01IoZABx9gphca8lwaydLg/MrsvhC7XDVfzsRMhRzf3IgM2dibjMrtVhwB6mNbyCarUoeT9PR+X8teB25NAb/oSSOasIt3Ye0Vurjn X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(346002)(376002)(136003)(396003)(366004)(6506007)(86362001)(8676002)(6486002)(2906002)(478600001)(52116002)(956004)(4326008)(6666004)(34490700002)(1076003)(2616005)(44832011)(36756003)(6512007)(66476007)(8936002)(186003)(316002)(16526019)(66946007)(66556008)(5660300002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 7iMdveVxG7gHL3wrInRTbpq6lhs8kcjQbbpnK7dqzra6bJ9GvqKocZyxbLnYkGbMjmu+NPPpvRuWSS1tGFZTBkP0PjkwG/Sx4ltp+X6H/JnFRyiaHgIsU9V2xbcbGeAhMCZ6f4t0wq2YWXKzsKSBV+BWO3IVtVeja4Y4Qz8U9nTfbwNkU6f8hxpYfuTg2klYq5d6ORCD4B6DC5UY70z87wpWwZE5N0wx2t7qUP99Nw6lYBAWDMW4rJacynQpOEippdh//7KV0z8CWGyn9vzFXQgjed12aMApi8e6v7TUrjwqtlnTlKCRRJSTO8qyosSUnJ9RhIGmGKK6OCw8guXnSi8paLOlDpTsRwdT9FJQt9wxMOrH+JeqJ3ik+YgkyFYGdtZLEhZqMzyBQxTmhCbsEH3gLbdQTYUXnHNP5iHsqZhCh8zi03hM6bTkK2L7GsRrEeCuAEANqq1vQaYhYhjVhlMvy9yYfsXzE68zEvPZGVl1PilD5bYrOXxD3/VclUWUfI3t92k8i8dcOf4Xth84SXR8t2sZfbD2YiquS0Y5TukpFrsusKeOtFSbosf7UupQsVjTbB8j7TNdjGphcDykYknv27kk5/Bgc/g2ECBoI0VQDVwBGTsiPC06GGNIC4kaCZPGAze7/3mQIl3xabLYGg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9cc72032-892b-4f0b-38b3-08d870ee2b64 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2020 09:39:10.8469 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZLb9RxLLckypA566yzoWssseOlKHEVVzAuHmvou1/ILJgEnKlJ6vEV1pXkmlvJuixB09RQLissVJKKOY6kUkfw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7050 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add clk bulk for nop-phy driver. Signed-off-by: Peng Fan --- drivers/phy/nop-phy.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) -- 2.28.0 diff --git a/drivers/phy/nop-phy.c b/drivers/phy/nop-phy.c index a5eed20f3f..fbfbe33e4e 100644 --- a/drivers/phy/nop-phy.c +++ b/drivers/phy/nop-phy.c @@ -4,17 +4,49 @@ * Written by Jean-Jacques Hiblot */ +#include #include #include #include #include +struct nop_phy_priv { + struct clk_bulk bulk; +}; + +static int nop_phy_init(struct phy *phy) +{ + struct nop_phy_priv *priv = dev_get_priv(phy->dev); + + if (CONFIG_IS_ENABLED(CLK)) + return clk_enable_bulk(&priv->bulk); + + return 0; +} + +static int nop_phy_probe(struct udevice *dev) +{ + struct nop_phy_priv *priv = dev_get_priv(dev); + int ret; + + if (CONFIG_IS_ENABLED(CLK)) { + ret = clk_get_bulk(dev, &priv->bulk); + if (ret < 0) { + dev_err(dev, "Failed to get clk: %d\n", ret); + return ret; + } + } + + return 0; +} + static const struct udevice_id nop_phy_ids[] = { { .compatible = "nop-phy" }, { } }; static struct phy_ops nop_phy_ops = { + .init = nop_phy_init, }; U_BOOT_DRIVER(nop_phy) = { @@ -22,4 +54,6 @@ U_BOOT_DRIVER(nop_phy) = { .id = UCLASS_PHY, .of_match = nop_phy_ids, .ops = &nop_phy_ops, + .probe = nop_phy_probe, + .priv_auto_alloc_size = sizeof(struct nop_phy_priv), };