[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] versatilepb: add i2c support
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH] versatilepb: add i2c support |
Date: |
Tue, 03 Apr 2012 11:13:46 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120312 Thunderbird/11.0 |
Am 02.04.2012 22:17, schrieb Oskar Andero:
> Signed-off-by: Oskar Andero <address@hidden>
> ---
> 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