]> Git Repo - linux.git/commitdiff
Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
authorLinus Torvalds <[email protected]>
Thu, 4 Jul 2013 21:02:09 +0000 (14:02 -0700)
committerLinus Torvalds <[email protected]>
Thu, 4 Jul 2013 21:02:09 +0000 (14:02 -0700)
Pull i2c updates from Wolfram Sang:
 - new drivers: Kontron PLD, Wondermedia VT
 - mv64xxx driver gained sun4i support and a bigger cleanup
 - duplicate driver 'intel-mid' removed
 - added generic device tree binding for sda holding time (and
   designware driver already uses it)
 - we tried to allow driver probing with only device tree and no i2c
   ids, but I had to revert it because of side effects.  Needs some
   rethinking.
 - driver bugfixes, cleanups...

* 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (34 commits)
  i2c-designware: use div_u64 to fix link
  i2c: Kontron PLD i2c bus driver
  i2c: iop3xxx: fix build failure after waitqueue changes
  i2c-designware: make SDA hold time configurable
  i2c: mv64xxx: Set bus frequency to 100kHz if clock-frequency is not provided
  i2c: imx: allow autoloading on dt ids
  i2c: mv64xxx: Fix transfer error code
  i2c: i801: SMBus patch for Intel Coleto Creek DeviceIDs
  i2c: omap: correct usage of the interrupt enable register
  i2c-pxa: prepare clock before use
  Revert "i2c: core: make it possible to match a pure device tree driver"
  i2c: nomadik: allocate adapter number dynamically
  i2c: nomadik: support elder Nomadiks
  i2c: mv64xxx: Add Allwinner sun4i compatible
  i2c: mv64xxx: make the registers offset configurable
  i2c: mv64xxx: Add macros to access parts of registers
  i2c: vt8500: Add support for I2C bus on Wondermedia SoCs
  i2c: designware: fix race between subsequent xfers
  i2c: bfin-twi: Read and write the FIFO in loop
  i2c: core: make it possible to match a pure device tree driver
  ...

1  2 
MAINTAINERS
drivers/i2c/busses/Kconfig
drivers/i2c/busses/i2c-cpm.c
drivers/i2c/busses/i2c-nomadik.c

diff --combined MAINTAINERS
index 28ffeec53bb9d7458476713c50d3a20e950cf137,5fa200fa5b249cad52a9db0f473ffc80858d4346..50105f98cb681b076267e915689971d429f99112
@@@ -242,11 -242,6 +242,11 @@@ F:       drivers/acpi
  F:    drivers/pnp/pnpacpi/
  F:    include/linux/acpi.h
  F:    include/acpi/
 +F:    Documentation/acpi
 +F:    Documentation/ABI/testing/sysfs-bus-acpi
 +F:    drivers/pci/*acpi*
 +F:    drivers/pci/*/*acpi*
 +F:    drivers/pci/*/*/*acpi*
  
  ACPI FAN DRIVER
  M:    Zhang Rui <[email protected]>
@@@ -802,7 -797,6 +802,7 @@@ F: arch/arm/mach-gemini
  ARM/CSR SIRFPRIMA2 MACHINE SUPPORT
  M:    Barry Song <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/baohua/linux.git
  S:    Maintained
  F:    arch/arm/mach-prima2/
  F:    drivers/dma/sirf-dma.c
@@@ -1141,7 -1135,6 +1141,7 @@@ L:      [email protected] (m
  S:    Maintained
  F:    arch/arm/mach-s5p*/
  F:    arch/arm/mach-exynos*/
 +N:    exynos
  
  ARM/SAMSUNG MOBILE MACHINE SUPPORT
  M:    Kyungmin Park <[email protected]>
@@@ -1208,15 -1201,6 +1208,15 @@@ M:    Dinh Nguyen <[email protected]
  S:    Maintained
  F:    drivers/clk/socfpga/
  
 +ARM/STI ARCHITECTURE
 +M:    Srinivas Kandagatla <[email protected]>
 +M:    Stuart Menefy <[email protected]>
 +L:    [email protected] (moderated for non-subscribers)
 +L:    [email protected]
 +W:    http://www.stlinux.com
 +S:    Maintained
 +F:    arch/arm/mach-sti/
 +
  ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
  M:    Lennert Buytenhek <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
@@@ -1301,6 -1285,7 +1301,7 @@@ S:      Maintaine
  F:    arch/arm/mach-vt8500/
  F:    drivers/clocksource/vt8500_timer.c
  F:    drivers/gpio/gpio-vt8500.c
+ F:    drivers/i2c/busses/i2c-wmt.c
  F:    drivers/mmc/host/wmt-sdmmc.c
  F:    drivers/pwm/pwm-vt8500.c
  F:    drivers/rtc/rtc-vt8500.c
@@@ -1325,7 -1310,6 +1326,7 @@@ W:      http://wiki.xilinx.co
  T:    git git://git.xilinx.com/linux-xlnx.git
  S:    Supported
  F:    arch/arm/mach-zynq/
 +F:    drivers/cpuidle/cpuidle-zynq.c
  
  ARM64 PORT (AARCH64 ARCHITECTURE)
  M:    Catalin Marinas <[email protected]>
@@@ -1617,7 -1601,6 +1618,7 @@@ F:      drivers/net/wireless/b43legacy
  
  BACKLIGHT CLASS/SUBSYSTEM
  M:    Richard Purdie <[email protected]>
 +M:    Jingoo Han <[email protected]>
  S:    Maintained
  F:    drivers/video/backlight/
  F:    include/linux/backlight.h
@@@ -1876,13 -1859,6 +1877,13 @@@ S:    Odd fixe
  F:    Documentation/video4linux/bttv/
  F:    drivers/media/pci/bt8xx/bttv*
  
 +BUSLOGIC SCSI DRIVER
 +M:    Khalid Aziz <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/scsi/BusLogic.*
 +F:    drivers/scsi/FlashPoint.*
 +
  C-MEDIA CMI8788 DRIVER
  M:    Clemens Ladisch <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
@@@ -2145,10 -2121,9 +2146,10 @@@ M:    Mike Turquette <[email protected]
  L:    [email protected] (same as CLK API & CLKDEV)
  T:    git git://git.linaro.org/people/mturquette/linux.git
  S:    Maintained
 -F:    drivers/clk/clk.c
 -F:    drivers/clk/clk-*
 +F:    drivers/clk/
 +X:    drivers/clk/clkdev.c
  F:    include/linux/clk-pr*
 +F:    include/linux/clk/
  
  COMMON INTERNET FILE SYSTEM (CIFS)
  M:    Steve French <[email protected]>
@@@ -2241,8 -2216,7 +2242,8 @@@ M:      Viresh Kumar <[email protected]
  L:    [email protected]
  L:    [email protected]
  S:    Maintained
 -T:    git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
 +T:    git git://git.linaro.org/people/vireshk/linux.git (For ARM Updates)
  F:    drivers/cpufreq/
  F:    include/linux/cpufreq.h
  
@@@ -2543,7 -2517,7 +2544,7 @@@ F:      drivers/usb/dwc3
  DEVICE FREQUENCY (DEVFREQ)
  M:    MyungJoo Ham <[email protected]>
  M:    Kyungmin Park <[email protected]>
 -L:    linux-kernel@vger.kernel.org
 +L:    linux-pm@vger.kernel.org
  S:    Maintained
  F:    drivers/devfreq/
  
@@@ -2917,8 -2891,8 +2918,8 @@@ F:      drivers/media/dvb-frontends/ec100
  
  ECRYPT FILE SYSTEM
  M:    Tyler Hicks <[email protected]>
 -M:    Dustin Kirkland <[email protected]>
  L:    [email protected]
 +W:    http://ecryptfs.org
  W:    https://launchpad.net/ecryptfs
  S:    Supported
  F:    Documentation/filesystems/ecryptfs.txt
@@@ -3130,13 -3104,6 +3131,13 @@@ M:    Maxim Levitsky <maximlevitsky@gmail.
  S:    Maintained
  F:    drivers/media/rc/ene_ir.*
  
 +ENHANCED ERROR HANDLING (EEH)
 +M:    Gavin Shan <[email protected]>
 +L:    [email protected]
 +S:    Supported
 +F:    Documentation/powerpc/eeh-pci-error-recovery.txt
 +F:    arch/powerpc/kernel/eeh*.c
 +
  EPSON S1D13XXX FRAMEBUFFER DRIVER
  M:    Kristoffer Ericson <[email protected]>
  S:    Maintained
@@@ -3254,7 -3221,7 +3255,7 @@@ F:      lib/fault-inject.
  
  FCOE SUBSYSTEM (libfc, libfcoe, fcoe)
  M:    Robert Love <[email protected]>
 -L:    [email protected]
 +L:    fcoe-[email protected]
  W:    www.Open-FCoE.org
  S:    Supported
  F:    drivers/scsi/libfc/
@@@ -3343,15 -3310,6 +3344,15 @@@ T:    git git://git.kernel.org/pub/scm/lin
  S:    Odd fixes
  F:    drivers/block/floppy.c
  
 +FMC SUBSYSTEM
 +M:    Alessandro Rubini <[email protected]>
 +W:    http://www.ohwr.org/projects/fmc-bus
 +S:    Supported
 +F:    drivers/fmc/
 +F:    include/linux/fmc*.h
 +F:    include/linux/ipmi-fru.h
 +K:    fmc_d.*register
 +
  FPU EMULATOR
  M:    Bill Metzenthen <[email protected]>
  W:    http://floatingpoint.sourceforge.net/emulator/index.html
@@@ -3610,7 -3568,6 +3611,7 @@@ GPIO SUBSYSTE
  M:    Grant Likely <[email protected]>
  M:    Linus Walleij <[email protected]>
  S:    Maintained
 +L:    [email protected]
  T:    git git://git.secretlab.ca/git/linux-2.6.git
  F:    Documentation/gpio.txt
  F:    drivers/gpio/
@@@ -4023,8 -3980,7 +4024,8 @@@ S:      Maintaine
  F:    arch/ia64/
  
  IBM Power in-Nest Crypto Acceleration
 -M:    Kent Yoder <[email protected]>
 +M:    Marcelo Henrique Cerri <[email protected]>
 +M:    Fionnuala Gunter <[email protected]>
  L:    [email protected]
  S:    Supported
  F:    drivers/crypto/nx/
@@@ -4153,7 -4109,6 +4154,7 @@@ F:      drivers/ipack
  
  INTEGRITY MEASUREMENT ARCHITECTURE (IMA)
  M:    Mimi Zohar <[email protected]>
 +M:    Dmitry Kasatkin <[email protected]>
  S:    Supported
  F:    security/integrity/ima/
  
@@@ -4494,16 -4449,6 +4495,16 @@@ S:    Maintaine
  F:    drivers/scsi/*iscsi*
  F:    include/scsi/*iscsi*
  
 +ISCSI EXTENSIONS FOR RDMA (ISER) INITIATOR
 +M:    Or Gerlitz <[email protected]>
 +M:    Roi Dayan <[email protected]>
 +L:    [email protected]
 +S:    Supported
 +W:    http://www.openfabrics.org
 +W:    www.open-iscsi.org
 +Q:    http://patchwork.kernel.org/project/linux-rdma/list/
 +F:    drivers/infiniband/ulp/iser
 +
  ISDN SUBSYSTEM
  M:    Karsten Keil <[email protected]>
  L:    [email protected] (subscribers-only)
@@@ -4623,7 -4568,7 +4624,7 @@@ F:      fs/jbd2
  F:    include/linux/jbd2.h
  
  JSM Neo PCI based serial card
 -M:    Lucas Tavares <lucaskt@linux.vnet.ibm.com>
 +M:    Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
  L:    [email protected]
  S:    Maintained
  F:    drivers/tty/serial/jsm/
@@@ -4757,23 -4702,14 +4758,23 @@@ F:   arch/s390/kvm
  F:    drivers/s390/kvm/
  
  KERNEL VIRTUAL MACHINE (KVM) FOR ARM
 -M:    Christoffer Dall <c[email protected]>
 +M:    Christoffer Dall <c[email protected]>
  L:    [email protected]
  W:    http://systems.cs.columbia.edu/projects/kvm-arm
 -S:    Maintained
 +S:    Supported
  F:    arch/arm/include/uapi/asm/kvm*
  F:    arch/arm/include/asm/kvm*
  F:    arch/arm/kvm/
  
 +KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)
 +M:    Marc Zyngier <[email protected]>
 +L:    [email protected] (moderated for non-subscribers)
 +L:    [email protected]
 +S:    Maintained
 +F:    arch/arm64/include/uapi/asm/kvm*
 +F:    arch/arm64/include/asm/kvm*
 +F:    arch/arm64/kvm/
 +
  KEXEC
  M:    Eric Biederman <[email protected]>
  W:    http://kernel.org/pub/linux/utils/kernel/kexec/
@@@ -5821,7 -5757,7 +5822,7 @@@ M:      Matthew Wilcox <[email protected]
  L:    [email protected]
  T:    git git://git.infradead.org/users/willy/linux-nvme.git
  S:    Supported
 -F:    drivers/block/nvme.c
 +F:    drivers/block/nvme*
  F:    include/linux/nvme.h
  
  OMAP SUPPORT
@@@ -5989,10 -5925,8 +5990,10 @@@ M:    Willem Riede <[email protected]
  L:    [email protected]
  L:    [email protected]
  S:    Maintained
 -F:    drivers/scsi/osst*
 -F:    drivers/scsi/st*
 +F:    Documentation/scsi/osst.txt
 +F:    drivers/scsi/osst.*
 +F:    drivers/scsi/osst_*.h
 +F:    drivers/scsi/st.h
  
  OPENCORES I2C BUS DRIVER
  M:    Peter Korsgaard <[email protected]>
@@@ -6206,6 -6140,7 +6207,6 @@@ M:      Linas Vepstas <[email protected]
  L:    [email protected]
  S:    Supported
  F:    Documentation/PCI/pci-error-recovery.txt
 -F:    Documentation/powerpc/eeh-pci-error-recovery.txt
  
  PCI SUBSYSTEM
  M:    Bjorn Helgaas <[email protected]>
  S:    Maintained
  F:    drivers/pinctrl/pinctrl-at91.c
  
 +PIN CONTROLLER - SAMSUNG
 +M:    Tomasz Figa <[email protected]>
 +M:    Thomas Abraham <[email protected]>
 +L:    [email protected] (moderated for non-subscribers)
 +L:    [email protected] (moderated for non-subscribers)
 +S:    Maintained
 +F:    drivers/pinctrl/pinctrl-exynos.*
 +F:    drivers/pinctrl/pinctrl-s3c*
 +F:    drivers/pinctrl/pinctrl-samsung.*
 +
  PIN CONTROLLER - ST SPEAR
  M:    Viresh Kumar <[email protected]>
  L:    [email protected]
@@@ -7149,8 -7074,7 +7150,8 @@@ M:      Kai Mäkisara <Kai.Makisara@kolumbus
  L:    [email protected]
  S:    Maintained
  F:    Documentation/scsi/st.txt
 -F:    drivers/scsi/st*
 +F:    drivers/scsi/st.*
 +F:    drivers/scsi/st_*.h
  
  SCTP PROTOCOL
  M:    Vlad Yasevich <[email protected]>
@@@ -7691,7 -7615,7 +7692,7 @@@ F:      drivers/clk/spear
  SPI SUBSYSTEM
  M:    Mark Brown <[email protected]>
  M:    Grant Likely <[email protected]>
 -L:    [email protected]
 +L:    [email protected]
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
  Q:    http://patchwork.kernel.org/project/spi-devel-general/list/
  S:    Maintained
@@@ -7734,7 -7658,6 +7735,7 @@@ STABLE BRANC
  M:    Greg Kroah-Hartman <[email protected]>
  L:    [email protected]
  S:    Supported
 +F:    Documentation/stable_kernel_rules.txt
  
  STAGING SUBSYSTEM
  M:    Greg Kroah-Hartman <[email protected]>
@@@ -7851,7 -7774,7 +7852,7 @@@ F:      drivers/staging/media/solo6x10
  STAGING - SPEAKUP CONSOLE SPEECH DRIVER
  M:    William Hubbs <[email protected]>
  M:    Chris Brannon <[email protected]>
 -M:    Kirk Reiser <kirk@braille.uwo.ca>
 +M:    Kirk Reiser <kirk@reisers.ca>
  M:    Samuel Thibault <[email protected]>
  L:    [email protected]
  W:    http://www.linux-speakup.org/
@@@ -8308,8 -8231,7 +8309,8 @@@ S:      Odd fixe
  F:    drivers/media/usb/tm6000/
  
  TPM DEVICE DRIVER
 -M:    Kent Yoder <[email protected]>
 +M:    Leonidas Da Silva Barbosa <[email protected]>
 +M:    Ashley Lai <[email protected]>
  M:    Rajiv Andrade <[email protected]>
  W:    http://tpmdd.sourceforge.net
  M:    Marcel Selhorst <[email protected]>
@@@ -9073,7 -8995,7 +9074,7 @@@ S:      Maintaine
  F:    drivers/net/wireless/wl3501*
  
  WM97XX TOUCHSCREEN DRIVERS
 -M:    Mark Brown <broonie@opensource.wolfsonmicro.com>
 +M:    Mark Brown <broonie@kernel.org>
  M:    Liam Girdwood <[email protected]>
  L:    [email protected]
  T:    git git://opensource.wolfsonmicro.com/linux-2.6-touch
@@@ -9083,6 -9005,7 +9084,6 @@@ F:      drivers/input/touchscreen/*wm97
  F:    include/linux/wm97xx.h
  
  WOLFSON MICROELECTRONICS DRIVERS
 -M:    Mark Brown <[email protected]>
  L:    [email protected]
  T:    git git://opensource.wolfsonmicro.com/linux-2.6-asoc
  T:    git git://opensource.wolfsonmicro.com/linux-2.6-audioplus
@@@ -9183,13 -9106,6 +9184,13 @@@ S:    Supporte
  F:    arch/arm/xen/
  F:    arch/arm/include/asm/xen/
  
 +XEN HYPERVISOR ARM64
 +M:    Stefano Stabellini <[email protected]>
 +L:    [email protected] (moderated for non-subscribers)
 +S:    Supported
 +F:    arch/arm64/xen/
 +F:    arch/arm64/include/asm/xen/
 +
  XEN NETWORK BACKEND DRIVER
  M:    Ian Campbell <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
index 527503617ee21607a11f4f2887be979770e5c061,3c046097be7138c9f32ac5b404fceb21c3c06dd6..fdc2ab4af315f75fd7b23360af9c60783a18214f
@@@ -108,6 -108,7 +108,7 @@@ config I2C_I80
            Lynx Point-LP (PCH)
            Avoton (SOC)
            Wellsburg (PCH)
+           Coleto Creek (PCH)
  
          This driver can also be built as a module.  If so, the module
          will be called i2c-i801.
@@@ -150,7 -151,6 +151,7 @@@ config I2C_PIIX
            ATI SB700/SP5100
            ATI SB800
            AMD Hudson-2
 +          AMD CZ
            Serverworks OSB4
            Serverworks CSB5
            Serverworks CSB6
@@@ -475,16 -475,6 +476,6 @@@ config I2C_IM
          This driver can also be built as a module.  If so, the module
          will be called i2c-imx.
  
- config I2C_INTEL_MID
-       tristate "Intel Moorestown/Medfield Platform I2C controller"
-       depends on PCI
-       help
-         Say Y here if you have an Intel Moorestown/Medfield platform I2C
-         controller.
-         This support is also available as a module. If so, the module
-         will be called i2c-intel-mid.
  config I2C_IOP3XX
        tristate "Intel IOPx3xx and IXP4xx on-chip I2C interface"
        depends on ARCH_IOP32X || ARCH_IOP33X || ARCH_IXP4XX || ARCH_IOP13XX
          This driver can also be built as a module.  If so, the module
          will be called i2c-iop3xx.
  
+ config I2C_KEMPLD
+       tristate "Kontron COM I2C Controller"
+       depends on MFD_KEMPLD
+       help
+         This enables support for the I2C bus interface on some Kontron ETX
+         and COMexpress (ETXexpress) modules.
+         This driver can also be built as a module. If so, the module
+         will be called i2c-kempld.
  config I2C_MPC
        tristate "MPC107/824x/85xx/512x/52xx/83xx/86xx"
        depends on PPC
  
  config I2C_MV64XXX
        tristate "Marvell mv64xxx I2C Controller"
-       depends on (MV64X60 || PLAT_ORION)
+       depends on (MV64X60 || PLAT_ORION || ARCH_SUNXI)
        help
          If you say yes to this option, support will be included for the
          built-in I2C interface on the Marvell 64xxx line of host bridges.
+         This driver is also used for Allwinner SoCs I2C controllers.
  
          This driver can also be built as a module.  If so, the module
          will be called i2c-mv64xxx.
@@@ -686,7 -687,7 +688,7 @@@ config I2C_SIMTE
  
  config I2C_SIRF
        tristate "CSR SiRFprimaII I2C interface"
 -      depends on ARCH_PRIMA2
 +      depends on ARCH_SIRF
        help
          If you say yes to this option, support will be included for the
          CSR SiRFprimaII I2C interface.
@@@ -725,6 -726,16 +727,16 @@@ config I2C_VERSATIL
          This driver can also be built as a module.  If so, the module
          will be called i2c-versatile.
  
+ config I2C_WMT
+       tristate "Wondermedia WM8xxx SoC I2C bus support"
+       depends on ARCH_VT8500
+       help
+         Say yes if you want to support the I2C bus on Wondermedia 8xxx-series
+         SoCs.
+         This driver can also be built as a module. If so, the module will be
+         called i2c-wmt.
  config I2C_OCTEON
        tristate "Cavium OCTEON I2C bus support"
        depends on CPU_CAVIUM_OCTEON
index 9e6002108720e4169ae771ce6387176217351ebc,eccf5c2d4a1218ee5a04d4fa9f43ad0c39f9aa80..2e1f7eb55bf4a6f6d525db8548928daa39cbd1f2
@@@ -338,14 -338,6 +338,14 @@@ static int cpm_i2c_xfer(struct i2c_adap
        tptr = 0;
        rptr = 0;
  
 +      /*
 +       * If there was a collision in the last i2c transaction,
 +       * Set I2COM_MASTER as it was cleared during collision.
 +       */
 +      if (in_be16(&tbdf->cbd_sc) & BD_SC_CL) {
 +              out_8(&cpm->i2c_reg->i2com, I2COM_MASTER);
 +      }
 +
        while (tptr < num) {
                pmsg = &msgs[tptr];
                dev_dbg(&adap->dev, "R: %d T: %d\n", rptr, tptr);
@@@ -654,7 -646,7 +654,7 @@@ static int cpm_i2c_probe(struct platfor
  
        cpm->ofdev = ofdev;
  
-       dev_set_drvdata(&ofdev->dev, cpm);
+       platform_set_drvdata(ofdev, cpm);
  
        cpm->adap = cpm_ops;
        i2c_set_adapdata(&cpm->adap, cpm);
@@@ -697,7 -689,7 +697,7 @@@ out_free
  
  static int cpm_i2c_remove(struct platform_device *ofdev)
  {
-       struct cpm_i2c *cpm = dev_get_drvdata(&ofdev->dev);
+       struct cpm_i2c *cpm = platform_get_drvdata(ofdev);
  
        i2c_del_adapter(&cpm->adap);
  
index c7e3b0c1a1caf033ee326e9ce41d9bc0f7239959,063e726dde117581e1a233d10e52d7a23d936dd3..512dfe609706a562922986b040a8bda753d82126
@@@ -15,7 -15,6 +15,6 @@@
  #include <linux/init.h>
  #include <linux/module.h>
  #include <linux/amba/bus.h>
- #include <linux/atomic.h>
  #include <linux/slab.h>
  #include <linux/interrupt.h>
  #include <linux/i2c.h>
  /* maximum threshold value */
  #define MAX_I2C_FIFO_THRESHOLD        15
  
+ /**
+  * struct i2c_vendor_data - per-vendor variations
+  * @has_mtdws: variant has the MTDWS bit
+  * @fifodepth: variant FIFO depth
+  */
+ struct i2c_vendor_data {
+       bool has_mtdws;
+       u32 fifodepth;
+ };
  enum i2c_status {
        I2C_NOP,
        I2C_ON_GOING,
@@@ -138,6 -147,7 +147,7 @@@ struct i2c_nmk_client 
  
  /**
   * struct nmk_i2c_dev - private data structure of the controller.
+  * @vendor: vendor data for this variant.
   * @adev: parent amba device.
   * @adap: corresponding I2C adapter.
   * @irq: interrupt line for the controller.
   * @stop: stop condition.
   * @xfer_complete: acknowledge completion for a I2C message.
   * @result: controller propogated result.
 - * @pinctrl: pinctrl handle.
 - * @pins_default: default state for the pins.
 - * @pins_idle: idle state for the pins.
 - * @pins_sleep: sleep state for the pins.
   * @busy: Busy doing transfer.
   */
  struct nmk_i2c_dev {
+       struct i2c_vendor_data          *vendor;
        struct amba_device              *adev;
        struct i2c_adapter              adap;
        int                             irq;
        int                             stop;
        struct completion               xfer_complete;
        int                             result;
 -      /* Three pin states - default, idle & sleep */
 -      struct pinctrl                  *pinctrl;
 -      struct pinctrl_state            *pins_default;
 -      struct pinctrl_state            *pins_idle;
 -      struct pinctrl_state            *pins_sleep;
        bool                            busy;
  };
  
@@@ -422,7 -442,7 +433,7 @@@ static int read_i2c(struct nmk_i2c_dev 
        irq_mask = (I2C_IT_RXFNF | I2C_IT_RXFF |
                        I2C_IT_MAL | I2C_IT_BERR);
  
-       if (dev->stop)
+       if (dev->stop || !dev->vendor->has_mtdws)
                irq_mask |= I2C_IT_MTD;
        else
                irq_mask |= I2C_IT_MTDWS;
@@@ -502,7 -522,7 +513,7 @@@ static int write_i2c(struct nmk_i2c_de
         * set the MTDWS bit (Master Transaction Done Without Stop)
         * to start repeated start operation
         */
-       if (dev->stop)
+       if (dev->stop || !dev->vendor->has_mtdws)
                irq_mask |= I2C_IT_MTD;
        else
                irq_mask |= I2C_IT_MTDWS;
@@@ -636,7 -656,13 +647,7 @@@ static int nmk_i2c_xfer(struct i2c_adap
        }
  
        /* Optionaly enable pins to be muxed in and configured */
 -      if (!IS_ERR(dev->pins_default)) {
 -              status = pinctrl_select_state(dev->pinctrl,
 -                              dev->pins_default);
 -              if (status)
 -                      dev_err(&dev->adev->dev,
 -                              "could not set default pins\n");
 -      }
 +      pinctrl_pm_select_default_state(&dev->adev->dev);
  
        status = init_hw(dev);
        if (status)
@@@ -666,7 -692,13 +677,7 @@@ out
        clk_disable_unprepare(dev->clk);
  out_clk:
        /* Optionally let pins go into idle state */
 -      if (!IS_ERR(dev->pins_idle)) {
 -              status = pinctrl_select_state(dev->pinctrl,
 -                              dev->pins_idle);
 -              if (status)
 -                      dev_err(&dev->adev->dev,
 -                              "could not set pins to idle state\n");
 -      }
 +      pinctrl_pm_select_idle_state(&dev->adev->dev);
  
        pm_runtime_put_sync(&dev->adev->dev);
  
@@@ -861,22 -893,41 +872,22 @@@ static int nmk_i2c_suspend(struct devic
  {
        struct amba_device *adev = to_amba_device(dev);
        struct nmk_i2c_dev *nmk_i2c = amba_get_drvdata(adev);
 -      int ret;
  
        if (nmk_i2c->busy)
                return -EBUSY;
  
 -      if (!IS_ERR(nmk_i2c->pins_sleep)) {
 -              ret = pinctrl_select_state(nmk_i2c->pinctrl,
 -                              nmk_i2c->pins_sleep);
 -              if (ret)
 -                      dev_err(dev, "could not set pins to sleep state\n");
 -      }
 +      pinctrl_pm_select_sleep_state(dev);
  
        return 0;
  }
  
  static int nmk_i2c_resume(struct device *dev)
  {
 -      struct amba_device *adev = to_amba_device(dev);
 -      struct nmk_i2c_dev *nmk_i2c = amba_get_drvdata(adev);
 -      int ret;
 -
        /* First go to the default state */
 -      if (!IS_ERR(nmk_i2c->pins_default)) {
 -              ret = pinctrl_select_state(nmk_i2c->pinctrl,
 -                              nmk_i2c->pins_default);
 -              if (ret)
 -                      dev_err(dev, "could not set pins to default state\n");
 -      }
 +      pinctrl_pm_select_default_state(dev);
        /* Then let's idle the pins until the next transfer happens */
 -      if (!IS_ERR(nmk_i2c->pins_idle)) {
 -              ret = pinctrl_select_state(nmk_i2c->pinctrl,
 -                              nmk_i2c->pins_idle);
 -              if (ret)
 -                      dev_err(dev, "could not set pins to idle state\n");
 -      }
 +      pinctrl_pm_select_idle_state(dev);
 +
        return 0;
  }
  #else
@@@ -929,8 -980,6 +940,6 @@@ static void nmk_i2c_of_probe(struct dev
                pdata->sm = I2C_FREQ_MODE_FAST;
  }
  
- static atomic_t adapter_id = ATOMIC_INIT(0);
  static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
  {
        int ret = 0;
        struct device_node *np = adev->dev.of_node;
        struct nmk_i2c_dev      *dev;
        struct i2c_adapter *adap;
+       struct i2c_vendor_data *vendor = id->data;
+       u32 max_fifo_threshold = (vendor->fifodepth / 2) - 1;
  
        if (!pdata) {
                if (np) {
                        pdata = &u8500_i2c;
        }
  
+       if (pdata->tft > max_fifo_threshold) {
+               dev_warn(&adev->dev, "requested TX FIFO threshold %u, adjusted down to %u\n",
+                       pdata->tft, max_fifo_threshold);
+               pdata->tft = max_fifo_threshold;
+       }
+       if (pdata->rft > max_fifo_threshold) {
+               dev_warn(&adev->dev, "requested RX FIFO threshold %u, adjusted down to %u\n",
+                       pdata->rft, max_fifo_threshold);
+               pdata->rft = max_fifo_threshold;
+       }
        dev = kzalloc(sizeof(struct nmk_i2c_dev), GFP_KERNEL);
        if (!dev) {
                dev_err(&adev->dev, "cannot allocate memory\n");
                ret = -ENOMEM;
                goto err_no_mem;
        }
+       dev->vendor = vendor;
        dev->busy = false;
        dev->adev = adev;
        amba_set_drvdata(adev, dev);
  
 -      dev->pinctrl = devm_pinctrl_get(&adev->dev);
 -      if (IS_ERR(dev->pinctrl)) {
 -              ret = PTR_ERR(dev->pinctrl);
 -              goto err_pinctrl;
 -      }
 -
 -      dev->pins_default = pinctrl_lookup_state(dev->pinctrl,
 -                                               PINCTRL_STATE_DEFAULT);
 -      if (IS_ERR(dev->pins_default)) {
 -              dev_err(&adev->dev, "could not get default pinstate\n");
 -      } else {
 -              ret = pinctrl_select_state(dev->pinctrl,
 -                                         dev->pins_default);
 -              if (ret)
 -                      dev_dbg(&adev->dev, "could not set default pinstate\n");
 -      }
 -
 -      dev->pins_idle = pinctrl_lookup_state(dev->pinctrl,
 -                                            PINCTRL_STATE_IDLE);
 -      if (IS_ERR(dev->pins_idle)) {
 -              dev_dbg(&adev->dev, "could not get idle pinstate\n");
 -      } else {
 -              /* If possible, let's go to idle until the first transfer */
 -              ret = pinctrl_select_state(dev->pinctrl,
 -                                         dev->pins_idle);
 -              if (ret)
 -                      dev_dbg(&adev->dev, "could not set idle pinstate\n");
 -      }
 -
 -      dev->pins_sleep = pinctrl_lookup_state(dev->pinctrl,
 -                                             PINCTRL_STATE_SLEEP);
 -      if (IS_ERR(dev->pins_sleep))
 -              dev_dbg(&adev->dev, "could not get sleep pinstate\n");
 +      /* Select default pin state */
 +      pinctrl_pm_select_default_state(&adev->dev);
 +      /* If possible, let's go to idle until the first transfer */
 +      pinctrl_pm_select_idle_state(&adev->dev);
  
        dev->virtbase = ioremap(adev->res.start, resource_size(&adev->res));
        if (!dev->virtbase) {
        adap->class     = I2C_CLASS_HWMON | I2C_CLASS_SPD;
        adap->algo      = &nmk_i2c_algo;
        adap->timeout   = msecs_to_jiffies(pdata->timeout);
-       adap->nr = atomic_read(&adapter_id);
        snprintf(adap->name, sizeof(adap->name),
-                "Nomadik I2C%d at %pR", adap->nr, &adev->res);
-       atomic_inc(&adapter_id);
+                "Nomadik I2C at %pR", &adev->res);
  
        /* fetch the controller configuration from machine */
        dev->cfg.clk_freq = pdata->clk_freq;
                 "initialize %s on virtual base %p\n",
                 adap->name, dev->virtbase);
  
-       ret = i2c_add_numbered_adapter(adap);
+       ret = i2c_add_adapter(adap);
        if (ret) {
                dev_err(&adev->dev, "failed to add adapter\n");
                goto err_add_adap;
        iounmap(dev->virtbase);
   err_no_ioremap:
        kfree(dev);
 - err_pinctrl:
   err_no_mem:
  
        return ret;
@@@ -1064,14 -1156,26 +1086,26 @@@ static int nmk_i2c_remove(struct amba_d
        return 0;
  }
  
+ static struct i2c_vendor_data vendor_stn8815 = {
+       .has_mtdws = false,
+       .fifodepth = 16, /* Guessed from TFTR/RFTR = 7 */
+ };
+ static struct i2c_vendor_data vendor_db8500 = {
+       .has_mtdws = true,
+       .fifodepth = 32, /* Guessed from TFTR/RFTR = 15 */
+ };
  static struct amba_id nmk_i2c_ids[] = {
        {
                .id     = 0x00180024,
                .mask   = 0x00ffffff,
+               .data   = &vendor_stn8815,
        },
        {
                .id     = 0x00380024,
                .mask   = 0x00ffffff,
+               .data   = &vendor_db8500,
        },
        {},
  };
This page took 0.092078 seconds and 4 git commands to generate.