- 22 9月, 2016 2 次提交
-
-
由 Dmitry Bazhenov 提交于
Due to a bug in the ThunderX I2C hardware sending STOP during a recovery attempt could lock up the hardware. To work around this problem do not send STOP at the beginning of the recovery but use the override registers to bring the TWSI including the high-level controller out of the bad state. Signed-off-by: NDmitry Bazhenov <dmitry.bazhenov@auriga.com> Signed-off-by: NJan Glauber <jglauber@cavium.com> [Changed commit message] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Dmitry Bazhenov 提交于
The set SCL recovery function unconditionally pulls the SCL line low. Only pull SCL line low according to val parameter. Signed-off-by: NDmitry Bazhenov <dmitry.bazhenov@auriga.com> Signed-off-by: NJan Glauber <jglauber@cavium.com> [Changed commit message] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 17 9月, 2016 1 次提交
-
-
由 Ulrich Hecht 提交于
Same as r8a7795. Signed-off-by: NUlrich Hecht <ulrich.hecht+renesas@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 16 9月, 2016 2 次提交
-
-
由 Yang Li 提交于
Since commit 1c4b6c3b ("i2c: imx: implement bus recovery") the driver starts to use gpio/pinctrl to support optional bus recovery feature. But pinctrl is not always usable. There are platforms such as ls1021a and ls1043a that don't support pinctrl, and it could just be broken due to old/broken device tree. The patch makes it really optional that the probe function won't bailout on pinctrl problems instead it just disables bus recovery and prints out notification when there is problem with pinctrl. Since pinctrl is only used by bus recovery in this driver, move pinctrl initialization into bus recovery init function to prevent confusion. Signed-off-by: NLi Yang <leoyang.li@nxp.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Neil Armstrong 提交于
Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com> Signed-off-by: NJerome Brunet <jbrunet@baylibre.com> Acked-by: NKevin Hilman <khilman@baylibre.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 09 9月, 2016 10 次提交
-
-
由 Masahiro Yamada 提交于
Currently, the adapter is set to the master mode at the first use. Since then, it is kept in the slave mode, so unexpected glitch signals on the I2C lines may cause the adapter into insane state. Setting it to the master mode along with initialization solves the problem. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reported-by: NAkio Noda <noda.akio@socionext.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Masahiro Yamada 提交于
If clk_prepare_enable() fails, clk_disable_unprepare() is called in the failure path, where the enable_count is still zero, so it hits WARN_ON(core->enable_count == 0) in the clk_core_disable(). To fix this, make the clock setting more linear in the probe function so that it can exploit "goto err" in case of error. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Masahiro Yamada 提交于
If clk_prepare_enable() fails, clk_disable_unprepare() is called in the failure path, where the enable_count is still zero, so it hits WARN_ON(core->enable_count == 0) in the clk_core_disable(). To fix this, make the clock setting more linear in the probe function so that it can exploit "goto err" in case of error. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jon Hunter 提交于
Fix the following warnings reported by coccinelle for the Tegra I2C driver. drivers/i2c/busses/i2c-tegra.c:513:2-23: WARNING: Assignment of bool to 0/1 drivers/i2c/busses/i2c-tegra.c:539:3-24: WARNING: Assignment of bool to 0/1 Reported-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Shardar Shariff Md 提交于
To summarize the issue observed in error cases: SW Flow: For i2c message transfer, packet header and data payload is posted and then required error/packet completion interrupts are enabled later. HW flow: HW process the packet just after packet header is posted, if ARB lost/NACK error occurs (SW will not handle immediately when error happens as error interrupts are not enabled at this point). HW assumes error is acknowledged and clears current data in FIFO, But SW here posts the remaining data payload which still stays in FIFO as stale data (data without packet header). Now once the interrupts are enabled, SW handles ARB lost/NACK error by clearing the ARB lost/NACK interrupt. Now HW assumes that SW attended the error and will parse/process stale data (data without packet header) present in FIFO which causes invalid NACK errors. Fix: Enable the error interrupts before posting the packet into FIFO which make sure HW to not clear the fifo. Also disable the packet mode before acknowledging errors (ARB lost/NACK error) to not process any stale data. As error interrupts are enabled before posting the packet header use spinlock to avoid preempting. Signed-off-by: NShardar Shariff Md <smohammed@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Shardar Shariff Md 提交于
Use readl_poll_timeout_atomic() function as *wait_for_config_load() function can be called from interrupt context. Signed-off-by: NShardar Shariff Md <smohammed@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Shardar Shariff Md 提交于
Define separate function for configuration load register handling to make it use by different functions later. Signed-off-by: NShardar Shariff Md <smohammed@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Shardar Shariff Md 提交于
During i2c controller initialization, when fifo flush fails return error instead of returning the error during exit. Signed-off-by: NShardar Shariff Md <smohammed@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Shardar Shariff Md 提交于
After CONFIG_LOAD register is programmed instead of explicitly waiting for timeout, use readl_poll_timeout() to check for register value to get updated or wait till timeout. Signed-off-by: NShardar Shariff Md <smohammed@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Geert Uytterhoeven 提交于
"i2c-sh_mobile" is used on sh7343, sh7366, sh7722, sh7723, and sh7724 only. As all of the above select ARCH_SHMOBILE, restrict its driver dependencies from SUPERH to ARCH_SHMOBILE. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: NSimon Horman <horms+renesas@verge.net.au> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 31 8月, 2016 11 次提交
-
-
由 Andy Shevchenko 提交于
It's better to have strings in the code like they appeared in the output. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Rosin 提交于
This makes it trivial to constify them, so do that. Signed-off-by: NPeter Rosin <peda@axentia.se> Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jon Hunter 提交于
On Tegra124/132 the pins for I2C6 are shared with the Display Port AUX (DPAUX) channel and on Tegra210 the pins for I2C4 and I2C6 are shared with DPAUX1 and DPAUX0, respectively. The multiplexing of the pins is handled by a register in the DPAUX and so the Tegra DPAUX driver has been updated to register a pinctrl device for managing these pins. The pins for these particular I2C devices are bound to the I2C device prior to probing. However, these I2C devices are in a different power partition to the DPAUX devices that own the pins. Hence, it is desirable to place the pins in the 'idle' state and allow the DPAUX power partition to switch off, when these I2C devices is not in use. Therefore, add calls to place the I2C pins in the 'default' and 'idle' states when the I2C device is runtime resumed and suspended, respectively. Please note that the pinctrl functions that set the state of the pins check to see if the devices has pins associated and will return zero if they do not. Therefore, it is safe to call these pinctrl functions even for I2C devices that do not have any pins associated. Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Acked-by: NLaxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jon Hunter 提交于
Update the Tegra I2C driver to use runtime PM and move the code in the tegra_i2c_clock_enable/disable() functions to the PM runtime resume and suspend callbacks, respectively. Note that given that CONFIG_PM is not mandatory for Tegra, if CONFIG_PM is not enabled and so runtime PM is not enabled, ensure that the I2C clocks are turned on during probe and kept on by calling the resume callback directly. In the function tegra_i2c_init(), the variable 'err' does not need to be initialised to zero in tegra_i2c_init() because it is initialised when pm_runtime_get_sync() is called. Furthermore, to ensure we only return 0 from tegra_i2c_init(), it is necessary to re-initialise 'err' to 0 after a successful call to pm_runtime_get_sync() because it can return a positive value on success. However, alternatively re-initialise 'err' by using the return value of the function tegra_i2c_flush_fifos() because it can only be 0 or -ETIMEDOUT. Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Acked-by: NLaxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jon Hunter 提交于
The I2C adapter is unlocked regardless of whether the tegra_i2c_init() called during the resume is successful or not. However, if the tegra_i2c_init() is not successful, then ->is_suspended is not set to false. Simplify the resume code by only setting ->is_suspended to false if tegra_i2c_init() is successful and return the error code from tegra_i2c_init(). Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Acked-by: NLaxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jon Hunter 提交于
All Tegra I2C devices have the name "Tegra I2C adapter" which is not very useful when viewing the I2C adapter names via the sysfs. Therefore, use the device name, which is unique for each I2C device, instead. Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Acked-by: NLaxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jon Hunter 提交于
Tegra has only supported device-tree for platform/board configuration for quite some time now and so simplify the Tegra I2C driver by dropping code for non device-tree platforms/boards. Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jon Hunter 提交于
Add missing new line characters for the various error messages. Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Acked-by: NLaxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jon Hunter 提交于
Checkpatch warns about missing blank lines after declarations in the Tegra I2C driver and so fix these. Note that the initialisation of 'val' to zero in tegra_dvc_init() is unnecessary and so remove this. Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jon Hunter 提交于
Checkpatch warns about spacing around the '<<' operator in the Tegra I2C driver and so fix these by converting the bit definitions that are using this operator to use the BIT macro. Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jon Hunter 提交于
Checkpatch warns about some lines over 80 characters in the Tegra I2C driver and so fix these. While we are at it, prefix the second instance of "STOP condition" in the comment with a "the". Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 26 8月, 2016 14 次提交
-
-
https://github.com/peda-r/i2c-mux由 Wolfram Sang 提交于
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Lucas De Marchi 提交于
Disabling the adapter after each transfer adds additional delays for each I2C transfer. Even if we don't wait for it to be disabled anymore, on next transfer we will need to if we have several transfers in a row. Now during the transfer init we check if IC_TAR can be changed dynamically, the status register for no activity and TX buffer being empty. In this case we don't need to disable it When a transfer fails the adapter will still be disabled - this is a conservative approach. When transfers succeed, the adapter is left enabled and it's configured so to disable interrupts. Alternating register reads on 2 slaves: perf stat -r4 chrt -f 10 ./i2c-test /dev/i2c-1 25000 0x40 0x6 0x1e 0x00 Before: 8.638705161 seconds time elapsed ( +- 5.90% ) After: 7.516821591 seconds time elapsed ( +- 0.11% ) Signed-off-by: NLucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: NJosé Roberto de Souza <jose.souza@intel.com> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Tested-by: NChristian Ruppert <christian.ruppert@alitech.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Lucas De Marchi 提交于
This adapter can be synthesized with dynamic tar update enabled or disabled. When enabled it is not necessary to disable the adapter to change the slave address in some situations, which saves some time per transaction. There is no direct register to know if this feature is enabled but we can do it indirectly by writing to the 10BIT_ADDR field in IC_CON: this field is read only when dynamic tar update is enabled. Signed-off-by: NLucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: NJosé Roberto de Souza <jose.souza@intel.com> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Tested-by: NChristian Ruppert <christian.ruppert@alitech.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Lucas De Marchi 提交于
These are used in 2 places and will be needed in more. Signed-off-by: NLucas De Marchi <lucas.demarchi@intel.com> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Tested-by: NChristian Ruppert <christian.ruppert@alitech.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 José Roberto de Souza 提交于
If we aren't going to continue using the controller we can just disable it instead of waiting for it to complete. The biggest improvement here is when a I2C transaction is completed and it doesn't block until the adapter is disabled. When a new transfer is needed we will disable and wait for its completion. This way the adapter will continue changing its state in parallel to the execution of the thread that requested the I2C transaction saving most of the time 25~250 usec per I2C transaction. A simple program doing a register read (1 byte write, 1 byte read) alternating on 2 different slaves repeated 25k times for each and measurements taken 4 times we get: perf stat -r4 chrt -f 10 ./i2c-test /dev/i2c-1 25000 0x40 0x6 0x1e 0x00 Before: 30.879317977 seconds time elapsed ( +- 14.83% ) After: 8.638705161 seconds time elapsed ( +- 5.90% ) Signed-off-by: NJosé Roberto de Souza <jose.souza@intel.com> Signed-off-by: NLucas De Marchi <lucas.demarchi@intel.com> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Tested-by: NChristian Ruppert <christian.ruppert@alitech.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jarkko Nikula 提交于
Fast mode is the default speed of i2c-designware which can be overridden by platform data or by "clock-frequency" device property. Even though the ACPI 5.1 can pass device properties via _DSD method, shipping systems define the connection speed between I2C host and each slave in their I2cSerialBus resources. Which means speed is not defined per bus but per slave. As there is now support in i2c-core to find the bus speed from ACPI use that to set up the bus speed prior registering the I2C adapter. Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jarkko Nikula 提交于
ACPI 5 specification doesn't have property for the I2C bus speed but I2cSerialBus resource descriptor which define each controller-slave connection define the maximum speed supported by that connection. Thus finding the maximum safe speed for the bus is to walk through all I2cSerialBus resources that are associated to I2C controller and use the speed of slowest connection. Add function i2c_acpi_find_bus_speed() to the i2c-core that adapter drivers can call prior registering itself to core. This implies two-step walk through the I2cSerialBus resources: call to i2c_acpi_find_bus_speed() does the first scan and finds the safe bus speed that adapter drivers can set up. Adapter driver registration does the second scan when i2c-core creates the I2C slaves by calling the i2c_acpi_register_devices(). In that way the bus speed is set in case slave device probe gets called during registration and does communication. Previous version commit 55d38d06 ("i2c: core: Add function for finding the bus speed from ACPI") got reverted due merge conflicts from commit 525e6fab ("i2c / ACPI: add support for ACPI reconfigure notifications"). This version is a bit bigger than previous version but is still sharing the lowest and complicated part of I2cSerialBus lookup routines with the existing code. Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jarkko Nikula 提交于
I2C ACPI enumeration was originally implemented in another module under drivers/acpi/ but was later moved into i2c-core with added support for I2C ACPI operation region. Rename these acpi_i2c_ prefixed functions, structures and defines in i2c-core to i2c_acpi_ in order to have more consistent name space. This is updated version from commit a7003b65 ("i2c: core: Cleanup I2C ACPI namespace") that got reverted due merge conflicts from commit 525e6fab ("i2c / ACPI: add support for ACPI reconfigure notifications"). Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Weifeng Voon 提交于
This patch enabled high speed mode. High speed mode can be turn on by setting the clk_freq to 3400000. High speed HCNT and LCNT are needed as there is no default value provided. Signed-off-by: NWeifeng Voon <weifeng.voon@intel.com> Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Weifeng Voon 提交于
DW_IC_CON_MASTER, DW_IC_CON_SLAVE_DISABLE and DW_IC_CON_RESTART_EN are common config that need to be set for i2c designware master. So, configure it first without having to repeat inside the if else. Signed-off-by: NWeifeng Voon <weifeng.voon@intel.com> Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Weifeng Voon 提交于
This patch enabled fast mode plus. The fast mode plus and fast speed share the same HCNT and LCNT register. So, the fast mode plus will only run when the HCNT and LCNT value is provided. Else, it will run at fast speed as default. Signed-off-by: NWeifeng Voon <weifeng.voon@intel.com> Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Weifeng Voon 提交于
I2C designware controller can run at fast mode plus and high speed. This patch adds the capability to get the HCNT, LCNT configuration via FPCN (fast plus) and HSCN (high speed) ACPI method. Signed-off-by: NWeifeng Voon <weifeng.voon@intel.com> Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Weifeng Voon 提交于
I2c designware controller operate speed is configured in the register IC_CON. Previously the operate speed is determined by a local variable clk_freq. This patch will move the local variable clk_freq into struct dw_i2c_dev. This change will ease the set and get of the clk_freq. Signed-off-by: NWeifeng Voon <weifeng.voon@intel.com> Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jan Glauber 提交于
The i2c Octeon and ThunderX drivers are maintained by Cavium. While at it fix the whitespace errors of the next entry. Signed-off-by: NJan Glauber <jglauber@cavium.com> Acked-by: NDavid Daney <david.daney@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-