summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
AgeCommit message (Collapse)Author
2017-08-14i2c: simtec: use release_mem_region instead of release_resourceAnton Vasilyev
Use api pair of request_mem_region and release_mem_region instead of release_resource. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-08-14i2c: core: Make comment about I2C table requirement to reflect the codeJavier Martinez Canillas
I2C drivers were required to have an I2C device ID table even if were for devices that would only be registered using a specific firmware interface (e.g: OF or ACPI). But commit da10c06a044b ("i2c: Make I2C ID tables non-mandatory for DT'ed devices") changed the I2C core to relax the requirement and allow drivers to avoid defining this table. Unfortunately it only took into account drivers for OF-only devices and forgot about ACPI-only ones, and this was fixed by commit c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case as well"). But the latter didn't update the original comment, so it doesn't reflect what the code does now. Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-08-14i2c: designware: Fix standard mode speed when configuring the slave modeJarkko Nikula
Code sets bit DW_IC_CON_SPEED_FAST (0x4) always when configuring the slave mode. This results incorrect register value DW_IC_CON_SPEED_HIGH (0x6) when OR'ed together with DW_IC_CON_SPEED_STD (0x2). Remove this and let the code set the speed mode bits according to clock frequency or default to fast mode. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-08-14i2c: designware: Fix oops from i2c_dw_irq_handler_slaveJarkko Nikula
When i2c-designware is initialized in slave mode the i2c-designware-slave.c: i2c_dw_irq_handler_slave() can hit a NULL pointer dereference when I2C slave backend is not registered but code is accessing the struct dw_i2c_dev.slave without testing is it NULL. We might get spurious interrupts from other devices or from IRQ core during unloading the driver when CONFIG_DEBUG_SHIRQ is set. Existing check for enable and IRQ status is not enough since device can be power gated and those bits may read 1. Fix this by handling the interrupt only when also struct dw_i2c_dev.slave is set. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-08-14i2c: designware: Fix system suspendUlf Hansson
The commit 8503ff166504 ("i2c: designware: Avoid unnecessary resuming during system suspend"), may suggest to the PM core to try out the so called direct_complete path for system sleep. In this path, the PM core treats a runtime suspended device as it's already in a proper low power state for system sleep, which makes it skip calling the system sleep callbacks for the device, except for the ->prepare() and the ->complete() callbacks. However, the PM core may unset the direct_complete flag for a parent device, in case its child device are being system suspended before. In this scenario, the PM core invokes the system sleep callbacks, no matter if the device is runtime suspended or not. Particularly in cases of an existing i2c slave device, the above path is triggered, which breaks the assumption that the i2c device is always runtime resumed whenever the dw_i2c_plat_suspend() is being called. More precisely, dw_i2c_plat_suspend() calls clk_core_disable() and clk_core_unprepare(), for an already disabled/unprepared clock, leading to a splat in the log about clocks calls being wrongly balanced and breaking system sleep. To still allow the direct_complete path in cases when it's possible, but also to keep the fix simple, let's runtime resume the i2c device in the ->suspend() callback, before continuing to put the device into low power state. Note, in cases when the i2c device is attached to the ACPI PM domain, this problem doesn't occur, because ACPI's ->suspend() callback, assigned to acpi_subsys_suspend(), already calls pm_runtime_resume() for the device. It should also be noted that this change does not fix commit 8503ff166504 ("i2c: designware: Avoid unnecessary resuming during system suspend"). Because for the non-ACPI case, the system sleep support was already broken prior that point. Cc: <stable@vger.kernel.org> # v4.4+ Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Tested-by: John Stultz <john.stultz@linaro.org> Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-08-14i2c: mux: pinctrl: drop the idle_state memberPeter Rosin
The information is available elsewhere. Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-08-14i2c: mux: pinctrl: remove platform_dataPeter Rosin
No platform (at least no upstreamed platform) has ever used this platform_data. Just drop it and simplify the code. Reviewed-by: Stephen Warren <swarren@nvidia.com> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-08-14i2c: mux: mlxcpld: move header file out of I2C realmWolfram Sang
include/linux/i2c is not for client devices. Move the header file to a more appropriate location. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-08-14i2c: mux: pca954x: move header file out of I2C realmWolfram Sang
include/linux/i2c is not for client devices. Move the header file to a more appropriate location. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-08-14i2c: mux: pca9541: sort include filesWolfram Sang
Make it consistent with the other drivers. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-08-13i2c-cht-wc: Add Intel Cherry Trail Whiskey Cove SMBUS controller driverHans de Goede
The Intel Cherry Trail Whiskey Cove PMIC does not contain a builtin battery charger, instead boards with this PMIC use an external TI bq24292i charger IC, which is connected to a SMBUS controller built into the PMIC. This commit adds an i2c-bus driver for the PMIC's builtin SMBUS controller. The probe function for this i2c-bus will also register an i2c-client for the TI bq24292i charger after the i2c-bus has been registered. Note that several device-properties are set on the client-device to tell the bq24190 power-supply driver to integrate the Whiskey Cove PMIC and e.g. use the PMIC's BC1.2 detection (through extcon) to determine the maximum input current. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-08-12i2c: rk3x: add support for rv1108Andy Yan
Support for the i2c controller on rv1108 soc. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-08-12i2c: uniphier-f: add suspend / resume supportMasahiro Yamada
When resuming, set up registers that have been lost in the sleep state. Also, add clock handling in the resume / suspend hooks. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-08-12i2c: uniphier: add suspend / resume supportMasahiro Yamada
When resuming, set up registers that have been lost in the sleep state. Also, add clock handling in the resume / suspend hooks. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-08-12i2c: constify internal structuresGustavo A. R. Silva
Check for i2c_algorithm and i2c_adapter_quirks structures that are only stored in the algo and quirks fields of an i2c_adapter structure correspondingly. These fields are declared const, so i2c_algorithm and i2c_adapter_quirks structures that have this property can be declared as const also. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> (for designware) Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-31i2c: Convert to using %pOF instead of full_nameRob Herring
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-31i2c: allow i2c-versatile for ARM MPS platformsRussell King
Allow i2c-versatile to be enabled for ARM MPS platforms. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-31i2c: use dev_get_drvdata() to get private data in suspend/resume hooksMasahiro Yamada
Several drivers call to_platform_device() to get platform_device and pass it to platform_get_drvdata(). In platform_get_drvdata(), the platform_device is converted back to struct device again. Use dev_get_drvdata() to avoid platform_device/device dance. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> (for DesignWare only) Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-31Merge branch 'i2c-mux/for-current' of https://github.com/peda-r/i2c-mux into ↵Wolfram Sang
i2c/for-current
2017-07-31i2c: mediatek: send i2c master code at 400kJun Gao
The speed of sending i2c master code in high-speed mode depends on source clock, clock-div and TIMING register. The source clock and clock-div of different SoC are not all the same. In order to send i2c master code at 400k in high-speed mode, a appropriate value should be set to TIMING register for a certain source clock and clock-div. Signed-off-by: Jun Gao <jun.gao@mediatek.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-31i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHzHans de Goede
At least the Acer Iconia Tab8 / aka W1-810 uses 1MiHz instead of 1MHz for one of its busses, fix this up to 1MHz instead of failing the probe of that bus. This fixes the accelerometer on the Acer Iconia Tab8 not working. Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-31i2c: designware: Print clock freq on invalid clock freq errorHans de Goede
When we refuse to probe due to an invalid clock frequency, log the frequency which is causing this error. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-31i2c: core: Allow empty id_table in ACPI case as wellAndy Shevchenko
For now empty ID table is not allowed with ACPI and prevents driver to be probed. Add a check to allow empty ID table. This introduces a helper i2c_acpi_match_device(). Note, we rename some static function in i2c-core-acpi.c to distinguish with public API. Fixes: da10c06a044b ("i2c: Make I2C ID tables non-mandatory for DT'ed devices") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Rajmohan Mani <rajmohan.mani@intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> [wsa: needed to get some drivers probed again] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-17i2c: mux: pinctrl: mention correct module name in Kconfig help textChris Gorman
Kconfig says the resulting module is pinctrl-i2cmux, but the module when built is i2c-mux-pinctrl. Fixes: ae58d1e40698 ("i2c: Add generic I2C multiplexer using pinctrl API") Signed-off-by: Chris Gorman <chrisjohgorman@gmail.com> Signed-off-by: Peter Rosin <peda@axentia.se>
2017-07-12Merge branch 'i2c/for-4.13' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "This pull request contains: - i2c core reorganization. One source file became too monolithic. It is now split up, yet we still have the same named object as the final output. This should ease maintenance. - new drivers: ZTE ZX2967 family, ASPEED 24XX/25XX - designware driver gained slave mode support - xgene-slimpro driver gained ACPI support - bigger overhaul for pca-platform driver - the algo-bit module now supports messages with enforced STOP - slightly bigger than usual set of driver updates and improvements and with much appreciated quality assurance from Andy Shevchenko" * 'i2c/for-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (51 commits) i2c: Provide a stub for i2c_detect_slave_mode() i2c: designware: Let slave adapter support be optional i2c: designware: Make HW init functions static i2c: designware: fix spelling mistakes i2c: pca-platform: propagate error from i2c_pca_add_numbered_bus i2c: pca-platform: correctly set algo_data.reset_chip i2c: acpi: Do not create i2c-clients for LNXVIDEO ACPI devices i2c: designware: enable SLAVE in platform module i2c: designware: add SLAVE mode functions i2c: zx2967: drop COMPILE_TEST dependency i2c: zx2967: always use the same device when printing errors i2c: pca-platform: use dev_warn/dev_info instead of printk i2c: pca-platform: use device managed allocations i2c: pca-platform: add devicetree awareness i2c: pca-platform: switch to struct gpio_desc dt-bindings: add bindings for i2c-pca-platform i2c: cadance: fix ctrl/addr reg write order i2c: zx2967: add i2c controller driver for ZTE's zx2967 family dt: bindings: add documentation for zx2967 family i2c controller i2c: algo-bit: add support for I2C_M_STOP ...
2017-07-04i2c: designware: Let slave adapter support be optionalJarkko Nikula
Only certain system configurations may use the I2C slave mode so let the support be optional. This allow reducing module size if needed: text data bss dec hex filename 10328 1336 16 11680 2da0 drivers/i2c/busses/i2c-designware-core.ko 7222 1136 8 8366 20ae drivers/i2c/busses/i2c-designware-core.ko Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Luis Oliveira <lolivei@synopsys.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-04i2c: designware: Make HW init functions staticJarkko Nikula
Recent i2c-designware slave support patches use master or slave HW init functions through the function pointer so we can declare them static. While at it, rename i2c_dw_init() as i2c_dw_init_master(). Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Luis Oliveira <lolivei@synopsys.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-04i2c: designware: fix spelling mistakesColin Ian King
Trivial fixes to spelling mistakes in dev_dbg message "STAUTS" -> "STATUS" "SLAVE_ACTTVITY" -> "SLAVE_ACTIVITY" Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-04i2c: pca-platform: propagate error from i2c_pca_add_numbered_busChris Packham
Rather than returning -ENODEV if i2c_pca_add_numbered_bus() fails, propagate the error to aid debugging. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-04i2c: pca-platform: correctly set algo_data.reset_chipChris Packham
When device tree support was added the setting of algo_data.reset_chip was moved. There were two problems with this. The first being that i2c_pca_pf_resetchip was only used if platform data was provided. The second that it was unconditionally overridden with i2c_pca_pf_dummyreset. Ensure that however the reset gpio is defined the correct reset_chip function is used. Fixes: commit 4cc7229daa46 ("i2c: pca-platform: switch to struct gpio_desc") Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-04i2c: acpi: Do not create i2c-clients for LNXVIDEO ACPI devicesHans de Goede
ACPI video devices get tagged by the kernel with the custom LNXVIDEO HID so that normal pnp-id matching can be used and are handled by the acpi-video driver. Sometimes the ACPI nodes describing these contain a SERIAL_TYPE_I2C ACPI resource. Before this commit the presence of this resource would cause the i2c-core to create a /sys/bus/i2c/devices/i2c-LNXVIDEO:00 device for this with a modalias of: "i2c:LNXVIDEO:00". There is no i2c driver for this custom HID, the acpi-video driver binds directly to the ACPI device /sys/bus/acpi/devices/LNXVIDEO\:00 which has a modalias of "acpi:LNXVIDEO:" . Not only is the creation of an i2c-client for this undesirable, it is actually causing problems. This weird pseudo-resource claims an i2c speed of 100KHz and typically points to the i2c bus which is used by the touchscreen controller. Some touchscreen controllers only work properly at 400KHz, at 100KHz they cause errors like these: i2c_designware 80860F41:03: i2c_dw_handle_tx_abort: lost arbitration i2c_designware 80860F41:03: i2c_dw_handle_tx_abort: lost arbitration i2c_designware 80860F41:03: i2c_dw_handle_tx_abort: lost arbitration i2c_designware 80860F41:03: i2c_dw_handle_tx_abort: lost arbitration silead_ts i2c-MSSL1680:00: Registers clear error -11 This commit makes the i2c-core ignore LNXVIDEO compatible ACPI devices which has 2 positive results: 1) The bogus i2c-client for these is no longer created. 2) i2c_acpi_lookup_speed now ignores the 100KHz speed from the pseudo i2c-resouce and properly returns 400KHz as speed for the touchscreen i2c bus, fixing the touchscreen not working on various devies. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-07-03Merge tag 'char-misc-4.13-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc updates from Greg KH: "Here is the "big" char/misc driver patchset for 4.13-rc1. Lots of stuff in here, a large thunderbolt update, w1 driver header reorg, the new mux driver subsystem, google firmware driver updates, and a raft of other smaller things. Full details in the shortlog. All of these have been in linux-next for a while with the only reported issue being a merge problem with this tree and the jc-docs tree in the w1 documentation area" * tag 'char-misc-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (147 commits) misc: apds990x: Use sysfs_match_string() helper mei: drop unreachable code in mei_start mei: validate the message header only in first fragment. DocBook: w1: Update W1 file locations and names in DocBook mux: adg792a: always require I2C support nvmem: rockchip-efuse: add support for rk322x-efuse nvmem: core: add locking to nvmem_find_cell nvmem: core: Call put_device() in nvmem_unregister() nvmem: core: fix leaks on registration errors nvmem: correct Broadcom OTP controller driver writes w1: Add subsystem kernel public interface drivers/fsi: Add module license to core driver drivers/fsi: Use asynchronous slave mode drivers/fsi: Add hub master support drivers/fsi: Add SCOM FSI client device driver drivers/fsi/gpio: Add tracepoints for GPIO master drivers/fsi: Add GPIO based FSI master drivers/fsi: Document FSI master sysfs files in ABI drivers/fsi: Add error handling for slave drivers/fsi: Add tracepoints for low-level operations ...
2017-06-27i2c: designware: enable SLAVE in platform moduleLuis Oliveira
- Slave mode selected in platform module if the support is detected in the DT. Signed-off-by: Luis Oliveira <lolivei@synopsys.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-27i2c: designware: add SLAVE mode functionsLuis Oliveira
- Changes in Kconfig to enable I2C_DESIGNWARE_SLAVE support - Slave functions added to core library file - Slave abort sources added to common source file - New driver: i2c-designware-slave added - Changes in the Makefile to compile the I2C_DESIGNWARE_SLAVE module when supported by the architecture. All the SLAVE flow is added but it is not enabled via platform driver. Signed-off-by: Luis Oliveira <lolivei@synopsys.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> [wsa: made a function static and one-lined a message] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-27i2c: zx2967: drop COMPILE_TEST dependencyShawn Guo
0-DAY kernel test reports the following build issue on IA64 architecture with allmodconfig. drivers/i2c/busses/i2c-zx2967.c: In function 'zx2967_i2c_writesb': >> drivers/i2c/busses/i2c-zx2967.c:87:2: error: implicit declaration of function 'writesb' [-Werror=implicit-function-declaration] writesb(i2c->reg_base + reg, data, len); ^~~~~~~ drivers/i2c/busses/i2c-zx2967.c: In function 'zx2967_i2c_readsb': >> drivers/i2c/busses/i2c-zx2967.c:93:2: error: implicit declaration of function 'readsb' [-Werror=implicit-function-declaration] readsb(i2c->reg_base + reg, data, len); ^~~~~~ cc1: some warnings being treated as errors It's caused by that writesb/readsb are unavailable on IA64 architecture. Let's drop COMPILE_TEST dependency to avoid the build issue. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-27i2c: zx2967: always use the same device when printing errorsWolfram Sang
Let's always use the platform device for dev_* and not sometimes the adapter device as well. Also fix this checkpatch check: CHECK: Macro argument 'i2c' may be better as '(i2c)' to avoid precedence issues Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-27i2c: pca-platform: use dev_warn/dev_info instead of printkChris Packham
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-27i2c: pca-platform: use device managed allocationsChris Packham
Switch to using the devm_ APIs and remove the now unnecessary error handling and most of the device removal code. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> [wsa: adapted error handling I added in previous patch] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-27i2c: pca-platform: add devicetree awarenessChris Packham
Allow devices that use this driver to be registered via a devicetree. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> [wsa: fixed leakage when registering GPIO failed] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-27i2c: pca-platform: switch to struct gpio_descChris Packham
Make use of struct gpio_desc which allows us to specify the active state of the reset pin. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-23i2c: cadance: fix ctrl/addr reg write orderMatt Weber
The driver was clearing the hold bit in the control register before writing to the address register which resulted in a stop condition being generated rather than a repeated start. This issue was only observed when a system was running much slower than a normal processor would execute. The IP data sheet mentions a ordering of writing to the address register before clearing the hold. Fixes: df8eb5691c4 ("i2c: Add driver for Cadence I2C controller") Signed-off-by: John Linn <john.linn@xilinx.com> Signed-off-by: Paresh Chaudhary <paresh.chaudhary@rockwellcollins.com> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-23i2c: zx2967: add i2c controller driver for ZTE's zx2967 familyBaoyou Xie
This patch adds i2c controller driver for ZTE's zx2967 family. Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Jun Nie <jun.nie@linaro.org> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-23i2c: algo-bit: add support for I2C_M_STOPJean Delvare
Support for enforced STOPs will allow us to use SCCB compatible devices. Based on a preliminary patch by Wolfram Sang. Signed-off-by: Jean Delvare <jdelvare@suse.de> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-23i2c: aspeed: added slave support for Aspeed I2C driverBrendan Higgins
Added slave support for Aspeed I2C controller. Supports fourteen busses present in AST24XX and AST25XX BMC SoCs by Aspeed. Signed-off-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-23i2c: aspeed: added driver for Aspeed I2CBrendan Higgins
Added initial master support for Aspeed I2C controller. Supports fourteen busses present in AST24XX and AST25XX BMC SoCs by Aspeed. Signed-off-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-23i2c: rcar: document HW incapabilitiesWolfram Sang
Add recent findings (IGNORE_NAK) and document in a bit more detail why the feature is not possible. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-22i2c: imx: Use correct function to write to registerMichail Georgios Etairidis
The i2c-imx driver incorrectly uses readb()/writeb() to read and write to the appropriate registers when performing a repeated start. The appropriate imx_i2c_read_reg()/imx_i2c_write_reg() functions should be used instead. Performing a repeated start results in a kernel panic. The platform is imx. Signed-off-by: Michail G Etairidis <m.etairidis@beck-ipc.com> Fixes: ce1a78840ff7 ("i2c: imx: add DMA support for freescale i2c driver") Fixes: 054b62d9f25c ("i2c: imx: fix the i2c bus hang issue when do repeat restart") Acked-by: Fugang Duan <fugang.duan@nxp.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-19i2c: emev2: Handle return value of clk_prepare_enableArvind Yadav
clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-19i2c: designware: introducing I2C_SLAVE definitionsLuis Oliveira
- Definitions were added to core library - A example was added to designware-core.txt Documentation that shows how the slave can be setup using DTS SLAVE related definitions were added to the core of the controller. Signed-off-by: Luis Oliveira <lolivei@synopsys.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-19i2c: designware: MASTER mode as separated driverLuis Oliveira
- The functions related to I2C master mode of operation were transformed in a single driver. - Common definitions were moved to i2c-designware-core.h - The i2c-designware-core is now only a library file, the functions associated are in a source file called i2c-designware-common and are used by both i2c-designware-master and i2c-designware-slave. - To decrease noise in namespace common i2c_dw_*() functions are now using ops to keep them private. - Designware PCI driver had to be changed to match the previous ops functions implementation. Almost all of the "core" source is now part of the "master" source. The difference is the functions used by both modes and they are in the "common" source file. Signed-off-by: Luis Oliveira <lolivei@synopsys.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>