From patchwork Fri Jul 26 18:17:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 13743037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA225C3DA49 for ; Fri, 26 Jul 2024 18:20:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UB2yJwdnYb2P4da/POGQoMfTHp7V1lBWEjlzymwP8HU=; b=0edkyPFuJD1EFy8ST6b+Iruncc N3tXG50UkYqPNfCl4YNv9b2h4ACF4Su7P7kmMqKkIjwbBXvmeEL4Zyxusfp0ddJgceP5ZPL4S+fY5 wFbJnLIptE2bNRWmI354TjXykQu6WVExcpqt9f/1Kf/Eb+tL+4KMXUHUkJQzyxMuw2t9CIdki44ob eSSvKezoPITTNOWPgngKUSg/aCD44ra4a6Fg08IP3WF/flUbaXopjEww2hnAV5eAm2TN+BmhbyB10 1X8A8STM5kWWl0ygnbcfdJd6ygKUdN2GzbvWBuDRf6PTQKZNi9GxPlknnV55EPkjbRpMNOWzKWiU9 ekIOnM9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPYf-00000004eOA-0mlU; Fri, 26 Jul 2024 18:20:49 +0000 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPVw-00000004dM1-2HqS for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 18:18:03 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2DEEDC0008; Fri, 26 Jul 2024 18:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1722017878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UB2yJwdnYb2P4da/POGQoMfTHp7V1lBWEjlzymwP8HU=; b=V4plbe+JHBZ+BcsSSbMU3fD9SNLkG2/Xq0mSl2tN4CoE9T1+Fk2dKc/FeXqPhuq/Gfqg+Z BEbxnR4Yp5WUThk2P4kv8TLW7wQqzZzt5/7AS0URzoSC36hPZw2Pwb/fQ7p9/Dk2Sbe7ON leZ94Xgyf4TmW4TUTz3oCbP8pqEUzSbXP5TS9I3kOq4jqCZfzC72c0rDIcIp01+0uGjuoa rSSpA543jj9t5RR86KhDTafRh4mArEVIrU1fst/yc+vqFCr/UxVL8VM63SicJbDIRmy3yr eQKC3u7loCRRXtMu5uiJ94GuLUm7UNlMIkaQg5HyoxHO6xl/0Lxs6W+ddyj9cg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 26 Jul 2024 20:17:54 +0200 Subject: [PATCH v5 06/12] usb: cdns3-ti: grab auxdata from match data MIME-Version: 1.0 Message-Id: <20240726-s2r-cdns-v5-6-8664bfb032ac@bootlin.com> References: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Mathias Nyman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman , =?utf-8?q?Gr=C3=A9gory_Clement?= , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebru?= =?utf-8?q?n?= X-Mailer: b4 0.14.0 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_111800_946808_F362C514 X-CRM114-Status: GOOD ( 13.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Current code uses the global `cdns_ti_auxdata` variable as auxiliary data passed to of_platform_populate(). Use match data to store a pointer to auxdata. Current behavior is not changed; it allows future compatibles to provide different auxiliary data. Signed-off-by: Théo Lebrun Reviewed-by: Roger Quadros --- drivers/usb/cdns3/cdns3-ti.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c index 618fba5fa2bb..159814dfc856 100644 --- a/drivers/usb/cdns3/cdns3-ti.c +++ b/drivers/usb/cdns3/cdns3-ti.c @@ -87,18 +87,6 @@ static inline void cdns_ti_writel(struct cdns_ti *data, u32 offset, u32 value) writel(value, data->usbss + offset); } -static struct cdns3_platform_data cdns_ti_pdata = { - .quirks = CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE, /* Errata i2409 */ -}; - -static const struct of_dev_auxdata cdns_ti_auxdata[] = { - { - .compatible = "cdns,usb3", - .platform_data = &cdns_ti_pdata, - }, - {}, -}; - static void cdns_ti_reset_and_init_hw(struct cdns_ti *data) { u32 reg; @@ -142,6 +130,7 @@ static int cdns_ti_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *node = pdev->dev.of_node; + const struct of_dev_auxdata *auxdata; struct cdns_ti *data; unsigned long rate; int error, i; @@ -203,7 +192,8 @@ static int cdns_ti_probe(struct platform_device *pdev) goto err; } - error = of_platform_populate(node, NULL, cdns_ti_auxdata, dev); + auxdata = device_get_match_data(dev); + error = of_platform_populate(node, NULL, auxdata, dev); if (error) { dev_err(dev, "failed to create children: %d\n", error); goto err; @@ -256,9 +246,21 @@ static const struct dev_pm_ops cdns_ti_pm_ops = { SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) }; +static struct cdns3_platform_data cdns_ti_pdata = { + .quirks = CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE, /* Errata i2409 */ +}; + +static const struct of_dev_auxdata cdns_ti_auxdata[] = { + { + .compatible = "cdns,usb3", + .platform_data = &cdns_ti_pdata, + }, + {}, +}; + static const struct of_device_id cdns_ti_of_match[] = { - { .compatible = "ti,j721e-usb", }, - { .compatible = "ti,am64-usb", }, + { .compatible = "ti,j721e-usb", .data = cdns_ti_auxdata }, + { .compatible = "ti,am64-usb", .data = cdns_ti_auxdata }, {}, }; MODULE_DEVICE_TABLE(of, cdns_ti_of_match);