qemu-arm.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alastair D'Silva" <alastair@au1.ibm.com>
To: qemu-arm <qemu-arm@nongnu.org>, QEMU Developers <qemu-devel@nongnu.org>
Cc: "Andrew Jeffery" <andrew@aj.id.au>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Alastair D'Silva" <alastair@d-silva.org>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Joel Stanley" <joel@jms.id.au>
Subject: [Qemu-devel] [PATCH v5 1/7] arm: Uniquely name imx25 I2C buses.
Date: Thu,  5 Jan 2017 15:34:24 +1100	[thread overview]
Message-ID: <20170105043430.3176-2-alastair@au1.ibm.com> (raw)
In-Reply-To: <20170105043430.3176-1-alastair@au1.ibm.com>

From: Alastair D'Silva <alastair@d-silva.org>

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 <alastair@d-silva.org>
---
 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)
-- 
2.9.3


  reply	other threads:[~2017-01-05  4:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05  4:34 [Qemu-devel] [PATCH v5 0/7] Add support for the Epson RX8900 RTC to the aspeed board Alastair D'Silva
2017-01-05  4:34 ` Alastair D'Silva [this message]
2017-01-16 14:58   ` [Qemu-arm] [PATCH v5 1/7] arm: Uniquely name imx25 I2C buses Peter Maydell
2017-01-05  4:34 ` [Qemu-devel] [PATCH v5 2/7] qtest: Support named interrupts Alastair D'Silva
2017-01-16 14:58   ` Peter Maydell
2017-01-05  4:34 ` [Qemu-arm] [PATCH v5 3/7] qtest: Support setting named GPIOs Alastair D'Silva
2017-01-16 15:00   ` Peter Maydell
2017-01-05  4:34 ` [Qemu-devel] [PATCH v5 4/7] qtest: Fix whitespace Alastair D'Silva
2017-01-16 15:00   ` Peter Maydell
2017-01-05  4:34 ` [Qemu-devel] [PATCH v5 5/7] hw/timer: Add Epson RX8900 RTC support Alastair D'Silva
2017-01-16 15:53   ` [Qemu-arm] " Peter Maydell
2017-01-05  4:34 ` [Qemu-arm] [PATCH v5 6/7] tests: Test all implemented RX8900 functionality Alastair D'Silva
2017-01-05  4:34 ` [Qemu-devel] [PATCH v5 7/7] arm: Add an RX8900 RTC to the ASpeed board Alastair D'Silva
2017-01-05  4:46 ` [Qemu-devel] [PATCH v5 0/7] Add support for the Epson RX8900 RTC to the aspeed board no-reply
2017-01-05  4:53 ` [Qemu-arm] " no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170105043430.3176-2-alastair@au1.ibm.com \
    --to=alastair@au1.ibm.com \
    --cc=alastair@d-silva.org \
    --cc=andrew@aj.id.au \
    --cc=clg@kaod.org \
    --cc=joel@jms.id.au \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).