Commit 3e565a35 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 more i2c updates from Wolfram Sang:

 - hot bugfix for i801 to make laptops with strange BIOS reboot again
   when using SMBUS Host notify

 - change to MAINTAINERS creating a specific fallback entry for I2C host
   drivers and settings its status to "Odd fixes"

 - a long overdue param checking for the I2C core

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: add param sanity check to i2c_transfer()
  MAINTAINERS: add maintainer for Renesas I2C related drivers
  MAINTAINERS: remove me as maintainer for I2C host drivers
  i2c: i801: Restore configuration at shutdown
  i2c: i801: Save register SMBSLVCMD value only once
parents 1bad9ce1 1eace834
...@@ -5911,6 +5911,11 @@ S: Supported ...@@ -5911,6 +5911,11 @@ S: Supported
F: drivers/phy/ F: drivers/phy/
F: include/linux/phy/ F: include/linux/phy/
GENERIC PINCTRL I2C DEMULTIPLEXER DRIVER
M: Wolfram Sang <wsa+renesas@sang-engineering.com>
S: Supported
F: drivers/i2c/muxes/i2c-demux-pinctrl.c
GENERIC PM DOMAINS GENERIC PM DOMAINS
M: "Rafael J. Wysocki" <rjw@rjwysocki.net> M: "Rafael J. Wysocki" <rjw@rjwysocki.net>
M: Kevin Hilman <khilman@kernel.org> M: Kevin Hilman <khilman@kernel.org>
...@@ -6586,15 +6591,25 @@ W: https://i2c.wiki.kernel.org/ ...@@ -6586,15 +6591,25 @@ W: https://i2c.wiki.kernel.org/
Q: https://patchwork.ozlabs.org/project/linux-i2c/list/ Q: https://patchwork.ozlabs.org/project/linux-i2c/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
S: Maintained S: Maintained
F: Documentation/devicetree/bindings/i2c/ F: Documentation/devicetree/bindings/i2c/i2c.txt
F: Documentation/i2c/ F: Documentation/i2c/
F: drivers/i2c/ F: drivers/i2c/*
F: drivers/i2c/*/
F: include/linux/i2c.h F: include/linux/i2c.h
F: include/linux/i2c-*.h F: include/linux/i2c-dev.h
F: include/linux/i2c-smbus.h
F: include/uapi/linux/i2c.h F: include/uapi/linux/i2c.h
F: include/uapi/linux/i2c-*.h F: include/uapi/linux/i2c-*.h
I2C SUBSYSTEM HOST DRIVERS
L: linux-i2c@vger.kernel.org
W: https://i2c.wiki.kernel.org/
Q: https://patchwork.ozlabs.org/project/linux-i2c/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
S: Odd Fixes
F: Documentation/devicetree/bindings/i2c/
F: drivers/i2c/algos/
F: drivers/i2c/busses/
I2C-TAOS-EVM DRIVER I2C-TAOS-EVM DRIVER
M: Jean Delvare <jdelvare@suse.com> M: Jean Delvare <jdelvare@suse.com>
L: linux-i2c@vger.kernel.org L: linux-i2c@vger.kernel.org
...@@ -11906,6 +11921,11 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git c ...@@ -11906,6 +11921,11 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git c
S: Supported S: Supported
F: drivers/clk/renesas/ F: drivers/clk/renesas/
RENESAS EMEV2 I2C DRIVER
M: Wolfram Sang <wsa+renesas@sang-engineering.com>
S: Supported
F: drivers/i2c/busses/i2c-emev2.c
RENESAS ETHERNET DRIVERS RENESAS ETHERNET DRIVERS
R: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> R: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org
...@@ -11921,6 +11941,12 @@ L: linux-iio@vger.kernel.org ...@@ -11921,6 +11941,12 @@ L: linux-iio@vger.kernel.org
S: Supported S: Supported
F: drivers/iio/adc/rcar_gyro_adc.c F: drivers/iio/adc/rcar_gyro_adc.c
RENESAS R-CAR I2C DRIVERS
M: Wolfram Sang <wsa+renesas@sang-engineering.com>
S: Supported
F: drivers/i2c/busses/i2c-rcar.c
F: drivers/i2c/busses/i2c-sh_mobile.c
RENESAS USB PHY DRIVER RENESAS USB PHY DRIVER
M: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> M: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
L: linux-renesas-soc@vger.kernel.org L: linux-renesas-soc@vger.kernel.org
......
...@@ -966,8 +966,6 @@ static void i801_enable_host_notify(struct i2c_adapter *adapter) ...@@ -966,8 +966,6 @@ static void i801_enable_host_notify(struct i2c_adapter *adapter)
if (!(priv->features & FEATURE_HOST_NOTIFY)) if (!(priv->features & FEATURE_HOST_NOTIFY))
return; return;
priv->original_slvcmd = inb_p(SMBSLVCMD(priv));
if (!(SMBSLVCMD_HST_NTFY_INTREN & priv->original_slvcmd)) if (!(SMBSLVCMD_HST_NTFY_INTREN & priv->original_slvcmd))
outb_p(SMBSLVCMD_HST_NTFY_INTREN | priv->original_slvcmd, outb_p(SMBSLVCMD_HST_NTFY_INTREN | priv->original_slvcmd,
SMBSLVCMD(priv)); SMBSLVCMD(priv));
...@@ -1615,6 +1613,10 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -1615,6 +1613,10 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
outb_p(inb_p(SMBAUXCTL(priv)) & outb_p(inb_p(SMBAUXCTL(priv)) &
~(SMBAUXCTL_CRC | SMBAUXCTL_E32B), SMBAUXCTL(priv)); ~(SMBAUXCTL_CRC | SMBAUXCTL_E32B), SMBAUXCTL(priv));
/* Remember original Host Notify setting */
if (priv->features & FEATURE_HOST_NOTIFY)
priv->original_slvcmd = inb_p(SMBSLVCMD(priv));
/* Default timeout in interrupt mode: 200 ms */ /* Default timeout in interrupt mode: 200 ms */
priv->adapter.timeout = HZ / 5; priv->adapter.timeout = HZ / 5;
...@@ -1699,6 +1701,15 @@ static void i801_remove(struct pci_dev *dev) ...@@ -1699,6 +1701,15 @@ static void i801_remove(struct pci_dev *dev)
*/ */
} }
static void i801_shutdown(struct pci_dev *dev)
{
struct i801_priv *priv = pci_get_drvdata(dev);
/* Restore config registers to avoid hard hang on some systems */
i801_disable_host_notify(priv);
pci_write_config_byte(dev, SMBHSTCFG, priv->original_hstcfg);
}
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int i801_suspend(struct device *dev) static int i801_suspend(struct device *dev)
{ {
...@@ -1728,6 +1739,7 @@ static struct pci_driver i801_driver = { ...@@ -1728,6 +1739,7 @@ static struct pci_driver i801_driver = {
.id_table = i801_ids, .id_table = i801_ids,
.probe = i801_probe, .probe = i801_probe,
.remove = i801_remove, .remove = i801_remove,
.shutdown = i801_shutdown,
.driver = { .driver = {
.pm = &i801_pm_ops, .pm = &i801_pm_ops,
}, },
......
...@@ -1845,6 +1845,9 @@ int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) ...@@ -1845,6 +1845,9 @@ int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
unsigned long orig_jiffies; unsigned long orig_jiffies;
int ret, try; int ret, try;
if (WARN_ON(!msgs || num < 1))
return -EINVAL;
if (adap->quirks && i2c_check_for_quirks(adap, msgs, num)) if (adap->quirks && i2c_check_for_quirks(adap, msgs, num))
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
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