- 28 4月, 2016 1 次提交
-
-
由 David Daney 提交于
CN3860 does not interrupt the CPU when the i2c status changes. If we get a timeout, and see the status has in fact changed, we know we have this problem, and drop back to polling. Signed-off-by: NDavid Daney <ddaney@caviumnetworks.com> Signed-off-by: NJan Glauber <jglauber@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 27 4月, 2016 4 次提交
-
-
由 Javier Martinez Canillas 提交于
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either built-in or as a module, use that macro instead of open coding the same. Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Oleksij Rempel 提交于
Documentation/timers/timers-howto.txt recommends to use usleep_range on delays > 10usec. According to my test results with Neonode zForce touchscreen driver, usleep_range indeed reduces CPU load. Stats collected with "./perf record -a -g -F 1000 sleep 10" i2c-imx with udelay(50): 34.19% 0.00% irq/220-Neonode [kernel.kallsyms] [k] irq_thread ---irq_thread |--33.75%--irq_thread_fn | |--19.27%--0x7f08a878 | | i2c_master_recv | | i2c_transfer | | __i2c_transfer | | i2c_imx_xfer | | |--11.71%--i2c_imx_trx_complete | | |--5.70%--i2c_imx_start <<<<---------------- | | | |--5.38%--__timer_const_udelay | | | | __timer_delay | | | | --5.07%--read_current_timer i2c-imx with usleep_range(50,100) 29.08% 0.00% irq/220-Neonode [kernel.kallsyms] [k] irq_thread ---irq_thread |--28.89%--irq_thread_fn | |--17.21%--0x7f08a878 | | i2c_master_recv | | |--17.14%--i2c_transfer | | | __i2c_transfer | | | i2c_imx_xfer | | | |--14.29%--i2c_imx_trx_complete | | | |--1.42%--i2c_imx_start <<<<---------- | | | | |--0.71%--usleep_range | | | | |--0.53%--i2c_imx_bus_busy Signed-off-by: NOleksij Rempel <linux@rempel-privat.de> Signed-off-by: NDirk Behme <dirk.behme@de.bosch.com> Reviewed-by: NVladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Swain 提交于
There is a race between the TWSI interrupt and the condition that is required before proceeding: Low-level: interrupt flag bit must be set High-level controller: valid bit must be clear If the interrupt comes too early and the condition is not met the wait will time out, and the transfer is aborted leading to very poor performance. To avoid this race retry for the condition ~80 µs later. The retry is avoided on the very first invocation of wait_event_timeout() (which tests the condition before entering the wait and is therefore always wrong in this case). EEPROM reads on 100kHz i2c now measure ~5.2kB/s, about 1/2 what's achievable, and much better than the worst-case 100 bytes/sec before. While at it remove the debug print from the low-level wait function. Signed-off-by: NPeter Swain <pswain@cavium.com> Signed-off-by: NJan Glauber <jglauber@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jan Glauber 提交于
Zero-length message support (SMBUS QUICK or i2c) never worked with the Octeon hardware. Disable SMBUS QUICK support and bail out in case of a zero-length i2c request. After this change 'i2c-detect -q' will return an error on Octeon but the previously reported results were wrong anyway. Signed-off-by: NJan Glauber <jglauber@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 26 4月, 2016 10 次提交
-
-
由 Javier Martinez Canillas 提交于
The clk_prepare_enable() function can fail so check the return value and propagate the error in case of a failure. Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Javier Martinez Canillas 提交于
The driver not always prints the error code in case of a failure but this information can be very useful for debugging. So let's print if available. Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Krzysztof Kozlowski 提交于
Improve the readability by: - fixing indentation, - switching to proper block comments, - removing spurious blank lines, - checkpatch: void function return statements are not generally useful, - checkpatch: braces {} are not necessary for any arm of this statement, - checkpatch: missing a blank line after declarations. Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Krzysztof Kozlowski 提交于
Cleanup the weird function-level comments and remove obvious documentation for probe/remove. Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Krzysztof Kozlowski 提交于
If during probe() the s3c24xx_i2c_init() failed, the clock was left in disabled but prepared state. Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jan Glauber 提交于
cn78xx has a different interrupt architecture, so we have to manage the interrupts differently. Signed-off-by: NDavid Daney <ddaney@caviumnetworks.com> Signed-off-by: NJan Glauber <jglauber@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 David Daney 提交于
Use High-Level Controller (HLC) when possible. The HLC can read/write up to 8 bytes and is completely optional. The most important difference of the HLC is that it only requires one interrupt for a transfer (up to 8 bytes) where the low-level read/write requires 2 interrupts plus one interrupt per transferred byte. Since the interrupts are costly using the HLC improves the performance. Also, the HLC provides improved error handling. Signed-off-by: NDavid Daney <ddaney@caviumnetworks.com> Signed-off-by: NJan Glauber <jglauber@cavium.com> [wsa: fixed trivial checkpatch warnings] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Swain 提交于
Add helper function that reads back a value after writing to make sure the write is finished and use it in octeon_i2c_write_int(). Signed-off-by: NPeter Swain <pswain@cavium.com> Signed-off-by: NJan Glauber <jglauber@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jan Glauber 提交于
Switch to the i2c bus recovery framework using generic SCL recovery. If this fails try to reset the hardware. The recovery is triggered during START on timeout of the interrupt or failure to reach the START / repeated-START condition. The START function is moved to xfer and while at it remove the xfer debug message (i2c core already provides a debug message for this). Signed-off-by: NJan Glauber <jglauber@cavium.com> [wsa: removed one empty line] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jan Glauber 提交于
Introduce a function that checks for valid status codes depending on the phase of a transmit or receive. Also add all existing status codes and improve error handling for various states. The Octeon TWSI has an "assert acknowledge" bit (TWSI_CTL_AAK) that is required to be set in master receive mode until the last byte is requested. The state check needs to consider if this bit was set. Signed-off-by: NJan Glauber <jglauber@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 25 4月, 2016 5 次提交
-
-
由 Axel Lin 提交于
Use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS to simplify the code. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Axel Lin 提交于
Use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS to simplify the code. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
smatch rightfully says: drivers/i2c/muxes/i2c-mux-pinctrl.c:175 i2c_mux_pinctrl_probe() warn: inconsistent indenting Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Acked-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
The lock is taken while reading two registers. On RT the first lock is taken in hard irq where it might sleep and in the threaded irq. The threaded irq runs in oneshot mode so the hard irq does not run until the thread the completes so there is no reason to grab the lock. Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de> [grygorii.strashko@ti.com: drop locking from isr completely and remove lock field from struct omap_i2c_dev] Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Irina Tirdea 提交于
Share the ACPI companion for the platform device with the i2c adapter, so that the adapter has access to the properties defined in ACPI tables. Signed-off-by: NIrina Tirdea <irina.tirdea@intel.com> Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 22 4月, 2016 8 次提交
-
-
由 Peter Rosin 提交于
All i2c mux users are using an explicit i2c mux core, drop support for implicit i2c mux cores. Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Rosin 提交于
Allocate an explicit i2c mux core to handle parent and child adapters etc. Update the select/deselect ops to be in terms of the i2c mux core instead of the child adapter. Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Rosin 提交于
Allocate an explicit i2c mux core to handle parent and child adapters etc. Update the select/deselect ops to be in terms of the i2c mux core instead of the child adapter. Add a mask to handle the case where not all child adapters should cause a mux deselect to happen, now that there is a common deselect op for all child adapters. Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Rosin 提交于
Allocate an explicit i2c mux core to handle parent and child adapters etc. Update the select/deselect ops to be in terms of the i2c mux core instead of the child adapter. Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Rosin 提交于
Allocate an explicit i2c mux core to handle parent and child adapters etc. Update the select/deselect ops to be in terms of the i2c mux core instead of the child adapter. Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Rosin 提交于
Allocate an explicit i2c mux core to handle parent and child adapters etc. Update the select/deselect ops to be in terms of the i2c mux core instead of the child adapter. Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Rosin 提交于
Allocate an explicit i2c mux core to handle parent and child adapters etc. Update the select/deselect ops to be in terms of the i2c mux core instead of the child adapter. Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Rosin 提交于
All i2c-muxes have a parent adapter and one or many child adapters. A mux also has some means of selection. Previously, this was stored per child adapter, but it is only needed to keep track of this per mux. Add an i2c mux core, that keeps track of this consistently. Also add some glue for users of the old interface, which will create one implicit mux core per child adapter. Signed-off-by: NPeter Rosin <peda@axentia.se> Tested-by: NAntti Palosaari <crope@iki.fi> Tested-by: NCrestez Dan Leonard <leonard.crestez@intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 15 4月, 2016 1 次提交
-
-
由 David Wu 提交于
Switch to the new generic functions: i2c_parse_fw_timings(). Signed-off-by: NDavid Wu <david.wu@rock-chips.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 14 4月, 2016 3 次提交
-
-
由 Jan Glauber 提交于
Remove superfluous check and stray newline. Signed-off-by: NJan Glauber <jglauber@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jan Glauber 提交于
Add helper functions for control, data and status register access. This simplifies the code and makes the purpose of the register access clearer. Signed-off-by: NJan Glauber <jglauber@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jan Glauber 提交于
Rename the [read|write]_sw functions to make it clearer they access the TWSI registers. Signed-off-by: NJan Glauber <jglauber@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 13 4月, 2016 6 次提交
-
-
由 Jan Glauber 提交于
No functional change, just moving the functions upward in preparation of improving the recovery. Signed-off-by: NJan Glauber <jglauber@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jan Glauber 提交于
Convert the adapter timeout to 2 ms independently of depending on CONFIG_HZ. CONFIG_HZ is 100 for MIPS Cavium-Octeon so the timeout value is not changed. Also set retries to 5 to improve robustness. Signed-off-by: NJan Glauber <jglauber@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Shardar Shariff Md 提交于
Enable multi-master mode in I2C_CNFG reg based on hw features. Using single/multi-master mode bit introduced for Tegra210, whereas multi-master mode is enabled by default in HW for T124 and earlier Tegra SOC. Enabling this bit doesn't explicitly start treating the bus has having multiple masters, but will start checking for arbitration lost and reporting when it occurs. The Tegra210 I2C controller supports single/multi master mode. Add chipdata for Tegra210 and its compatibility string so that Tegra210 will select data that enables multi master mode correctly. Do below prerequisites for multi-master bus if "multi-master" dt property entry is added. 1. Enable 1st level clock always set. 2. Disable 2nd level clock gating (slcg which is supported from T124 SOC and later chips) Signed-off-by: NShardar Shariff Md <smohammed@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jarkko Nikula 提交于
Allow runtime PM so that PM and PCI core can put the device into low-power state when idle and resume it back when needed in those platforms that support PM for i801 device. Enable also autosuspend with 1 second delay in order to not needlessly toggle power state on and off if there are multiple transactions during short time. Device is resumed at the beginning of bus access and marked idle ready for autosuspend at the end of it. Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Tested-by: NReinette Chatre <reinette.chatre@intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jarkko Nikula 提交于
Stop using legacy PCI PM support and convert to standard dev_pm_ops. This provides more straightforward path to add runtime PM. While at it remove explicit PCI power state control and configuration space save/restore as the PCI core does it. Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Tested-by: NReinette Chatre <reinette.chatre@intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Linus Walleij 提交于
When using a certain I2C device with runtime PM enabled on a certain I2C bus adaper the following happens: struct amba_device *foo \ struct i2c_adapter *bar \ struct i2c_client *baz The AMBA device foo has its device PM struct set to ignore children with pm_suspend_ignore_children(&foo->dev, true). This makes runtime PM work just fine locally in the driver: the fact that devices on the bus are suspended or resumed individually does not affect its operation, and the hardware does not power up unless transferring messages. However this child ignorance property is not inherited into the struct i2c_adapter *bar. On system suspend things will work fine. On system resume the following annoying phenomenon occurs: - In the pm_runtime_force_resume() path of struct i2c_client *baz, pm_runtime_set_active(&baz->dev); is eventually called. - This becomes __pm_runtime_set_status(&baz->dev, RPM_ACTIVE); - __pm_runtime_set_status() detects that RPM state is changed, and checks whether the parent is: not active (RPM_ACTIVE) and not ignoring its children If this happens it concludes something is wrong, because a parent that is not ignoring its children must be active before any children activate. - Since the struct i2c_adapter *bar does not ignore its children, the PM core thinks that it must indeed go online before its children, the check bails out with -EBUSY, i.e. the i2c_client *baz thinks it can't work because it's parent is not online, and it respects its parent. - In the driver the .resume() callback returns -EBUSY from the runtime_force_resume() call as per above. This leaves the device in a suspended state, leading to bad behaviour later when the device is used. The following debug print is made with an extra printg patch but illustrates the problem: [ 17.040832] bh1780 2-0029: parent (i2c-2) is not active parent->power.ignore_children = 0 [ 17.040832] bh1780 2-0029: pm_runtime_force_resume: pm_runtime_set_active() failed (-16) [ 17.040863] dpm_run_callback(): pm_runtime_force_resume+0x0/0x88 returns -16 [ 17.040863] PM: Device 2-0029 failed to resume: error -16 Fix this by letting all struct i2c_adapter:s ignore their children: i2c children have no business doing keeping their parents awake: they are completely autonomous devices that just use their parent to talk, a usecase which must be power managed in the host on a per-message basis. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 12 4月, 2016 2 次提交
-
-
由 Wolfram Sang 提交于
Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-