hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/i2c/algos/i2c-algo-pca.c
....@@ -1,17 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * i2c-algo-pca.c i2c driver algorithms for PCA9564 adapters
34 * Copyright (C) 2004 Arcom Control Systems
45 * Copyright (C) 2008 Pengutronix
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
156 */
167
178 #include <linux/kernel.h>
....@@ -484,17 +475,17 @@
484475 /* To avoid integer overflow, use clock/100 for calculations */
485476 clock = pca_clock(pca_data) / 100;
486477
487
- if (pca_data->i2c_clock > 1000000) {
478
+ if (pca_data->i2c_clock > I2C_MAX_FAST_MODE_PLUS_FREQ) {
488479 mode = I2C_PCA_MODE_TURBO;
489480 min_tlow = 14;
490481 min_thi = 5;
491482 raise_fall_time = 22; /* Raise 11e-8s, Fall 11e-8s */
492
- } else if (pca_data->i2c_clock > 400000) {
483
+ } else if (pca_data->i2c_clock > I2C_MAX_FAST_MODE_FREQ) {
493484 mode = I2C_PCA_MODE_FASTP;
494485 min_tlow = 17;
495486 min_thi = 9;
496487 raise_fall_time = 22; /* Raise 11e-8s, Fall 11e-8s */
497
- } else if (pca_data->i2c_clock > 100000) {
488
+ } else if (pca_data->i2c_clock > I2C_MAX_STANDARD_MODE_FREQ) {
498489 mode = I2C_PCA_MODE_FAST;
499490 min_tlow = 44;
500491 min_thi = 20;
....@@ -562,8 +553,8 @@
562553 }
563554 EXPORT_SYMBOL(i2c_pca_add_numbered_bus);
564555
565
-MODULE_AUTHOR("Ian Campbell <icampbell@arcom.com>, "
566
- "Wolfram Sang <w.sang@pengutronix.de>");
556
+MODULE_AUTHOR("Ian Campbell <icampbell@arcom.com>");
557
+MODULE_AUTHOR("Wolfram Sang <kernel@pengutronix.de>");
567558 MODULE_DESCRIPTION("I2C-Bus PCA9564/PCA9665 algorithm");
568559 MODULE_LICENSE("GPL");
569560