Merge tag 'at24-4.20-updates-for-wolfram' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-4.20
AT24 updates for 4.20 Single patch from Wang Xin improving the read/write loop in at24 under high load.
Este commit está contenido en:
@@ -140,6 +140,7 @@
|
||||
|
||||
#define SBREG_BAR 0x10
|
||||
#define SBREG_SMBCTRL 0xc6000c
|
||||
#define SBREG_SMBCTRL_DNV 0xcf000c
|
||||
|
||||
/* Host status bits for SMBPCISTS */
|
||||
#define SMBPCISTS_INTS BIT(3)
|
||||
@@ -1399,7 +1400,11 @@ static void i801_add_tco(struct i801_priv *priv)
|
||||
spin_unlock(&p2sb_spinlock);
|
||||
|
||||
res = &tco_res[ICH_RES_MEM_OFF];
|
||||
res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL;
|
||||
if (pci_dev->device == PCI_DEVICE_ID_INTEL_DNV_SMBUS)
|
||||
res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL_DNV;
|
||||
else
|
||||
res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL;
|
||||
|
||||
res->end = res->start + 3;
|
||||
res->flags = IORESOURCE_MEM;
|
||||
|
||||
|
@@ -538,7 +538,6 @@ static const struct i2c_algorithm lpi2c_imx_algo = {
|
||||
|
||||
static const struct of_device_id lpi2c_imx_of_match[] = {
|
||||
{ .compatible = "fsl,imx7ulp-lpi2c" },
|
||||
{ .compatible = "fsl,imx8dv-lpi2c" },
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, lpi2c_imx_of_match);
|
||||
|
@@ -401,11 +401,8 @@ static int uniphier_fi2c_master_xfer(struct i2c_adapter *adap,
|
||||
return ret;
|
||||
|
||||
for (msg = msgs; msg < emsg; msg++) {
|
||||
/* If next message is read, skip the stop condition */
|
||||
bool stop = !(msg + 1 < emsg && msg[1].flags & I2C_M_RD);
|
||||
/* but, force it if I2C_M_STOP is set */
|
||||
if (msg->flags & I2C_M_STOP)
|
||||
stop = true;
|
||||
/* Emit STOP if it is the last message or I2C_M_STOP is set. */
|
||||
bool stop = (msg + 1 == emsg) || (msg->flags & I2C_M_STOP);
|
||||
|
||||
ret = uniphier_fi2c_master_xfer_one(adap, msg, stop);
|
||||
if (ret)
|
||||
|
@@ -248,11 +248,8 @@ static int uniphier_i2c_master_xfer(struct i2c_adapter *adap,
|
||||
return ret;
|
||||
|
||||
for (msg = msgs; msg < emsg; msg++) {
|
||||
/* If next message is read, skip the stop condition */
|
||||
bool stop = !(msg + 1 < emsg && msg[1].flags & I2C_M_RD);
|
||||
/* but, force it if I2C_M_STOP is set */
|
||||
if (msg->flags & I2C_M_STOP)
|
||||
stop = true;
|
||||
/* Emit STOP if it is the last message or I2C_M_STOP is set. */
|
||||
bool stop = (msg + 1 == emsg) || (msg->flags & I2C_M_STOP);
|
||||
|
||||
ret = uniphier_i2c_master_xfer_one(adap, msg, stop);
|
||||
if (ret)
|
||||
|
@@ -532,6 +532,7 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
|
||||
{
|
||||
u8 rx_watermark;
|
||||
struct i2c_msg *msg = i2c->rx_msg = i2c->tx_msg;
|
||||
unsigned long flags;
|
||||
|
||||
/* Clear and enable Rx full interrupt. */
|
||||
xiic_irq_clr_en(i2c, XIIC_INTR_RX_FULL_MASK | XIIC_INTR_TX_ERROR_MASK);
|
||||
@@ -547,6 +548,7 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
|
||||
rx_watermark = IIC_RX_FIFO_DEPTH;
|
||||
xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, rx_watermark - 1);
|
||||
|
||||
local_irq_save(flags);
|
||||
if (!(msg->flags & I2C_M_NOSTART))
|
||||
/* write the address */
|
||||
xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET,
|
||||
@@ -556,6 +558,8 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
|
||||
|
||||
xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET,
|
||||
msg->len | ((i2c->nmsgs == 1) ? XIIC_TX_DYN_STOP_MASK : 0));
|
||||
local_irq_restore(flags);
|
||||
|
||||
if (i2c->nmsgs == 1)
|
||||
/* very last, enable bus not busy as well */
|
||||
xiic_irq_clr_en(i2c, XIIC_INTR_BNB_MASK);
|
||||
|
Referencia en una nueva incidencia
Block a user