- May 22, 2014
-
-
Maxime Ripard authored
The Allwinner A10 compatibles were following a slightly different compatible patterns than the rest of the SoCs for historical reasons. Move to the other pattern for consistency across all Allwinner Socs. Signed-off-by:
Maxime Ripard <maxime.ripard@free-electrons.com> [wsa: dropped binding OK as per http://lists.infradead.org/pipermail/linux-arm-kernel/2014-February/229438.html ] Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- May 14, 2014
-
-
Wolfram Sang authored
This hardware does not support zero length transfers. Instead, the driver does one (random) byte transfers currently with undefined results for the slaves. We now bail out. Signed-off-by:
Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
Andy Gross authored
This patch corrects the error check on the call to pm_runtime_get_sync. Signed-off-by:
Andy Gross <agross@codeaurora.org> Reviewed-by:
Ivan T. Ivanov <iivanov@mm-sol.com> Acked-by:
Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Olof Johansson authored
Don't unmark the device as suspended until after it's been re-setup. The main race would be w.r.t. an i2c driver that gets resumed at the same time (asyncronously), that is allowed to do a transfer since suspended is set to 0 before reinit, but really should have seen the -EIO return instead. Signed-off-by:
Olof Johansson <olof@lixom.net> Signed-off-by:
Doug Anderson <dianders@chromium.org> Acked-by:
Kukjin Kim <kgene.kim@samsung.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
Ulf Hansson authored
devm_ioremap() returns NULL on error, not an error. Signed-off-by:
Ulf Hansson <ulf.hansson@linaro.org> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
Du, Wenkai authored
There have been "i2c_designware 80860F41:00: controller timed out" errors on a number of Baytrail platforms. The issue is caused by incorrect value in Interrupt Mask Register (DW_IC_INTR_MASK) when i2c core is being enabled. This causes call to __i2c_dw_enable() to immediately start the transfer which leads to timeout. There are 3 failure modes observed: 1. Failure in S0 to S3 resume path The default value after reset for DW_IC_INTR_MASK is 0x8ff. When we start the first transaction after resuming from system sleep, TX_EMPTY interrupt is already unmasked because of the hardware default. 2. Failure in normal operational path This failure happens rarely and is hard to reproduce. Debug trace showed that DW_IC_INTR_MASK had value of 0x254 when failure occurred, which meant TX_EMPTY was unmasked. 3. Failure in S3 to S0 suspend path This failure also happens rarely and is hard to reproduce. Adding debug trace that read DW_IC_INTR_MASK made this failure not reproducible. But from ISR call trace we could conclude TX_EMPTY was unmasked when problem occurred. The patch masks all interrupts before the controller is enabled to resolve the faulty DW_IC_INTR_MASK conditions. Signed-off-by:
Wenkai Du <wenkai.du@intel.com> Acked-by:
Mika Westerberg <mika.westerberg@linux.intel.com> [wsa: improved the comment and removed typo in commit msg] Signed-off-by:
Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
- Apr 07, 2014
-
-
Uwe Kleine-König authored
If the renamed symbol is defined lib/iomap.c implements ioport_map and ioport_unmap and currently (nearly) all platforms define the port accessor functions outb/inb and friend unconditionally. So HAS_IOPORT_MAP is the better name for this. Consequently NO_IOPORT is renamed to NO_IOPORT_MAP. The motivation for this change is to reintroduce a symbol HAS_IOPORT that signals if outb/int et al are available. I will address that at least one merge window later though to keep surprises to a minimum and catch new introductions of (HAS|NO)_IOPORT. The changes in this commit were done using: $ git grep -l -E '(NO|HAS)_IOPORT' | xargs perl -p -i -e 's/\b((?:CONFIG_)?(?:NO|HAS)_IOPORT)\b/$1_MAP/' Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Apr 06, 2014
-
-
Wolfram Sang authored
During development, the driver first really needed to depend on COMMON_CLK only. Later, it was switched to writel_relaxed, but it was forgotten to update the dependencies, so build errors occured: config: make ARCH=i386 allyesconfig All error/warnings: drivers/i2c/busses/i2c-cadence.c: In function 'cdns_i2c_clear_bus_hold': >> drivers/i2c/busses/i2c-cadence.c:168:3: error: implicit declaration >> of function 'writel_relaxed' [-Werror=implicit-function-declaration] Use a very safe dependency for now. Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Soren Brinkmann authored
Add a driver for the Cadence I2C controller. This controller is for example found in Xilinx Zynq. Signed-off-by:
Soren Brinkmann <soren.brinkmann@xilinx.com> Tested-by:
Michal Simek <michal.simek@xilinx.com> Reviewed-by:
Harini Katakam <harinik@xilinx.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Wolfram Sang authored
It is used with of_property_read_u32(), so it should be u32. Signed-off-by:
Wolfram Sang <wsa@the-dreams.de> Acked-by:
Bjorn Andersson <bjorn.andersson@sonymobile.com> Fixes: 10c5a842 ('i2c: qup: New bus driver for the Qualcomm QUP I2C controller')
-
- Apr 03, 2014
-
-
Dan Carpenter authored
These should ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()". Fixes: 10c5a842 ('i2c: qup: New bus driver for the Qualcomm QUP I2C controller') Signed-off-by:
Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Mar 28, 2014
-
-
Bjorn Andersson authored
This bus driver supports the QUP i2c hardware controller in the Qualcomm SOCs. The Qualcomm Universal Peripheral Engine (QUP) is a general purpose data path engine with input/output FIFOs and an embedded i2c mini-core. The driver supports FIFO mode (for low bandwidth applications) and block mode (interrupt generated for each block-size data transfer). Signed-off-by:
Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by:
Bjorn Andersson <bjorn.andersson@sonymobile.com> Reviewed-by:
Andy Gross <agross@codeaurora.org> Tested-by:
Philip Elcan <pelcan@codeaurora.org> [wsa: removed needless IS_ERR_VALUE] Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Wolfram Sang authored
Warn users that class based instantiation is going away soon in favour of more robust probing and faster bootup times. Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Wolfram Sang authored
Warn users that class based instantiation is going away soon in favour of more robust probing and faster bootup times. Signed-off-by:
Wolfram Sang <wsa@the-dreams.de> Cc: Barry Song <baohua@kernel.org>
-
Wolfram Sang authored
Warn users that class based instantiation is going away soon in favour of more robust probing and faster bootup times. Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Wolfram Sang authored
Warn users that class based instantiation is going away soon in favour of more robust probing and faster bootup times. Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Wolfram Sang authored
Warn users that class based instantiation is going away soon in favour of more robust probing and faster bootup times. Signed-off-by:
Wolfram Sang <wsa@the-dreams.de> Cc: Sekhar Nori <nsekhar@ti.com> Cc: Kevin Hilman <khilman@deeprootsystems.com>
-
Wolfram Sang authored
Warn users that class based instantiation is going away soon in favour of more robust probing and faster bootup times. Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Maxime Ripard authored
The reset framework recently gained optional stubs when CONFIG_RESET_CONTROLLER is not selected. It also introduced a function reset_get_optional, that is also dummy-defined whenever the framework isn't enabled, for drivers that needs an optional reset controller. Switch to this function, since the mv64xxx driver is in this case. This also fixes a compilation breakage whenever the reset framework wasn't selected: drivers/i2c/busses/i2c-mv64xxx.c:771:2: error: implicit declaration of function 'devm_reset_control_get' While we're at it, remove the redundant test on dev.of_node surrounding the calls to reset framework functions, since it will either be a valid pointer, an error pointer in the case where we called reset_get_optional without an of_node pointer or if it failed, or NULL if we're not loaded through DT. Signed-off-by:
Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Mar 27, 2014
-
-
Nishanth Menon authored
we use IS_ERR_VALUE to check for error values of pm_runtime_get_sync, when the value can only be < 0 in the case of err. Replace the check with a simpler < 0 check. This fixes the coccicheck warnings: linux-2.6/drivers/i2c/busses/i2c-omap.c:1157:5-24: pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at line 1158 linux-2.6/drivers/i2c/busses/i2c-omap.c:1278:7-26: pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at line 1279 drivers/i2c/busses/i2c-omap.c:638:5-24: pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at line 639 Signed-off-by:
Nishanth Menon <nm@ti.com> Reviewed-by:
Felipe Balbi <balbi@ti.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Uwe Kleine-König authored
This was tested on a EFM32GG-DK3750 devboard that has a temperature sensor and an eeprom on its i2c bus. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Mar 24, 2014
-
-
Scott Wood authored
Fixes a build break due to the undeclared use of irq_of_parse_and_map() and of_iomap(). This build break was apparently introduced while the driver was unbuildable due to the bug fixed by 62c19c9d ("i2c: Remove usage of orphaned symbol OF_I2C"). When 62c19c was added in v3.14-rc7, the driver was enabled again, breaking the powerpc mpc85xx_defconfig and mpc85xx_smp_defconfig. 62c19c is marked for stable, so this should go there as well. Reported-by:
Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by:
Scott Wood <scottwood@freescale.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
- Mar 13, 2014
-
-
Richard Weinberger authored
The symbol is an orphan, don't depend on it anymore. Signed-off-by:
Richard Weinberger <richard@nod.at> [wsa: enhanced commit message] Signed-off-by:
Wolfram Sang <wsa@the-dreams.de> Fixes: 687b81d0 (i2c: move OF helpers into the core) Cc: stable@kernel.org
-
Jingoo Han authored
Remove unnecessary cast of void pointer, because 'algo_data' of 'struct i2c_adapter' is a void pointer. Casting the void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by:
Jingoo Han <jg1.han@samsung.com> Reviewed-by:
Naveen Krishna Chatradhi <ch.naveen@samsung.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingoo Han authored
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. warning: 'exynos5_i2c_suspend_noirq' defined but not used [-Wunused-function] warning: 'exynos5_i2c_resume_noirq' defined but not used [-Wunused-function] Signed-off-by:
Jingoo Han <jg1.han@samsung.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Ben Dooks authored
When using device-tree and the i2c-gpio driver is called before the GPIO node has been probed then it needs to correctly defer the probe instead of returning a permanent error that the gpio numbers are not valid. This fixes the following error: /i2c@2: invalid GPIO pins, sda=-517/scl=-517 Signed-off-by:
Ben Dooks <ben.dooks@codethink.co.uk> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
David Howells authored
The SMBUS tracepoints can be enabled thusly: echo 1 >/sys/kernel/debug/tracing/events/i2c/enable and will dump messages that can be viewed in /sys/kernel/debug/tracing/trace that look like: ... smbus_read: i2c-0 a=051 f=0000 c=fa BYTE_DATA ... smbus_reply: i2c-0 a=051 f=0000 c=fa BYTE_DATA l=1 [39] ... smbus_result: i2c-0 a=051 f=0000 c=fa BYTE_DATA rd res=0 formatted as: i2c-<adapter-nr> a=<addr> f=<flags> c=<command> <protocol-name> <rd|wr> res=<result> l=<data-len> [<data-block>] The adapters to be traced can be selected by something like: echo adapter_nr==1 >/sys/kernel/debug/tracing/events/i2c/filter Note that this shares the same filter and enablement as i2c. Signed-off-by:
David Howells <dhowells@redhat.com> Reviewed-by:
Steven Rostedt <rostedt@goodmis.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
David Howells authored
Add tracepoints into the I2C message transfer function to retrieve the message sent or received. The following config options must be turned on to make use of the facility: CONFIG_FTRACE CONFIG_ENABLE_DEFAULT_TRACERS The I2C tracepoint can be enabled thusly: echo 1 >/sys/kernel/debug/tracing/events/i2c/enable and will dump messages that can be viewed in /sys/kernel/debug/tracing/trace that look like: ... i2c_write: i2c-5 #0 a=044 f=0000 l=2 [02-14] ... i2c_read: i2c-5 #1 a=044 f=0001 l=4 ... i2c_reply: i2c-5 #1 a=044 f=0001 l=4 [33-00-00-00] ... i2c_result: i2c-5 n=2 ret=2 formatted as: i2c-<adapter-nr> #<message-array-index> a=<addr> f=<flags> l=<datalen> n=<message-array-size> ret=<result> [<data>] The operation is done between the i2c_write/i2c_read lines and the i2c_reply and i2c_result lines so that if the hardware hangs, the trace buffer can be consulted to determine the problematic operation. The adapters to be traced can be selected by something like: echo adapter_nr==1 >/sys/kernel/debug/tracing/events/i2c/filter These changes are based on code from Steven Rostedt. Signed-off-by:
Steven Rostedt <rostedt@goodmis.org> Signed-off-by:
David Howells <dhowells@redhat.com> Reviewed-by:
Steven Rostedt <rostedt@goodmis.org> [wsa: adapted path for 'enable' in the commit msg] Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingoo Han authored
Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro is not preferred. Signed-off-by:
Jingoo Han <jg1.han@samsung.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Mar 12, 2014
-
-
Simon Glass authored
There is a rather odd feature of the exynos i2c controller that if it is left enabled, it can lock itself up with the clk line held low. This makes the bus unusable. Unfortunately, the s3c24xx_i2c_set_master() function does not notice this, and reports a timeout. From then on the bus cannot be used until the AP is rebooted. The problem happens when any sort of interrupt occurs (e.g. due to a bus transition) when we are not in the middle of a transaction. We have seen many instances of this when U-Boot leaves the bus apparently happy, but Linux cannot access it. The current code is therefore pretty fragile. This fixes things by leaving the bus disabled unless we are actually in a transaction. We enable the bus at the start of the transaction and disable it at the end. That way we won't get interrupts and will not lock up the bus. It might be possible to clear pending interrupts on start-up, but this seems to be a more robust solution. We can't service interrupts when we are not in a transaction, and anyway would rather not lock up the bus while we try. Signed-off-by:
Simon Glass <sjg@chromium.org> Signed-off-by:
Naveen Krishna Chatradhi <ch.naveen@samsung.com> Acked-by:
Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Wolfram Sang authored
Warn users that class based instantiation is going away soon in favour of more robust probing and faster bootup times. Signed-off-by:
Wolfram Sang <wsa@the-dreams.de> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com>
-
Marek Roszko authored
This adds the ability to set "clock-frequency" in the device tree for the at91 i2cbus following the naming of other i2c bus implementations. If the property is not set,the clock frequency will default to the previously used define of 100KHz. Signed-off-by:
Marek Roszko <mark.roszko@gmail.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Chew, Chiau Ee authored
On Intel BayTrail, there was case whereby the resulting fast mode bus speed becomes slower (~20% slower compared to expected speed) if using the HCNT/LCNT calculated in the core layer. Thus, this patch is added to allow pci glue layer to pass in optimal HCNT/LCNT/SDA hold time values to core layer since the core layer supports cofigurable HCNT/LCNT/SDA hold time values now. Signed-off-by:
Chew, Chiau Ee <chiau.ee.chew@intel.com> Acked-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Mar 10, 2014
-
-
Maxime COQUELIN authored
This patch fixes the error returned to the i2c_transfer function to -EAGAIN in case of arbitratin lost, so that the retry mechanism can be used. Signed-off-by:
Maxime Coquelin <maxime.coquelin@st.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Wolfram Sang authored
We now have a central place to put this code to. Tested-by:
Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Wolfram Sang authored
Calling the state machine with a definite state which is only used in this context is superfluous. Do it directly. Tested-by:
Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Wolfram Sang authored
For start and restart, we are doing the same thing. Let's consolidate that. Tested-by:
Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Chew, Chiau Ee authored
All the I2C controllers on Intel BayTrail LPSS subsystem able to support 10-bit addressing mode functionality. Signed-off-by:
Chew, Chiau Ee <chiau.ee.chew@intel.com> Signed-off-by:
Ong, Boon Leong <boon.leong.ong@intel.com> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
Jingoo Han authored
Use devm_ioremap_resource() in order to make the code simpler, and remove redundant return value check of platform_get_resource() because the value is checked by devm_ioremap_resource(). Signed-off-by:
Jingoo Han <jg1.han@samsung.com> Acked-by:
Shawn Guo <shawn.guo@linaro.org> Acked-by:
Marek Vasut <marex@denx.de> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-
- Mar 09, 2014
-
-
Jingoo Han authored
Use devm_ioremap_resource() in order to make the code simpler, and remove redundant return value check of platform_get_resource() because the value is checked by devm_ioremap_resource(). Signed-off-by:
Jingoo Han <jg1.han@samsung.com> Acked-by:
Stephen Warren <swarren@wwwdotorg.org> Signed-off-by:
Wolfram Sang <wsa@the-dreams.de>
-