- 19 6月, 2013 1 次提交
-
-
由 Wolfram Sang 提交于
This reverts commit c80f5284. Regressions have been found and also run time based instantiation would fail. We need more thoughts on this. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 16 6月, 2013 1 次提交
-
-
由 Linus Walleij 提交于
The Nomadik I2C was using a local atomic counter to number the I2C adapters. This does not work on configurations where you also add, say a GPIO bit-banged adapter to the system. They will start to conflict about being adapter 0. There is no reason to use the numbered adapter function, and the semantic effect on systems with only Nomadik I2C blocks will be none - instead of increasing the number atomically in the driver itself, it is done in the I2C core. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 15 6月, 2013 6 次提交
-
-
由 Linus Walleij 提交于
The Nomadik I2C block was introduced with the Nomadik STn8815 SoC (the STn8810 incidentally is identical to the one named i2c-stu300.c). However as developments have only been tested on the DB8500 family, it was not properly working with the STn8815 anymore. Rectify this by adding some vendor variant data in the same manner as other PrimeCells, and switch code path depending on version. Tested on the S8815 Nomadik dongle. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Maxime Ripard 提交于
Add the compatible string for the Allwinner A10 i2c controller and the associated register layout. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Tested-by: NSebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Maxime Ripard 提交于
The Allwinner i2c controller uses the same logic as the Marvell one, but with slightly different register offsets. Introduce a structure that will be passed by either the pdata or associated to the compatible strings, and that holds the various registers that might be needed. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Tested-by: NSebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Maxime Ripard 提交于
These macros make it more comprehensive to access to useful masked and shifted area of the various registers used. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Tested-by: NSebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Tony Prisk 提交于
This patch adds support for the I2C bus controllers found on Wondermedia 8xxx-series SoCs. Only master-mode is supported. Signed-off-by: NTony Prisk <linux@prisktech.co.nz> [wsa: fixed one macro to shift 8 instead of 16] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Christian Ruppert 提交于
The designware block is not always properly disabled in the case of transfer errors. Interrupts from aborted transfers might be handled after the data structures for the following transfer are initialised but before the hardware is set up. This can corrupt the data structures to the point that the system is stuck in an infinite interrupt loop (where FIFOs are never emptied because dev->msg_read_idx == dev->msgs_num). This patch cleanly disables the designware-i2c hardware at the end of every transfer, be it successful or not. Signed-off-by: NChristian Ruppert <christian.ruppert@abilis.com> [wsa: extended the comment] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 13 6月, 2013 7 次提交
-
-
由 Sonic Zhang 提交于
TWI transfer interrupts may be lost when system is heavily handling other interrupts, while current transfer handler depends on each accurate interrupt and misses some data in this case. Because there are 2 2-byte FIFOs in blackfin TWI controller, the occurrence of the data loss can be reduced by reading till the RX FIFO is empty and writing till the TX FIFO is full. Reported-by: NBob Maris <mail@maris-ee.eu> Signed-off-by: NSonic Zhang <sonic.zhang@analog.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Linus Walleij 提交于
This tries to address an issue found when writing an MFD driver for the Nomadik STw481x PMICs: as the platform is using device tree exclusively I want to specify the driver matching like this: static const struct of_device_id stw481x_match[] = { { .compatible = "st,stw4810", }, { .compatible = "st,stw4811", }, {}, }; static struct i2c_driver stw481x_driver = { .driver = { .name = "stw481x", .of_match_table = stw481x_match, }, .probe = stw481x_probe, .remove = stw481x_remove, }; However that turns out not to be possible: the I2C probe code is written so that the probe() call is always passed a match from i2c_match_id() using non-devicetree matches. This is probably why most devices using device tree for I2C clients currently will pass no .of_match_table *at all* but instead just use .id_table from struct i2c_driver to match the device. As you realize that means that the whole idea with compatible strings is discarded, and that is why we find strange device tree I2C device compatible strings like "product" instead of "vendor,product" as you could expect. Let's figure out how to fix this before the mess spreads. This patch will allow probeing devices with only an of_match_table as per above, and will pass NULL as the second argument to the probe() function. If the driver wants to deduce secondary info from the struct of_device_id .data field, it has to call of_match_device() on its own match table in the probe function device tree probe path. If drivers define both an .of_match_table *AND* a i2c_driver .id_table, the .of_match_table will take precedence, just as is done in the i2c_device_match() function in i2c-core.c. I2C devices probed from device tree should subsequently be fixed to handle the case where of_match_table() is used (I think none of them do that today), and platforms should fix their device trees to use compatible strings for I2C devices instead of setting the name to Linux device driver names as is done in multiple cases today. Cc: Rob Herring <rob.herring@calxeda.com> Cc: Grant Likely <grant.likely@linaro.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jingoo Han 提交于
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device. Signed-off-by: NJingoo Han <jg1.han@samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Mika Westerberg 提交于
If a process receives signal while it is waiting for I2C transfer to complete, an error is returned to the caller and the transfer is aborted. This can cause the driver to fail subsequent transfers. Also according to commit d295a86e (i2c: mv64xxx: work around signals causing I2C transactions to be aborted) I2C drivers aren't supposed to abort transactions on signals. To prevent this switch to use wait_for_completion_timeout() instead of wait_for_completion_interruptible_timeout() in the designware I2C driver. Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: NChristian Ruppert <christian.ruppert@abilis.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Fabio Estevam 提交于
Since commit ab78029e (drivers/pinctrl: grab default handles from device core), we can rely on device core for handling pinctrl. So remove devm_pinctrl_get_select_default() from the driver. Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Fabio Estevam 提交于
Since commit ab78029e (drivers/pinctrl: grab default handles from device core), we can rely on device core for handling pinctrl. So remove devm_pinctrl_get_select_default() from the driver. Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 06 6月, 2013 9 次提交
-
-
由 Russell King 提交于
Asking for a multi-part message to be handled by this driver is racy; it has been observed that the following sequence is possible with this driver: - send start - send address + write - send data - send (repeated) start - send address + write - send (repeated) start - send address + read - unrecoverable bus hang (except by system reset) The problem is that the interrupt handling sees the next event after the first repeated start is sent - the IFLG bit is set in the register even though INTEN is disabled. Let's fix this by moving all of the message processing into interrupt context, rather than having it partly in IRQ and partly in process context. This allows us to move immediately to the next message in the interrupt handler and get on with the transfer, rather than incuring a couple of scheduling switches to get the next message. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Acked-by: NMark A. Greer <mgreer@animalcreek.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Russell King 提交于
Move mv64xxx_i2c_prepare_for_io() higher up in the driver to avoid a future forward declaration for this function. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Acked-by: NMark A. Greer <mgreer@animalcreek.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Russell King 提交于
As this driver does not advertise protocol mangling support (I2C_FUNC_PROTOCOL_MANGLING is not set), having code to act on I2C_M_NOSTART is illogical, and in any case isn't supportable on anything but the first message - which makes no sense. Remove the I2C_M_NOSTART code. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Acked-by: NMark A. Greer <mgreer@animalcreek.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Russell King 提交于
Propagate the error code from request_irq() rather than ignoring it entirely. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Acked-by: NMark A. Greer <mgreer@animalcreek.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Russell King 提交于
As we're changing to using devm_* APIs to fix various problems in this driver, lets also do devm_kzalloc() while we're here too. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Acked-by: NMark A. Greer <mgreer@animalcreek.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Russell King 提交于
This driver forgets to use clk_put(). Rather than adding clk_put(), lets instead use devm_clk_get() to obtain this clock so that it's automatically handled on cleanup. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Acked-by: NMark A. Greer <mgreer@animalcreek.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Russell King 提交于
Eliminate reg_base_p and reg_size, mv64xxx_i2c_unmap_regs() and an unchecked ioremap() return from this driver by using the devm_* API for requesting and ioremapping resources. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Acked-by: NMark A. Greer <mgreer@animalcreek.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Russell King 提交于
mv64xxx_i2c_map_regs() already returns an error code, so lets propagate that to mv64xxx_i2c_probe()'s caller. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Acked-by: NMark A. Greer <mgreer@animalcreek.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Andy Shevchenko 提交于
Moorestown support is removed from kernel and Medfield is supported by i2c-designware-pci. But i2c-intel-mid is still in upstream and community resources are wasted to maintain it. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 18 5月, 2013 5 次提交
-
-
由 Wolfram Sang 提交于
devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Acked-by: NStephen Warren <swarren@nvidia.com> Acked-by: NBarry Song <Baohua.Song@csr.com>
-
由 Alexander Sverdlin 提交于
i2c: suppress lockdep warning on delete_device Since commit 846f9974 the following lockdep warning is thrown in case i2c device is removed (via delete_device sysfs attribute) which contains subdevices (e.g. i2c multiplexer): ============================================= [ INFO: possible recursive locking detected ] 3.8.7-0-sampleversion-fct #8 Tainted: G O --------------------------------------------- bash/3743 is trying to acquire lock: (s_active#110){++++.+}, at: [<ffffffff802b3048>] sysfs_hash_and_remove+0x58/0xc8 but task is already holding lock: (s_active#110){++++.+}, at: [<ffffffff802b3cb8>] sysfs_write_file+0xc8/0x208 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(s_active#110); lock(s_active#110); *** DEADLOCK *** May be due to missing lock nesting notation 4 locks held by bash/3743: #0: (&buffer->mutex){+.+.+.}, at: [<ffffffff802b3c3c>] sysfs_write_file+0x4c/0x208 #1: (s_active#110){++++.+}, at: [<ffffffff802b3cb8>] sysfs_write_file+0xc8/0x208 #2: (&adap->userspace_clients_lock/1){+.+.+.}, at: [<ffffffff80454a18>] i2c_sysfs_delete_device+0x90/0x238 #3: (&__lockdep_no_validate__){......}, at: [<ffffffff803dcc24>] device_release_driver+0x24/0x48 stack backtrace: Call Trace: [<ffffffff80575cc8>] dump_stack+0x8/0x34 [<ffffffff801b50fc>] __lock_acquire+0x161c/0x2110 [<ffffffff801b5c3c>] lock_acquire+0x4c/0x70 [<ffffffff802b60cc>] sysfs_addrm_finish+0x19c/0x1e0 [<ffffffff802b3048>] sysfs_hash_and_remove+0x58/0xc8 [<ffffffff802b7d8c>] sysfs_remove_group+0x64/0x148 [<ffffffff803d990c>] device_remove_attrs+0x9c/0x1a8 [<ffffffff803d9b1c>] device_del+0x104/0x1d8 [<ffffffff803d9c18>] device_unregister+0x28/0x70 [<ffffffff8045505c>] i2c_del_adapter+0x1cc/0x328 [<ffffffff8045802c>] i2c_del_mux_adapter+0x14/0x38 [<ffffffffc025c108>] pca954x_remove+0x90/0xe0 [pca954x] [<ffffffff804542f8>] i2c_device_remove+0x80/0xe8 [<ffffffff803dca9c>] __device_release_driver+0x74/0xf8 [<ffffffff803dcc2c>] device_release_driver+0x2c/0x48 [<ffffffff803dbc14>] bus_remove_device+0x13c/0x1d8 [<ffffffff803d9b24>] device_del+0x10c/0x1d8 [<ffffffff803d9c18>] device_unregister+0x28/0x70 [<ffffffff80454b08>] i2c_sysfs_delete_device+0x180/0x238 [<ffffffff802b3cd4>] sysfs_write_file+0xe4/0x208 [<ffffffff8023ddc4>] vfs_write+0xbc/0x160 [<ffffffff8023df6c>] SyS_write+0x54/0xd8 [<ffffffff8013d424>] handle_sys64+0x44/0x64 The problem is already known for USB and PCI subsystems. The reason is that delete_device attribute is defined statically in i2c-core.c and used for all devices in i2c subsystem. Discussion of original USB problem: http://lkml.indiana.edu/hypermail/linux/kernel/1204.3/01160.html Commit 356c05d5 introduced new macro to suppress lockdep warnings for this special case and included workaround for USB code. LKML discussion of the workaround: http://lkml.indiana.edu/hypermail/linux/kernel/1205.1/03634.html As i2c case is in principle the same, the same workaround could be used here. Signed-off-by: NAlexander Sverdlin <alexander.sverdlin@nsn.com> Acked-by: NAlan Stern <stern@rowland.harvard.edu> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Tejun Heo <tj@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Russell King 提交于
Do not use interruptible waits in an I2C driver; if a process uses signals (eg, Xorg uses SIGALRM and SIGPIPE) then these signals can cause the I2C driver to abort a transaction in progress by another driver, which can cause that driver to fail. I2C drivers are not expected to abort transactions on signals. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jean Delvare 提交于
Duplicate the feature bits documentation in modinfo, as not every user will read the driver's source code or documentation file. Signed-off-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Mika Westerberg 提交于
This is the same controller as on Intel Lynxpoint but the ACPI ID is different (8086F41). Add support for this. Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 17 5月, 2013 2 次提交
-
-
由 Mika Westerberg 提交于
If the I2C bus is put to a low power state by an ACPI method it might pull the SDA line low (as its power is removed). Once the bus is put to full power state again, the SDA line is pulled back to high. This transition looks like a STOP condition from the controller point-of-view which sets STOP detected bit in its status register causing the driver to fail subsequent transfers. Fix this by always clearing all interrupts before we start a transfer. Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
由 Josef Ahmad 提交于
i2c_dw_xfer_msg() pushes a number of bytes to transmit/receive to/from the bus into the TX FIFO. For master-rx transactions, the maximum amount of data that can be received is calculated depending solely on TX and RX FIFO load. This is racy - TX FIFO may contain master-rx data yet to be processed, which will eventually land into the RX FIFO. This data is not taken into account and the function may request more data than the controller is actually capable of storing. This patch ensures the driver takes into account the outstanding master-rx data in TX FIFO to prevent RX FIFO overrun. Signed-off-by: NJosef Ahmad <josef.ahmad@linux.intel.com> Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
- 24 4月, 2013 2 次提交
-
-
由 Steven A. Falco 提交于
The TX_FIFO register is 10 bits wide. The lower 8 bits are the data to be written, while the upper two bits are flags to indicate stop/start. The driver apparently attempted to optimize write access, by only writing a byte in those cases where the stop/start bits are zero. However, we have seen cases where the lower byte is duplicated onto the upper byte by the hardware, which causes inadvertent stop/starts. This patch changes the write access to the transmit FIFO to always be 16 bits wide. Signed off by: Steven A. Falco <sfalco@harris.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
由 송은봉 提交于
HZ based value is better than a magic number. Signed-off-by: NEunbong Song <eunb.song@samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 20 4月, 2013 4 次提交
-
-
由 송은봉 提交于
I've been debugging the abnormal operation of i2c on octeon. If a process is terminated by signal in the middle of i2c operation, next i2c read operation which is done by another process was failed. So i changed to ignore signal in the middle of i2c operation. After that the problem was not reproduced. Signed-off-by: NEunbong Song <eunb.song@samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
Driver core already takes care of refcounting, no need to do this on driver level again. Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
-
由 Wolfram Sang 提交于
Driver core already takes care of refcounting, no need to do this on driver level again. Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
-
由 Wolfram Sang 提交于
Driver core already takes care of refcounting, no need to do this on driver level again. Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Tested-by: NSekhar Nori <nsekhar@ti.com>
-
- 17 4月, 2013 1 次提交
-
-
由 Doug Anderson 提交于
The i2c-arb-gpio-challenge driver implements an I2C arbitration scheme where masters need to claim the bus with a GPIO before they can start a transaction. This should generally only be used when standard I2C multimaster isn't appropriate for some reason (errata/bugs). This driver is based on code that Simon Glass added to the i2c-s3c2410 driver in the Chrome OS kernel 3.4 tree. The current incarnation as a mux driver is as suggested by Grant Likely. See <https://patchwork.kernel.org/patch/1877311/> for some history. Signed-off-by: NDoug Anderson <dianders@chromium.org> Signed-off-by: NSimon Glass <sjg@chromium.org> Signed-off-by: NNaveen Krishna Chatradhi <ch.naveen@samsung.com> Reviewed-by: NStephen Warren <swarren@nvidia.com> Acked-by: NOlof Johansson <olof@lixom.net> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 16 4月, 2013 2 次提交
-
-
由 Alexandre Courbot 提交于
GENERIC_GPIO is now equivalent to GPIOLIB and features that depended on GENERIC_GPIO can now depend on GPIOLIB to allow removal of this option. Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NGrant Likely <grant.likely@secretlab.ca>
-
由 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>
-