diff options
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/ast_i2c.c | 4 | ||||
-rw-r--r-- | drivers/i2c/davinci_i2c.c | 2 | ||||
-rw-r--r-- | drivers/i2c/exynos_hs_i2c.c | 2 | ||||
-rw-r--r-- | drivers/i2c/i2c-gpio.c | 2 | ||||
-rw-r--r-- | drivers/i2c/imx_lpi2c.c | 12 | ||||
-rw-r--r-- | drivers/i2c/lpc32xx_i2c.c | 6 | ||||
-rw-r--r-- | drivers/i2c/mxc_i2c.c | 10 | ||||
-rw-r--r-- | drivers/i2c/nx_i2c.c | 2 | ||||
-rw-r--r-- | drivers/i2c/octeon_i2c.c | 2 | ||||
-rw-r--r-- | drivers/i2c/s3c24x0_i2c.c | 2 | ||||
-rw-r--r-- | drivers/i2c/tegra_i2c.c | 5 |
11 files changed, 27 insertions, 22 deletions
diff --git a/drivers/i2c/ast_i2c.c b/drivers/i2c/ast_i2c.c index 3aa8ad1cf8..2d3fecaa14 100644 --- a/drivers/i2c/ast_i2c.c +++ b/drivers/i2c/ast_i2c.c @@ -110,7 +110,7 @@ static int ast_i2c_probe(struct udevice *dev) { struct ast2500_scu *scu; - debug("Enabling I2C%u\n", dev->seq); + debug("Enabling I2C%u\n", dev_seq(dev)); /* * Get all I2C devices out of Reset. @@ -307,7 +307,7 @@ static int ast_i2c_set_speed(struct udevice *dev, unsigned int speed) struct ast_i2c_regs *regs = priv->regs; ulong i2c_rate, divider; - debug("Setting speed for I2C%d to <%u>\n", dev->seq, speed); + debug("Setting speed for I2C%d to <%u>\n", dev_seq(dev), speed); if (!speed) { debug("No valid speed specified\n"); return -EINVAL; diff --git a/drivers/i2c/davinci_i2c.c b/drivers/i2c/davinci_i2c.c index 074d6095e2..7811abad80 100644 --- a/drivers/i2c/davinci_i2c.c +++ b/drivers/i2c/davinci_i2c.c @@ -470,7 +470,7 @@ static int davinci_i2c_probe(struct udevice *dev) { struct i2c_bus *i2c_bus = dev_get_priv(dev); - i2c_bus->id = dev->seq; + i2c_bus->id = dev_seq(dev); i2c_bus->regs = dev_read_addr_ptr(dev); i2c_bus->speed = 100000; diff --git a/drivers/i2c/exynos_hs_i2c.c b/drivers/i2c/exynos_hs_i2c.c index 7dbf0a4752..879ddc67b6 100644 --- a/drivers/i2c/exynos_hs_i2c.c +++ b/drivers/i2c/exynos_hs_i2c.c @@ -533,7 +533,7 @@ static int s3c_i2c_of_to_plat(struct udevice *dev) dev_read_u32_default(dev, "clock-frequency", I2C_SPEED_STANDARD_RATE); i2c_bus->node = node; - i2c_bus->bus_num = dev->seq; + i2c_bus->bus_num = dev_seq(dev); exynos_pinmux_config(i2c_bus->id, PINMUX_FLAG_HS_MODE); diff --git a/drivers/i2c/i2c-gpio.c b/drivers/i2c/i2c-gpio.c index 8bd96a074e..387f00b2cd 100644 --- a/drivers/i2c/i2c-gpio.c +++ b/drivers/i2c/i2c-gpio.c @@ -298,7 +298,7 @@ static int i2c_gpio_probe(struct udevice *dev, uint chip, uint chip_flags) i2c_gpio_send_stop(bus, delay); debug("%s: bus: %d (%s) chip: %x flags: %x ret: %d\n", - __func__, dev->seq, dev->name, chip, chip_flags, ret); + __func__, dev_seq(dev), dev->name, chip, chip_flags, ret); return ret; } diff --git a/drivers/i2c/imx_lpi2c.c b/drivers/i2c/imx_lpi2c.c index 270a49423c..92c500327b 100644 --- a/drivers/i2c/imx_lpi2c.c +++ b/drivers/i2c/imx_lpi2c.c @@ -289,7 +289,7 @@ static int bus_i2c_set_bus_speed(struct udevice *bus, int speed) return clock_rate; } } else { - clock_rate = imx_get_i2cclk(bus->seq); + clock_rate = imx_get_i2cclk(dev_seq(bus)); if (!clock_rate) return -EPERM; } @@ -377,7 +377,7 @@ static int bus_i2c_init(struct udevice *bus, int speed) val = readl(®s->mcr) & ~LPI2C_MCR_MEN_MASK; writel(val | LPI2C_MCR_MEN(1), ®s->mcr); - debug("i2c : controller bus %d, speed %d:\n", bus->seq, speed); + debug("i2c : controller bus %d, speed %d:\n", dev_seq(bus), speed); return ret; } @@ -452,11 +452,11 @@ static int imx_lpi2c_probe(struct udevice *bus) return -EINVAL; i2c_bus->base = addr; - i2c_bus->index = bus->seq; + i2c_bus->index = dev_seq(bus); i2c_bus->bus = bus; /* power up i2c resource */ - ret = init_i2c_power(bus->seq); + ret = init_i2c_power(dev_seq(bus)); if (ret) { debug("init_i2c_power err = %d\n", ret); return ret; @@ -486,7 +486,7 @@ static int imx_lpi2c_probe(struct udevice *bus) } } else { /* To i.MX7ULP, only i2c4-7 can be handled by A7 core */ - ret = enable_i2c_clk(1, bus->seq); + ret = enable_i2c_clk(1, dev_seq(bus)); if (ret < 0) return ret; } @@ -496,7 +496,7 @@ static int imx_lpi2c_probe(struct udevice *bus) return ret; debug("i2c : controller bus %d at 0x%lx , speed %d: ", - bus->seq, i2c_bus->base, + dev_seq(bus), i2c_bus->base, i2c_bus->speed); return 0; diff --git a/drivers/i2c/lpc32xx_i2c.c b/drivers/i2c/lpc32xx_i2c.c index e321d4b70d..ad11e978cc 100644 --- a/drivers/i2c/lpc32xx_i2c.c +++ b/drivers/i2c/lpc32xx_i2c.c @@ -282,7 +282,11 @@ U_BOOT_I2C_ADAP_COMPLETE(lpc32xx_2, lpc32xx_i2c_init, NULL, static int lpc32xx_i2c_probe(struct udevice *bus) { struct lpc32xx_i2c_dev *dev = dev_get_plat(bus); - bus->seq = dev->index; + + /* + * FIXME: This is not permitted + * dev_seq(bus) = dev->index; + */ __i2c_init(dev->base, dev->speed, 0, dev->index); return 0; diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index 3d37858fb4..cbc2bbf5d3 100644 --- a/drivers/i2c/mxc_i2c.c +++ b/drivers/i2c/mxc_i2c.c @@ -914,7 +914,7 @@ static int mxc_i2c_probe(struct udevice *bus) } i2c_bus->base = addr; - i2c_bus->index = bus->seq; + i2c_bus->index = dev_seq(bus); i2c_bus->bus = bus; /* Enable clk */ @@ -930,7 +930,7 @@ static int mxc_i2c_probe(struct udevice *bus) return ret; } #else - ret = enable_i2c_clk(1, bus->seq); + ret = enable_i2c_clk(1, dev_seq(bus)); if (ret < 0) return ret; #endif @@ -942,7 +942,7 @@ static int mxc_i2c_probe(struct udevice *bus) ret = fdt_stringlist_search(fdt, node, "pinctrl-names", "gpio"); if (ret < 0) { debug("i2c bus %d at 0x%2lx, no gpio pinctrl state.\n", - bus->seq, i2c_bus->base); + dev_seq(bus), i2c_bus->base); } else { ret = gpio_request_by_name_nodev(offset_to_ofnode(node), "scl-gpios", 0, &i2c_bus->scl_gpio, @@ -955,7 +955,7 @@ static int mxc_i2c_probe(struct udevice *bus) ret || ret2) { dev_err(bus, "i2c bus %d at %lu, fail to request scl/sda gpio\n", - bus->seq, i2c_bus->base); + dev_seq(bus), i2c_bus->base); return -EINVAL; } } @@ -966,7 +966,7 @@ static int mxc_i2c_probe(struct udevice *bus) */ debug("i2c : controller bus %d at %lu , speed %d: ", - bus->seq, i2c_bus->base, + dev_seq(bus), i2c_bus->base, i2c_bus->speed); return 0; diff --git a/drivers/i2c/nx_i2c.c b/drivers/i2c/nx_i2c.c index a672c011d2..c63a732557 100644 --- a/drivers/i2c/nx_i2c.c +++ b/drivers/i2c/nx_i2c.c @@ -240,7 +240,7 @@ static int nx_i2c_probe(struct udevice *dev) return -EINVAL; bus->regs = (struct nx_i2c_regs *)addr; - bus->bus_num = dev->seq; + bus->bus_num = dev_seq(dev); /* i2c node parsing */ i2c_process_node(dev); diff --git a/drivers/i2c/octeon_i2c.c b/drivers/i2c/octeon_i2c.c index b1a9cce71c..100c751f94 100644 --- a/drivers/i2c/octeon_i2c.c +++ b/drivers/i2c/octeon_i2c.c @@ -811,7 +811,7 @@ static int octeon_i2c_probe(struct udevice *dev) if (ret) return ret; - debug("TWSI bus %d at %p\n", dev->seq, twsi->base); + debug("TWSI bus %d at %p\n", dev_seq(dev), twsi->base); /* Start with standard speed, real speed set via DT or cmd */ return twsi_init(twsi->base, i2c_slave_addr); diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c index ff2c3452a3..0c8915605d 100644 --- a/drivers/i2c/s3c24x0_i2c.c +++ b/drivers/i2c/s3c24x0_i2c.c @@ -318,7 +318,7 @@ static int s3c_i2c_of_to_plat(struct udevice *dev) dev_read_u32_default(dev, "clock-frequency", I2C_SPEED_STANDARD_RATE); i2c_bus->node = node; - i2c_bus->bus_num = dev->seq; + i2c_bus->bus_num = dev_seq(dev); exynos_pinmux_config(i2c_bus->id, 0); diff --git a/drivers/i2c/tegra_i2c.c b/drivers/i2c/tegra_i2c.c index 7cb5e8b343..1e74484542 100644 --- a/drivers/i2c/tegra_i2c.c +++ b/drivers/i2c/tegra_i2c.c @@ -362,7 +362,7 @@ static int tegra_i2c_probe(struct udevice *dev) int ret; bool is_dvc; - i2c_bus->id = dev->seq; + i2c_bus->id = dev_seq(dev); i2c_bus->type = dev_get_driver_data(dev); i2c_bus->regs = (struct i2c_ctlr *)dev_read_addr(dev); if ((ulong)i2c_bus->regs == FDT_ADDR_T_NONE) { @@ -408,7 +408,8 @@ static int tegra_i2c_probe(struct udevice *dev) } i2c_init_controller(i2c_bus); debug("%s: controller bus %d at %p, speed %d: ", - is_dvc ? "dvc" : "i2c", dev->seq, i2c_bus->regs, i2c_bus->speed); + is_dvc ? "dvc" : "i2c", dev_seq(dev), i2c_bus->regs, + i2c_bus->speed); return 0; } |