linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-kernel@vger.kernel.org
Cc: Lee Jones <lee.jones@linaro.org>
Subject: [PATCH v1 4/5] mfd: intel_quark_i2c_gpio: Replace I²C speeds with descriptive definitions
Date: Tue,  2 Mar 2021 15:56:19 +0200	[thread overview]
Message-ID: <20210302135620.89958-4-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20210302135620.89958-1-andriy.shevchenko@linux.intel.com>

I²C header provides a descriptive definitions for standard bus speeds.
Use them instead of plain numbers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mfd/intel_quark_i2c_gpio.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c
index 053780539175..7af22d1399e1 100644
--- a/drivers/mfd/intel_quark_i2c_gpio.c
+++ b/drivers/mfd/intel_quark_i2c_gpio.c
@@ -16,6 +16,7 @@
 #include <linux/clkdev.h>
 #include <linux/clk-provider.h>
 #include <linux/dmi.h>
+#include <linux/i2c.h>
 #include <linux/platform_data/gpio-dwapb.h>
 #include <linux/platform_data/i2c-designware.h>
 
@@ -54,19 +55,19 @@ static const struct dmi_system_id dmi_platform_info[] = {
 		.matches = {
 			DMI_EXACT_MATCH(DMI_BOARD_NAME, "Galileo"),
 		},
-		.driver_data = (void *)100000,
+		.driver_data = (void *)I2C_MAX_STANDARD_MODE_FREQ,
 	},
 	{
 		.matches = {
 			DMI_EXACT_MATCH(DMI_BOARD_NAME, "GalileoGen2"),
 		},
-		.driver_data = (void *)400000,
+		.driver_data = (void *)I2C_MAX_FAST_MODE_FREQ,
 	},
 	{
 		.matches = {
 			DMI_EXACT_MATCH(DMI_BOARD_NAME, "SIMATIC IOT2000"),
 		},
-		.driver_data = (void *)400000,
+		.driver_data = (void *)I2C_MAX_FAST_MODE_FREQ,
 	},
 	{}
 };
@@ -176,7 +177,7 @@ static int intel_quark_i2c_setup(struct pci_dev *pdev, struct mfd_cell *cell)
 		return -ENOMEM;
 
 	/* Normal mode by default */
-	pdata->i2c_scl_freq = 100000;
+	pdata->i2c_scl_freq = I2C_MAX_STANDARD_MODE_FREQ;
 
 	dmi_id = dmi_first_match(dmi_platform_info);
 	if (dmi_id)
-- 
2.30.1


  parent reply	other threads:[~2021-03-02 16:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 13:56 [PATCH v1 1/5] mfd: intel_quark_i2c_gpio: revert "Constify static struct resources" Andy Shevchenko
2021-03-02 13:56 ` [PATCH v1 2/5] mfd: intel_quark_i2c_gpio: Unregister resources in reversed order Andy Shevchenko
2021-03-23  9:21   ` Lee Jones
2021-03-02 13:56 ` [PATCH v1 3/5] mfd: intel_quark_i2c_gpio: Remove unused struct device member Andy Shevchenko
2021-03-23  9:22   ` Lee Jones
2021-03-02 13:56 ` Andy Shevchenko [this message]
2021-03-23  9:22   ` [PATCH v1 4/5] mfd: intel_quark_i2c_gpio: Replace I²C speeds with descriptive definitions Lee Jones
2021-03-02 13:56 ` [PATCH v1 5/5] mfd: intel_quark_i2c_gpio: Reuse BAR definitions for MFD cell indexing Andy Shevchenko
2021-03-23  9:20   ` Lee Jones
2021-03-23 10:31     ` Andy Shevchenko
2021-03-02 20:59 ` [PATCH v1 1/5] mfd: intel_quark_i2c_gpio: revert "Constify static struct resources" Rikard Falkeborn
2021-03-18 12:53   ` Andy Shevchenko
2021-03-19  8:39     ` Lee Jones
2021-03-19 10:01       ` Andy Shevchenko
2021-03-20 20:59 ` Tong Zhang
2021-03-23  9:14 ` Lee Jones
2021-03-23 10:31   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210302135620.89958-4-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).