Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp778800lqd; Wed, 24 Apr 2024 17:27:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUKp0UAcAzBbI9F3RBvktglr07LJT9P1+OflJburBuNZ+QQxXhPk/RUtJl0/b6+NdWe6HMIOZfKM+ru1uu8VgzOIODxXGzHOOJ80Mq9Vg== X-Google-Smtp-Source: AGHT+IETjqHQznzsb1PZGVP+4BiZsbMSnKcswwaim+UTEDvRSwh4jXnKpIFMiTDhtX5Zw0sEZtxH X-Received: by 2002:a05:6402:3454:b0:572:2f14:9bd with SMTP id l20-20020a056402345400b005722f1409bdmr2623610edc.30.1714004849809; Wed, 24 Apr 2024 17:27:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714004849; cv=pass; d=google.com; s=arc-20160816; b=Ms6H20rCsVgnKEtTsRYSA/sogMmYYsUNv2W7uPnzgY9c/hHk0TxMIr7mAYDBztv3Qx 2FKiaaLgZpiDcjUiEQqv8HdLjTRJfxtV3rCerNbLePB8U22UJY0I4r+Ad8g/nw/nfnLx zZGg1piLV9/vL1UEvnyLQLbMKWYxz5pO6F0xmh0VVXUybPpxPCWFy8PhXBcQiFgbvU1+ UOy3qOaHR8fNW1ClzSAO9sNzb92GwZj3Eg9XoVEPOfu1g7Zw9raLqR8iCav4LI9T5iJu Tz80OkzKwqRNvjv99Q6BjAKG31abrZY5Kn7jdQiWZi9I7Ar8CRYw2O+YT7m2spNFnPmF v1WA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=vWJOzdW6/H5XbrbPhX0RJtUgxr66uLfJYu7XRqi6vgk=; fh=cpD+ehYTg5Kkp9rm1NbzIZqwMaDwDybTA/27fbyX18M=; b=trebJ/7xr7giP6dpxvYdnZyOYIIs/mxdlFMNaivtAnmUj+6/ggJ/pdTfSkXPpaNGdL U/rbSzVXuWobVGP29/NF/POrybVvHtfn5IyeSMcKELRRtxyQx5vqDOukmkK0xbUhMjNj /OnnDcIjdjHAyQ+Vshpkm/bc0XTBd9CNBfmFbmYg9vKamkzLKtmp7AyAW1tDk61fvDY1 vCV9reUy8sDN2OnBCQC0O3xltUW8ysVcLR5q+EMPInsfBp88xqaXgCxSsUlfLbm+NxLi +YNgK1BB7kdTPl98qSQ8mdI9DlPR+biIAPsg4vZZiqdMt6TknXnVbPbXH0FzXkPZUMV4 YQpA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=FiZ124UI; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-157883-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157883-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g2-20020a50d5c2000000b005722434f632si2496426edj.565.2024.04.24.17.27.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 17:27:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157883-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=FiZ124UI; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-157883-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157883-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5B6291F24EB9 for ; Thu, 25 Apr 2024 00:27:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DF1D10A26; Thu, 25 Apr 2024 00:26:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="FiZ124UI" Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.207]) (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 D58D981F; Thu, 25 Apr 2024 00:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.144.207 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714004813; cv=none; b=nikhsowRW6jWKUOgBfqxngqW9FwdVb8RVhSeck1zi6YQuG/UBW9OgpwO36dQBxLf7XSso3rKv3qhS6K4Vj+qeseol/s1M0PTNfW5cyC7IPcDqsB3rfXwZiFWt8bpfKwoL3vbyhXbFvW60VAjSDcrPMoRxS/5Cx3nRiFXm8dvTCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714004813; c=relaxed/simple; bh=F1S87CksO9YcMorfhmRvrNBLU5zsOwiltZkftyOz8f0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kDe+pZKZTtFiDc+XG7DSPgPzNTrMWzoZl8aw+hR5YLHgso2gPGRg2RJE41SL6MLl7qY6yK3YnI9w37ZYItvdujzWfWtikqCoFJQDi4B12CuKpz4X6oVgpGJCIjpfiI8aaDxjFhvj5aRY+EshdJaKgdaiqrEGZcEpk44VuL2FHeE= 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=FiZ124UI; arc=none smtp.client-ip=192.19.144.207 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 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 AF56FC000C85; Wed, 24 Apr 2024 17:26:44 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com AF56FC000C85 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1714004804; bh=F1S87CksO9YcMorfhmRvrNBLU5zsOwiltZkftyOz8f0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FiZ124UIT6v8GQZ6pbi0LVPT++DjpeKtPSETWqf7Af18UC9POLdwVidzRDKSx6kXP l2JcRbfyVR8vN4fTdkmZiP6qwWFfHZT8f6r5nCFAjK5V5e7bKMyInGd4M5FQOFeh0o VkKOX+g2mgOfPJI++33OwzQIWqYeCXCIGfZzEaV0= 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 B80CB18041CAC6; Wed, 24 Apr 2024 17:26:42 -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 v2 1/4] i2c: designware: Create shared header hosting driver name Date: Wed, 24 Apr 2024 17:26:39 -0700 Message-Id: <20240425002642.2053657-2-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240425002642.2053657-1-florian.fainelli@broadcom.com> References: <20240425002642.2053657-1-florian.fainelli@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit We have a number of drivers that reference the string "i2c_designware" towards two goals: - ensure their device gets bound to the i2c_designware platform_driver - create a clock lookup reference that matches the i2c_designware instance number for the i2c-designware-platdrv.c driver to be able to lookup the input reference clock Since this string is copied in a bunch of different places and since it is possible to get this named wrong (see [1] and [2]) with unintended consequences, create a header file that hosts that define for other drivers to use and all agree on the correct name to use. [1]: https://lore.kernel.org/all/20240422084109.3201-1-duanqiangwen@net-swift.com/ [2]: https://lore.kernel.org/all/20240422084109.3201-2-duanqiangwen@net-swift.com/ Signed-off-by: Florian Fainelli --- MAINTAINERS | 1 + drivers/i2c/busses/i2c-designware-pcidrv.c | 3 ++- drivers/i2c/busses/i2c-designware-platdrv.c | 5 +++-- include/linux/platform_data/i2c-designware.h | 11 +++++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 include/linux/platform_data/i2c-designware.h diff --git a/MAINTAINERS b/MAINTAINERS index 2d5acd6d98c4..da1b39df2b94 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/platform_data/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..32d6f338a1ea 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -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(I2C_DESIGNWARE_NAME "-pci"); 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..8aa2bf274d78 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -22,6 +22,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/platform_data/i2c-designware.h b/include/linux/platform_data/i2c-designware.h new file mode 100644 index 000000000000..e385b6d70a04 --- /dev/null +++ b/include/linux/platform_data/i2c-designware.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef __I2C_DESIGNWARE_PDATA_H__ +#define __I2C_DESIGNWARE_PDATA_H__ + +/* This is the i2c-designware-platdrv.c platform driver name. This name is used + * to bind the device to the driver, as well as by the driver itself to request + * the input reference clock + */ +#define I2C_DESIGNWARE_NAME "i2c_designware" + +#endif /* __I2C_DESIGNWARE_PDATA_H__ */ -- 2.34.1