I2C_TRANSFER support is no longer optional

This commit is contained in:
Gregory Nutt 2016-01-31 14:00:53 -06:00
parent 2d41fb26b8
commit 2171438c61
15 changed files with 14 additions and 100 deletions

View File

@ -335,11 +335,8 @@ static int efm32_i2c_write(FAR struct i2c_master_s *dev, const uint8_t * buffer,
int buflen);
static int efm32_i2c_read(FAR struct i2c_master_s *dev, uint8_t * buffer,
int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int efm32_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
#endif /* CONFIG_I2C_TRANSFER */
#ifdef CONFIG_I2C_TRACE
static const char *efm32_i2c_state_str(int i2c_state);
@ -412,12 +409,10 @@ static struct efm32_i2c_priv_s efm32_i2c1_priv =
static const struct i2c_ops_s efm32_i2c_ops =
{
.setfrequency = efm32_i2c_setfrequency,
.setaddress = efm32_i2c_setaddress,
.write = efm32_i2c_write,
.read = efm32_i2c_read
#ifdef CONFIG_I2C_TRANSFER
, .transfer = efm32_i2c_transfer
#endif
.setaddress = efm32_i2c_setaddress,
.write = efm32_i2c_write,
.read = efm32_i2c_read,
.transfer = efm32_i2c_transfer
};
/****************************************************************************
@ -1698,13 +1693,11 @@ int efm32_i2c_read(FAR struct i2c_master_s *dev, uint8_t * buffer, int buflen)
*
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int efm32_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
{
return efm32_i2c_process(dev, msgs, count);
}
#endif
/****************************************************************************
* Public Functions

View File

@ -140,10 +140,8 @@ static int lpc11_i2c_write(FAR struct i2c_master_s *dev,
const uint8_t *buffer, int buflen);
static int lpc11_i2c_read(FAR struct i2c_master_s *dev, uint8_t *buffer,
int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int lpc11_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
#endif
static void lpc11_stopnext(struct lpc11_i2cdev_s *priv);
/****************************************************************************
@ -166,9 +164,7 @@ struct i2c_ops_s lpc11_i2c_ops =
.setaddress = lpc11_i2c_setaddress,
.write = lpc11_i2c_write,
.read = lpc11_i2c_read,
#ifdef CONFIG_I2C_TRANSFER
.transfer = lpc11_i2c_transfer
#endif
};
/****************************************************************************
@ -372,7 +368,6 @@ static void lpc11_i2c_timeout(int argc, uint32_t arg, ...)
*
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int lpc11_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
{
@ -390,7 +385,6 @@ static int lpc11_i2c_transfer(FAR struct i2c_master_s *dev,
return ret;
}
#endif
/****************************************************************************
* Name: lpc11_i2c_interrupt

View File

@ -140,10 +140,8 @@ static int lpc17_i2c_write(FAR struct i2c_master_s *dev,
const uint8_t *buffer, int buflen);
static int lpc17_i2c_read(FAR struct i2c_master_s *dev, uint8_t *buffer,
int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int lpc17_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
#endif
static void lpc17_stopnext(struct lpc17_i2cdev_s *priv);
/****************************************************************************
@ -166,9 +164,7 @@ struct i2c_ops_s lpc17_i2c_ops =
.setaddress = lpc17_i2c_setaddress,
.write = lpc17_i2c_write,
.read = lpc17_i2c_read,
#ifdef CONFIG_I2C_TRANSFER
.transfer = lpc17_i2c_transfer
#endif
};
/****************************************************************************
@ -372,7 +368,6 @@ static void lpc17_i2c_timeout(int argc, uint32_t arg, ...)
*
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int lpc17_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
{
@ -390,7 +385,6 @@ static int lpc17_i2c_transfer(FAR struct i2c_master_s *dev,
return ret;
}
#endif
/****************************************************************************
* Name: lpc17_i2c_interrupt

View File

@ -145,10 +145,8 @@ static int lpc2378_i2c_write(FAR struct i2c_master_s *dev,
const uint8_t *buffer, int buflen);
static int lpc2378_i2c_read(FAR struct i2c_master_s *dev, uint8_t *buffer,
int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int lpc2378_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
#endif
static void lpc2378_stopnext(struct lpc2378_i2cdev_s *priv);
/****************************************************************************
@ -171,9 +169,7 @@ struct i2c_ops_s lpc2378_i2c_ops =
.setaddress = lpc2378_i2c_setaddress,
.write = lpc2378_i2c_write,
.read = lpc2378_i2c_read,
#ifdef CONFIG_I2C_TRANSFER
.transfer = lpc2378_i2c_transfer
#endif
};
/****************************************************************************
@ -377,7 +373,6 @@ static void lpc2378_i2c_timeout(int argc, uint32_t arg, ...)
*
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int lpc2378_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
{
@ -395,7 +390,6 @@ static int lpc2378_i2c_transfer(FAR struct i2c_master_s *dev,
return ret;
}
#endif
/****************************************************************************
* Name: lpc2378_i2c_interrupt

View File

@ -137,9 +137,7 @@ struct i2c_ops_s lpc31_i2c_ops =
.setaddress = i2c_setaddress,
.write = i2c_write,
.read = i2c_read,
#ifdef CONFIG_I2C_TRANSFER
.transfer = i2c_transfer
#endif
};
/****************************************************************************

View File

@ -144,10 +144,8 @@ static int lpc43_i2c_write(FAR struct i2c_master_s *dev,
const uint8_t *buffer, int buflen);
static int lpc43_i2c_read(FAR struct i2c_master_s *dev, uint8_t *buffer,
int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int lpc43_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
#endif
struct i2c_ops_s lpc43_i2c_ops =
{
@ -155,9 +153,7 @@ struct i2c_ops_s lpc43_i2c_ops =
.setaddress = lpc43_i2c_setaddress,
.write = lpc43_i2c_write,
.read = lpc43_i2c_read,
#ifdef CONFIG_I2C_TRANSFER
.transfer = lpc43_i2c_transfer
#endif
};
/****************************************************************************

View File

@ -195,10 +195,8 @@ static int twi_setaddress(FAR struct i2c_master_s *dev, int addr, int nbits);
static int twi_write(FAR struct i2c_master_s *dev, const uint8_t *buffer,
int buflen);
static int twi_read(FAR struct i2c_master_s *dev, uint8_t *buffer, int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int twi_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
#endif
/* Initialization */
@ -225,9 +223,7 @@ struct i2c_ops_s g_twiops =
.setaddress = twi_setaddress,
.write = twi_write,
.read = twi_read,
#ifdef CONFIG_I2C_TRANSFER
.transfer = twi_transfer
#endif
};
/****************************************************************************
@ -897,7 +893,6 @@ static int twi_read(FAR struct i2c_master_s *dev, uint8_t *rbuffer, int rbuflen)
*
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int twi_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
{
@ -939,7 +934,6 @@ static int twi_transfer(FAR struct i2c_master_s *dev,
twi_givesem(&priv->exclsem);
return ret;
}
#endif
/****************************************************************************
* Initialization

View File

@ -242,10 +242,8 @@ static int twi_setaddress(FAR struct i2c_master_s *dev, int addr, int nbits);
static int twi_write(FAR struct i2c_master_s *dev, const uint8_t *buffer,
int buflen);
static int twi_read(FAR struct i2c_master_s *dev, uint8_t *buffer, int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int twi_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
#endif
/* Initialization */
@ -323,9 +321,7 @@ struct i2c_ops_s g_twiops =
.setaddress = twi_setaddress,
.write = twi_write,
.read = twi_read,
#ifdef CONFIG_I2C_TRANSFER
.transfer = twi_transfer
#endif
};
/****************************************************************************
@ -1014,7 +1010,6 @@ static int twi_read(FAR struct i2c_master_s *dev, uint8_t *rbuffer, int rbuflen)
*
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int twi_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
{
@ -1070,7 +1065,6 @@ static int twi_transfer(FAR struct i2c_master_s *dev,
twi_givesem(&priv->exclsem);
return ret;
}
#endif
/****************************************************************************
* Initialization

View File

@ -237,10 +237,8 @@ static int twi_setaddress(FAR struct i2c_master_s *dev, int addr, int nbits);
static int twi_write(FAR struct i2c_master_s *dev, const uint8_t *buffer,
int buflen);
static int twi_read(FAR struct i2c_master_s *dev, uint8_t *buffer, int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int twi_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
#endif
/* Initialization */
@ -303,9 +301,7 @@ struct i2c_ops_s g_twiops =
.setaddress = twi_setaddress,
.write = twi_write,
.read = twi_read,
#ifdef CONFIG_I2C_TRANSFER
.transfer = twi_transfer
#endif
};
/****************************************************************************
@ -1041,7 +1037,6 @@ static int twi_read(FAR struct i2c_master_s *dev, uint8_t *rbuffer, int rbuflen)
*
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int twi_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
{
@ -1097,7 +1092,6 @@ static int twi_transfer(FAR struct i2c_master_s *dev,
twi_givesem(&priv->exclsem);
return ret;
}
#endif
/****************************************************************************
* Initialization

View File

@ -356,11 +356,8 @@ static int stm32_i2c_process(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s
static int stm32_i2c_write(FAR struct i2c_master_s *dev, const uint8_t *buffer,
int buflen);
static int stm32_i2c_read(FAR struct i2c_master_s *dev, uint8_t *buffer, int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s *msgs,
int count);
#endif /* CONFIG_I2C_TRANSFER */
/************************************************************************************
* Private Data
@ -481,10 +478,8 @@ static const struct i2c_ops_s stm32_i2c_ops =
.setfrequency = stm32_i2c_setfrequency,
.setaddress = stm32_i2c_setaddress,
.write = stm32_i2c_write,
.read = stm32_i2c_read
#ifdef CONFIG_I2C_TRANSFER
, .transfer = stm32_i2c_transfer
#endif
.read = stm32_i2c_read,
.transfer = stm32_i2c_transfer
};
/************************************************************************************
@ -1908,14 +1903,12 @@ int stm32_i2c_read(FAR struct i2c_master_s *dev, uint8_t *buffer, int buflen)
*
************************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s *msgs,
int count)
{
stm32_i2c_sem_wait(dev); /* Ensure that address or flags don't change meanwhile */
return stm32_i2c_process(dev, msgs, count);
}
#endif
/************************************************************************************
* Public Functions

View File

@ -385,11 +385,8 @@ static int stm32_i2c_process(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s
static int stm32_i2c_write(FAR struct i2c_master_s *dev, const uint8_t *buffer,
int buflen);
static int stm32_i2c_read(FAR struct i2c_master_s *dev, uint8_t *buffer, int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s *msgs,
int count);
#endif /* CONFIG_I2C_TRANSFER */
/************************************************************************************
* Private Data
@ -489,10 +486,8 @@ static const struct i2c_ops_s stm32_i2c_ops =
.setfrequency = stm32_i2c_setfrequency,
.setaddress = stm32_i2c_setaddress,
.write = stm32_i2c_write,
.read = stm32_i2c_read
#ifdef CONFIG_I2C_TRANSFER
, .transfer = stm32_i2c_transfer
#endif
.read = stm32_i2c_read,
.transfer = stm32_i2c_transfer
};
/************************************************************************************
@ -2352,14 +2347,12 @@ int stm32_i2c_read(FAR struct i2c_master_s *dev, uint8_t *buffer, int buflen)
*
************************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s *msgs,
int count)
{
stm32_i2c_sem_wait(dev); /* Ensure that address or flags don't change meanwhile */
return stm32_i2c_process(dev, msgs, count);
}
#endif
/************************************************************************************
* Public Functions

View File

@ -342,10 +342,8 @@ static int stm32_i2c_process(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s
static int stm32_i2c_write(FAR struct i2c_master_s *dev, const uint8_t *buffer,
int buflen);
static int stm32_i2c_read(FAR struct i2c_master_s *dev, uint8_t *buffer, int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s *msgs,
int count);
#endif
/************************************************************************************
* Private Data
@ -445,10 +443,8 @@ struct i2c_ops_s stm32_i2c_ops =
.setfrequency = stm32_i2c_setfrequency,
.setaddress = stm32_i2c_setaddress,
.write = stm32_i2c_write,
.read = stm32_i2c_read
#ifdef CONFIG_I2C_TRANSFER
, .transfer = stm32_i2c_transfer
#endif
.read = stm32_i2c_read,
.transfer = stm32_i2c_transfer
};
/************************************************************************************
@ -1908,14 +1904,12 @@ int stm32_i2c_read(FAR struct i2c_master_s *dev, uint8_t *buffer, int buflen)
*
************************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s *msgs,
int count)
{
stm32_i2c_sem_wait(dev); /* ensure that address or flags don't change meanwhile */
return stm32_i2c_process(dev, msgs, count);
}
#endif
/************************************************************************************
* Public Functions

View File

@ -348,11 +348,8 @@ static int tiva_i2c_process(struct i2c_master_s *dev, struct i2c_msg_s *msgv,
static int tiva_i2c_write(struct i2c_master_s *dev, const uint8_t *buffer,
int buflen);
static int tiva_i2c_read(struct i2c_master_s *dev, uint8_t *buffer, int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int tiva_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgv,
int msgc);
#endif /* CONFIG_I2C_TRANSFER */
/************************************************************************************
* Private Data
@ -585,10 +582,8 @@ static const struct i2c_ops_s tiva_i2c_ops =
.setfrequency = tiva_i2c_setfrequency,
.setaddress = tiva_i2c_setaddress,
.write = tiva_i2c_write,
.read = tiva_i2c_read
#ifdef CONFIG_I2C_TRANSFER
, .transfer = tiva_i2c_transfer
#endif
.read = tiva_i2c_read,
.transfer = tiva_i2c_transfer
};
/************************************************************************************
@ -2136,7 +2131,6 @@ int tiva_i2c_read(struct i2c_master_s *dev, uint8_t *buffer, int buflen)
*
************************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int tiva_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgv,
int msgc)
{
@ -2149,7 +2143,6 @@ static int tiva_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgv,
tiva_i2c_sem_wait(dev); /* Ensure that address or flags don't change meanwhile */
return tiva_i2c_process(dev, msgv, msgc);
}
#endif
/************************************************************************************
* Public Functions

View File

@ -104,10 +104,8 @@ static int ez80_i2c_write(FAR struct i2c_master_s *dev,
FAR const uint8_t *buffer, int buflen);
static int ez80_i2c_read(FAR struct i2c_master_s *dev,
FAR uint8_t *buffer, int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int ez80_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
#endif
/****************************************************************************
* Public Function Prototypes
@ -130,10 +128,8 @@ const struct i2c_ops_s g_ops =
ez80_i2c_setfrequency,
ez80_i2c_setaddress,
ez80_i2c_write,
ez80_i2c_read
#ifdef CONFIG_I2C_TRANSFER
, ez80_i2c_transfer
#endif
ez80_i2c_read,
ez80_i2c_transfer
};
/****************************************************************************
@ -965,7 +961,6 @@ static int ez80_i2c_read(FAR struct i2c_master_s *dev, FAR uint8_t *buffer,
*
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int ez80_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
{
@ -1045,7 +1040,6 @@ static int ez80_i2c_transfer(FAR struct i2c_master_s *dev,
ez80_i2c_semgive();
return ret;
}
#endif
/****************************************************************************
* Public Functions

View File

@ -98,10 +98,8 @@ static int z8_i2c_write(FAR struct i2c_master_s *dev,
FAR const uint8_t *buffer, int buflen);
static int z8_i2c_read(FAR struct i2c_master_s *dev,
FAR uint8_t *buffer, int buflen);
#ifdef CONFIG_I2C_TRANSFER
static int z8_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count);
#endif
/****************************************************************************
* Public Function Prototypes
@ -715,7 +713,6 @@ static int z8_i2c_read(FAR struct i2c_master_s *dev, FAR uint8_t *buffer,
*
****************************************************************************/
#ifdef CONFIG_I2C_TRANSFER
static int z8_i2c_transfer(FAR struct i2c_master_s *dev,
FAR struct i2c_msg_s *msgs, int count)
{
@ -795,7 +792,6 @@ static int z8_i2c_transfer(FAR struct i2c_master_s *dev,
z8_i2c_semgive();
return ret;
}
#endif
/****************************************************************************
* Public Functions