]> git.sur5r.net Git - u-boot/blobdiff - drivers/i2c/fsl_i2c.c
rockchip: gpio: Read the GPIO value correctly
[u-boot] / drivers / i2c / fsl_i2c.c
index 811033b0b83757815208dc88c2ab7b9ce165ad90..b56a1c2541d7165fbd2cc0ac7db7affe61c640d0 100644 (file)
@@ -4,19 +4,7 @@
  * 2012, Heiko Schocher, DENX Software Engineering, hs@denx.de.
  * Changes for multibus/multiadapter I2C support.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * Version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0
  */
 
 #include <common.h>
@@ -38,7 +26,7 @@
  * generic value.
  */
 #ifndef CONFIG_I2C_TIMEOUT
-#define CONFIG_I2C_TIMEOUT     10000
+#define CONFIG_I2C_TIMEOUT     100000
 #endif
 
 #define I2C_READ_BIT  1
@@ -127,7 +115,7 @@ static const struct {
 static unsigned int set_i2c_bus_speed(const struct fsl_i2c *dev,
        unsigned int i2c_clk, unsigned int speed)
 {
-       unsigned short divider = min(i2c_clk / speed, (unsigned short) -1);
+       unsigned short divider = min(i2c_clk / speed, (unsigned int)USHRT_MAX);
 
        /*
         * We want to choose an FDR/DFSR that generates an I2C bus speed that