| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Wondermedia I2C Master Mode Driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Derived from GPLv2+ licensed source: |
|---|
| 7 | 8 | * - Copyright (C) 2008 WonderMedia Technologies, Inc. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License version 2, or |
|---|
| 11 | | - * (at your option) any later version. as published by the Free Software |
|---|
| 12 | | - * Foundation |
|---|
| 13 | 9 | */ |
|---|
| 14 | 10 | |
|---|
| 15 | 11 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 403 | 399 | |
|---|
| 404 | 400 | i2c_dev->mode = I2C_MODE_STANDARD; |
|---|
| 405 | 401 | err = of_property_read_u32(np, "clock-frequency", &clk_rate); |
|---|
| 406 | | - if ((!err) && (clk_rate == 400000)) |
|---|
| 402 | + if (!err && (clk_rate == I2C_MAX_FAST_MODE_FREQ)) |
|---|
| 407 | 403 | i2c_dev->mode = I2C_MODE_FAST; |
|---|
| 408 | 404 | |
|---|
| 409 | 405 | i2c_dev->dev = &pdev->dev; |
|---|