- 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 10 次提交
-
-
由 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>
-
由 Lucas Stach 提交于
In PIO mode we can end up with the same errors as in DMA mode, but as IRQs are disabled there we have to check for them manually after each command. Also don't use the big controller reset hammer when receiving a NAK from a slave. It's sufficient to tell the controller to continue at a clean state. Signed-off-by: NLucas Stach <l.stach@pengutronix.de> Tested-by: NMarek Vasut <marex@denx.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Lucas Stach 提交于
This commit fixes the three following races in PIO code: - The CTRL0 register is racy in itself, when programming transfer state and run bit in the same cycle the hardware sometimes ends up using the state from the last transfer. Fix this by programming state in one cycle, make sure the write is flushed down APBX bus by reading back the reg and only then trigger the run bit. - Only clear the DMAREQ bit in DEBUG0 after the read/write to the data reg happened. Otherwise we are racing with the hardware about who touches the data reg first. - When checking for completion of a transfer it's not sufficient to check if the data engine finished, but also a check for i2c bus idle is needed. In PIO mode we are really fast to program the next transfer after a finished one, so the controller possibly tries to start a new transfer while the clkgen engine is still busy writing the NAK/STOP from the last transfer to the bus. Signed-off-by: NLucas Stach <l.stach@pengutronix.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Mika Westerberg 提交于
Using autosuspend helps to reduce the resume latency in situations where another I2C message is going to be started soon. For example with HID over I2C touch panels we get several messages in a short period of time while the touch panel is in use. Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Mika Westerberg 提交于
This is not an atomic context so there is no need to use mdelay() but instead use usleep_range(). Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Mika Westerberg 提交于
The correct way to disable or enable the controller is to wait until the DW_IC_ENABLE_STATUS register bit matches the bit we program into DW_IC_ENABLE register. This procedure is described in the DesignWare I2C databook. By doing this we can be sure that the controller is in correct state once the function returns. Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Mika Westerberg 提交于
It is not good idea to mix static and dynamic I2C adapter numbering. In this particular case on Lynxpoint we had graphics I2C adapter which took the first numbers preventing the designware I2C driver from using the adapter numbers it preferred. Since Lynxpoint support was just introduced and there is no hardware available outside Intel we can fix this by switching to use dynamic adapter numbering instead of static. Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Andy Shevchenko 提交于
This makes the error handling much more simpler than open-coding everything and in addition makes the probe function smaller an tidier. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Andy Shevchenko 提交于
With dev_err() we can get the device instance printed as well and is pretty much standard to use dev_* macros in the drivers anyway. In addition correct the indentation of probe() arguments. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Andy Shevchenko 提交于
This makes the error handling much more simpler than open-coding everything and in addition makes the probe function smaller and tidier. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 09 4月, 2013 2 次提交
-
-
由 Yijing Wang 提交于
CONFIG_HOTPLUG is going away as an option, cleanup CONFIG_HOTPLUG ifdefs in i2c files. Signed-off-by: NYijing Wang <wangyijing@huawei.com> Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jaemin Yoo 提交于
SMBus read and write are supported by the emulation layer of i2c framework if the controller doesn't have SMBus features. I2C_M_RECV_LEN flag is used to let i2c drivers know rx length is not yet determined but will be read to the first byte in rx buffer. s3c2410 doesn't handle this flag. So only one byte is read from slave. There fore following two features are added to the driver code. 1. skip rx length check if I2C_M_RECV_LEN is set and the length is 1. 2. add actual bytes to the rx length after reading first bytes if I2C_M_RECV_LEN. I2C_M_RECV_LEN is only set for SMBus command. So this code does not affect legacy codes which only use i2c command for s3c2410. Signed-off-by: NJaemin Yoo <jmin.yoo@samsung.com> Tested-by: NPrasanna Kumar <prasanna.ps@samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 02 4月, 2013 6 次提交
-
-
由 Lars-Peter Clausen 提交于
i2c_del_mux_adapter always returns 0 and none of it current users check its return value anyway. It is also an essential requirement of the Linux device driver model, that functions which may be called from a device's remove callback to free resources provided by the device, are not allowed to fail. This is the case for i2c_del_mux_adapter(), so make its return type void to make the fact that it won't fail explicit. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Lars-Peter Clausen 提交于
i2c_del_mux_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 its return value and assume that it will always succeed (which it will). A subsequent patch will make the return type of i2c_del_mux_adapter() void. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Acked-by: NGuenter Roeck <linux@roeck-us.net> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Lars-Peter Clausen 提交于
i2c_del_adapter() is usually called from a drivers remove callback. The Linux device driver model does not allow the remove callback to fail and all resources allocated in the probe callback need to be freed, as well as all resources which have been provided to the rest of the kernel(for example a I2C adapter) need to be revoked. So any function revoking such resources isn't allowed to fail either. i2c_del_adapter() adheres to this requirement and will never fail. But i2c_del_adapter()'s return type is int, which may cause driver authors to think that it can fail. This led to code constructs like: ret = i2c_del_adapter(...); BUG_ON(ret); Since i2c_del_adapter() always returns 0 the BUG_ON is never hit and essentially becomes dead code, which means it can be removed. Making the return type of i2c_del_adapter() void makes it explicit that the function will never fail and should prevent constructs like the above from re-appearing in the kernel code. All callers of i2c_del_adapter() have already been updated in a previous patch to ignore the return value, so the conversion of the return type from int to void can be done without causing any build failures. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 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>
-
由 Lars-Peter Clausen 提交于
Currently i2c_del_adapter() returns -EINVAL when it gets an adapter which is not registered. But none of the users of i2c_del_adapter() depend on this behavior, so for the sake of being able to sanitize the return type of i2c_del_adapter argue, that the purpose of i2c_del_adapter() is to remove an I2C adapter from the system. If the adapter is not registered in the first place this becomes a no-op. So we can return success without having to do anything. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Lars-Peter Clausen 提交于
The detach_adapter callback has been deprecated for quite some time and has no user left. Keeping it alive blocks other cleanups, so remove it. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 29 3月, 2013 3 次提交
-
-
由 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>
-
Update the code to use devm_* API so that driver core will manage resources. Signed-off-by: NVishwanathrao Badarkhe, Manish <manishv.b@ti.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
Since we have generic i2c bus recover routines now, these custom ones need to be renamed to fix the namespace clash. Proper conversion needs to be done by someone who has access to the hardware. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 27 3月, 2013 2 次提交
-
-
由 Jean Delvare 提交于
gpio_direction_output() may fail, check for that and deal with it appropriately. Also log an error message if gpio_request() fails. Signed-off-by: NJean Delvare <khali@linux-fr.org> Acked-by: NPeter Korsgaard <peter.korsgaard@barco.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jean Delvare 提交于
GPIOs may not be available immediately when i2c-gpio looks for them. Implement support for deferred probing so that probing can be attempted again later when GPIO pins are finally available. Signed-off-by: NJean Delvare <khali@linux-fr.org> Tested-by: NBo Shen <voice.shen@atmel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 24 3月, 2013 7 次提交
-
-
由 Heiko Stübner 提交于
Make them conform more to established standards. Signed-off-by: NHeiko Stuebner <heiko@sntech.de> Acked-by: NKukjin Kim <kgene.kim@samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Heiko Stübner 提交于
The register definitions are only used in the driver itself. This also removes the last dependency on plat/ includes from the i2c driver. Signed-off-by: NHeiko Stuebner <heiko@sntech.de> Acked-by: NKukjin Kim <kgene.kim@samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
(SMATCH) drivers/i2c/busses/i2c-ismt.c:186:14: warning: duplicate const Acked-by: NNeil Horman <nhorman@tuxdriver.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Stephen Warren 提交于
Tegra only supports, and always enables, device tree. Remove all ifdefs and runtime checks for DT support from the driver. Platform data is therefore no longer required. Delete the header that defines it. Signed-off-by: NStephen Warren <swarren@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Doug Anderson 提交于
The commit: "i2c-core: dt: Pick i2c bus number from i2c alias if present" adds support for automatically picking the bus number based on the alias ID. Remove the now unnecessary code from i2c-pxa that did the same thing. Signed-off-by: NDoug Anderson <dianders@chromium.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Viresh Kumar 提交于
Add i2c bus recovery infrastructure to i2c adapters as specified in the i2c protocol Rev. 03 section 3.1.16 titled "Bus clear". http://www.nxp.com/documents/user_manual/UM10204.pdf Sometimes during operation i2c bus hangs and we need to give dummy clocks to slave device to start the transfer again. Now we may have capability in the bus controller to generate these clocks or platform may have gpio pins which can be toggled to generate dummy clocks. This patch supports both. This patch also adds in generic bus recovery routines gpio or scl line based which can be used by bus controller. In addition controller driver may provide its own version of the bus recovery routine. This doesn't support multi-master recovery for now. Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org> [wsa: changed gpio type to int and minor reformatting] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Doug Anderson 提交于
This allows you to get the equivalent functionality of i2c_add_numbered_adapter() with all data in the device tree and no special case code in your driver. This is a common device tree technique. For quick reference, the FDT syntax for using an alias to provide an ID looks like: aliases { i2c0 = &i2c_0; i2c1 = &i2c_1; }; Signed-off-by: NDoug Anderson <dianders@chromium.org> [wsa: removed one check from static function. We know our callers] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 22 3月, 2013 3 次提交
-
-
由 Guenter Roeck 提交于
My old e-mail address is no longer working. Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Seth Heasley 提交于
This patch adds the iSMT SMBus Controller DeviceIDs for the Intel Avoton SOC. Signed-off-by: NSeth Heasley <seth.heasley@intel.com> Acked-by: NNeil Horman <nhorman@tuxdriver.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Laxman Dewangan 提交于
NVIDIA's Tegra SoC allows read/write of controller register only if controller clock is enabled. System hangs if read/write happens to registers without enabling clock. clk_prepare_enable() can be fail due to unknown reason and hence adding check for return value of this function. If this function success then only access register otherwise return to caller with error. Signed-off-by: NLaxman Dewangan <ldewangan@nvidia.com> Reviewed-by: NStephen Warren <swarren@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
- 11 3月, 2013 1 次提交
-
-
由 Heiko Carstens 提交于
Remove !S390 dependency from i2c Kconfig, since s390 now supports PCI, HAS_IOMEM and HAS_DMA, however we need to add a couple of GENERIC_HARDIRQS dependecies to fix compile and link errors like these: ERROR: "devm_request_threaded_irq" [drivers/i2c/i2c-smbus.ko] undefined! ERROR: "devm_request_threaded_irq" [drivers/i2c/busses/i2c-ocores.ko] undefined! Cc: Wolfram Sang <w.sang@pengutronix.de> Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
-
- 28 2月, 2013 2 次提交
-
-
由 Tejun Heo 提交于
MAX_IDR_MASK is another weirdness in the idr interface. As idr covers whole positive integer range, it's defined as 0x7fffffff or INT_MAX. Its usage in idr_find(), idr_replace() and idr_remove() is bizarre. They basically mask off the sign bit and operate on the rest, so if the caller, by accident, passes in a negative number, the sign bit will be masked off and the remaining part will be used as if that was the input, which is worse than crashing. The constant is visible in idr.h and there are several users in the kernel. * drivers/i2c/i2c-core.c:i2c_add_numbered_adapter() Basically used to test if adap->nr is a negative number which isn't -1 and returns -EINVAL if so. idr_alloc() already has negative @start checking (w/ WARN_ON_ONCE), so this can go away. * drivers/infiniband/core/cm.c:cm_alloc_id() drivers/infiniband/hw/mlx4/cm.c:id_map_alloc() Used to wrap cyclic @start. Can be replaced with max(next, 0). Note that this type of cyclic allocation using idr is buggy. These are prone to spurious -ENOSPC failure after the first wraparound. * fs/super.c:get_anon_bdev() The ID allocated from ida is masked off before being tested whether it's inside valid range. ida allocated ID can never be a negative number and the masking is unnecessary. Update idr_*() functions to fail with -EINVAL when negative @id is specified and update other MAX_IDR_MASK users as described above. This leaves MAX_IDR_MASK without any user, remove it and relocate other MAX_IDR_* constants to lib/idr.c. Signed-off-by: NTejun Heo <tj@kernel.org> Cc: Jean Delvare <khali@linux-fr.org> Cc: Roland Dreier <roland@kernel.org> Cc: Sean Hefty <sean.hefty@intel.com> Cc: Hal Rosenstock <hal.rosenstock@gmail.com> Cc: "Marciniszyn, Mike" <mike.marciniszyn@intel.com> Cc: Jack Morgenstein <jackm@dev.mellanox.co.il> Cc: Or Gerlitz <ogerlitz@mellanox.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Acked-by: NWolfram Sang <wolfram@the-dreams.de> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
由 Tejun Heo 提交于
Convert to the much saner new idr interface. Signed-off-by: NTejun Heo <tj@kernel.org> Cc: Jean Delvare <khali@linux-fr.org> Cc: Wolfram Sang <wolfram@the-dreams.de> Tested-by: NMark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 23 2月, 2013 1 次提交
-
-
由 Al Viro 提交于
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
- 22 2月, 2013 2 次提交
-
-
由 Doug Anderson 提交于
There is simply no reason to be manually setting the private driver data to NULL in the remove/fail to probe cases. This is just extra cruft code that can be removed. A few notes: * Nothing relies on drvdata being set to NULL. * The __device_release_driver() function eventually calls dev_set_drvdata(dev, NULL) anyway, so there's no need to do it twice. * I verified that there were no cases where xxx_get_drvdata() was being called in these drivers and checking for / relying on the NULL return value. This could be cleaned up kernel-wide but for now just take the baby step and remove from the i2c subsystem. Reported-by: NWolfram Sang <wsa@the-dreams.de> Reported-by: NStephen Warren <swarren@wwwdotorg.org> Signed-off-by: NDoug Anderson <dianders@chromium.org> Reviewed-by: NJean Delvare <khali@linux-fr.org> Acked-by: NPeter Korsgaard <jacmet@sunsite.dk> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: NMarek Vasut <marex@denx.de> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
由 Dmitry Torokhov 提交于
The remove() methods should not be marked __exit unless we are using platform_driver_probe() which disables unbinding device from driver via sysfs. Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-