diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-13 15:13:18 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-13 15:13:18 -0700 |
commit | 3e565a351ed3e94352bfbe0be06c659fc8fafb19 (patch) | |
tree | ea0c23c03484140413f4dcb75d11c69c05d5cdb0 | |
parent | 1bad9ce155a7c010a9a5f3261ad12a6a8eccfb2c (diff) | |
parent | 1eace8344c02c625ee99cc3ffa50187ded2c87b5 (diff) |
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
-rw-r--r-- | MAINTAINERS | 34 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 16 | ||||
-rw-r--r-- | drivers/i2c/i2c-core-base.c | 3 |
3 files changed, 47 insertions, 6 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 73d83416d852..f79952e6f627 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5911,6 +5911,11 @@ S: Supported F: drivers/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 M: "Rafael J. Wysocki" <rjw@rjwysocki.net> M: Kevin Hilman <khilman@kernel.org> @@ -6586,15 +6591,25 @@ 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: Maintained -F: Documentation/devicetree/bindings/i2c/ +F: Documentation/devicetree/bindings/i2c/i2c.txt 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-dev.h +F: include/linux/i2c-smbus.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 M: Jean Delvare <jdelvare@suse.com> 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 S: Supported 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 R: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> L: netdev@vger.kernel.org @@ -11921,6 +11941,12 @@ L: linux-iio@vger.kernel.org S: Supported 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 M: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> L: linux-renesas-soc@vger.kernel.org diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 692b34125866..e0d59e9ff3c6 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -966,8 +966,6 @@ static void i801_enable_host_notify(struct i2c_adapter *adapter) if (!(priv->features & FEATURE_HOST_NOTIFY)) return; - priv->original_slvcmd = inb_p(SMBSLVCMD(priv)); - if (!(SMBSLVCMD_HST_NTFY_INTREN & priv->original_slvcmd)) outb_p(SMBSLVCMD_HST_NTFY_INTREN | priv->original_slvcmd, SMBSLVCMD(priv)); @@ -1615,6 +1613,10 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) outb_p(inb_p(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 */ priv->adapter.timeout = HZ / 5; @@ -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 static int i801_suspend(struct device *dev) { @@ -1728,6 +1739,7 @@ static struct pci_driver i801_driver = { .id_table = i801_ids, .probe = i801_probe, .remove = i801_remove, + .shutdown = i801_shutdown, .driver = { .pm = &i801_pm_ops, }, diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 1adeebaa81b0..1ba40bb2b966 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1845,6 +1845,9 @@ int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) unsigned long orig_jiffies; int ret, try; + if (WARN_ON(!msgs || num < 1)) + return -EINVAL; + if (adap->quirks && i2c_check_for_quirks(adap, msgs, num)) return -EOPNOTSUPP; |