hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/i2c/busses/i2c-st.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2013 STMicroelectronics
34 *
45 * I2C master mode controller driver, used in STMicroelectronics devices.
56 *
67 * Author: Maxime Coquelin <maxime.coquelin@st.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2, as
10
- * published by the Free Software Foundation.
118 */
129
1310 #include <linux/clk.h>
....@@ -216,7 +213,7 @@
216213 */
217214 static struct st_i2c_timings i2c_timings[] = {
218215 [I2C_MODE_STANDARD] = {
219
- .rate = 100000,
216
+ .rate = I2C_MAX_STANDARD_MODE_FREQ,
220217 .rep_start_hold = 4400,
221218 .rep_start_setup = 5170,
222219 .start_hold = 4400,
....@@ -225,7 +222,7 @@
225222 .bus_free_time = 5170,
226223 },
227224 [I2C_MODE_FAST] = {
228
- .rate = 400000,
225
+ .rate = I2C_MAX_FAST_MODE_FREQ,
229226 .rep_start_hold = 660,
230227 .rep_start_setup = 660,
231228 .start_hold = 660,
....@@ -839,7 +836,7 @@
839836
840837 i2c_dev->mode = I2C_MODE_STANDARD;
841838 ret = of_property_read_u32(np, "clock-frequency", &clk_rate);
842
- if ((!ret) && (clk_rate == 400000))
839
+ if (!ret && (clk_rate == I2C_MAX_FAST_MODE_FREQ))
843840 i2c_dev->mode = I2C_MODE_FAST;
844841
845842 i2c_dev->dev = &pdev->dev;