summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'i2c/for-4.4' of ↵Linus Torvalds2015-11-1030-358/+1547
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: - New drivers: UniPhier (with and without FIFO) - some drivers got some bigger rework: ismt, designware, img-scb (rcar had to be reverted because issues were showing up just lately) - ACPI: reworked the device scanning and added support for muxes ... and quite a lot of driver bugfixes and cleanups this time. All files touched outside of the i2c realm have proper acks. * 'i2c/for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (70 commits) i2c: rcar: Revert the latest refactoring series i2c: pnx: remove superfluous assignment MAINTAINERS: i2c: drop i2c-pnx maintainer MAINTAINERS: i2c: mark also subdirectories as maintained i2c: cadence: enable driver for ARM64 i2c: i801: Document Intel DNV and Broxton i2c: at91: manage unexpected RXRDY flag when starting a transfer i2c: pnx: Use setup_timer instead of open coding it i2c: add ACPI support for I2C mux ports acpi: add acpi_preset_companion() stub i2c: pxa: Add support for pxa910/988 & new configuration features i2c: au1550: Convert to devm_kzalloc and devm_ioremap_resource i2c-dev: Fix I2C_SLAVE ioctl comment i2c-dev: Fix typo in ioctl name reference i2c: sirf: tune the divider to make i2c bus freq more accurate i2c: imx: Use -ENXIO as error in the NACK case i2c: i801: Add support for Intel Broxton i2c: i801: Add support for Intel DNV i2c: mediatek: add i2c resume support i2c: imx: implement bus recovery ...
| * i2c: rcar: Revert the latest refactoring seriesWolfram Sang2015-10-301-71/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This whole series caused sometimes timeouts and even OOPSes on some r8a7791 Koelsch boards. We need to understand and fix those first. Revert "i2c: rcar: clean up after refactoring" Revert "i2c: rcar: revoke START request early" Revert "i2c: rcar: check master irqs before slave irqs" Revert "i2c: rcar: don't issue stop when HW does it automatically" Revert "i2c: rcar: init new messages in irq" Revert "i2c: rcar: refactor setup of a msg" Revert "i2c: rcar: remove spinlock" Revert "i2c: rcar: remove unused IOERROR state" Revert "i2c: rcar: rework hw init" Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: pnx: remove superfluous assignmentWolfram Sang2015-10-301-1/+1
| | | | | | | | | | | | | | | | smatch rightfully says: drivers/i2c/busses/i2c-pnx.c:499 i2c_pnx_xfer warn: unused return: stat = ioread32() Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: cadence: enable driver for ARM64Michal Simek2015-10-261-1/+1
| | | | | | | | | | | | | | This IP is available on Xilinx ZynqMP. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: i801: Document Intel DNV and BroxtonJarkko Nikula2015-10-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | Add missing entries into i2c-i801 documentation and Kconfig about recently added Intel DNV and Broxton. Reported-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: at91: manage unexpected RXRDY flag when starting a transferLudovic Desroches2015-10-261-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases, we could start a new i2c transfer with the RXRDY flag set. It is not a clean state and it leads to print annoying error messages even if there no real issue. The cause is only having garbage data in the Receive Holding Register because of a weird behavior of the RXRDY flag. Reported-by: Peter Rosin <peda@lysator.liu.se> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Tested-by: Peter Rosin <peda@lysator.liu.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Fixes: 93563a6a71bb ("i2c: at91: fix a race condition when using the DMA controller") Cc: stable@vger.kernel.org #4.1
| * i2c: pnx: Use setup_timer instead of open coding itMuhammad Falak R Wani2015-10-251-3/+2Star
| | | | | | | | | | | | | | | | Use timer API function setup_timer instead of init_timer to initialize the timer. Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: add ACPI support for I2C mux portsDustin Byford2015-10-256-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although I2C mux devices are easily enumerated using ACPI (_HID/_CID or device property compatible string match), enumerating I2C client devices connected through an I2C mux needs a little extra work. This change implements a method for describing an I2C device hierarchy that includes mux devices by using an ACPI Device() for each mux channel along with an _ADR to set the channel number for the device. See Documentation/acpi/i2c-muxes.txt for a simple example. To make this work the ismt, i801, and designware pci/platform devs now share an ACPI companion with their I2C adapter dev similar to how it's done in OF. This is done on the assumption that power management functions will not be called directly on the I2C dev that is sharing the ACPI node. Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Dustin Byford <dustin@cumulusnetworks.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: pxa: Add support for pxa910/988 & new configuration featuresVaibhav Hiremath2015-10-251-1/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | TWSI_ILCR & TWSI_IWCR registers are used to adjust clock rate of standard & fast mode in pxa910/988; so this patch adds these two new entries to "struct pxa_reg_layout" and "struct pxa_i2c". Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Signed-off-by: Yi Zhang <yizhang@marvell.com> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Tested-by: Robert Jarzmik <robert.jarzmik@free.fr> [wsa: white space fixes] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: au1550: Convert to devm_kzalloc and devm_ioremap_resourceAxel Lin2015-10-231-39/+13Star
| | | | | | | | | | | | | | | | Use devm_* APIs to simplify the code. Signed-off-by: Axel Lin <axel.lin@ingics.com> Tested-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c-dev: Fix I2C_SLAVE ioctl commentJean Delvare2015-10-231-10/+7Star
| | | | | | | | | | | | | | | | | | | | | | The first part of the comment is wrong since November 2007, delete it. The second part of the comment is related to I2C_PEC, not I2C_SLAVE, so move it where it belongs. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c-dev: Fix typo in ioctl name referenceJean Delvare2015-10-231-3/+3
| | | | | | | | | | | | | | | | The ioctl is named I2C_RDWR for "I2C read/write". But references to it were misspelled "rdrw". Fix them. Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: sirf: tune the divider to make i2c bus freq more accurateGuoying Zhang2015-10-231-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In prima2 and atlas7, due to some hardware design issue. we need to adjust the divider ratio a little according to i2c bus frequency ranges. Since i2c is open drain interface that allows the slave to stall the transaction by holding the SCL line at '0', the RTL implementation is waiting for SCL feedback from the pin after setting it to High-Z ('1'). This wait adds to the high-time interval counter few cycles of the input synchronization (depending on the SCL_FILTER_REG field), and also the time it takes for the board pull-up resistor to rise the SCL line. For slow SCL settings these additions are negligible, but they start to affect the speed when clock is set to faster frequencies. This patch is based on the actual tests, and it makes SCL more accurate. Signed-off-by: Guoying Zhang <Guoying.Zhang@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: imx: Use -ENXIO as error in the NACK caseFabio Estevam2015-10-231-1/+1
| | | | | | | | | | | | | | | | According to Documentation/i2c/fault-codes the response to a bus NACK should be -ENXIO, so fix the error code. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: i801: Add support for Intel BroxtonJarkko Nikula2015-10-231-0/+3
| | | | | | | | | | | | | | This patch adds the SMBUS PCI ID of Intel Broxton. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: i801: Add support for Intel DNVMika Westerberg2015-10-231-0/+4
| | | | | | | | | | | | | | | | | | | | Intel DNV SoC has the same legacy SMBus host controller than Intel Sunrisepoint PCH. It also has same iTCO watchdog on the bus. Add DNV PCI ID to the list of supported devices. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: mediatek: add i2c resume supportLiguo Zhang2015-10-231-0/+16
| | | | | | | | | | | | | | | | | | mt65xx i2c controller initial setting will be cleared after system suspend, so we should init mt65xx i2c controller again when system resume. Signed-off-by: Liguo Zhang <liguo.zhang@mediatek.com> Signed-off-by: Eddie Huang <eddie.huang@mediatek.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: imx: implement bus recoveryGao Pan2015-10-231-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement bus recovery methods for i2c-imx so we can recover from situations where SCL/SDA are stuck low. Once i2c bus SCL/SDA are stuck low during transfer, config the i2c pinctrl to gpio mode by calling pinctrl sleep set function, and then use GPIO to emulate the i2c protocol to send nine dummy clock to recover i2c device. After recovery, set i2c pinctrl to default group setting. Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Gao Pan <b54642@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: uniphier_f: add UniPhier FIFO-builtin I2C driverMasahiro Yamada2015-10-233-0/+593
| | | | | | | | | | | | | | | | | | Add support for on-chip I2C controller used on newer UniPhier SoCs such as PH1-Pro4, PH1-Pro5, etc. This adapter is equipped with 8-depth TX/RX FIFOs. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: uniphier: add UniPhier FIFO-less I2C driverMasahiro Yamada2015-10-233-0/+450
| | | | | | | | | | | | | | | | | | Add support for on-chip I2C controller used on old UniPhier SoCs such as PH1-LD4, PH1-sLD8, etc. This adapter is so simple that it has no FIFO in it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: designware: reverts "i2c: designware: Add support for AMD I2C controller"Ken Xue2015-10-231-26/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch reverts commit a445900c9060 (i2c: designware: Add support for AMD I2C controller). It never worked anyhow because it did not register a proper clkdev. Since kernel 4.1 starts to support APD, there is no need to get freq from id->driver_data for AMD0010. clkdev is supposed to be already registered in APD. So, revert old design and make AMD0010 looks like other ones. Signed-off-by: Ken Xue <Ken.Xue@amd.com> Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: imx: add support for Freescale Layerscape platformsShaohui Xie2015-10-231-2/+2
| | | | | | | | | | | | Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com> Signed-off-by: Hou Zhiqiang <B48286@freescale.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: at91: fix write transfers by clearing pending interrupt firstCyrille Pitchen2015-10-221-8/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases a NACK interrupt may be pending in the Status Register (SR) as a result of a previous transfer. However at91_do_twi_transfer() did not read the SR to clear pending interruptions before starting a new transfer. Hence a NACK interrupt rose as soon as it was enabled again at the I2C controller level, resulting in a wrong sequence of operations and strange patterns of behaviour on the I2C bus, such as a clock stretch followed by a restart of the transfer. This first issue occurred with both DMA and PIO write transfers. Also when a NACK error was detected during a PIO write transfer, the interrupt handler used to wrongly start a new transfer by writing into the Transmit Holding Register (THR). Then the I2C slave was likely to reply with a second NACK. This second issue is fixed in atmel_twi_interrupt() by handling the TXRDY status bit only if both the TXCOMP and NACK status bits are cleared. Tested with a at24 eeprom on sama5d36ek board running a linux-4.1-at91 kernel image. Adapted to linux-next. Reported-by: Peter Rosin <peda@lysator.liu.se> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Tested-by: Peter Rosin <peda@lysator.liu.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Fixes: 93563a6a71bb ("i2c: at91: fix a race condition when using the DMA controller") Cc: stable@vger.kernel.org #4.1
| * i2c: designware: Fix build error when !CONFIG_PM_SLEEPJarkko Nikula2015-10-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit ("i2c: designware: Rename platform driver probe and PM functions") introduced "'dw_i2c_plat_prepare' undeclared here" and "'dw_i2c_plat_complete' undeclared here" build errors when CONFIG_PM_SLEEP is not set. Fix this by renaming NULL defined dw_i2c_prepare and dw_i2c_complete PM hooks to dw_i2c_plat_prepare and dw_i2c_plat_complete since this was obviously missing from the commit. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: stu300: Fix module autoload for OF platform driverLuis de Bethencourt2015-10-201-0/+1
| | | | | | | | | | | | | | | | | | This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rk3x: Fix module autoload for OF platform driverLuis de Bethencourt2015-10-201-0/+1
| | | | | | | | | | | | | | | | This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: meson: Fix module autoload for OF platform driverLuis de Bethencourt2015-10-201-0/+1
| | | | | | | | | | | | | | | | This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: ibm-iic: Fix module autoload for OF platform driverLuis de Bethencourt2015-10-201-0/+1
| | | | | | | | | | | | | | | | This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: Remove obsolete platform data supportGeert Uytterhoeven2015-10-201-19/+2Star
| | | | | | | | | | | | | | | | | | | | | | Since commit 4baadb9e05c68962 ("ARM: shmobile: r8a7778: remove obsolete setup code"), Renesas R-Car SoCs are only supported in generic DT-only ARM multi-platform builds. The driver doesn't need to use platform data anymore, hence remove platform data configuration. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> [wsa: removed now unused ret value and cast to proper enum type] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: sh_mobile: add support for r8a7795 (R-Car H3)Wolfram Sang2015-10-201-0/+1
| | | | | | | | | | | | | | | | | | Enable the I2C core for this SoC. It is compitable to Gen2 SoCs, so reuse the settings. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: rcar: add support for r8a7795 (R-Car H3)Wolfram Sang2015-10-201-0/+3
| | | | | | | | | | | | | | | | | | Enable the I2C core for this SoC. I add a new type because this version has new features (e.g. DMA) which will be added somewhen later. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: ocores: support big-endian register layoutMax Filippov2015-10-201-4/+27
| | | | | | | | | | | | | | | | | | | | This allows using OpenCores I2C controller attached to its host in native-endian mode with bi-endian CPUs. Example of such system is Xtensa XTFPGA platform. Acked-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: au1550: relax bus timings a bitManuel Lauss2015-10-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The i2c-au1550 driver has to program various setup and hold times for the sda/scl signals by hand. The current values seem to be working best when the driver is supplied with 50MHz, however on the DB1300 board 48MHz is the closest we can get to it, and the timings are a bit too tight for that, leading to the last bit of a transmission sometimes being swallowed. This manifests itself in wrong readings of the ne1619 sensor and inability to configure the wm8731 i2s codec. With the relaxed timings, both the sensor and the i2s codec can now be accessed more reliably over a wider range of I2C block input frequencies. Verified on DB1200, DB1300 and DB1550 boards. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: tegra: drop duplicated code for assigning algoBarry Song2015-10-201-1/+0Star
| | | | | | | | | | | | | | | | | | This code is repeated in probe: i2c_dev->adapter.algo = &tegra_i2c_algo; Cc: Donglin Peng <pengdonglin137@163.com> Signed-off-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: davinci: Optimize clock generation on Keystone SoCAlexander Sverdlin2015-10-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to "KeyStone Architecture Inter-IC Control Bus User Guide", fixed additive part of frequency divisors (referred as "d" in the code and datasheet) always equals to 6, independent of module clock prescaler. module clock frequency master clock frequency = ---------------------- (ICCL + 6) + (ICCH + 6) It was not the case with original Davinci IP. Introduce new compatible property "ti,keystone-i2c", which triggers special handling in the driver. Without this change Keystone-based systems (having 204.8MHz input clock) choose prescaler 29 (PSC=28). Using d=5 in this case leads to bus bitrate ~353kHz instead of requested 400kHz. After correction, assuming d=6 bus rate is ~392kHz. This gives ~11% transfer rate increase. Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Tested-by: Hemanth Guruva Reddy <hemanth.guruva_reddy@nokia.com> Tested-by: Lukasz Gemborowski <lukasz.gemborowski@nokia.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: ismt: issue a warning when fail to request MSIAndy Shevchenko2015-10-201-6/+5Star
| | | | | | | | | | | | | | | | | | Issue the warning in all error paths when unable to register MSI or its handler. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: ismt: propagate actual error codeAndy Shevchenko2015-10-201-1/+1
| | | | | | | | | | | | | | | | Propagate actual return code when requesting interrupt fails. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: ismt: do not duplicate msi_enabled flagAndy Shevchenko2015-10-201-5/+1Star
| | | | | | | | | | | | | | | | | | struct pci_dev already has a flag to track if MSI is enabled or not. Use it directly. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: ismt: PCI core handles power state for usAndy Shevchenko2015-10-201-33/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to repeat the work that is already done in the PCI driver core. Remove suspend and resume callbacks. Note that there is no more calls performed to enable or disable a PCI device during suspend-resume cycle. Nowadays they seems to be superfluous. Someone can read more in [1]. [1] https://www.kernel.org/doc/ols/2009/ols2009-pages-319-330.pdf Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: ismt: improve usage of devres APIAndy Shevchenko2015-10-201-13/+5Star
| | | | | | | | | | | | | | | | | | pcim_release() will release any requested region. There is no need to duplicate this effort in the driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: ismt: mark register space with __iomemAndy Shevchenko2015-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This fixes the code to suppress sparse warnings like: drivers/i2c/busses/i2c-ismt.c:725:36: warning: incorrect type in argument 2 (different address spaces) drivers/i2c/busses/i2c-ismt.c:725:36: expected void volatile [noderef] <asn:2>*addr drivers/i2c/busses/i2c-ismt.c:725:36: got void * Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c / ACPI: Rework I2C device scanningMika Westerberg2015-10-201-23/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way we currently scan I2C devices behind an I2C host controller does not work in cases where the I2C device in question is not declared directly below the host controller ACPI node. This is perfectly legal according the ACPI 6.0 specification and some existing systems are doing this. To be able to enumerate all devices which are connected to a certain I2C host controller we need to rework the current I2C scanning routine a bit. Instead of scanning directly below the host controller we scan the whole ACPI namespace for present devices with valid I2cSerialBus() connection pointing to the host controller in question. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Dustin Byford <dustin@cumulusnetworks.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: designware: Move common probe code into i2c_dw_probe()Jarkko Nikula2015-10-154-63/+49Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is some code duplication in i2c-designware-platdrv and i2c-designware-pcidrv probe functions. What is even worse that duplication requires i2c_dw_xfer(), i2c_dw_func() and i2c_dw_isr() i2c-designware-core functions to be exported. Therefore move common code into new i2c_dw_probe() and make functions above local to i2c-designware-core. While merging the code patch does following functional changes: - I2C Adapter name will be "Synopsys DesignWare I2C adapter". Previously it was used for platform and ACPI devices but PCI device used "i2c-designware-pci". - Using device name for interrupt name. Previous it was platform device name, ACPI device name or "i2c-designware-pci". - Error code from devm_request_irq() and i2c_add_numbered_adapter() will be printed in case of error. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: designware: Rename platform driver probe and PM functionsJarkko Nikula2015-10-151-12/+12
| | | | | | | | | | | | | | | | | | Make it easier to distinguish between i2c-designware-platdrv and i2c-designware-core functions and to be consistent with i2c-designware-pcidrv. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: designware: Make dw_readl() and dw_writel() staticJarkko Nikula2015-10-152-4/+2Star
| | | | | | | | | | | | | | | | | | dw_readl() and dw_writel() are not used outside of i2c-designware-core and they are not exported so make them static and remove their forward declaration. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: designware: Remove unused functionsJarkko Nikula2015-10-152-15/+0Star
| | | | | | | | | | | | | | | | | | | | i2c_dw_is_enabled() became unused by the commit be58eda775c8 ("i2c: designware-pci: Cleanup driver power management") and i2c_dw_enable() by the commit 3a48d1c08fe0 ("i2c: prevent spurious interrupt on Designware controllers"). Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: designware: Disable interrupts before requesting PCI device interruptJarkko Nikula2015-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Device must not generate interrupts before registering the interrupt handler so move i2c_dw_disable_int() before requesting it. There are no known issues with this. The code has been here since commit fe20ff5c7e9c ("i2c-designware: Add support for Designware core behind PCI devices."). Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: designware: Remove interrupt clearing from i2c_dw_pci_probe()Jarkko Nikula2015-10-153-9/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to clear interrupts in i2c_dw_pci_probe() since only place where interrupts are unmasked is i2c_dw_xfer_init() and there interrupts are always cleared after commit 2a2d95e9d6d2 ("i2c: designware: always clear interrupts before enabling them"). This allows to cleanup the code and replace i2c_dw_clear_int() in i2c_dw_xfer_init() by direct register read as there are no other callers. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: img-scb: verify support for requested bit rateSifan Naeem2015-10-101-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The requested bit rate can be outside the range supported by the driver. The maximum bit rate this driver supports at the moment is 400Khz. If the requested bit rate is larger than the maximum supported by the driver, set the bitrate to the maximum supported before bitrate_khz is calculated. Maximum speed supported by the driver can be increased to 1Mhz by adding support for "fast plus mode" in the future. Fixes: commit 27bce457d588 ("i2c: img-scb: Add Imagination Technologies I2C SCB driver") Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com> Acked-by: James Hogan <james.hogan@imgtec.com> Reviewed-by: James Hartley <james.hartley@imgtec.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: img-scb: Clear line and interrupt status before starting a transferSifan Naeem2015-10-101-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Clear line status and all generated interrupts from the interrupt status register before starting a transfer, as we may have unserviced interrupts from previous transfers that might be handled in the context of the new transfer. Fixes: commit 27bce457d588 ("i2c: img-scb: Add Imagination Technologies I2C SCB driver") Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com> Acked-by: James Hogan <james.hogan@imgtec.com> Reviewed-by: James Hartley <james.hartley@imgtec.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>