From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEzoH-0003I1-JM for qemu-devel@nongnu.org; Tue, 03 Apr 2012 05:13:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEzoC-0003sp-RP for qemu-devel@nongnu.org; Tue, 03 Apr 2012 05:13:53 -0400 Received: from cantor2.suse.de ([195.135.220.15]:33543 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEzoC-0003sf-L8 for qemu-devel@nongnu.org; Tue, 03 Apr 2012 05:13:48 -0400 Message-ID: <4F7ABF4A.2080200@suse.de> Date: Tue, 03 Apr 2012 11:13:46 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1333397837-5389-1-git-send-email-oskar.andero@gmail.com> In-Reply-To: <1333397837-5389-1-git-send-email-oskar.andero@gmail.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] versatilepb: add i2c support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Oskar Andero Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, paul@codesourcery.com Am 02.04.2012 22:17, schrieb Oskar Andero: > Signed-off-by: Oskar Andero > --- > hw/versatilepb.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 1 files changed, 80 insertions(+), 0 deletions(-) >=20 > 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" > =20 > /* Primary interrupt controller. */ > =20 > +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 =3D { > .class_init =3D vpb_sic_class_init, > }; > =20 > +static TypeInfo vpb_i2c_info =3D { static const, please, since you don't modify it. > + .name =3D "vpb_i2c", > + .parent =3D TYPE_SYS_BUS_DEVICE, > + .instance_size =3D sizeof(vpb_i2c_state), > + .class_init =3D vpb_i2c_class_init, > +}; > + > static void versatilepb_register_types(void) > { > type_register_static(&vpb_sic_info); > + type_register_static(&vpb_i2c_info); > } > =20 > type_init(versatilepb_register_types) Otherwise looks okay technically; don't know about I2C personally. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg