[U-Boot] [PATCH 04/55] dm: i2c: Move definitions to the top of the header file
Heiko Schocher denx
hs at denx.de
Fri Jul 3 08:55:22 CEST 2015
Hello Simon,
Am 03.07.2015 um 02:15 schrieb Simon Glass:
> Move the flags and struct definitions higher in the file so that we can
> reference them with functions declared in the driver model section.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> include/i2c.h | 86 +++++++++++++++++++++++++++++------------------------------
> 1 file changed, 43 insertions(+), 43 deletions(-)
Acked-by: Heiko Schocher <hs at denx.de>
bye,
Heiko
>
> diff --git a/include/i2c.h b/include/i2c.h
> index e1ad8d8..4c0e263 100644
> --- a/include/i2c.h
> +++ b/include/i2c.h
> @@ -74,6 +74,49 @@ struct dm_i2c_bus {
> int speed_hz;
> };
>
> +/*
> + * Not all of these flags are implemented in the U-Boot API
> + */
> +enum dm_i2c_msg_flags {
> + I2C_M_TEN = 0x0010, /* ten-bit chip address */
> + I2C_M_RD = 0x0001, /* read data, from slave to master */
> + I2C_M_STOP = 0x8000, /* send stop after this message */
> + I2C_M_NOSTART = 0x4000, /* no start before this message */
> + I2C_M_REV_DIR_ADDR = 0x2000, /* invert polarity of R/W bit */
> + I2C_M_IGNORE_NAK = 0x1000, /* continue after NAK */
> + I2C_M_NO_RD_ACK = 0x0800, /* skip the Ack bit on reads */
> + I2C_M_RECV_LEN = 0x0400, /* length is first received byte */
> +};
> +
> +/**
> + * struct i2c_msg - an I2C message
> + *
> + * @addr: Slave address
> + * @flags: Flags (see enum dm_i2c_msg_flags)
> + * @len: Length of buffer in bytes, may be 0 for a probe
> + * @buf: Buffer to send/receive, or NULL if no data
> + */
> +struct i2c_msg {
> + uint addr;
> + uint flags;
> + uint len;
> + u8 *buf;
> +};
> +
> +/**
> + * struct i2c_msg_list - a list of I2C messages
> + *
> + * This is called i2c_rdwr_ioctl_data in Linux but the name does not seem
> + * appropriate in U-Boot.
> + *
> + * @msg: Pointer to i2c_msg array
> + * @nmsgs: Number of elements in the array
> + */
> +struct i2c_msg_list {
> + struct i2c_msg *msgs;
> + uint nmsgs;
> +};
> +
> /**
> * dm_i2c_read() - read bytes from an I2C chip
> *
> @@ -294,49 +337,6 @@ void i2c_reg_write(uint8_t addr, uint8_t reg, uint8_t val);
>
> #endif
>
> -/*
> - * Not all of these flags are implemented in the U-Boot API
> - */
> -enum dm_i2c_msg_flags {
> - I2C_M_TEN = 0x0010, /* ten-bit chip address */
> - I2C_M_RD = 0x0001, /* read data, from slave to master */
> - I2C_M_STOP = 0x8000, /* send stop after this message */
> - I2C_M_NOSTART = 0x4000, /* no start before this message */
> - I2C_M_REV_DIR_ADDR = 0x2000, /* invert polarity of R/W bit */
> - I2C_M_IGNORE_NAK = 0x1000, /* continue after NAK */
> - I2C_M_NO_RD_ACK = 0x0800, /* skip the Ack bit on reads */
> - I2C_M_RECV_LEN = 0x0400, /* length is first received byte */
> -};
> -
> -/**
> - * struct i2c_msg - an I2C message
> - *
> - * @addr: Slave address
> - * @flags: Flags (see enum dm_i2c_msg_flags)
> - * @len: Length of buffer in bytes, may be 0 for a probe
> - * @buf: Buffer to send/receive, or NULL if no data
> - */
> -struct i2c_msg {
> - uint addr;
> - uint flags;
> - uint len;
> - u8 *buf;
> -};
> -
> -/**
> - * struct i2c_msg_list - a list of I2C messages
> - *
> - * This is called i2c_rdwr_ioctl_data in Linux but the name does not seem
> - * appropriate in U-Boot.
> - *
> - * @msg: Pointer to i2c_msg array
> - * @nmsgs: Number of elements in the array
> - */
> -struct i2c_msg_list {
> - struct i2c_msg *msgs;
> - uint nmsgs;
> -};
> -
> /**
> * struct dm_i2c_ops - driver operations for I2C uclass
> *
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
More information about the U-Boot
mailing list