- Feb 27, 2010
-
-
Rade Bozic authored
Signed-off-by:
Rade Bozic <rade.bozic.ext@nsn.com> Signed-off-by:
David Daney <ddaney@caviumnetworks.com> Cc: Michael Lawnick <michael.lawnick.ext@nsn.com> To: linux-mips@linux-mips.org To: linux-i2c@vger.kernel.org To: ben-linux@fluff.org To: khali@linux-fr.org Cc: rade.bozic.ext@nsn.com Cc: Michael Lawnick <michael.lawnick.ext@nsn.com> Patchwork: http://patchwork.linux-mips.org/patch/890/ Signed-off-by:
Ralf Baechle <ralf@linux-mips.org>
-
- Feb 12, 2010
-
-
Russell King authored
Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk>
-
Russell King authored
Remove unnecessary includes Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk>
-
Russell King authored
It makes them harder to grep for. Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk>
-
Russell King authored
Since the drivers data now contains the i2c adapter structure, we can pass around the drivers data between internal functions (which is what they want) rather than using the i2c adapter structure and having an additional pointer dereference each time. Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk>
-
Russell King authored
Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk>
-
Russell King authored
Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk>
-
Russell King authored
This avoids unnecessary casting. Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk>
-
Russell King authored
Acked-by:
Vitaly Wool <vitalywool@gmail.com> Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk>
-
Russell King authored
clk_set_rate() is not supposed to be used to turn clocks on and off. That's what clk_enable/clk_disable is for. Acked-by:
Vitaly Wool <vitalywool@gmail.com> Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk>
-
Russell King authored
Acked-by:
Vitaly Wool <vitalywool@gmail.com> Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk>
-
Russell King authored
Acked-by:
Vitaly Wool <vitalywool@gmail.com> Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk>
-
- Feb 05, 2010
-
-
Jean Delvare authored
The functionality bit vector is always returned as a little-endian 32-bit number by the device, so it must be byte-swapped to the host endianness. On the other hand, the delay value is handled by the USB stack, so no byte swapping is needed on our side. This fixes bug #15105: http://bugzilla.kernel.org/show_bug.cgi?id=15105 Reported-by:
Jens Richter <jens@richter-stutensee.de> Signed-off-by:
Jean Delvare <khali@linux-fr.org> Tested-by:
Jens Richter <jens@richter-stutensee.de> Cc: Till Harbaum <till@harbaum.org> Cc: stable@kernel.org
-
- Jan 24, 2010
-
-
Uwe Kleine-König authored
accordingly adapt order of release_mem_region and release_mem_region on remove. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Wolfram Sang <w.sang@pengutronix.de> Cc: Richard Zhao <linuxzsc@gmail.com> Cc: Darius Augulis <augulis.darius@gmail.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: linux-i2c@vger.kernel.org Acked-by:
Wolfram Sang <w.sang@pengutronix.de> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Valentin Longchamp authored
After generating the stop bit by changing MSTA from 1 to 0, the i2c_imx->stopped was immediatly set to 1. The second test on i2c_imx->stopped then is correct and the controller never waits if the bus is busy. This patch corrects this. On mx31moboard, stop bit was not generated on single write transfers. This was kept unnoticed as other transfers are made afterwards that help the write recipient to resynchronize. Thanks to Philippe and Michael for the debugging. Signed-off-by:
Valentin Longchamp <valentin.longchamp@epfl.ch> Signed-off by: Philippe Rétornaz <philippe.retornaz@epfl.ch> Reported-by:
Michael Bonani <michael.bonani@epfl.ch> Acked-by; Wolfram Sang <w.sang@pengutronix.de> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
- Jan 16, 2010
-
-
Thadeu Lima de Souza Cascardo authored
dev_dbg outputs dev_name, which is released with device_unregister. This bug resulted in output like this: i2c Xy2�0: adapter [SMBus I801 adapter at 1880] unregistered The right output would be: i2c i2c-0: adapter [SMBus I801 adapter at 1880] unregistered Signed-off-by:
Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Wolfram Sang authored
Unexpected signals can disturb the bus-handling and lock it up. Don't use interruptible in 'wait_event_*' and 'wake_*' as in commits dc1972d0 (for cpm), 1ab082d7 (for mpc), b7af349b (for omap). Signed-off-by:
Wolfram Sang <w.sang@pengutronix.de> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Márton Németh authored
Remove the following sparse warnings (see "make C=1"): * drivers/i2c/busses/i2c-ali1563.c:91:3: warning: do-while statement is not a compound statement * drivers/i2c/busses/i2c-ali1563.c:161:3: warning: do-while statement is not a compound statement Signed-off-by:
Márton Németh <nm127@freemail.hu> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Roel Kluin authored
With `while (timeout++ < MAX_TIMEOUT)' timeout reaches MAX_TIMEOUT + 1 after the loop. This is probably unlikely to produce a problem. Signed-off-by:
Roel Kluin <roel.kluin@gmail.com> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Tobias Klauser authored
The C99 specification states in section 6.11.5: The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature. Signed-off-by:
Tobias Klauser <tklauser@distanz.ch> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- Dec 23, 2009
-
-
Manjunatha GK authored
Current OMAP3 I2C driver code does not follow the correct sequence for soft reset. Due to this, lock up issues are reported during timeout/error cases. This patch fixes above issue by disabling I2C controller as per OMAP3430 TRM for soft reset. As per TRM, I2C controller needs to be disabled as a first step during soft reset. Here is correct soft reset sequence: a. Ensure that the module is disabled (clear the I2Ci.I2C_CON[15] I2C_EN bit to 0). b. Set the I2Ci.I2C_SYSC[1] SRST bit to 1. c. Enable the module by setting I2Ci.I2C_CON[15] I2C_EN bit to 1. d. Check the I2Ci.I2C_SYSS[0] RDONE bit until it is set to 1 to indicate the software reset is complete. Tested on Zoom2, Zoom3, 3430SDP and 3630SDP Signed-off-by:
Manjunatha GK <manjugk@ti.com> Signed-off-by:
George, <Harith<harith@ti.com> Acked-by:
Varadarajan, Charu <Latha<charu@ti.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Cory Maccarrone authored
Commit ef871432... (i2c-omap: OMAP3: PM: (re)init for every transfer to support off-mode) introduced a change which make the dev->iestate contents be written to the OMAP_I2C_IE_REG every time omap_i2c_unidle is called. Previously, the state was only written if it wasn't equal to zero. In omap_i2c_probe, omap_i2c_unidle() is called prior to omap_i2c_init(), in which case dev->iestate has not yet been initialized and will be set to zero. Having this value written to the registers causes deadlock while booting. As such, this change restores the original functionality. Signed-off-by:
Cory Maccarrone <darkstar6262@gmail.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Sonic Zhang authored
Calculation of the CLKDIV speed setting should be done using base 10 math rather than base 2. We also avoid exceeding the spec due to integer truncation and a 50% duty cycle. Signed-off-by:
Sonic Zhang <sonic.zhang@analog.com> Signed-off-by:
Mike Frysinger <vapier@gentoo.org> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
- Dec 15, 2009
-
-
Alexey Dobriyan authored
Signed-off-by:
Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Dec 14, 2009
-
-
sonic zhang authored
Struct dev_pm_ops is not configured in current i2c bus type. i2c drivers only depends on suspend/resume entries in struct dev_pm_ops are not informed of PM suspend and resume events by i2c framework. Signed-off-by:
Sonic Zhang <sonic.zhang@analog.com> Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
Jean Delvare authored
Struct i2c_client_address_data only contains one field at this point, which makes its usefulness questionable. Get rid of it and pass simple address lists around instead. Signed-off-by:
Jean Delvare <khali@linux-fr.org> Tested-by:
Wolfram Sang <w.sang@pengutronix.de>
-
Jean Delvare authored
The "kind" parameter always has value -1, and nobody is using it any longer, so we can remove it. Signed-off-by:
Jean Delvare <khali@linux-fr.org> Tested-by:
Wolfram Sang <w.sang@pengutronix.de>
-
- Dec 08, 2009
-
-
Kevin Wells authored
Map I2C adapter number to platform ID number Signed-off-by:
Kevin Wells <kevin.wells@nxp.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Rajendra Nayak authored
Because of OMAP off-mode, powerdomain can go off when I2C is idle. Save enough state, and do a re-init for each transfer. Additional save/restore state added by Jagadeesh Bhaskar Pakaravoor (SYSC_REG) and Aaro Koskinen (wakeup sources.) Also, The OMAP3430 TRM states: "During active mode (I2Ci.I2C_CON[15] I2C_EN bit is set to 1), make no changes to the I2Ci.I2C_SCLL and I2Ci.I2C_SCLH registers. Changes may result in unpredictable behavior." Hence, the I2C_EN bit should be clearer when modifying these registers. Please note that clearing the entire I2C_CON register to disable the I2C module is safe, because the I2C_CON register is re-configured for each transfer. Signed-off-by:
Jouni Hogander <jouni.hogander@nokia.com> Signed-off-by:
Rajendra Nayak <rnayak@ti.com> Cc: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com> Cc: Aaro Koskinen <aaro.koskinen@nokia.com> Cc: Jon Hunter <jon-hunter@ti.com> Cc: Hu Tao <taohu@motorola.com> Cc: Xiaolong Chen <A21785@motorola.com> Signed-off-by:
Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Shinya Kuribayashi authored
In the case of no-ACKs, we don't want to see dev_err() messages in the console, because some utilities like i2c-tools are capable of printing decorated console output. This patch will ease such situations. Signed-off-by:
Shinya Kuribayashi <shinya.kuribayashi@necel.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Shinya Kuribayashi authored
Signed-off-by:
Shinya Kuribayashi <shinya.kuribayashi@necel.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Shinya Kuribayashi authored
* ABRT_MASTER_DIS: Fix a typo. * i2c_dw_handle_tx_abort: Return an appropriate error number depending on abort_source. * i2c_dw_xfer: Add a missing abort_source initialization. Signed-off-by:
Shinya Kuribayashi <shinya.kuribayashi@necel.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Shinya Kuribayashi authored
Suppose TX_ABRT occurs in the middle of processing i2c_msg msgs[], and a STOP condition has already been generated on the bus. In this case, subsequent i2c_dw_xfer_msg() might initiate a new and unnecessary I2C transaction, which we'd have to avoid. Furthermore, anytime TX_ABRT is set, the contents of tx/rx buffers are flushed, so we don't have to process RX_FULL and TX_EMPTY. Disable interrupts, and skip them. Signed-off-by:
Shinya Kuribayashi <shinya.kuribayashi@necel.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Shinya Kuribayashi authored
Current error handling procedures are not good in two respects: * Forgot to mark dev->cmd_complete as "completed" on errors Once an I2C transaction is initiated, wait_for_completion_ interruptible_timeout() waits for dev->cmd_complete to be completed. We have to take care of it whenever an error is detected, otherwise we will have a needless HZ timeout. * Forgot to disable interrupts In the previous patch, interrupt mask operations have been changed. We don't disable interrupts at the end of the interrupt handler any more, and try to keep RX_FULL (and TX_EMPTY if required) enabled during the transaction so that we can send longer data than the size of Tx/Rx FIFO. If an error is detected, we need to disable interrupts before quitting current transaction. We can work around above points using dev->msg_err effectively. Signed-off-by:
Shinya Kuribayashi <shinya.kuribayashi@necel.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Shinya Kuribayashi authored
Currently we disable TX_EMPTY interrupt when buf_len is zero, but this is wrong. (buf_len == 0) means that all transmit data in the current i2c_msg message has been sent out, but that doesn't necessarily mean all i2c_msg messages have been processed. TX_EMPTY interrupt is used as the driving force of DW I2C transactions, so we need to keep it enabled as long as i2c_msg messages are available. Signed-off-by:
Shinya Kuribayashi <shinya.kuribayashi@necel.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Shinya Kuribayashi authored
Currently we process the first i2c_dw_xfer_msg() in i2c_dw_xfer(), but in this case there is a possibility to be interrupted by certain interrupts. As described before in this patchset, we need to keep providing new transmit data within a given time period, otherwise Tx FIFO underrun takes place and STOP condition will be generated on the bus, even if we have more bytes to be written. In order to exclude all such possibilities, change TX_EMPTY interrupt usage as below: * DW_IC_INTR_DEFAULT_MASK: Define a default interrupt mask set, and put TX_EMPTY there. * i2c_dw_xfer_init: Enable DW_IC_INTR_DEFAULT_MASK prior to initiating a new I2C transaction. The first TX_EMPTY will be triggered shortly. With the help of it, we can make the first call to i2c_dw_xfer_msg() in the interrupt handler. * i2c_dw_xfer_msg: Fixup intr_mask operation accordingly. Make sure that TX_EMPTY operations need to be reversed. * request_irq: Set IRQF_DISABLED so that we could load transmit data into Tx FIFO without being distracted by other interrupts. * Remove i2c_dw_xfer_msg() in i2c_dw_xfer(). Signed-off-by:
Shinya Kuribayashi <shinya.kuribayashi@necel.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Shinya Kuribayashi authored
I2c_dw_xfer_msg() also has the same target address inconsistency check, and furthermore it checks across all i2c_msg messages, while i2c_dw_read() walks through i2c_msg messages only with_ I2C_M_RD flag. That is, target address check in i2c_dw_read() is redundant and useless. Signed-off-by:
Shinya Kuribayashi <shinya.kuribayashi@necel.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Shinya Kuribayashi authored
Set proper I2C_FUNC_SMBUS_* bits so that the driver could be used with some utilities requiring SMBus functionalities, such as i2c-tools. Note that DW I2C core doesn't support I2C_FUNC_SMBUS_QUICK, as it's not capable of zero-length data transactions. Signed-off-by:
Shinya Kuribayashi <shinya.kuribayashi@necel.com> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Shinya Kuribayashi authored
As the driver and hardware always process the given data in parallel, then it would be better to initialize tx_limit, rx_limit and rx_valid variables just prior to being used. This will help us to send / receive as much data as possible. Signed-off-by:
Shinya Kuribayashi <shinya.kuribayashi@necel.com> Acked-by:
Baruch Siach <baruch@tkos.co.il> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-
Shinya Kuribayashi authored
While we have a local variable "buf_len" for dev->tx_buf_len, we don't have such local variable for dev->tx_buf pointer. While "buf_len" is restored at first then updated when we start processing a new i2c_msg (determined by STATUS_WRITE_IN_PROGRESS flag), ->tx_buf is different. Such inconsistency makes the code slightly hard to follow. Signed-off-by:
Shinya Kuribayashi <shinya.kuribayashi@necel.com> Acked-by:
Baruch Siach <baruch@tkos.co.il> Signed-off-by:
Ben Dooks <ben-linux@fluff.org>
-