qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Oskar Andero <oskar.andero@gmail.com>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, paul@codesourcery.com
Subject: Re: [Qemu-devel] [PATCH] versatilepb: add i2c support
Date: Tue, 03 Apr 2012 11:13:46 +0200	[thread overview]
Message-ID: <4F7ABF4A.2080200@suse.de> (raw)
In-Reply-To: <1333397837-5389-1-git-send-email-oskar.andero@gmail.com>

Am 02.04.2012 22:17, schrieb Oskar Andero:
> Signed-off-by: Oskar Andero <oskar.andero@gmail.com>
> ---
>  hw/versatilepb.c |   80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 80 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/versatilepb.c b/hw/versatilepb.c
> index 25afb1e..014621a 100644
> --- a/hw/versatilepb.c
> +++ b/hw/versatilepb.c
> @@ -16,9 +16,18 @@
>  #include "boards.h"
>  #include "blockdev.h"
>  #include "exec-memory.h"
> +#include "bitbang_i2c.h"
>  
>  /* Primary interrupt controller.  */
>  
> +typedef struct {
> +    SysBusDevice busdev;
> +    MemoryRegion iomem;
> +    bitbang_i2c_interface *bitbang;
> +    int out;
> +    int in;
> +} vpb_i2c_state;

Please use Camel Case for new types, e.g., VPBI2CState.

> +
>  typedef struct vpb_sic_state
>  {
>    SysBusDevice busdev;
[...]
> @@ -380,9 +452,17 @@ static TypeInfo vpb_sic_info = {
>      .class_init    = vpb_sic_class_init,
>  };
>  
> +static TypeInfo vpb_i2c_info = {

static const, please, since you don't modify it.

> +    .name          = "vpb_i2c",
> +    .parent        = TYPE_SYS_BUS_DEVICE,
> +    .instance_size = sizeof(vpb_i2c_state),
> +    .class_init    = vpb_i2c_class_init,
> +};
> +
>  static void versatilepb_register_types(void)
>  {
>      type_register_static(&vpb_sic_info);
> +    type_register_static(&vpb_i2c_info);
>  }
>  
>  type_init(versatilepb_register_types)

Otherwise looks okay technically; don't know about I2C personally.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2012-04-03  9:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-02 20:17 [Qemu-devel] [PATCH] versatilepb: add i2c support Oskar Andero
2012-04-03  9:13 ` Andreas Färber [this message]
2012-04-05 17:45 ` Peter Maydell

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=4F7ABF4A.2080200@suse.de \
    --to=afaerber@suse.de \
    --cc=oskar.andero@gmail.com \
    --cc=paul@codesourcery.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).