mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
i2c: pxa: add support for SCCB devices
Add support for SCCB by implementing I2C_M_IGNORE_NAK and I2C_M_STOP flags and advertising functionality flag I2C_FUNC_PROTOCOL_MANGLING. Also fixed missing functionality flag I2C_FUNC_NOSTART. Signed-off-by: Petr Cvek <petr.cvek@tul.cz> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
23173eae7b
commit
86261fdd65
@ -885,7 +885,9 @@ static void i2c_pxa_irq_txempty(struct pxa_i2c *i2c, u32 isr)
|
|||||||
return; /* ignore */
|
return; /* ignore */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isr & ISR_BED) {
|
if ((isr & ISR_BED) &&
|
||||||
|
(!((i2c->msg->flags & I2C_M_IGNORE_NAK) &&
|
||||||
|
(isr & ISR_ACKNAK)))) {
|
||||||
int ret = BUS_ERROR;
|
int ret = BUS_ERROR;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -919,12 +921,14 @@ static void i2c_pxa_irq_txempty(struct pxa_i2c *i2c, u32 isr)
|
|||||||
icr |= ICR_ALDIE | ICR_TB;
|
icr |= ICR_ALDIE | ICR_TB;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this is the last byte of the last message, send
|
* If this is the last byte of the last message or last byte
|
||||||
* a STOP.
|
* of any message with I2C_M_STOP (e.g. SCCB), send a STOP.
|
||||||
*/
|
*/
|
||||||
if (i2c->msg_ptr == i2c->msg->len &&
|
if ((i2c->msg_ptr == i2c->msg->len) &&
|
||||||
i2c->msg_idx == i2c->msg_num - 1)
|
((i2c->msg->flags & I2C_M_STOP) ||
|
||||||
icr |= ICR_STOP;
|
(i2c->msg_idx == i2c->msg_num - 1)))
|
||||||
|
icr |= ICR_STOP;
|
||||||
|
|
||||||
} else if (i2c->msg_idx < i2c->msg_num - 1) {
|
} else if (i2c->msg_idx < i2c->msg_num - 1) {
|
||||||
/*
|
/*
|
||||||
* Next segment of the message.
|
* Next segment of the message.
|
||||||
@ -1071,7 +1075,8 @@ static int i2c_pxa_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num
|
|||||||
|
|
||||||
static u32 i2c_pxa_functionality(struct i2c_adapter *adap)
|
static u32 i2c_pxa_functionality(struct i2c_adapter *adap)
|
||||||
{
|
{
|
||||||
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
|
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL |
|
||||||
|
I2C_FUNC_PROTOCOL_MANGLING | I2C_FUNC_NOSTART;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct i2c_algorithm i2c_pxa_algorithm = {
|
static const struct i2c_algorithm i2c_pxa_algorithm = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user