Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1489717lqd; Thu, 25 Apr 2024 18:27:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVCnX5SYaugh5AGpeJRWFb8RhhTv2mdnNCO4Wg0amD9fuYJjeoCgoYKPlPNuVS3wazghiP76A/dmjHAR/BZ52lqlBdDEzc5xGZLXsXnFA== X-Google-Smtp-Source: AGHT+IHIcOHIEQ26ZowJr1ILjXDosEita0NWNWVBOQWOI5G+Epz2iKfP4daB0vHYt5i28xKjOzag X-Received: by 2002:a17:903:24c:b0:1e4:ddcf:5095 with SMTP id j12-20020a170903024c00b001e4ddcf5095mr1767294plh.8.1714094843232; Thu, 25 Apr 2024 18:27:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714094843; cv=pass; d=google.com; s=arc-20160816; b=GmQ88jQIWNRBYM+swHAJ9EcsxkFm5vSZm44XlU/mCQASeQjmt64zRt2I+owthSCsD6 gvJWNW/OacAtiruTQJDOktXbBmcMHP0M9tvE61Cbk6GQAruWkwCSV5FzILANAAcRGMU3 yw8U7iqruEnvl63YYFnVkt8wtcy05CpG8L5IkF3Se9q41jMk80fXj247Xwrh2bncXVfr DiPsl30Kabl7CHOPUjouJcpkltGKGtDbELkPNHjvAXcFfEA9wCmZKDq5kQG96+iaJzC8 +RntO5IF6f7IOgdoF54bW67R7ZVGKrTRdYBkpoiUGC5zo94NkFmYWXmYqdPvFPgjk9ns NyBQ== 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=86Muj6yeR82i+VdpYFezkcdiP5K3sxLSJDS7Veubi20=; fh=cpD+ehYTg5Kkp9rm1NbzIZqwMaDwDybTA/27fbyX18M=; b=OauEGjKqG601I99z1qisvZZURxp1yH/xuwMmrQtdbFMiJtwwnlQsnxDEqidn276r8k ACViQ4JmFZ8uRcO4dbYTq0JA63i4Q5olV+8uBd2Ag9tt30Rrc1O9O3f3aAamos0t9JUU dfC5vsl2AujPL7OtovjGTWykLux/bufGCZIDGYs2Vkiktqi6dPBMdxU8fkf7iSyfxxFp Pj80v9F5iSG4UVUWq0a72LNAcqQzXEBEW1X82H/LDZWPJB5+6SEvb+VEcOwuCPlfpDov t1LIey/ZhDmYBfifiANp6E22HPg4yBNMefTmWPF/twkBJIAImxAekyHJQONnIZ6F36rD QAVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=FRqmzLRc; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-159233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159233-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id l3-20020a170902f68300b001e3d2428c5asi14726519plg.596.2024.04.25.18.27.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 18:27:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=FRqmzLRc; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-159233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159233-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 361E8B2489E for ; Thu, 25 Apr 2024 21:45:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13235156646; Thu, 25 Apr 2024 21:44:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="FRqmzLRc" 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 AA6C0155726; Thu, 25 Apr 2024 21:44:43 +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=1714081485; cv=none; b=XVc6xpEGnT54jcA/Tr560hgr9JKP5Jnq4o9j2zIfMnRdATv5BDlbFo9dowHba571JG2ZMlCgTuFvaXdc1g+JzNLJiFAuAO0xCbT1PEHoehoDtZJlxVlGnR31RCrjnjAbW9wOK0R0UdZdLIaSaSoZvg3fts1axhfBfRm+yGm27F4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714081485; c=relaxed/simple; bh=9mL/dj9SJENEHlN7H9ZQRKRS3vgcoRMl1JiH1RhpS0Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=os+LFTB6Mp1VGVdhZYPuCTOuayYtj5bW61QMY3vEsfG41I+Qm7/kV8i03bD/U5yFt/nrT1B9B573WgafK0CwW1kygH//g0H3iBtQtbiKDndXtg1kgTPNb/iPBmw+BPCNi8fouHZBxU6Z20Q9vK6X+4I5tq7eBBBS+/UfwdWNF4g= 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=FRqmzLRc; 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 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 4813EC0005E5; Thu, 25 Apr 2024 14:44:42 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 4813EC0005E5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1714081482; bh=9mL/dj9SJENEHlN7H9ZQRKRS3vgcoRMl1JiH1RhpS0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FRqmzLRcyzSfOxRf6V2y9d/ku6PZ4Jefrqx3EXIpa4pEOcEAv4W/Z4S0Uwc7NtWrA Eit+GRi70AfnpxrZ6VMegSPdarPW8qLfhiw1hkcA/9PQosihFZQIKTTg4ZyFR6RZ4D ohgaNNckJlQ1ZNoG4oOljRNdVUJ8ih1i0f2/d+cw= 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 53DC418041CAC7; Thu, 25 Apr 2024 14:44:40 -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 v3 2/5] i2c: designware: Create shared header hosting driver name Date: Thu, 25 Apr 2024 14:44:35 -0700 Message-Id: <20240425214438.2100534-3-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240425214438.2100534-1-florian.fainelli@broadcom.com> References: <20240425214438.2100534-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. Link: https://lore.kernel.org/all/20240422084109.3201-1-duanqiangwen@net-swift.com/ [1] Link: https://lore.kernel.org/all/20240422084109.3201-2-duanqiangwen@net-swift.com/ [2] Signed-off-by: Florian Fainelli --- MAINTAINERS | 1 + drivers/i2c/busses/i2c-designware-platdrv.c | 4 +++- include/linux/platform_data/i2c-designware.h | 12 ++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) 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-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 0be7b0dc849b..107945d0337e 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -33,6 +33,8 @@ #include #include +#include + #include "i2c-designware-core.h" static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev) @@ -489,7 +491,7 @@ 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..1196103df4f5 --- /dev/null +++ b/include/linux/platform_data/i2c-designware.h @@ -0,0 +1,12 @@ +/* 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