[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v4 1/8] arm: Uniquely name imx25 I2C buses.
From: |
Peter Maydell |
Subject: |
Re: [Qemu-arm] [PATCH v4 1/8] arm: Uniquely name imx25 I2C buses. |
Date: |
Fri, 16 Dec 2016 13:03:41 +0000 |
On 15 December 2016 at 05:48, Alastair D'Silva <address@hidden> wrote:
> From: Alastair D'Silva <address@hidden>
>
> The imx25 chip provides 3 i2c buses, but they have all been named
> "i2c", which makes it difficult to predict which bus a device will
> be connected to when specified on the command line.
>
> This patch addresses the issue by naming the buses uniquely:
> i2c-bus.0 i2c-bus.1 i2c-bus.2
>
> Signed-off-by: Alastair D'Silva <address@hidden>
> ---
> hw/arm/imx25_pdk.c | 2 +-
> hw/i2c/imx_i2c.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c
> index 025b608..44e741f 100644
> --- a/hw/arm/imx25_pdk.c
> +++ b/hw/arm/imx25_pdk.c
> @@ -139,7 +139,7 @@ static void imx25_pdk_init(MachineState *machine)
> * of simple qtest. See "make check" for details.
> */
> i2c_create_slave((I2CBus *)qdev_get_child_bus(DEVICE(&s->soc.i2c[0]),
> - "i2c"),
> + "i2c-bus.0"),
> "ds1338", 0x68);
> }
> }
> diff --git a/hw/i2c/imx_i2c.c b/hw/i2c/imx_i2c.c
> index 37e5a62..6c81b98 100644
> --- a/hw/i2c/imx_i2c.c
> +++ b/hw/i2c/imx_i2c.c
> @@ -310,7 +310,7 @@ static void imx_i2c_realize(DeviceState *dev, Error
> **errp)
> IMX_I2C_MEM_SIZE);
> sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
> sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq);
> - s->bus = i2c_init_bus(DEVICE(dev), "i2c");
> + s->bus = i2c_init_bus(DEVICE(dev), NULL);
> }
>
> static void imx_i2c_class_init(ObjectClass *klass, void *data)
This change looks OK to me, but it is an incompatible change to the
command line (albeit only one where you couldn't have reliably
used the command line to start with), so I'm just cc'ing
Jean-Christophe Dubois, who's been active with the iMX code in the
past, for a second opinion.
We should flag this up in 2.9's Changelog as well.
thanks
-- PMM
- [Qemu-arm] [PATCH v4 0/8] Add support for the Epson RX8900 RTC to the aspeed board, Alastair D'Silva, 2016/12/15
- [Qemu-arm] [PATCH v4 7/8] tests: Test all implemented RX8900 functionality, Alastair D'Silva, 2016/12/15
- [Qemu-arm] [PATCH v4 3/8] qtest: Support setting named GPIOs, Alastair D'Silva, 2016/12/15
- [Qemu-arm] [PATCH v4 6/8] hw/timer: Add Epson RX8900 RTC support, Alastair D'Silva, 2016/12/15
- [Qemu-arm] [PATCH v4 2/8] qtest: Support named interrupts, Alastair D'Silva, 2016/12/15
- [Qemu-arm] [PATCH v4 1/8] arm: Uniquely name imx25 I2C buses., Alastair D'Silva, 2016/12/15
- Re: [Qemu-arm] [PATCH v4 1/8] arm: Uniquely name imx25 I2C buses.,
Peter Maydell <=
- [Qemu-arm] [PATCH v4 4/8] qtest: Fix whitespace, Alastair D'Silva, 2016/12/15
- [Qemu-arm] [PATCH v4 8/8] arm: Add an RX8900 RTC to the ASpeed board, Alastair D'Silva, 2016/12/15
- [Qemu-arm] [PATCH v4 5/8] hw/i2c: Tidy up NULL check for i2c slave init callbacks, Alastair D'Silva, 2016/12/15