- 10 2月, 2017 1 次提交
-
-
由 Bhumika Goyal 提交于
Declare i2c_algorithm structures as const as they are only stored in the algo field of an i2c_adapter structure. This field is of type const, so i2c_algorithm structures having this property can be made const too. Signed-off-by: NBhumika Goyal <bhumirks@gmail.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> for Acked-by: NPatrice Chotard <patrice.chotard@st.com> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NJean Delvare <jdelvare@suse.de> Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 22 8月, 2016 1 次提交
-
-
由 Wolfram Sang 提交于
The core will do this for us now. Signed-off-by: NWolfram Sang <wsa-dev@sang-engineering.com> Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com> Acked-by: NPeter Korsgaard <peter@korsgaard.com> Acked-by: NHeiko Stuebner <heiko@sntech.de> Acked-by: NNeil Horman <nhorman@tuxdriver.com> Acked-by: NThierry Reding <treding@nvidia.com> Acked-by: NRay Jui <ray.jui@broadcom.com> Acked-by: NVladimir Zapolskiy <vz@mleia.com> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Acked-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: NLaxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 15 8月, 2016 1 次提交
-
-
由 Cyrille Pitchen 提交于
The "alternative command" feature was introduced with sama5d2 SoCs. Its purpose is to let the hardware i2c controller automatically send the STOP condition on the i2c bus at the end of a data transfer. Without this feature, the i2c driver has to write the 'STOP' bit into the Control Register so the hardware i2c controller is triggered to send the STOP condition on the bus. Using the "alternative command" feature requires to set the transfer data length into the 8bit DATAL field of the Alternative Command Register. Hence only data transfers up to 255 bytes can take advantage of the "alternative command" feature. For greater data transfer sizes, the driver should use the previous implementation, when the "alternative command" support was not implemented yet. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 27 5月, 2016 1 次提交
-
-
由 Ludovic Desroches 提交于
When the DMA configuration fails, there is a log reporting that we can't use DMA and indicating the error number. When booting the kernel, it is annoying to see this error number. Moreover, people can think something is going wrong. It is not the case, it means that DMA can't be used but it doesn't prevent to use i2c. Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 04 12月, 2015 1 次提交
-
-
由 Ludovic Desroches 提交于
The hold field allows to configure the data hold time which can be set with the help of the generic binding 'i2c-sda-hold-time-ns'. This feature has been introduced with SAMA5D4 SoC family. Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 26 10月, 2015 1 次提交
-
-
由 Ludovic Desroches 提交于
In some cases, we could start a new i2c transfer with the RXRDY flag set. It is not a clean state and it leads to print annoying error messages even if there no real issue. The cause is only having garbage data in the Receive Holding Register because of a weird behavior of the RXRDY flag. Reported-by: NPeter Rosin <peda@lysator.liu.se> Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com> Tested-by: NPeter Rosin <peda@lysator.liu.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Fixes: 93563a6a ("i2c: at91: fix a race condition when using the DMA controller") Cc: stable@vger.kernel.org #4.1
-
- 22 10月, 2015 1 次提交
-
-
由 Cyrille Pitchen 提交于
In some cases a NACK interrupt may be pending in the Status Register (SR) as a result of a previous transfer. However at91_do_twi_transfer() did not read the SR to clear pending interruptions before starting a new transfer. Hence a NACK interrupt rose as soon as it was enabled again at the I2C controller level, resulting in a wrong sequence of operations and strange patterns of behaviour on the I2C bus, such as a clock stretch followed by a restart of the transfer. This first issue occurred with both DMA and PIO write transfers. Also when a NACK error was detected during a PIO write transfer, the interrupt handler used to wrongly start a new transfer by writing into the Transmit Holding Register (THR). Then the I2C slave was likely to reply with a second NACK. This second issue is fixed in atmel_twi_interrupt() by handling the TXRDY status bit only if both the TXCOMP and NACK status bits are cleared. Tested with a at24 eeprom on sama5d36ek board running a linux-4.1-at91 kernel image. Adapted to linux-next. Reported-by: NPeter Rosin <peda@lysator.liu.se> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com> Tested-by: NPeter Rosin <peda@lysator.liu.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Fixes: 93563a6a ("i2c: at91: fix a race condition when using the DMA controller") Cc: stable@vger.kernel.org #4.1
-
- 11 6月, 2015 1 次提交
-
-
由 Cyrille Pitchen 提交于
buf_len is a size_t, so unsigned, but was tested with '<= 0'. Reported-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 10 6月, 2015 5 次提交
-
-
由 Cyrille Pitchen 提交于
When FIFOs are available and enabled, the driver now configures the Atmel eXtended DMA Controller to perform word accesses instead of byte accesses when possible. The actual access width depends on the size of the buffer to transmit. To enable FIFO support the "atmel,fifo-size" property must be set properly in the I2C controller node of the device tree. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Cyrille Pitchen 提交于
The probe() function now prints the hardware version of the I2C controller. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> [wsa: s/version/hw version/] for clarity] Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Cyrille Pitchen 提交于
The alternative command mode was introduced to simplify the transmission of STOP conditions and to solve timing and latency issues around them. This mode relies on a new register, the Alternative Command Register, which must be set at the same time as the Master Mode Register. This new register was designed to allow simple setup of basic combined transactions built from up to two unitary transactions. Indeed, the ACR is split into two areas, which describe one unitary transaction each. Each area is filled with Data Length 8bit counter, a Direction and a PEC Request bit. The PEC bit is only used in SMBus mode and is not supported by this driver yet. Also when using alternative command mode, the MREAD bit from the Master Mode Register is ignored. Instead the Direction bits from ACR are used to setup the direction, read or write, of each unitary transaction. Finally the 8bit counters must filled with the data length of their respective transaction. Then if only one transaction is to be used, the data length of the second one must be set to zero. At the moment, this driver uses only the first transaction. In addition to MMR and ACR, the Control Register also need to be written to enable the alternative command mode. That's the purpose of its ACMEN bit, which stands for Alternative Command Mode Enable. Note that the alternative command mode is compatible with the use of the Internal Address Register. So combined transactions for eeprom read are actually implemented with the Internal Address Register. This register is written with up to 3 bytes, which are the internal address sent to the slave through the first write transaction. Then the first area of the ACR describe the write transaction to follow, which carries the data to be read from the eeprom. The second area of the ACR is not used so its Data Length 8bit counter is cleared. For each byte sent or received by the device, the Data Length 8bit counter is decremented. When it reaches 0, a STOP condition is automatically sent. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Cyrille Pitchen 提交于
This patch just fixes typo before applying later patches which will use register bits with index above 16. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Cyrille Pitchen 提交于
For TX transactions, the TXCOMP bit in the Status Register is cleared when the first data is written into the Transmit Holding Register. In the lines from at91_do_twi_transfer(): at91_twi_write_data_dma(dev); at91_twi_write(dev, AT91_TWI_IER, AT91_TWI_TXCOMP); the TXCOMP interrupt may be enabled before the DMA controller has actually started to write into the THR. In such a case, the TXCOMP bit is still set into the Status Register so the interrupt is triggered immediately. The driver understands that a transaction completion has occurred but this transaction hasn't started yet. Hence the TXCOMP interrupt is no longer enabled by at91_do_twi_transfer() but instead by at91_twi_write_data_dma_callback(). Also, the TXCOMP bit in the Status Register in not a clear on read flag but a snapshot of the transmission state at the time the Status Register is read. When a NACK error is dectected by the I2C controller, the TXCOMP, NACK and TXRDY bits are set together to 1 in the SR. If enabled, the TXCOMP interrupt is triggered at the same time. Also setting the TXRDY to 1 triggers the DMA controller to write the next data into the THR. Such a write resets the TXCOMP bit to 0 in the SR. So depending on when the interrupt handler reads the SR, it may fail to detect the NACK error if it relies on the TXCOMP bit. The NACK bit and its interrupt should be used instead. For RX transactions, the TXCOMP bit in the Status Register is cleared when the START bit is set into the Control Register. However to unify the management of the TXCOMP bit when the DMA controller is used, the TXCOMP interrupt is now enabled by the DMA callbacks for both TX and RX transfers. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Cc: stable@vger.kernel.org #3.10 and later Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 15 3月, 2015 1 次提交
-
-
由 Nicholas Mc Guire 提交于
Return type of wait_for_completion_timeout is unsigned long not int. This patch adds a timeout variable of appropriate type and fixes up the assignment. Signed-off-by: NNicholas Mc Guire <hofrat@osadl.org> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 13 3月, 2015 1 次提交
-
-
由 Wolfram Sang 提交于
Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Tested-By: NLudovic Desroches <ludovic.desroches@atmel.com>
-
- 24 11月, 2014 1 次提交
-
-
由 Ludovic Desroches 提交于
If dma controller is not probed, defer i2c probe. Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com> Reviewed-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 22 11月, 2014 1 次提交
-
-
由 Arnd Bergmann 提交于
Since at91sam9g45 is now DT-only, all DMA capable users of this driver are using the DT case, and the legacy support can be removed. Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 12 11月, 2014 1 次提交
-
-
由 Wenyou Yang 提交于
Amend the at91 i2c pin controller to set the state of the pins to: - "default" on resume. - "sleep" on suspend(). This should make it possible to optimize energy usage for the pins both for the suspend/resume cycle Signed-off-by: NWenyou Yang <wenyou.yang@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 10 11月, 2014 2 次提交
-
-
由 Wenyou Yang 提交于
Signed-off-by: NWenyou Yang <wenyou.yang@atmel.com> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wenyou Yang 提交于
Drivers should put the device into low power states proactively whenever the device is not in use. Thus implement support for runtime PM and use the autosuspend feature to make sure that we can still perform well in case we see lots of i2c traffic within short period of time. Signed-off-by: NWenyou Yang <wenyou.yang@atmel.com> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 08 11月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
iowait is for blkio [1]. I2C shouldn't use it. [1] https://lkml.org/lkml/2014/11/3/317Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Cc: stable@kernel.org
-
- 20 10月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 02 9月, 2014 2 次提交
-
-
由 Marek Roszko 提交于
The driver was not bound checking the received length byte to ensure it was within the the buffer size that is allocated for SMBus blocks. This resulted in buffer overflows whenever an invalid length byte was received. It also failed to ensure the length byte was not zero. If it received zero, it would end up in an infinite loop as the at91_twi_read_next_byte function returned immediately without allowing RHR to be read to clear the RXRDY interrupt. Tested agaisnt a SMBus compliant battery. Signed-off-by: NMarek Roszko <mark.roszko@gmail.com> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
由 Simon Lindgren 提交于
There is a race condition in at91_do_twi_xfer when signals arrive. If a signal is recieved while waiting for a transfer to complete wait_for_completion_interruptible_timeout() will return -ERESTARTSYS. This is not handled correctly resulting in interrupts still being enabled and a transfer being in flight when we return. Symptoms include a range of oopses and bus lockups. Oopses can happen when the transfer completes because the interrupt handler will corrupt the stack. If a new transfer is started before the interrupt fires the controller will start a new transfer in the middle of the old one, resulting in confused slaves and a locked bus. To avoid this, use wait_for_completion_io_timeout instead so that we don't have to deal with gracefully shutting down the transfer and disabling the interrupts. Signed-off-by: NSimon Lindgren <simon@aqwary.com> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
- 02 8月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
dma_{un}map_* uses 'enum dma_data_direction' not 'enum dma_transfer_direction'. Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Cc: stable@kernel.org
-
- 17 7月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
This driver has been flagged to drop class based instantiation. The removal improves boot-up time and is unneeded for embedded controllers. Users have been warned to switch for some time now, so we can actually do the removal. Keep the DEPRECATED flag, so the core can inform users that the behaviour finally changed now. After another transition period, this flag can go, too. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 12 3月, 2014 1 次提交
-
-
由 Marek Roszko 提交于
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: NMarek Roszko <mark.roszko@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 06 3月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
Warn users that class based instantiation is going away soon in favour of more robust probing and faster bootup times. Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com>
-
- 16 1月, 2014 1 次提交
-
-
由 jean-jacques hiblot 提交于
Signed-off-by: NJean-Jacques Hiblot <jjhiblot@traphandler.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 15 11月, 2013 1 次提交
-
-
由 Wolfram Sang 提交于
Use this new function to make code more comprehensible, since we are reinitialzing the completion, not initializing. [akpm@linux-foundation.org: linux-next resyncs] Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 23 8月, 2013 1 次提交
-
-
由 Wolfram Sang 提交于
I2C of helpers used to live in of_i2c.c but experience (from SPI) shows that it is much cleaner to have this in the core. This also removes a circular dependency between the helpers and the core, and so we can finally register child nodes in the core instead of doing this manually in each driver. So, fix the drivers and documentation, too. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 16 4月, 2013 1 次提交
-
-
由 Ludovic Desroches 提交于
Use generic DMA DT helper. Platforms booting with or without DT populated are both supported. Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com> Acked-by: NJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 02 4月, 2013 1 次提交
-
-
由 Lars-Peter Clausen 提交于
i2c_del_adapter() always returns 0. So all checks testing whether it will be non zero will always evaluate to false and the conditional code is dead code. This patch updates all callers of i2c_del_mux_adapter() to ignore the return value and assume that it will always succeed (which it will). In a subsequent patch the return type of i2c_del_adapter() will be made void. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Acked-by: NBen Hutchings <bhutchings@solarflare.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Acked-by: NShawn Guo <shawn.guo@linaro.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 29 3月, 2013 1 次提交
-
-
由 Sachin Kamat 提交于
This eliminates having an #ifdef returning NULL for the case when OF is disabled. Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 11 2月, 2013 1 次提交
-
-
由 Joachim Eastwood 提交于
Commit 70d46a24 "i2c: at91: add dt support to i2c-at91" added DT only support for at91sam9x5. Building i2c-at91 without CONFIG_OF now warns about at91sam9x5_config as being unused. drivers/i2c/busses/i2c-at91.c:556:30: warning: 'at91sam9x5_config' defined but not used [-Wunused-variable] Move at91sam9x5_config under the defined(CONFIG_OF) guard as new AT91 SoCs will be DT only. Signed-off-by: NJoachim Eastwood <manabian@gmail.com> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
- 28 1月, 2013 1 次提交
-
-
由 Joachim Eastwood 提交于
Signed-off-by: NJoachim Eastwood <manabian@gmail.com> Acked-by: NLudovic Ddesroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
-
- 25 1月, 2013 1 次提交
-
-
由 Thierry Reding 提交于
Convert all uses of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages so all explicit error messages can be removed from the failure code paths. Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de> Acked-by: NWolfram Sang <w.sang@pengutronix.de> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 23 12月, 2012 1 次提交
-
-
由 Bill Pemberton 提交于
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: NBill Pemberton <wfp5p@virginia.edu> Acked-by: Peter Korsgaard <peter.korsgaard@barco.com> (for ocores and mux-gpio) Acked-by: Havard Skinnemoen <hskinnemoen@gmail.com> (for i2c-gpio) Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn> (for puf3) Acked-by: Barry Song <baohua.song@csr.com> (for sirf) Reviewed-by: NJean Delvare <khali@linux-fr.org> [wsa: Fixed "foo* bar" flaws while we are here] Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
-
- 25 11月, 2012 2 次提交
-
-
由 Ludovic Desroches 提交于
Add dma support for Atmel TWI which is available on sam9x5 and later. When using dma for reception, you have to read only n-2 bytes. The last two bytes are read manually. Don't doing this should cause to send the STOP command too late and then to get extra data in the receive register. Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
-
由 Ludovic Desroches 提交于
Replace tabs for struct members indentation by space to minimise line changes when adding new members which would require extra tabs to keep alignment. Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
-