From: Vasily Khoruzhick <anarsoul@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/2] Add support for Zipit Z2 machine
Date: Wed, 1 Jun 2011 09:25:51 +0300 [thread overview]
Message-ID: <201106010925.51408.anarsoul@gmail.com> (raw)
In-Reply-To: <BANLkTimXKHMfUQV-fcXfTAHGSTn3qSCpeQ@mail.gmail.com>
On Wednesday 01 June 2011 02:35:05 Peter Maydell wrote:
> On 31 May 2011 15:16, Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> > +static uint32_t zipit_lcd_transfer(SSISlave *dev, uint32_t value)
> > +{
> > + ZipitLCD *z = FROM_SSI_SLAVE(ZipitLCD, dev);
> > + if (z->enabled) {
> > + z->buf[z->pos] = value & 0xff;
> > + z->pos++;
> > + }
> > + if (z->pos == 3) {
> > + switch (z->buf[0]) {
> > + case 0x74:
> > + printf("%s: reg: 0x%.2x\n", __func__, z->buf[2]);
> > + break;
> > + case 0x76:
> > + printf("%s: value: 0x%.4x\n", __func__, z->buf[1] << 8 |
> > z->buf[2]); + break;
> > + default:
> > + printf("%s: unknown command!\n", __func__);
> > + break;
> > + }
> > + z->pos = 0;
> > + }
> > + return 0;
> > +}
>
> Presumably this is a stub for later functionality?
> I don't think we should be printing the debug tracing by default.
Ok, will fix it
> > +static SSISlaveInfo zipit_lcd_info = {
> > + .qdev.name = "zipit-lcd",
> > + .qdev.size = sizeof(ZipitLCD),
> > + .init = zipit_lcd_init,
> > + .transfer = zipit_lcd_transfer
> > +};
>
> Not that the device does much, but it ought to have a
> VMStateDescription structure to save/load its state.
Ok
> > + case I2C_START_RECV:
> > + if (s->len != 1)
> > + printf("%s: short message!?\n", __func__);
>
> QEMU coding style demands braces here. Running through
> scripts/checkpatch.pl should catch this kind of thing.
Ok
> > +static int aer915_recv(i2c_slave *slave)
> > +{
> > + int retval = 0x00;
> > + AER915State *s = FROM_I2C_SLAVE(AER915State, slave);
> > +
> > + /* Hardcoded value */
>
> This comment isn't telling us anything we can't see from
> the code. More interesting would be what the hardcoded
> value actually means...
Ok
> > +static I2CSlaveInfo aer915_info = {
> > + .qdev.name = "aer915",
> > + .qdev.size = sizeof(AER915State),
> > + .init = aer915_init,
> > + .event = aer915_event,
> > + .recv = aer915_recv,
> > + .send = aer915_send
> > +};
>
> Missing save/load support again.
This device is stateless, it only reports battery voltage (which is
hardcoded), so nothing to save/load here.
> > + bus = pxa2xx_i2c_bus(cpu->i2c[0]);
> > + i2c_create_slave(bus, "aer915", 0x55);
> > + wm = i2c_create_slave(bus, "wm8750", 0x1b);
> > + /* .. and to the sound interface. */
>
> This comment has come from spitz.c, and it doesn't make
> much sense here since you've not copied the preceding
> comment which it is a continuation of:
> /* Attach a WM8750 to the bus */
Ok, will remove it.
Thanks for review :)
Regards
Vasily
next prev parent reply other threads:[~2011-06-01 6:26 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-31 14:16 [Qemu-devel] [PATCH 1/2] pxa2xx_lcd: add proper rotation support Vasily Khoruzhick
2011-05-31 14:16 ` [Qemu-devel] [PATCH 2/2] Add support for Zipit Z2 machine Vasily Khoruzhick
2011-05-31 23:35 ` Peter Maydell
2011-06-01 6:25 ` Vasily Khoruzhick [this message]
2011-06-01 9:28 ` [Qemu-devel] [PATCH v2 1/2] pxa2xx_lcd: add proper rotation support Vasily Khoruzhick
2011-06-01 9:28 ` [Qemu-devel] [PATCH v2 2/2] Add support for Zipit Z2 machine Vasily Khoruzhick
2011-06-03 15:33 ` [Qemu-devel] [PATCH v2 1/2] pxa2xx_lcd: add proper rotation support Vasily Khoruzhick
2011-06-03 15:36 ` [Qemu-devel] [PATCH v3 " Vasily Khoruzhick
2011-06-03 15:36 ` [Qemu-devel] [PATCH v3 2/2] Add support for Zipit Z2 machine Vasily Khoruzhick
2011-06-03 15:38 ` [Qemu-devel] [PATCH v3 1/2] pxa2xx_lcd: add proper rotation support Vasily Khoruzhick
2011-06-08 8:52 ` Vasily Khoruzhick
2011-06-08 9:50 ` Peter Maydell
2011-06-08 11:22 ` Vasily Khoruzhick
2011-06-17 10:04 ` [Qemu-devel] [PATCH v4 " Vasily Khoruzhick
2011-06-17 10:04 ` [Qemu-devel] [PATCH v4 2/2] Add support for Zipit Z2 machine Vasily Khoruzhick
2011-06-21 9:47 ` Vasily Khoruzhick
2011-06-24 14:45 ` Peter Maydell
2011-06-24 17:06 ` Vasily Khoruzhick
2011-06-24 17:16 ` Peter Maydell
2011-07-06 13:52 ` [Qemu-devel] [PATCH v5] " Vasily Khoruzhick
2011-07-11 15:26 ` Vasily Khoruzhick
2011-07-28 8:19 ` Vasily Khoruzhick
2011-07-12 17:31 ` Peter Maydell
2011-07-30 5:04 ` andrzej zaborowski
2011-06-21 9:47 ` [Qemu-devel] [PATCH v4 1/2] pxa2xx_lcd: add proper rotation support Vasily Khoruzhick
2011-07-04 20:11 ` andrzej zaborowski
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=201106010925.51408.anarsoul@gmail.com \
--to=anarsoul@gmail.com \
--cc=peter.maydell@linaro.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).