summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
Commit message (Collapse)AuthorAgeFilesLines
* i2c: drivers: Use generic definitions for bus frequenciesAndy Shevchenko2020-03-2444-199/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we have generic definitions for bus frequencies, let's use them. Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Acked-by: Robert Richter <rrichter@marvell.com> Reviewed-by: Thor Thayer <thor.thayer@linux.intel.com> Acked-by: Elie Morisse <syniurge@gmail.com> Acked-by: Nehal Shah <nehal-bakulchandra.shah@amd.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Acked-by: Scott Branden <scott.branden@broadcom.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Acked-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Vladimir Zapolskiy <vz@mleia.com> Acked-by: Gregory CLEMENT <gregory.clement@bootlin.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Chris Brandt <chris.brandt@renesas.com> Reviewed-by: Baolin Wang <baolin.wang7@gmail.com> Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com> Acked-by: Patrice Chotard <patrice.chotard@st.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: algo: Use generic definitions for bus frequenciesAndy Shevchenko2020-03-241-3/+3
| | | | | | | Since we have generic definitions for bus frequencies, let's use them. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: stm32f7: switch to I²C generic property parsingAndy Shevchenko2020-03-241-31/+26
| | | | | | | | | | Switch to the new generic functions: i2c_parse_fw_timings(). While here, replace hard coded values with standard bus frequency definitions. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Alain Volmat <alain.volmat@st.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: rcar: Consolidate timings calls in rcar_i2c_clock_calculate()Andy Shevchenko2020-03-241-9/+9
| | | | | | | | | | | Move i2c_parse_fw_timings() to rcar_i2c_clock_calculate() to consolidate timings calls in one place. While here, replace hard coded values with standard bus frequency definitions. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: core: Allow override timing properties with 0Andy Shevchenko2020-03-242-14/+18
| | | | | | | | | | Some drivers may allow to override properties with 0 value when defaults are not in use, thus, replace memset() with corresponding per property update. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: core: Provide generic definitions for bus frequenciesAndy Shevchenko2020-03-242-5/+5
| | | | | | | | | | | | | | | | | | | | | There are few maximum bus frequencies being used in the I²C core code. Provide generic definitions for bus frequencies and use them in the core. The drivers may use predefined constants where it is appropriate. Some of them are already using these under slightly different names. We will convert them later to use newly introduced defines. Note, the name of modes are chosen to follow well established naming scheme [1]. These definitions will also help to avoid typos in the numbers that may lead to subtle errors. [1]: https://en.wikipedia.org/wiki/I%C2%B2C#Differences_between_modes Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: mxs: Use dma_request_chan() instead dma_request_slave_channel()Peter Ujfalusi2020-03-221-3/+3
| | | | | | | | | | | dma_request_slave_channel() is a wrapper on top of dma_request_chan() eating up the error code. By using dma_request_chan() directly the driver can support deferred probing against DMA. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: imx: remove duplicate print after platform_get_irq()Tang Bin2020-03-211-3/+1
| | | | | | | | | | We don't need dev_err() message because when something goes wrong, platform_get_irq() has print an error message itself, so we should remove duplicate dev_err(). Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Acked-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: designware: Fix spelling typos in the commentsAndy Shevchenko2020-03-215-8/+8
| | | | | | | | Fix spelling typos in the comments with help of `codespell`. Signed-off-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>
* i2c: designware: Discard i2c_dw_read_comp_param() functionSerge Semin2020-03-212-7/+0
| | | | | | | | | | There is no code left in the kernel which would be using the function. So just remove it. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: designware: Detect the FIFO size in the common codeSerge Semin2020-03-215-24/+27
| | | | | | | | | | | | | | | | | | | | | The problem with detecting the FIFO depth in the platform driver is that in order to implement this we have to access the controller IC_COMP_PARAM_1 register. Currently it's done before the i2c_dw_set_reg_access() method execution, which is errors prone since the method determines the registers endianness and access mode and we can't use dw_readl/dw_writel accessors before this information is retrieved. We also can't move the i2c_dw_set_reg_access() function invocation to after the master/slave probe functions call (when endianness and access mode are determined), since the FIFO depth information is used by them for initializations. So in order to fix the problem we have no choice but to move the FIFO size detection methods to the common code and call it at the probe stage. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Reviewed-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>
* i2c: dev: Fix the race between the release of i2c_dev and cdevKevin Hao2020-03-201-22/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The struct cdev is embedded in the struct i2c_dev. In the current code, we would free the i2c_dev struct directly in put_i2c_dev(), but the cdev is manged by a kobject, and the release of it is not predictable. So it is very possible that the i2c_dev is freed before the cdev is entirely released. We can easily get the following call trace with CONFIG_DEBUG_KOBJECT_RELEASE and CONFIG_DEBUG_OBJECTS_TIMERS enabled. ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x38 WARNING: CPU: 19 PID: 1 at lib/debugobjects.c:325 debug_print_object+0xb0/0xf0 Modules linked in: CPU: 19 PID: 1 Comm: swapper/0 Tainted: G W 5.2.20-yocto-standard+ #120 Hardware name: Marvell OcteonTX CN96XX board (DT) pstate: 80c00089 (Nzcv daIf +PAN +UAO) pc : debug_print_object+0xb0/0xf0 lr : debug_print_object+0xb0/0xf0 sp : ffff00001292f7d0 x29: ffff00001292f7d0 x28: ffff800b82151788 x27: 0000000000000001 x26: ffff800b892c0000 x25: ffff0000124a2558 x24: 0000000000000000 x23: ffff00001107a1d8 x22: ffff0000116b5088 x21: ffff800bdc6afca8 x20: ffff000012471ae8 x19: ffff00001168f2c8 x18: 0000000000000010 x17: 00000000fd6f304b x16: 00000000ee79de43 x15: ffff800bc0e80568 x14: 79616c6564203a74 x13: 6e6968207473696c x12: 5f72656d6974203a x11: ffff0000113f0018 x10: 0000000000000000 x9 : 000000000000001f x8 : 0000000000000000 x7 : ffff0000101294cc x6 : 0000000000000000 x5 : 0000000000000000 x4 : 0000000000000001 x3 : 00000000ffffffff x2 : 0000000000000000 x1 : 387fc15c8ec0f200 x0 : 0000000000000000 Call trace: debug_print_object+0xb0/0xf0 __debug_check_no_obj_freed+0x19c/0x228 debug_check_no_obj_freed+0x1c/0x28 kfree+0x250/0x440 put_i2c_dev+0x68/0x78 i2cdev_detach_adapter+0x60/0xc8 i2cdev_notifier_call+0x3c/0x70 notifier_call_chain+0x8c/0xe8 blocking_notifier_call_chain+0x64/0x88 device_del+0x74/0x380 device_unregister+0x54/0x78 i2c_del_adapter+0x278/0x2d0 unittest_i2c_bus_remove+0x3c/0x80 platform_drv_remove+0x30/0x50 device_release_driver_internal+0xf4/0x1c0 driver_detach+0x58/0xa0 bus_remove_driver+0x84/0xd8 driver_unregister+0x34/0x60 platform_driver_unregister+0x20/0x30 of_unittest_overlay+0x8d4/0xbe0 of_unittest+0xae8/0xb3c do_one_initcall+0xac/0x450 do_initcall_level+0x208/0x224 kernel_init_freeable+0x2d8/0x36c kernel_init+0x18/0x108 ret_from_fork+0x10/0x1c irq event stamp: 3934661 hardirqs last enabled at (3934661): [<ffff00001009fa04>] debug_exception_exit+0x4c/0x58 hardirqs last disabled at (3934660): [<ffff00001009fb14>] debug_exception_enter+0xa4/0xe0 softirqs last enabled at (3934654): [<ffff000010081d94>] __do_softirq+0x46c/0x628 softirqs last disabled at (3934649): [<ffff0000100b4a1c>] irq_exit+0x104/0x118 This is a common issue when using cdev embedded in a struct. Fortunately, we already have a mechanism to solve this kind of issue. Please see commit 233ed09d7fda ("chardev: add helper function to register char devs with a struct device") for more detail. In this patch, we choose to embed the struct device into the i2c_dev, and use the API provided by the commit 233ed09d7fda to make sure that the release of i2c_dev and cdev are in sequence. Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: qcom-geni: Drop of_platform.h includeStephen Boyd2020-03-131-1/+0
| | | | | | | | | | | | This driver doesn't call any DT platform functions like of_platform_*(). Remove the include as it isn't used. Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: qcom-geni: Grow a dev pointer to simplify codeStephen Boyd2020-03-131-31/+26
| | | | | | | | | | | | | | | Some lines are long here. Use a struct dev pointer to shorten lines and simplify code. The clk_get() call can fail because of EPROBE_DEFER problems too, so just remove the error print message because it isn't useful. Finally, platform_get_irq() already prints an error so just remove that error message. Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: qcom-geni: Let firmware specify irq trigger flagsStephen Boyd2020-03-131-2/+2
| | | | | | | | | | | | | | | | We don't need to force IRQF_TRIGGER_HIGH here as the DT or ACPI tables should take care of this for us. Just use 0 instead so that we use the flags from the firmware. Also, remove specify dev_name() for the irq name so that we can get better information in /proc/interrupts about which device is generating interrupts. Cc: Alok Chauhan <alokc@codeaurora.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: stm32f7: do not backup read-only PECR registerAlain Volmat2020-03-131-4/+0
| | | | | | | | | | | The PECR register provides received packet computed PEC value.  It makes no sense restoring its value after a reset, and anyway, as read-only register it cannot be restored. Fixes: ea6dd25deeb5 ("i2c: stm32f7: add PM_SLEEP suspend/resume support") Signed-off-by: Alain Volmat <alain.volmat@st.com> Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: smbus: remove outdated references to irq level triggersWolfram Sang2020-03-101-5/+0
| | | | | | | | | | IRQ levels are now handled within the IRQ core. Remove the forgotten references from the documentation. Fixes: 9b9f2b8bc2ac ("i2c: i2c-smbus: Use threaded irq for smbalert") Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: convert SMBus alert setup function to return an ERRPTRWolfram Sang2020-03-105-24/+32
| | | | | | | | | | | | Only few drivers use this call, so drivers and I2C core are converted at once with this patch. By simply using i2c_new_client_device() instead of i2c_new_device(), we easily can return an ERRPTR for this function as well. To make out of tree users aware that something changed, the function is renamed to i2c_new_smbus_alert_device(). Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: stm32f7: add a new st, stm32mp15-i2c compatibleAlain Volmat2020-03-101-6/+33
| | | | | | | | | | | | | Add a new stm32mp15 specific compatible to handle FastMode+ registers handling which is different on the stm32mp15 compared to the stm32f7 or stm32h7. Indeed, on the stm32mp15, the FastMode+ set and clear registers are separated while on the other platforms (F7 or H7) the control is done in a unique register. Signed-off-by: Alain Volmat <alain.volmat@st.com> Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: stm32f7: disable/restore Fast Mode Plus bits in low power modesAlain Volmat2020-03-101-13/+39
| | | | | | | | | | | | Defer the initial enabling of the Fast Mode Plus bits after the stm32f7_i2c_setup_timing call in probe function in order to avoid enabling them if speed is downgraded. Clear & restore the Fast Mode Plus bits in the suspend/resume handlers of the driver. Signed-off-by: Alain Volmat <alain.volmat@st.com> Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: brcmstb: Support BCM2711 HDMI BSC controllersMaxime Ripard2020-03-101-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | The HDMI blocks in the BCM2771 have an i2c controller to retrieve the EDID. This block is split into two parts, the BSC and the AUTO_I2C, lying in two separate register areas. The AUTO_I2C block has a mailbox-like interface and will take away the BSC control from the CPU if enabled. However, the BSC is the actually the same controller than the one supported by the brcmstb driver, and the AUTO_I2C doesn't really bring any immediate benefit. Let's use the BSC then, but let's also tie the AUTO_I2C registers with a separate compatible so that we can enable AUTO_I2C if needed in the future. The AUTO_I2C is enabled by default at boot though, so we first need to release the BSC from the AUTO_I2C control. Cc: Kamal Dasu <kdasu.kdev@gmail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Wolfram Sang <wsa@the-dreams.de> Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-i2c@vger.kernel.org Signed-off-by: Maxime Ripard <maxime@cerno.tech> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: omap: use devm_platform_ioremap_resource()chenqiwu2020-03-101-3/+1
| | | | | | | | | | Use a new API devm_platform_ioremap_resource() to simplify code. Signed-off-by: chenqiwu <chenqiwu@xiaomi.com> Tested-by: Luca Ceresoli <luca@lucaceresoli.net> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net> Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: use kobj_to_dev() APIchenqiwu2020-03-101-2/+2
| | | | | | | | Use kobj_to_dev() API instead of container_of(). Signed-off-by: chenqiwu <chenqiwu@xiaomi.com> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: powermac: correct comment about custom handlingWolfram Sang2020-03-101-8/+7
| | | | | | | | | The comment had some flaws which are now fixed: - the prefix is 'MAC' not 'AAPL' - no kernel coding style and too short length - 'we do' instead of 'we to' Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: dev: keep sorting of includesWolfram Sang2020-02-261-1/+1
| | | | Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: stm32f7: allow controller to be wakeup-sourceAlain Volmat2020-02-261-21/+86
| | | | | | | | | | | | | | | Allow the i2c-stm32f7 controller to become a wakeup-source of the system. In such case, when a slave is registered to the I2C controller, receiving a I2C message targeting that registered slave address wakes up the suspended system. In order to be able to wake-up, the I2C controller DT node must have the property wakeup-source defined and a slave must be registered. Signed-off-by: Alain Volmat <alain.volmat@st.com> Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: imx: implement master_xfer_atomic callbackStefan Lengfeld2020-02-261-41/+105
| | | | | | | | | | | | | | | | | | | | | Rework the read and write code paths in the driver to support operation in atomic contexts. To achieve this, the driver must not rely on IRQs and not call schedule(), e.g. via a sleep routine, in these cases. With this patch the driver supports normal operation, DMA transfers and now the polling mode or also called sleep-free or IRQ-less operation. It makes the code not simpler or easier to read, but atomic I2C transfers are needed on some hardware configurations, e.g. to trigger reboots on an external PMIC chip. Signed-off-by: Stefan Lengfeld <contact@stefanchrist.eu> [m.felsch@pengutronix.de: integrate https://patchwork.ozlabs.org/patch/1085943/ review feedback] [m.felsch@pengutronix.de: adapt commit message] Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Acked-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Stefan Agner <stefan@agner.ch> Tested-by: Stefan Lengfeld <contact@stefanchrist.eu> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: at91: implement i2c bus recoveryKamel Bouhara2020-02-262-0/+82
| | | | | | | | | | | Implement i2c bus recovery when slaves devices might hold SDA low. In this case re-assign SCL/SDA to gpios and issue 9 dummy clock pulses until the slave release SDA. Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com> Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* Merge branch 'i2c/for-5.6' of ↵Linus Torvalds2020-02-0729-748/+745
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "i2c core: - huge improvements and refactorizations of the Linux I2C documentation (lots of thanks to Luca for doing it and Jean for the careful review) - subsystem wide API conversion to i2c_new_client_device() - remove obsolete parport-light driver - smaller core updates (removal of 'extern', enabling more compile testing, use more helper macros) - and quite a bunch of driver updates (new IDs, simplifications, better PM, support of atomic transfers and other improvements) i2c-mux: - The main feature is the idle-state rework of the pca954x driver from Biwen Li at24 driver: - minor maintenance: update the license tag, sort headers - move support for the write-protect pin into nvmem core - add a reference to the new wp-gpios property in nvmem to at25 bindings - add support for regulator and pm_runtime control" * 'i2c/for-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (91 commits) i2c: cros-ec-tunnel: Fix ACPI identifier i2c: cros-ec-tunnel: Fix slave device enumeration i2c: stm32f7: add PM_SLEEP suspend/resume support i2c: cadence: Fix wording in i2c-cadence driver i2c: cadence: Fix power management order of operations i2c: cadence: Fix error printing in case of defer i2c: cadence: Handle transfer_size rollover i2c: i801: Add support for Intel Comet Lake PCH-V docs: i2c: writing-clients: properly name the stop condition docs: i2c: i2c-protocol: use same wording as smbus-protocol docs: i2c: rename sections so the overall picture is clearer docs: i2c: old-module-parameters: use monospace instead of "" docs: i2c: old-module-parameters: clarify this is for obsolete kernels docs: i2c: old-module-parameters: fix internal hyperlink docs: i2c: instantiating-devices: use monospace for sysfs attributes docs: i2c: instantiating-devices: rearrange static instatiation docs: i2c: instantiating-devices: fix internal hyperlink docs: i2c: smbus-protocol: improve I2C Block transactions description docs: i2c: smbus-protocol: fix punctuation docs: i2c: smbus-protocol: fix typo ...
| * i2c: cros-ec-tunnel: Fix ACPI identifierRaul E Rangel2020-01-311-1/+1
| | | | | | | | | | | | | | | | | | The initial patch was using the incorrect identifier. Fixes: 9af1563a5486 ("i2c: cros-ec-tunnel: Make the device acpi compatible") Signed-off-by: Raul E Rangel <rrangel@chromium.org> Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: cros-ec-tunnel: Fix slave device enumerationAkshu Agrawal2020-01-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | During adding of the adapter the slave device registration use to fail as the acpi companion field was not populated. Fixes: 9af1563a5486 ("i2c: cros-ec-tunnel: Make the device acpi compatible") Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Acked-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: stm32f7: add PM_SLEEP suspend/resume supportAlain Volmat2020-01-301-4/+113
| | | | | | | | | | | | | | | | | | | | Backup/restore I2C registers as part of the suspend/resume handlers. The device is marked as suspended to ensure that transfers are rejected during the suspended period. Signed-off-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: Alain Volmat <alain.volmat@st.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: cadence: Fix wording in i2c-cadence driverMichal Simek2020-01-301-1/+1
| | | | | | | | | | | | | | | | Fix wording based on checkpatch.pl Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: cadence: Fix power management order of operationsTopi Kuutela2020-01-301-3/+6
| | | | | | | | | | | | | | | | | | | | | | E.g. pm_runtime_set_active must be called while the power management system is disabled. Fixes extra hanging clk_enable. Signed-off-by: Topi Kuutela <topi.kuutela@gmail.com> Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: cadence: Fix error printing in case of deferShubhrajyoti Datta2020-01-301-1/+2
| | | | | | | | | | | | | | Do not print error in case of EPROBE_DEFER. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: cadence: Handle transfer_size rolloverAlex Williams2020-01-301-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under certain conditions, Cadence's I2C controller's transfer_size register will roll over and generate invalid read transactions. Before this change, the ISR relied solely on the RXDV bit to determine when to write more data to the user's buffer. The invalid read data would cause overruns, smashing stacks and worse. This change stops the buffer writes to the requested boundary and reports the error. The controller will be reset so normal transactions may resume. Signed-off-by: Alex Williams <alex.williams@ni.com> Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com> # in a seperate mail Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * i2c: i801: Add support for Intel Comet Lake PCH-VJarkko Nikula2020-01-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | Add support for Intel Comet Lake PCH-V which is based on Intel Kaby Lake. Difference between it and other Comet Lake variants is that former uses previous iTCO version 4 and latter use version 6 like Intel Cannon Lake PCH. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * Merge branch 'i2c-mux/for-next' of https://github.com/peda-r/i2c-mux into ↵Wolfram Sang2020-01-292-37/+61
| |\ | | | | | | | | | | | | | | | i2c/for-5.6 The main feature is the idle-state rework of the pca954x driver from Biwen Li.
| | * i2c: mux: pca954x: support property idle-stateBiwen Li2020-01-031-23/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This supports property idle-state,if present, overrides i2c-mux-idle-disconnect. My use cases: - Use the property idle-state to fix an errata on LS2085ARDB and LS2088ARDB. - Errata id: E-00013(board LS2085ARDB and LS2088ARDB revision on Rev.B, Rev.C and Rev.D). - About E-00013: - Description: I2C1 and I2C3 buses are missing pull-up. - Impact: When the PCA954x device is tri-stated, the I2C bus will float. This makes the I2C bus and its associated downstream devices inaccessible. - Hardware fix: Populate resistors R189 and R190 for I2C1 and resistors R228 and R229 for I2C3. - Software fix: Remove the tri-state option from the PCA954x driver(PCA954x always on enable status, specify a channel zero in dts to fix the errata E-00013). Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Biwen Li <biwen.li@nxp.com> Signed-off-by: Peter Rosin <peda@axentia.se>
| | * i2c: mux: pca9541: use the BIT macroPeter Rosin2020-01-031-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | Because it looks nice! Reviewed-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Peter Rosin <peda@axentia.se>
| * | i2c: xiic: fix indentation issueColin Ian King2020-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a statement that is indented one level too deeply, remove the extraneous tab. Fixes: b4c119dbc300 ("i2c: xiic: Add timeout to the rx fifo wait loop") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * | i2c: parport: fix spelling mistake: "Atmost" -> "At most"Colin Ian King2020-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | There is a spelling mistake in a module parameter description. Fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * | i2c: exynos: Update Kconfig documentationKrzysztof Kozlowski2020-01-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the help text to reflect current support devices: 1. The Exynos high speed I2C driver supports Exynos5 (ARMv7), Exynos5433 and Exynos7 (both ARMv8) SoCs, 2. The S3C I2C driver supports S3C, S5Pv210 and Exynos{3,4,5} SoCs. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * | i2c: Enable compile testing for more driversKrzysztof Kozlowski2020-01-231-28/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the I2C bus drivers can be compile tested to increase build coverage. This requires also: 1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C controllers, 2. Adding 'if' conditional to 'default y' so they will not get enabled by default on all other architectures, 3. Limiting few compile test options to supported architectures (which provide the readsX()/writesX() primitives). Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> [wsa: revert chunk for ZX2967. it needs more preparation] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * | i2c: xiic: Fix the clocking across bind unbindShubhrajyoti Datta2020-01-151-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recommendation is that the set_active should be done with pm runtime disabled. Also fix the remove path for clocking. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * | i2c: xiic: defer the probe if clock is not foundVenkatesh Yadav Abbarapu2020-01-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not always the case that clock is already available when i2c driver get probed at the first time, e.g. the clock is provided by clock wizard which may be probed after i2c driver. So let's defer the probe when devm_clk_get() call fails and give it chance to try later. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * | i2c: xiic: Add timeout to the rx fifo wait loopShubhrajyoti Datta2020-01-151-10/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add timeout to the rx fifo empty wait loop. Also check for the return value for xiic_reinit and pass it to xiic_start_xfer. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * | i2c: highlander: Use proper printk format for size_tKrzysztof Kozlowski2020-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | size_t should be printed with its own format to be 64-bit friendly and fix warning when compiling on 64-bit platform (e.g. with COMPILE_TEST): drivers/i2c/busses/i2c-highlander.c: In function ‘highlander_i2c_smbus_xfer’: drivers/i2c/busses/i2c-highlander.c:325:22: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=] Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * | i2c: pnx: Use proper printk format for resource_size_tKrzysztof Kozlowski2020-01-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resource_size_t should be printed with its own size-independent format to fix warnings when compiling on 64-bit platform (e.g. with COMPILE_TEST): drivers/i2c/busses/i2c-pnx.c: In function ‘i2c_pnx_probe’: drivers/i2c/busses/i2c-pnx.c:737:47: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘resource_size_t {aka long long unsigned int}’ [-Wformat=] Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * | i2c: pmcmsp: Use proper printk format for resource_size_tKrzysztof Kozlowski2020-01-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resource_size_t should be printed with its own size-independent format to fix warnings when compiling on 64-bit platform (e.g. with COMPILE_TEST): drivers/i2c/busses/i2c-pmcmsp.c: In function ‘pmcmsptwi_probe’: drivers/i2c/busses/i2c-pmcmsp.c:276:25: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘resource_size_t {aka long long unsigned int}’ [-Wformat=] Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>