Commit cefc06e4 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'i2c-for-6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
 "Usual business: a driver fix, a DT fix, a minor core fix"

* tag 'i2c-for-6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: npcm7xx: Fix callback completion ordering
  i2c: mux: Avoid potential false error message in i2c_mux_add_adapter
  dt-bindings: i2c: mxs: Pass ref and 'unevaluatedProperties: false'
parents 830380e3 92e73d80
...@@ -9,6 +9,9 @@ title: Freescale MXS Inter IC (I2C) Controller ...@@ -9,6 +9,9 @@ title: Freescale MXS Inter IC (I2C) Controller
maintainers: maintainers:
- Shawn Guo <shawnguo@kernel.org> - Shawn Guo <shawnguo@kernel.org>
allOf:
- $ref: /schemas/i2c/i2c-controller.yaml#
properties: properties:
compatible: compatible:
enum: enum:
...@@ -37,7 +40,7 @@ required: ...@@ -37,7 +40,7 @@ required:
- dmas - dmas
- dma-names - dma-names
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -694,6 +694,7 @@ static void npcm_i2c_callback(struct npcm_i2c *bus, ...@@ -694,6 +694,7 @@ static void npcm_i2c_callback(struct npcm_i2c *bus,
{ {
struct i2c_msg *msgs; struct i2c_msg *msgs;
int msgs_num; int msgs_num;
bool do_complete = false;
msgs = bus->msgs; msgs = bus->msgs;
msgs_num = bus->msgs_num; msgs_num = bus->msgs_num;
...@@ -722,23 +723,17 @@ static void npcm_i2c_callback(struct npcm_i2c *bus, ...@@ -722,23 +723,17 @@ static void npcm_i2c_callback(struct npcm_i2c *bus,
msgs[1].flags & I2C_M_RD) msgs[1].flags & I2C_M_RD)
msgs[1].len = info; msgs[1].len = info;
} }
if (completion_done(&bus->cmd_complete) == false) do_complete = true;
complete(&bus->cmd_complete); break;
break;
case I2C_NACK_IND: case I2C_NACK_IND:
/* MASTER transmit got a NACK before tx all bytes */ /* MASTER transmit got a NACK before tx all bytes */
bus->cmd_err = -ENXIO; bus->cmd_err = -ENXIO;
if (bus->master_or_slave == I2C_MASTER) do_complete = true;
complete(&bus->cmd_complete);
break; break;
case I2C_BUS_ERR_IND: case I2C_BUS_ERR_IND:
/* Bus error */ /* Bus error */
bus->cmd_err = -EAGAIN; bus->cmd_err = -EAGAIN;
if (bus->master_or_slave == I2C_MASTER) do_complete = true;
complete(&bus->cmd_complete);
break; break;
case I2C_WAKE_UP_IND: case I2C_WAKE_UP_IND:
/* I2C wake up */ /* I2C wake up */
...@@ -752,6 +747,8 @@ static void npcm_i2c_callback(struct npcm_i2c *bus, ...@@ -752,6 +747,8 @@ static void npcm_i2c_callback(struct npcm_i2c *bus,
if (bus->slave) if (bus->slave)
bus->master_or_slave = I2C_SLAVE; bus->master_or_slave = I2C_SLAVE;
#endif #endif
if (do_complete)
complete(&bus->cmd_complete);
} }
static u8 npcm_i2c_fifo_usage(struct npcm_i2c *bus) static u8 npcm_i2c_fifo_usage(struct npcm_i2c *bus)
......
...@@ -341,7 +341,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc, ...@@ -341,7 +341,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
priv->adap.lock_ops = &i2c_parent_lock_ops; priv->adap.lock_ops = &i2c_parent_lock_ops;
/* Sanity check on class */ /* Sanity check on class */
if (i2c_mux_parent_classes(parent) & class) if (i2c_mux_parent_classes(parent) & class & ~I2C_CLASS_DEPRECATED)
dev_err(&parent->dev, dev_err(&parent->dev,
"Segment %d behind mux can't share classes with ancestors\n", "Segment %d behind mux can't share classes with ancestors\n",
chan_id); chan_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment