From patchwork Mon Dec 13 18:00:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 523535 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10F86C4332F for ; Mon, 13 Dec 2021 18:00:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241455AbhLMSAi (ORCPT ); Mon, 13 Dec 2021 13:00:38 -0500 Received: from mga02.intel.com ([134.134.136.20]:21961 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238569AbhLMSAe (ORCPT ); Mon, 13 Dec 2021 13:00:34 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="226067531" X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="226067531" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2021 10:00:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="681722609" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 13 Dec 2021 10:00:29 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id E14D5144; Mon, 13 Dec 2021 20:00:35 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jarkko Nikula , Mika Westerberg Subject: [PATCH v2 1/6] i2c: designware-pci: Use temporary variable for struct device Date: Mon, 13 Dec 2021 20:00:29 +0200 Message-Id: <20211213180034.30929-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Use temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko --- v2: dropped dev --> i_dev renaming (Jarkko) drivers/i2c/busses/i2c-designware-pcidrv.c | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 0f409a4c2da0..5f76010f7dfd 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -207,23 +207,23 @@ static struct dw_pci_controller dw_pci_controllers[] = { }; #ifdef CONFIG_PM -static int i2c_dw_pci_suspend(struct device *dev) +static int i2c_dw_pci_suspend(struct device *d) { - struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); + struct dw_i2c_dev *dev = dev_get_drvdata(d); - i_dev->suspended = true; - i_dev->disable(i_dev); + dev->suspended = true; + dev->disable(dev); return 0; } -static int i2c_dw_pci_resume(struct device *dev) +static int i2c_dw_pci_resume(struct device *d) { - struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); + struct dw_i2c_dev *dev = dev_get_drvdata(d); int ret; - ret = i_dev->init(i_dev); - i_dev->suspended = false; + ret = dev->init(dev); + dev->suspended = false; return ret; } @@ -235,6 +235,7 @@ static UNIVERSAL_DEV_PM_OPS(i2c_dw_pm_ops, i2c_dw_pci_suspend, static int i2c_dw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { + struct device *d = &pdev->dev; struct dw_i2c_dev *dev; struct i2c_adapter *adap; int r; @@ -242,8 +243,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, struct dw_scl_sda_cfg *cfg; if (id->driver_data >= ARRAY_SIZE(dw_pci_controllers)) { - dev_err(&pdev->dev, "%s: invalid driver data %ld\n", __func__, - id->driver_data); + dev_err(d, "%s: invalid driver data %ld\n", __func__, id->driver_data); return -EINVAL; } @@ -251,8 +251,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, r = pcim_enable_device(pdev); if (r) { - dev_err(&pdev->dev, "Failed to enable I2C PCI device (%d)\n", - r); + dev_err(d, "Failed to enable I2C PCI device (%d)\n", r); return r; } @@ -260,11 +259,11 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, r = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev)); if (r) { - dev_err(&pdev->dev, "I/O memory remapping failed\n"); + dev_err(d, "I/O memory remapping failed\n"); return r; } - dev = devm_kzalloc(&pdev->dev, sizeof(struct dw_i2c_dev), GFP_KERNEL); + dev = devm_kzalloc(d, sizeof(*dev), GFP_KERNEL); if (!dev) return -ENOMEM; @@ -275,7 +274,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, dev->get_clk_rate_khz = controller->get_clk_rate_khz; dev->timings.bus_freq_hz = I2C_MAX_FAST_MODE_FREQ; dev->base = pcim_iomap_table(pdev)[0]; - dev->dev = &pdev->dev; + dev->dev = d; dev->irq = pci_irq_vector(pdev, 0); dev->flags |= controller->flags; @@ -291,8 +290,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, i2c_dw_adjust_bus_speed(dev); - if (has_acpi_companion(&pdev->dev)) - i2c_dw_acpi_configure(&pdev->dev); + if (has_acpi_companion(d)) + i2c_dw_acpi_configure(d); r = i2c_dw_validate_speed(dev); if (r) { @@ -314,7 +313,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, adap = &dev->adapter; adap->owner = THIS_MODULE; adap->class = 0; - ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev)); + ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(d)); adap->nr = controller->bus_num; r = i2c_dw_probe(dev); @@ -326,15 +325,15 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, if ((dev->flags & MODEL_MASK) == MODEL_AMD_NAVI_GPU) { r = navi_amd_register_client(dev); if (r) { - dev_err(dev->dev, "register client failed with %d\n", r); + dev_err(d, "register client failed with %d\n", r); return r; } } - pm_runtime_set_autosuspend_delay(&pdev->dev, 1000); - pm_runtime_use_autosuspend(&pdev->dev); - pm_runtime_put_autosuspend(&pdev->dev); - pm_runtime_allow(&pdev->dev); + pm_runtime_set_autosuspend_delay(d, 1000); + pm_runtime_use_autosuspend(d); + pm_runtime_put_autosuspend(d); + pm_runtime_allow(d); return 0; } @@ -342,13 +341,14 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, static void i2c_dw_pci_remove(struct pci_dev *pdev) { struct dw_i2c_dev *dev = pci_get_drvdata(pdev); + struct device *d = &pdev->dev; dev->disable(dev); - pm_runtime_forbid(&pdev->dev); - pm_runtime_get_noresume(&pdev->dev); + pm_runtime_forbid(d); + pm_runtime_get_noresume(d); i2c_del_adapter(&dev->adapter); - devm_free_irq(&pdev->dev, dev->irq, dev); + devm_free_irq(d, dev->irq, dev); pci_free_irq_vectors(pdev); } From patchwork Mon Dec 13 18:00:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 523773 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5166C433F5 for ; Mon, 13 Dec 2021 18:00:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241582AbhLMSAg (ORCPT ); Mon, 13 Dec 2021 13:00:36 -0500 Received: from mga07.intel.com ([134.134.136.100]:22693 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236059AbhLMSAb (ORCPT ); Mon, 13 Dec 2021 13:00:31 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="302170318" X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="302170318" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2021 10:00:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="613915793" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 13 Dec 2021 10:00:29 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id ED27D136; Mon, 13 Dec 2021 20:00:35 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jarkko Nikula , Mika Westerberg Subject: [PATCH v2 2/6] i2c: designware-pci: Convert to use dev_err_probe() Date: Mon, 13 Dec 2021 20:00:30 +0200 Message-Id: <20211213180034.30929-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211213180034.30929-1-andriy.shevchenko@linux.intel.com> References: <20211213180034.30929-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org It's fine to call dev_err_probe() in ->probe() when error code is known. Convert the driver to use dev_err_probe(). Signed-off-by: Andy Shevchenko --- v2: no changes drivers/i2c/busses/i2c-designware-pcidrv.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 5f76010f7dfd..85860902c496 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -242,26 +242,20 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, struct dw_pci_controller *controller; struct dw_scl_sda_cfg *cfg; - if (id->driver_data >= ARRAY_SIZE(dw_pci_controllers)) { - dev_err(d, "%s: invalid driver data %ld\n", __func__, id->driver_data); - return -EINVAL; - } + if (id->driver_data >= ARRAY_SIZE(dw_pci_controllers)) + return dev_err_probe(d, -EINVAL, "invalid driver data %ld\n", id->driver_data); controller = &dw_pci_controllers[id->driver_data]; r = pcim_enable_device(pdev); - if (r) { - dev_err(d, "Failed to enable I2C PCI device (%d)\n", r); - return r; - } + if (r) + return dev_err_probe(d, r, "Failed to enable I2C PCI device\n"); pci_set_master(pdev); r = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev)); - if (r) { - dev_err(d, "I/O memory remapping failed\n"); - return r; - } + if (r) + return dev_err_probe(d, r, "I/O memory remapping failed\n"); dev = devm_kzalloc(d, sizeof(*dev), GFP_KERNEL); if (!dev) From patchwork Mon Dec 13 18:00:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 523536 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A0D3C433F5 for ; Mon, 13 Dec 2021 18:00:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234963AbhLMSAb (ORCPT ); Mon, 13 Dec 2021 13:00:31 -0500 Received: from mga06.intel.com ([134.134.136.31]:33677 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235530AbhLMSAb (ORCPT ); Mon, 13 Dec 2021 13:00:31 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="299572185" X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="299572185" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2021 10:00:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="481601809" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 13 Dec 2021 10:00:29 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0A0DD1A8; Mon, 13 Dec 2021 20:00:36 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jarkko Nikula , Mika Westerberg Subject: [PATCH v2 3/6] i2c: designware-pci: use __maybe_unused for PM functions Date: Mon, 13 Dec 2021 20:00:31 +0200 Message-Id: <20211213180034.30929-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211213180034.30929-1-andriy.shevchenko@linux.intel.com> References: <20211213180034.30929-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Use __maybe_unused for PM functions instead of ifdeffery. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula --- v2: added tag (Jarkko) drivers/i2c/busses/i2c-designware-pcidrv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 85860902c496..e4be5420840a 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -206,8 +206,7 @@ static struct dw_pci_controller dw_pci_controllers[] = { }, }; -#ifdef CONFIG_PM -static int i2c_dw_pci_suspend(struct device *d) +static int __maybe_unused i2c_dw_pci_suspend(struct device *d) { struct dw_i2c_dev *dev = dev_get_drvdata(d); @@ -217,7 +216,7 @@ static int i2c_dw_pci_suspend(struct device *d) return 0; } -static int i2c_dw_pci_resume(struct device *d) +static int __maybe_unused i2c_dw_pci_resume(struct device *d) { struct dw_i2c_dev *dev = dev_get_drvdata(d); int ret; @@ -227,7 +226,6 @@ static int i2c_dw_pci_resume(struct device *d) return ret; } -#endif static UNIVERSAL_DEV_PM_OPS(i2c_dw_pm_ops, i2c_dw_pci_suspend, i2c_dw_pci_resume, NULL); From patchwork Mon Dec 13 18:00:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 523772 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 331B3C433FE for ; Mon, 13 Dec 2021 18:00:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235530AbhLMSAh (ORCPT ); Mon, 13 Dec 2021 13:00:37 -0500 Received: from mga07.intel.com ([134.134.136.100]:22696 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238502AbhLMSAc (ORCPT ); Mon, 13 Dec 2021 13:00:32 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="302170326" X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="302170326" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2021 10:00:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="464732560" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 13 Dec 2021 10:00:29 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 15A371EE; Mon, 13 Dec 2021 20:00:36 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jarkko Nikula , Mika Westerberg , Lakshmi Sowjanya D Subject: [PATCH v2 4/6] i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters Date: Mon, 13 Dec 2021 20:00:32 +0200 Message-Id: <20211213180034.30929-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211213180034.30929-1-andriy.shevchenko@linux.intel.com> References: <20211213180034.30929-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Lakshmi Sowjanya D The data type of hcnt and lcnt in the struct dw_i2c_dev is of type u16. It's better to have same data type in struct dw_scl_sda_cfg as well. Signed-off-by: Lakshmi Sowjanya D Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula --- v2: added tag (Jarkko) drivers/i2c/busses/i2c-designware-pcidrv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index e4be5420840a..499970d70755 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -39,10 +39,10 @@ enum dw_pci_ctl_id_t { }; struct dw_scl_sda_cfg { - u32 ss_hcnt; - u32 fs_hcnt; - u32 ss_lcnt; - u32 fs_lcnt; + u16 ss_hcnt; + u16 fs_hcnt; + u16 ss_lcnt; + u16 fs_lcnt; u32 sda_hold; }; From patchwork Mon Dec 13 18:00:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 523771 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C70CC433EF for ; Mon, 13 Dec 2021 18:00:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241620AbhLMSAt (ORCPT ); Mon, 13 Dec 2021 13:00:49 -0500 Received: from mga01.intel.com ([192.55.52.88]:57909 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241613AbhLMSAk (ORCPT ); Mon, 13 Dec 2021 13:00:40 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="262918298" X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="262918298" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2021 10:00:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="566773369" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 13 Dec 2021 10:00:29 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2119A302; Mon, 13 Dec 2021 20:00:36 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jarkko Nikula , Mika Westerberg Subject: [PATCH v2 5/6] i2c: designware-pci: Group MODULE_*() macros Date: Mon, 13 Dec 2021 20:00:33 +0200 Message-Id: <20211213180034.30929-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211213180034.30929-1-andriy.shevchenko@linux.intel.com> References: <20211213180034.30929-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org For better maintenance group MODULE_*() macros together. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula --- v2: added tag (Jarkko) drivers/i2c/busses/i2c-designware-pcidrv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 499970d70755..bc19d7f59d31 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -344,9 +344,6 @@ static void i2c_dw_pci_remove(struct pci_dev *pdev) pci_free_irq_vectors(pdev); } -/* work with hotplug and coldplug */ -MODULE_ALIAS("i2c_designware-pci"); - static const struct pci_device_id i2_designware_pci_ids[] = { /* Medfield */ { PCI_VDEVICE(INTEL, 0x0817), medfield }, @@ -403,9 +400,11 @@ static struct pci_driver dw_i2c_driver = { .pm = &i2c_dw_pm_ops, }, }; - module_pci_driver(dw_i2c_driver); +/* Work with hotplug and coldplug */ +MODULE_ALIAS("i2c_designware-pci"); + MODULE_AUTHOR("Baruch Siach "); MODULE_DESCRIPTION("Synopsys DesignWare PCI I2C bus adapter"); MODULE_LICENSE("GPL"); From patchwork Mon Dec 13 18:00:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 523534 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF74EC433FE for ; Mon, 13 Dec 2021 18:00:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241621AbhLMSAk (ORCPT ); Mon, 13 Dec 2021 13:00:40 -0500 Received: from mga01.intel.com ([192.55.52.88]:57909 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238447AbhLMSAj (ORCPT ); Mon, 13 Dec 2021 13:00:39 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="262918302" X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="262918302" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2021 10:00:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,203,1635231600"; d="scan'208";a="566773390" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 13 Dec 2021 10:00:31 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2C3185EF; Mon, 13 Dec 2021 20:00:36 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jarkko Nikula , Mika Westerberg Subject: [PATCH v2 6/6] i2c: designware-pci: Add a note about struct dw_scl_sda_cfg usage Date: Mon, 13 Dec 2021 20:00:34 +0200 Message-Id: <20211213180034.30929-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211213180034.30929-1-andriy.shevchenko@linux.intel.com> References: <20211213180034.30929-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Add a note about struct dw_scl_sda_cfg usage to discourage people of using this structure on new platforms. Instead they should try hard to put the needed information into firmware descriptions. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula --- v2: added tag (Jarkko) drivers/i2c/busses/i2c-designware-pcidrv.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index bc19d7f59d31..0ae3bbe8ed4e 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -38,6 +38,13 @@ enum dw_pci_ctl_id_t { navi_amd, }; +/* + * This is a legacy structure to describe the hardware counters + * to configure signal timings on the bus. For Device Tree platforms + * one should use the respective properties and for ACPI there is + * a set of ACPI methods that provide these counters. No new + * platform should use this structure. + */ struct dw_scl_sda_cfg { u16 ss_hcnt; u16 fs_hcnt;