pci: Make Rockchip PCIe voltage regulators optional
[oweals/u-boot.git] / drivers / i2c / s3c24x0_i2c.c
index 3c69dbf409b00fd8cff74cdd321fd6278a821e41..5907217981dc3b68ca91ea0228dbb2e378541a81 100644 (file)
@@ -1,19 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2002
  * David Mueller, ELSOFT AG, d.mueller@elsoft.ch
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
-/* This code should work for both the S3C2400 and the S3C2410
- * as they seem to have the same I2C controller inside.
- * The different address mapping is handled by the s3c24xx.h files below.
- */
 #include <common.h>
 #include <errno.h>
 #include <dm.h>
 #include <fdtdec.h>
 #if (defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
+#include <log.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/pinmux.h>
@@ -314,12 +310,13 @@ static int s3c_i2c_ofdata_to_platdata(struct udevice *dev)
 
        node = dev_of_offset(dev);
 
-       i2c_bus->regs = (struct s3c24x0_i2c *)dev_get_addr(dev);
+       i2c_bus->regs = (struct s3c24x0_i2c *)devfdt_get_addr(dev);
 
        i2c_bus->id = pinmux_decode_periph_id(blob, node);
 
-       i2c_bus->clock_frequency = fdtdec_get_int(blob, node,
-                                                 "clock-frequency", 100000);
+       i2c_bus->clock_frequency =
+               dev_read_u32_default(dev, "clock-frequency",
+                                    I2C_SPEED_STANDARD_RATE);
        i2c_bus->node = node;
        i2c_bus->bus_num = dev->seq;