qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/5] exynos4210: add Exynos4210 i2c implementati


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 3/5] exynos4210: add Exynos4210 i2c implementation
Date: Tue, 6 Mar 2012 18:49:21 +0000

On 2 March 2012 11:35, Igor Mitsyanko <address@hidden> wrote:
> Create 9 exynos4210 i2c interfaces.
>
> Signed-off-by: Igor Mitsyanko <address@hidden>

> +#define EXYNOS4_I2C(obj)                  \
> +OBJECT_CHECK(Exynos4210I2CState, (obj), TYPE_EXYNOS4_I2C)
> +#define EXYNOS4_I2C_SLAVE(obj)            \
> +OBJECT_CHECK(Exynos4210I2CSlave, (obj), TYPE_EXYNOS4_I2C_SLAVE)

Can you indent the second and subsequent lines of multi-line
macro definitions, please?

> +enum {
> +    idle,
> +    start_bit_received,
> +    sending_data,
> +    receiving_data
> +};
> +
> +struct Exynos4210I2CSlave {
> +    I2CSlave i2c;
> +    Exynos4210I2CState *host;
> +    uint32_t status;
> +};

I'm confused about the purpose of this class. My (possibly naive)
model of i2c is that there's a controller (in this case TYPE_EXYNOS4_I2C
, with its state in the struct Exynos4210I2CState) which is a subclass
of SysBus or whatever, and then there are i2c slaves, which are
subclasses of TYPE_I2C_SLAVE and communicate with the controller
strictly via the methods provided by the I2C_SLAVE class. But
this seems to be an I2CSlave subclass which has a direct pointer to
the internal state of the controller and very little state of its own.
What's it for?

> +static const VMStateDescription exynos4210_i2c_vmstate = {
> +    .name = TYPE_EXYNOS4_I2C,
> +    .version_id = 1,
> +    .minimum_version_id = 1,
> +    .fields      = (VMStateField[]) {

Why the big space?

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]