| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2013 STMicroelectronics |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * I2C master mode controller driver, used in STMicroelectronics devices. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * 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. |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 216 | 213 | */ |
|---|
| 217 | 214 | static struct st_i2c_timings i2c_timings[] = { |
|---|
| 218 | 215 | [I2C_MODE_STANDARD] = { |
|---|
| 219 | | - .rate = 100000, |
|---|
| 216 | + .rate = I2C_MAX_STANDARD_MODE_FREQ, |
|---|
| 220 | 217 | .rep_start_hold = 4400, |
|---|
| 221 | 218 | .rep_start_setup = 5170, |
|---|
| 222 | 219 | .start_hold = 4400, |
|---|
| .. | .. |
|---|
| 225 | 222 | .bus_free_time = 5170, |
|---|
| 226 | 223 | }, |
|---|
| 227 | 224 | [I2C_MODE_FAST] = { |
|---|
| 228 | | - .rate = 400000, |
|---|
| 225 | + .rate = I2C_MAX_FAST_MODE_FREQ, |
|---|
| 229 | 226 | .rep_start_hold = 660, |
|---|
| 230 | 227 | .rep_start_setup = 660, |
|---|
| 231 | 228 | .start_hold = 660, |
|---|
| .. | .. |
|---|
| 839 | 836 | |
|---|
| 840 | 837 | i2c_dev->mode = I2C_MODE_STANDARD; |
|---|
| 841 | 838 | 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)) |
|---|
| 843 | 840 | i2c_dev->mode = I2C_MODE_FAST; |
|---|
| 844 | 841 | |
|---|
| 845 | 842 | i2c_dev->dev = &pdev->dev; |
|---|