drivers/i2c: fixed nxstyle warnings
This commit is contained in:
parent
2b9bdc04cc
commit
f26dda88d1
6 changed files with 19 additions and 14 deletions
|
@ -417,7 +417,6 @@ int i2c_register(FAR struct i2c_master_s *i2c, int bus)
|
|||
return OK;
|
||||
}
|
||||
|
||||
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,8 @@
|
|||
*
|
||||
* Input Parameters:
|
||||
* dev - Device-specific state data
|
||||
* buffer - A pointer to a buffer of data to receive the data from the device
|
||||
* buffer - A pointer to a buffer of data to receive the data from the
|
||||
* device
|
||||
* buflen - The requested number of bytes to be read
|
||||
*
|
||||
* Returned Value:
|
||||
|
|
|
@ -58,7 +58,8 @@
|
|||
* Input Parameters:
|
||||
* dev - Device-specific state data
|
||||
* config - Described the I2C configuration
|
||||
* buffer - A pointer to the read-only buffer of data to be written to device
|
||||
* buffer - A pointer to the read-only buffer of data to be written to
|
||||
* device
|
||||
* buflen - The number of bytes to send from the buffer
|
||||
*
|
||||
* Returned Value:
|
||||
|
|
|
@ -57,9 +57,11 @@
|
|||
* Input Parameters:
|
||||
* dev - Device-specific state data
|
||||
* config - Described the I2C configuration
|
||||
* wbuffer - A pointer to the read-only buffer of data to be written to device
|
||||
* wbuffer - A pointer to the read-only buffer of data to be written to
|
||||
* device
|
||||
* wbuflen - The number of bytes to send from the buffer
|
||||
* rbuffer - A pointer to a buffer of data to receive the data from the device
|
||||
* rbuffer - A pointer to a buffer of data to receive the data from the
|
||||
* device
|
||||
* rbuflen - The requested number of bytes to be read
|
||||
*
|
||||
* Returned Value:
|
||||
|
|
|
@ -144,18 +144,19 @@ static int pca9540bdp_select_port(FAR struct pca9540bdp_dev_s *priv,
|
|||
return OK;
|
||||
}
|
||||
|
||||
/* Modify state and write it to the mux */
|
||||
/* selecting a port always enables the device */
|
||||
/* Modify state and write it to the mux. Selecting a port always enables
|
||||
* the device
|
||||
*/
|
||||
|
||||
priv->state = PCA9540BDP_ENABLE | val;
|
||||
return (pca9540bdp_write_config(priv, priv->state) == 0) ? OK : -ECOMM;
|
||||
}
|
||||
|
||||
static int pca9540bdp_transfer_on_port(FAR struct i2c_master_s* dev,
|
||||
static int pca9540bdp_transfer_on_port(FAR struct i2c_master_s *dev,
|
||||
FAR struct i2c_msg_s *msgs, int count)
|
||||
{
|
||||
FAR struct i2c_port_dev_s* port_dev = (FAR struct i2c_port_dev_s*) dev;
|
||||
FAR struct pca9540bdp_dev_s* priv = port_dev->dev;
|
||||
FAR struct i2c_port_dev_s *port_dev = (FAR struct i2c_port_dev_s *)dev;
|
||||
FAR struct pca9540bdp_dev_s *priv = port_dev->dev;
|
||||
int ret;
|
||||
|
||||
/* select the mux port */
|
||||
|
@ -177,8 +178,8 @@ static int pca9540bdp_transfer_on_port(FAR struct i2c_master_s* dev,
|
|||
#ifdef CONFIG_I2C_RESET
|
||||
static int pca9540bdp_reset_on_port (FAR struct i2c_master_s *dev)
|
||||
{
|
||||
FAR struct i2c_port_dev_s* port_dev = (struct i2c_port_dev_s*) dev;
|
||||
FAR struct pca9540bdp_dev_s* priv = port_dev->dev;
|
||||
FAR struct i2c_port_dev_s *port_dev = (struct i2c_port_dev_s *)dev;
|
||||
FAR struct pca9540bdp_dev_s *priv = port_dev->dev;
|
||||
int port = port_dev->port;
|
||||
int ret;
|
||||
|
||||
|
@ -307,7 +308,8 @@ FAR struct pca9540bdp_dev_s *
|
|||
return NULL; /* signal error condition */
|
||||
}
|
||||
|
||||
i2cinfo("PCA9549BDP (addr=0x%02x) set up with port %d\n", priv->addr, PCA9540BDP_SEL_PORT0);
|
||||
i2cinfo("PCA9549BDP (addr=0x%02x) set up with port %d\n", priv->addr,
|
||||
PCA9540BDP_SEL_PORT0);
|
||||
|
||||
return priv;
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ struct i2c_port_dev_s
|
|||
FAR struct i2c_master_s vi2c; /* Nested structure to allow casting as
|
||||
* public i2c master */
|
||||
uint8_t port; /* Associated port on the mux */
|
||||
FAR struct pca9540bdp_dev_s* dev; /* Associated device */
|
||||
FAR struct pca9540bdp_dev_s *dev; /* Associated device */
|
||||
};
|
||||
|
||||
#endif /* CONFIG_I2CMULTIPLEXER_PCA9540BDP */
|
||||
|
|
Loading…
Reference in a new issue