summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-owl.c
Commit message (Collapse)AuthorAgeFilesLines
* I2C: Explicitly include correct DT includesRob Herring2023-08-141-1/+2
| | | | | | | | | | | | | | | The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
* i2c: owl: Use devm_clk_get_enabled()Andi Shyti2023-06-231-14/+4
| | | | | | | | Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
* i2c: owl: drop of_match_ptr for ID tableKrzysztof Kozlowski2023-03-161-1/+1
| | | | | | | | | | | | The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it might not be relevant here). drivers/i2c/busses/i2c-owl.c:510:34: error: ‘owl_i2c_of_match’ defined but not used [-Werror=unused-const-variable=] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
* i2c: owl: Add compatible for the Actions Semi S500 I2C controllerCristian Ciocaltea2020-12-091-0/+1
| | | | | | | | | | Add S500 variant to the list of devices supported by the Actions Semi Owl I2C driver. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
* i2c: owl: Enable asynchronous probingCristian Ciocaltea2020-11-031-0/+1
| | | | | | | | | | | | | Speed up the boot process by using the asynchronous probing feature supported by the recent kernels. For SBCs based on the Actions Semi S500 SoC, the overall boot time is expected to be reduced by 200-300 ms. Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
* i2c: owl: Add support for atomic transfersCristian Ciocaltea2020-11-031-19/+54
| | | | | | | | | | | | | | | | | | Atomic transfers are required to properly power off a machine through an I2C controlled PMIC, such as the Actions Semi ATC260x series. System shutdown may happen with interrupts being disabled and, as a consequence, the kernel may hang if the driver does not support atomic transfers. This functionality is essentially implemented by polling the FIFO Status register until either Command Execute Completed or NACK Error bits are set. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> [wsa: rebased to current tree] Signed-off-by: Wolfram Sang <wsa@kernel.org>
* Merge branch 'i2c/for-5.10' of ↵Linus Torvalds2020-10-211-3/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: - if a host can be a client, too, the I2C core can now use it to emulate SMBus HostNotify support (STM32 and R-Car added this so far) - also for client mode, a testunit has been added. It can create rare situations on the bus, so host controllers can be tested - a binding has been added to mark the bus as "single-master". This allows for better timeout detections - new driver for Mellanox Bluefield - massive refactoring of the Tegra driver - EEPROMs recognized by the at24 driver can now have custom names - rest is driver updates * 'i2c/for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (80 commits) Documentation: i2c: add testunit docs to index i2c: tegra: Improve driver module description i2c: tegra: Clean up whitespaces, newlines and indentation i2c: tegra: Clean up and improve comments i2c: tegra: Clean up printk messages i2c: tegra: Clean up variable names i2c: tegra: Improve formatting of variables i2c: tegra: Check errors for both positive and negative values i2c: tegra: Factor out hardware initialization into separate function i2c: tegra: Factor out register polling into separate function i2c: tegra: Factor out packet header setup from tegra_i2c_xfer_msg() i2c: tegra: Factor out error recovery from tegra_i2c_xfer_msg() i2c: tegra: Rename wait/poll functions i2c: tegra: Remove "dma" variable from tegra_i2c_xfer_msg() i2c: tegra: Remove redundant check in tegra_i2c_issue_bus_clear() i2c: tegra: Remove likely/unlikely from the code i2c: tegra: Remove outdated barrier() i2c: tegra: Clean up variable types i2c: tegra: Reorder location of functions in the code i2c: tegra: Clean up probe function ...
| * i2c: busses: replace spin_lock_irqsave by spin_lock in hard IRQBarry Song2020-09-291-3/+2
| | | | | | | | | | | | | | | | | | | | The code has been in a irq-disabled context since it is hard IRQ. There is no necessity to do it again. Signed-off-by: Barry Song <song.bao.hua@hisilicon.com> Reviewed-by: Akash Asthana <akashast@codeaurora.org> Reviewed-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
* | i2c: owl: Clear NACK and BUS error bitsCristian Ciocaltea2020-10-101-0/+6
|/ | | | | | | | | | | | | When the NACK and BUS error bits are set by the hardware, the driver is responsible for clearing them by writing "1" into the corresponding status registers. Hence perform the necessary operations in owl_i2c_interrupt(). Fixes: d211e62af466 ("i2c: Add Actions Semiconductor Owl family S900 I2C driver") Reported-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
* i2c: busses: remove duplicate dev_err()Dejin Zheng2020-04-181-3/+1
| | | | | | | | | | it will print an error message by itself when platform_get_irq() goes wrong. so don't need dev_err() in here again. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Suggested-by: Markus Elfring <Markus.Elfring@web.de> Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: busses: convert to devm_platform_ioremap_resourceDejin Zheng2020-04-151-3/+1
| | | | | | | | | | | | | | use devm_platform_ioremap_resource() to simplify code, it contains platform_get_resource and devm_ioremap_resource. Reviewed-by: Barry Song <baohua@kernel.org> Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Acked-by: Robert Richter <rrichter@marvell.com> Acked-by: Thor Thayer <thor.thayer@linux.intel.com> Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: drivers: Use generic definitions for bus frequenciesAndy Shevchenko2020-03-241-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Add Actions Semiconductor Owl family S700 I2C supportParthiban Nallathambi2019-01-031-0/+1
| | | | | | | | | | Add S700 to the list of devices supported by Owl I2C driver. Add Actions Semiconductor Owl family S700 I2C driver. Signed-off-by: Parthiban Nallathambi <pn@denx.de> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: Add Actions Semiconductor Owl family S900 I2C driverManivannan Sadhasivam2018-08-041-0/+495
Add Actions Semiconductor Owl family S900 I2C driver. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>