Skip to content

Commit 10d82ad

Browse files
andy-shevLee Jones
authored andcommitted
mfd: intel_quark_i2c_gpio: Replace I²C speeds with descriptive definitions
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> Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent 2b77ea7 commit 10d82ad

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎drivers/mfd/intel_quark_i2c_gpio.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/clkdev.h>
1717
#include <linux/clk-provider.h>
1818
#include <linux/dmi.h>
19+
#include <linux/i2c.h>
1920
#include <linux/platform_data/gpio-dwapb.h>
2021
#include <linux/platform_data/i2c-designware.h>
2122

@@ -54,19 +55,19 @@ static const struct dmi_system_id dmi_platform_info[] = {
5455
.matches = {
5556
DMI_EXACT_MATCH(DMI_BOARD_NAME, "Galileo"),
5657
},
57-
.driver_data = (void *)100000,
58+
.driver_data = (void *)I2C_MAX_STANDARD_MODE_FREQ,
5859
},
5960
{
6061
.matches = {
6162
DMI_EXACT_MATCH(DMI_BOARD_NAME, "GalileoGen2"),
6263
},
63-
.driver_data = (void *)400000,
64+
.driver_data = (void *)I2C_MAX_FAST_MODE_FREQ,
6465
},
6566
{
6667
.matches = {
6768
DMI_EXACT_MATCH(DMI_BOARD_NAME, "SIMATIC IOT2000"),
6869
},
69-
.driver_data = (void *)400000,
70+
.driver_data = (void *)I2C_MAX_FAST_MODE_FREQ,
7071
},
7172
{}
7273
};
@@ -174,7 +175,7 @@ static int intel_quark_i2c_setup(struct pci_dev *pdev, struct mfd_cell *cell)
174175
return -ENOMEM;
175176

176177
/* Normal mode by default */
177-
pdata->i2c_scl_freq = 100000;
178+
pdata->i2c_scl_freq = I2C_MAX_STANDARD_MODE_FREQ;
178179

179180
dmi_id = dmi_first_match(dmi_platform_info);
180181
if (dmi_id)

0 commit comments

Comments
 (0)