Commit e77aee13 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
 "A core fix for ACPI matching and two driver bugfixes"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: iproc: Fix shifting 31 bits
  i2c: rcar: in slave mode, clear NACK earlier
  i2c: acpi: Remove dead code, i.e. i2c_acpi_match_device()
  i2c: core: Don't fail PRP0001 enumeration when no ID table exist
parents 1b46b921 02040811
...@@ -720,7 +720,7 @@ static int bcm_iproc_i2c_xfer_internal(struct bcm_iproc_i2c_dev *iproc_i2c, ...@@ -720,7 +720,7 @@ static int bcm_iproc_i2c_xfer_internal(struct bcm_iproc_i2c_dev *iproc_i2c,
/* mark the last byte */ /* mark the last byte */
if (!process_call && (i == msg->len - 1)) if (!process_call && (i == msg->len - 1))
val |= 1 << M_TX_WR_STATUS_SHIFT; val |= BIT(M_TX_WR_STATUS_SHIFT);
iproc_i2c_wr_reg(iproc_i2c, M_TX_OFFSET, val); iproc_i2c_wr_reg(iproc_i2c, M_TX_OFFSET, val);
} }
...@@ -738,7 +738,7 @@ static int bcm_iproc_i2c_xfer_internal(struct bcm_iproc_i2c_dev *iproc_i2c, ...@@ -738,7 +738,7 @@ static int bcm_iproc_i2c_xfer_internal(struct bcm_iproc_i2c_dev *iproc_i2c,
*/ */
addr = i2c_8bit_addr_from_msg(msg); addr = i2c_8bit_addr_from_msg(msg);
/* mark it the last byte out */ /* mark it the last byte out */
val = addr | (1 << M_TX_WR_STATUS_SHIFT); val = addr | BIT(M_TX_WR_STATUS_SHIFT);
iproc_i2c_wr_reg(iproc_i2c, M_TX_OFFSET, val); iproc_i2c_wr_reg(iproc_i2c, M_TX_OFFSET, val);
} }
......
...@@ -590,6 +590,7 @@ static bool rcar_i2c_slave_irq(struct rcar_i2c_priv *priv) ...@@ -590,6 +590,7 @@ static bool rcar_i2c_slave_irq(struct rcar_i2c_priv *priv)
/* master sent stop */ /* master sent stop */
if (ssr_filtered & SSR) { if (ssr_filtered & SSR) {
i2c_slave_event(priv->slave, I2C_SLAVE_STOP, &value); i2c_slave_event(priv->slave, I2C_SLAVE_STOP, &value);
rcar_i2c_write(priv, ICSCR, SIE | SDBS); /* clear our NACK */
rcar_i2c_write(priv, ICSIER, SAR); rcar_i2c_write(priv, ICSIER, SAR);
rcar_i2c_write(priv, ICSSR, ~SSR & 0xff); rcar_i2c_write(priv, ICSSR, ~SSR & 0xff);
} }
......
...@@ -276,16 +276,6 @@ void i2c_acpi_register_devices(struct i2c_adapter *adap) ...@@ -276,16 +276,6 @@ void i2c_acpi_register_devices(struct i2c_adapter *adap)
dev_warn(&adap->dev, "failed to enumerate I2C slaves\n"); dev_warn(&adap->dev, "failed to enumerate I2C slaves\n");
} }
const struct acpi_device_id *
i2c_acpi_match_device(const struct acpi_device_id *matches,
struct i2c_client *client)
{
if (!(client && matches))
return NULL;
return acpi_match_device(matches, &client->dev);
}
static const struct acpi_device_id i2c_acpi_force_400khz_device_ids[] = { static const struct acpi_device_id i2c_acpi_force_400khz_device_ids[] = {
/* /*
* These Silead touchscreen controllers only work at 400KHz, for * These Silead touchscreen controllers only work at 400KHz, for
......
...@@ -480,7 +480,7 @@ static int i2c_device_probe(struct device *dev) ...@@ -480,7 +480,7 @@ static int i2c_device_probe(struct device *dev)
* or ACPI ID table is supplied for the probing device. * or ACPI ID table is supplied for the probing device.
*/ */
if (!driver->id_table && if (!driver->id_table &&
!i2c_acpi_match_device(dev->driver->acpi_match_table, client) && !acpi_driver_match_device(dev, dev->driver) &&
!i2c_of_match_device(dev->driver->of_match_table, client)) { !i2c_of_match_device(dev->driver->of_match_table, client)) {
status = -ENODEV; status = -ENODEV;
goto put_sync_adapter; goto put_sync_adapter;
......
...@@ -59,20 +59,11 @@ static inline int __i2c_check_suspended(struct i2c_adapter *adap) ...@@ -59,20 +59,11 @@ static inline int __i2c_check_suspended(struct i2c_adapter *adap)
} }
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
const struct acpi_device_id *
i2c_acpi_match_device(const struct acpi_device_id *matches,
struct i2c_client *client);
void i2c_acpi_register_devices(struct i2c_adapter *adap); void i2c_acpi_register_devices(struct i2c_adapter *adap);
int i2c_acpi_get_irq(struct i2c_client *client); int i2c_acpi_get_irq(struct i2c_client *client);
#else /* CONFIG_ACPI */ #else /* CONFIG_ACPI */
static inline void i2c_acpi_register_devices(struct i2c_adapter *adap) { } static inline void i2c_acpi_register_devices(struct i2c_adapter *adap) { }
static inline const struct acpi_device_id *
i2c_acpi_match_device(const struct acpi_device_id *matches,
struct i2c_client *client)
{
return NULL;
}
static inline int i2c_acpi_get_irq(struct i2c_client *client) static inline int i2c_acpi_get_irq(struct i2c_client *client)
{ {
......
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