From patchwork Tue Apr 23 23:36:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 791326 Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AC002D047; Tue, 23 Apr 2024 23:36:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.144.205 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713915393; cv=none; b=aR84bCw/Dev2rfRAnlV5ehNfMhHfVs5+3kgf0gx3bY6dRkqmoFY9DbZZfXA471k3RpNC/JQDQ2QFsJcnrPNNsLqRsJtaSIIfXFfbZewpnFizx/zBNseYX3JW1YaIQQRBekapC83qDFgwMLUcr71uX974H/vbfDZf8c3kkC5zieA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713915393; c=relaxed/simple; bh=yUyzNylz3PSmIe/qPAuooBMrsNyvy/UTp32g/0i9WEw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fyc0S4OAvXAybG9LPnOosqwH/JRqh5LwonvfzuBFGh4G1t6u6H+uHlUlE2uOTUBS4E/F91nbD5L3mp3QjURcT7JqB+2DpRxSB4L6r/omU3ViWfWcDnY11xiylF8iKP1Cnzd/1NklCLqtizPZc0R0SbgTX/dy4Putly0ovgg2G4o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=pl4ccOUs; arc=none smtp.client-ip=192.19.144.205 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="pl4ccOUs" Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.36.132.253]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 0B92DC003AB9; Tue, 23 Apr 2024 16:36:29 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 0B92DC003AB9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1713915389; bh=yUyzNylz3PSmIe/qPAuooBMrsNyvy/UTp32g/0i9WEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pl4ccOUsQEP38NMNbod8XTzSPWx96JXcm4+r+fDZ5+Jjajl7IKrwgLEaYqA7DHfmN DhO+LyQQ0JD6LBOx316xVBWRkE5SuEtyjxUqzYZFzG1N5jzyGQzQwdcc79DvIYKl1e 9ZB+xxOKiofC3g60cT22gzw8a2HOVREDn4MInQz0= Received: from fainelli-desktop.igp.broadcom.net (fainelli-desktop.dhcp.broadcom.net [10.67.48.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPSA id 1420518041CAC6; Tue, 23 Apr 2024 16:36:27 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jan Dabros , Andi Shyti , Lee Jones , Jiawen Wu , Mengyuan Lou , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maciej Fijalkowski , Andrew Lunn , Duanqiang Wen , linux-i2c@vger.kernel.org (open list:SYNOPSYS DESIGNWARE I2C DRIVER), netdev@vger.kernel.org (open list:WANGXUN ETHERNET DRIVER) Subject: [PATCH 1/4] i2c: designware: Create shared header hosting driver name Date: Tue, 23 Apr 2024 16:36:19 -0700 Message-Id: <20240423233622.1494708-2-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240423233622.1494708-1-florian.fainelli@broadcom.com> References: <20240423233622.1494708-1-florian.fainelli@broadcom.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 We have a number of drivers that reference the string "i2c_designware" yet this is copied all over the places with opportunities for this string being mis-used. Create a shared header that defines this as a constant that other drivers can reference. Signed-off-by: Florian Fainelli --- MAINTAINERS | 1 + drivers/i2c/busses/i2c-designware-pcidrv.c | 5 +++-- drivers/i2c/busses/i2c-designware-platdrv.c | 5 +++-- include/linux/i2c-designware.h | 7 +++++++ 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 include/linux/i2c-designware.h diff --git a/MAINTAINERS b/MAINTAINERS index 2d5acd6d98c4..d5e10c747f65 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21438,6 +21438,7 @@ R: Jan Dabros L: linux-i2c@vger.kernel.org S: Supported F: drivers/i2c/busses/i2c-designware-* +F: include/linux/i2c-designware.h SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER M: Jaehoon Chung diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 9be9a2658e1f..948669265375 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -27,7 +28,7 @@ #include "i2c-designware-core.h" #include "i2c-ccgx-ucsi.h" -#define DRIVER_NAME "i2c-designware-pci" +#define DRIVER_NAME I2C_DESIGNWARE_NAME "-pci" enum dw_pci_ctl_id_t { medfield, @@ -425,7 +426,7 @@ static struct pci_driver dw_i2c_driver = { module_pci_driver(dw_i2c_driver); /* Work with hotplug and coldplug */ -MODULE_ALIAS("i2c_designware-pci"); +MODULE_ALIAS(DRIVER_NAME); MODULE_AUTHOR("Baruch Siach "); MODULE_DESCRIPTION("Synopsys DesignWare PCI I2C bus adapter"); MODULE_LICENSE("GPL"); diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 4ab41ba39d55..dc335a22546b 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -480,13 +481,13 @@ static const struct dev_pm_ops dw_i2c_dev_pm_ops = { }; /* Work with hotplug and coldplug */ -MODULE_ALIAS("platform:i2c_designware"); +MODULE_ALIAS("platform:" I2C_DESIGNWARE_NAME); static struct platform_driver dw_i2c_driver = { .probe = dw_i2c_plat_probe, .remove_new = dw_i2c_plat_remove, .driver = { - .name = "i2c_designware", + .name = I2C_DESIGNWARE_NAME, .of_match_table = of_match_ptr(dw_i2c_of_match), .acpi_match_table = ACPI_PTR(dw_i2c_acpi_match), .pm = pm_ptr(&dw_i2c_dev_pm_ops), diff --git a/include/linux/i2c-designware.h b/include/linux/i2c-designware.h new file mode 100644 index 000000000000..f20240ac89c4 --- /dev/null +++ b/include/linux/i2c-designware.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef __I2C_DESIGNWARE_H__ +#define __I2C_DESIGNWARE_H__ + +#define I2C_DESIGNWARE_NAME "i2c_designware" + +#endif /* __I2C_DESIGNWARE_H__ */ From patchwork Tue Apr 23 23:36:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 791325 Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B223F524B1; Tue, 23 Apr 2024 23:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.144.209 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713915397; cv=none; b=QkoOLTqHYGxiVgdh2bGTL1TNnvxtBVfb0yAUSLFOjDz/DjYzpKoVp3gaqrTKZ6x7So0GsnrUhCVeTKJopTHcnUTGr3JIsGnl0lIrzuD11K0QSStszDMdi5T+mg2JX5bIPQOCyuLG+dQ8TKDAWS+cCoNxpnz+h2O6PTdtVL7hCMw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713915397; c=relaxed/simple; bh=PXRU+ibr6SKuP9QT0b3EPSKEz0aQPxjM2+Jkz/k9tiI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AaExoh0IrZ7E5i482rmi61CRJUmX3XxzcFy29OGk38Djd3ji+fBgy6dCUBtlWqH67EqKeHnVFI8Yd3GpoymqcCVsziPjgl3gVn4oEAGdb4k4vGkNJYpEiSWKiiyT5qZ/iG9F51reUhh1MKmn0/CmuTvOQvj+URdmrwpquLbmYK8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=jCIos/7x; arc=none smtp.client-ip=192.19.144.209 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="jCIos/7x" Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.36.132.253]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 40E2EC001504; Tue, 23 Apr 2024 16:36:29 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 40E2EC001504 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1713915389; bh=PXRU+ibr6SKuP9QT0b3EPSKEz0aQPxjM2+Jkz/k9tiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jCIos/7xOtGTYAOZx0IIQqYVf9p1N7LhoeumlxUOyoTl3PzYGiWVeS1GoEar44rA3 TzwwGsnloBRZ/RCfFIGCO3jH0XKwxxcFWf8dfz//IwbjUeELy+ULkcg326q8GCF21M +BXSS2aAJ9OWYYUKkPAoJA0gADHoB6Nja4tGs9JY= Received: from fainelli-desktop.igp.broadcom.net (fainelli-desktop.dhcp.broadcom.net [10.67.48.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPSA id 4FD1F18041CAC7; Tue, 23 Apr 2024 16:36:27 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jan Dabros , Andi Shyti , Lee Jones , Jiawen Wu , Mengyuan Lou , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maciej Fijalkowski , Andrew Lunn , Duanqiang Wen , linux-i2c@vger.kernel.org (open list:SYNOPSYS DESIGNWARE I2C DRIVER), netdev@vger.kernel.org (open list:WANGXUN ETHERNET DRIVER) Subject: [PATCH 2/4] mfd: intel-lpss: Utilize i2c-designware.h Date: Tue, 23 Apr 2024 16:36:20 -0700 Message-Id: <20240423233622.1494708-3-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240423233622.1494708-1-florian.fainelli@broadcom.com> References: <20240423233622.1494708-1-florian.fainelli@broadcom.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Rather than open code the i2c_designware string, utilize the newly defined constant in i2c-designware.h. Signed-off-by: Florian Fainelli --- drivers/mfd/intel-lpss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index 2a9018112dfc..4d2c5250046f 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -116,7 +117,7 @@ static const struct mfd_cell intel_lpss_idma64_cell = { }; static const struct mfd_cell intel_lpss_i2c_cell = { - .name = "i2c_designware", + .name = I2C_DESIGNWARE_NAME, .num_resources = ARRAY_SIZE(intel_lpss_dev_resources), .resources = intel_lpss_dev_resources, }; From patchwork Tue Apr 23 23:36:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 791324 Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B85A252F9A; Tue, 23 Apr 2024 23:36:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.144.209 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713915401; cv=none; b=YrHGDMFl1tle3oFeQS6q8Rw4nSu2s5TFxJ3REN9y3HZKw5ICdMfT7jCXelvDBlSC3u3FBCqWk5qoKQls/6/BBvZzbv//EDIaTBv+ge0XWcp7QSlJI9D78WPcm/qvhCfnBPn/7mQO8AgOKAoxY3m7TtVTTQk0f4Eg1WPJYnVbGKw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713915401; c=relaxed/simple; bh=6m6y84bE3islwvb0CpCXCMzujbpcP8U/mUF+/NKShjU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mTWHIiFomoSGH4Y5W+PRR4ZcPRneDT7RVhDgtoqvbHnJeNYhdgNMe07Qb0gePgvmn3PpVdJCmkTWeBilkpQN+2R/BNTCUhSodhsVrH4cTfgb2HUjYb6I/F0O30wlxeeXl1rsRAgz1jV3bRmOhG3J1Y07jK3VYNVOOfwIhRAVNVE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=j6yl5ios; arc=none smtp.client-ip=192.19.144.209 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="j6yl5ios" Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.36.132.253]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id BE63BC00150C; Tue, 23 Apr 2024 16:36:29 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com BE63BC00150C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1713915389; bh=6m6y84bE3islwvb0CpCXCMzujbpcP8U/mUF+/NKShjU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j6yl5iosGqrvKQFVc4HdP5EsxMr2SAHBnC3Drw+JRixatFWf/bhjklr2IW/PYE+An UnMfQzGZfqVuxZScxJgqTM4SE1tHVZSDJlbXSDxshsApAqfgZjaWx+zAZcjHyg/OjO 0i2utPIZdSZtR5AgdWYxt/uE+EEHHN8KNnJAA9Rw= Received: from fainelli-desktop.igp.broadcom.net (fainelli-desktop.dhcp.broadcom.net [10.67.48.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPSA id C786718041CAC6; Tue, 23 Apr 2024 16:36:27 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jan Dabros , Andi Shyti , Lee Jones , Jiawen Wu , Mengyuan Lou , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maciej Fijalkowski , Andrew Lunn , Duanqiang Wen , linux-i2c@vger.kernel.org (open list:SYNOPSYS DESIGNWARE I2C DRIVER), netdev@vger.kernel.org (open list:WANGXUN ETHERNET DRIVER) Subject: [PATCH 4/4] net: txgbe: Utilize i2c-designware.h Date: Tue, 23 Apr 2024 16:36:22 -0700 Message-Id: <20240423233622.1494708-5-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240423233622.1494708-1-florian.fainelli@broadcom.com> References: <20240423233622.1494708-1-florian.fainelli@broadcom.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Rather than open code the i2c_designware string, utilize the newly defined constant in i2c-designware.h. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c index 93295916b1d2..c601eea164f1 100644 --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -571,8 +572,8 @@ static int txgbe_clock_register(struct txgbe *txgbe) char clk_name[32]; struct clk *clk; - snprintf(clk_name, sizeof(clk_name), "i2c_designware.%d", - pci_dev_id(pdev)); + snprintf(clk_name, sizeof(clk_name), "%s.%d", + I2C_DESIGNWARE_NAME, pci_dev_id(pdev)); clk = clk_register_fixed_rate(NULL, clk_name, NULL, 0, 156250000); if (IS_ERR(clk)) @@ -634,7 +635,7 @@ static int txgbe_i2c_register(struct txgbe *txgbe) info.parent = &pdev->dev; info.fwnode = software_node_fwnode(txgbe->nodes.group[SWNODE_I2C]); - info.name = "i2c_designware"; + info.name = I2C_DESIGNWARE_NAME; info.id = pci_dev_id(pdev); info.res = &DEFINE_RES_IRQ(pdev->irq);