Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1684684rdb; Thu, 7 Dec 2023 06:17:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmGVFdaVz8tc4MwdkGo6uQt6MJBe6hgSCtcnGoVr54DaOgDrLzuzAvmHe1rzrJ0yScrlLG X-Received: by 2002:a05:6a20:9153:b0:190:1e0c:d29 with SMTP id x19-20020a056a20915300b001901e0c0d29mr284457pzc.4.1701958665118; Thu, 07 Dec 2023 06:17:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701958665; cv=none; d=google.com; s=arc-20160816; b=KIw21C/eukapfOVcYftrO3aHBidiXdo+4zIg/1GIXecwEMKl0F8r7FVrl9vpFzy2Sr ZMq2R7LmkeI+178aNOgwaegZIFIXNAWuZehufb9rGHcXaxdKsn+RnU7m23OapOo1jzzX 4PyI3K8rlT1eD+sJlBiI+X80ObUzHZgYW4l6zIItf26KLy+zFiwmoj4kWKbafEhGhXjt TJzZL2s3dX/id4jl73ob3GPknuldTVN32ahDiDdWYVjLiWBJPZEX+A3ceKlSLgSW47fZ GaKyVn75zkh+hlmxqZ3wPGo/22k6anEeE1AggzpFE330ZVniRqGqJ9pPXXJg50QrOUxR eZNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=e0pdVs9FUBzOkINQ5SOl0/UMVn11RPuYQ13AQ+I8+Fw=; fh=2EyuYZuFv7pvbWODgXyYvSVo1Jt/nOD9U4n59BuOM5Q=; b=A6vIOBoX4I9yM7aJZme8JQy24gSqPKNeoJScaw8BUPVYhO25tCKztV5YCiN5s7HUSJ eGhphj/eYLa2JW3p00Sc/+TU9GmDABWgiJ9iy2T7LwtqgKf1vc0whyEASvAkiCeVCbOe Bqa2cJfa5f9Iy3WeAj1pm96qM/9Zzx2krKEKlyxDm1yOToKkbuaVsanfA75uk5qPFOcd +9Lnj+fv5PE4m2IraIRz8LX0XYV/g5xQmX9irWkz78afY9qOsA41QkzWyFEc/4vBIdke TJvY8xnwpX63hrCNd7AuFSbYkJKX+vnh6FmLPIZMaP0nPtA9KBcT11QaTXcmR+fmvvAE bT2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MIFD59oM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id t9-20020a63eb09000000b005ac2af99d30si202984pgh.705.2023.12.07.06.17.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 06:17:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MIFD59oM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B8491806A100; Thu, 7 Dec 2023 06:17:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443206AbjLGORR (ORCPT + 99 others); Thu, 7 Dec 2023 09:17:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443169AbjLGORF (ORCPT ); Thu, 7 Dec 2023 09:17:05 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29A5D10DD; Thu, 7 Dec 2023 06:17:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701958631; x=1733494631; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ss3MEGGnkWMgWZK3jTAcWgv4EgF/PIuIMEgXzDwOVDM=; b=MIFD59oMzFjC0n34fdY9RtLJVNshX3g7AwDp+lz61AhWJPw0xnqbGwx0 Hj2YGHc62zvdwt1HiNC9TKsvvHuhE5fBFu1Kbqeb/pWylYMmY8ydzOghw o1TJMc+zy/tP/1+lTPacDU3OtTkA6+xGOPTMv97S5Uz28K2C+KZkxpDBh IxsTOBpZko56n3eXlAV7z/V9SiSlzbX2Cnn3UY7R7MMgJOy1XWA+u0xd0 CqSCD/IOPow3QDQuEzRxhB3hz0fRGeMRyMVU8kPoEff+eMAqvpq6W/1Yv QCprA1WEbbwzd9Q1o2w5KXevODwLXzt3/HVEiGyRAjylyO3M0N0KFG5x2 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="460726093" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="460726093" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 06:17:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="889756078" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="889756078" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 07 Dec 2023 06:17:07 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id EC047A11; Thu, 7 Dec 2023 16:17:02 +0200 (EET) From: Andy Shevchenko To: Mario Limonciello , Jarkko Nikula , Herbert Xu , Andy Shevchenko , Wolfram Sang , Andi Shyti , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mika Westerberg , Jan Dabros , Philipp Zabel , Serge Semin Subject: [PATCH v5 10/24] i2c: designware: Always provide device ID tables Date: Thu, 7 Dec 2023 16:13:50 +0200 Message-ID: <20231207141653.2785124-11-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231207141653.2785124-1-andriy.shevchenko@linux.intel.com> References: <20231207141653.2785124-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 07 Dec 2023 06:17:32 -0800 (PST) There is no need to have ugly ifdeffery and additional macros for the device ID tables. Always provide them. Since we touch the ACPI table, make it sorted by ID. Reviewed-by: Andi Shyti Reviewed-by: Mario Limonciello Acked-by: Jarkko Nikula Tested-by: Serge Semin Link: https://lore.kernel.org/r/20231120144641.1660574-11-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko --- drivers/i2c/busses/i2c-designware-platdrv.c | 62 ++++++++++----------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 018c353a456a..15f19ec20b33 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -40,28 +40,6 @@ static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev) return clk_get_rate(dev->clk) / KILO; } -#ifdef CONFIG_ACPI -static const struct acpi_device_id dw_i2c_acpi_match[] = { - { "INT33C2", 0 }, - { "INT33C3", 0 }, - { "INT3432", 0 }, - { "INT3433", 0 }, - { "80860F41", ACCESS_NO_IRQ_SUSPEND }, - { "808622C1", ACCESS_NO_IRQ_SUSPEND }, - { "AMD0010", ACCESS_INTR_MASK }, - { "AMDI0010", ACCESS_INTR_MASK }, - { "AMDI0019", ACCESS_INTR_MASK | ARBITRATION_SEMAPHORE }, - { "AMDI0510", 0 }, - { "APMC0D0F", 0 }, - { "HISI02A1", 0 }, - { "HISI02A2", 0 }, - { "HISI02A3", 0 }, - { "HYGO0010", ACCESS_INTR_MASK }, - {} -}; -MODULE_DEVICE_TABLE(acpi, dw_i2c_acpi_match); -#endif - #ifdef CONFIG_OF #define BT1_I2C_CTL 0x100 #define BT1_I2C_CTL_ADDR_MASK GENMASK(7, 0) @@ -148,14 +126,6 @@ static int dw_i2c_of_configure(struct platform_device *pdev) return 0; } - -static const struct of_device_id dw_i2c_of_match[] = { - { .compatible = "snps,designware-i2c", }, - { .compatible = "mscc,ocelot-i2c", .data = (void *)MODEL_MSCC_OCELOT }, - { .compatible = "baikal,bt1-sys-i2c", .data = (void *)MODEL_BAIKAL_BT1 }, - {} -}; -MODULE_DEVICE_TABLE(of, dw_i2c_of_match); #else static int bt1_i2c_request_regs(struct dw_i2c_dev *dev) { @@ -486,6 +456,34 @@ static const struct dev_pm_ops dw_i2c_dev_pm_ops = { RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend, dw_i2c_plat_runtime_resume, NULL) }; +static const struct of_device_id dw_i2c_of_match[] = { + { .compatible = "snps,designware-i2c", }, + { .compatible = "mscc,ocelot-i2c", .data = (void *)MODEL_MSCC_OCELOT }, + { .compatible = "baikal,bt1-sys-i2c", .data = (void *)MODEL_BAIKAL_BT1 }, + {} +}; +MODULE_DEVICE_TABLE(of, dw_i2c_of_match); + +static const struct acpi_device_id dw_i2c_acpi_match[] = { + { "80860F41", ACCESS_NO_IRQ_SUSPEND }, + { "808622C1", ACCESS_NO_IRQ_SUSPEND }, + { "AMD0010", ACCESS_INTR_MASK }, + { "AMDI0010", ACCESS_INTR_MASK }, + { "AMDI0019", ACCESS_INTR_MASK | ARBITRATION_SEMAPHORE }, + { "AMDI0510", 0 }, + { "APMC0D0F", 0 }, + { "HISI02A1", 0 }, + { "HISI02A2", 0 }, + { "HISI02A3", 0 }, + { "HYGO0010", ACCESS_INTR_MASK }, + { "INT33C2", 0 }, + { "INT33C3", 0 }, + { "INT3432", 0 }, + { "INT3433", 0 }, + {} +}; +MODULE_DEVICE_TABLE(acpi, dw_i2c_acpi_match); + static const struct platform_device_id dw_i2c_platform_ids[] = { { "i2c_designware" }, {} @@ -497,8 +495,8 @@ static struct platform_driver dw_i2c_driver = { .remove_new = dw_i2c_plat_remove, .driver = { .name = "i2c_designware", - .of_match_table = of_match_ptr(dw_i2c_of_match), - .acpi_match_table = ACPI_PTR(dw_i2c_acpi_match), + .of_match_table = dw_i2c_of_match, + .acpi_match_table = dw_i2c_acpi_match, .pm = pm_ptr(&dw_i2c_dev_pm_ops), }, .id_table = dw_i2c_platform_ids, -- 2.43.0.rc1.1.gbec44491f096