- 02 4月, 2013 4 次提交
-
-
由 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>
-
- 21 2月, 2013 1 次提交
-
-
由 Jayachandran C 提交于
After commit a000b8c1 [i2c: ocores: Add support for the GRLIB port of the controller and use function pointers for getreg and setreg function], compiling i2c-ocores.c for 64-bit gives the following warning: drivers/i2c/busses/i2c-ocores.c: In function 'ocores_i2c_of_probe': drivers/i2c/busses/i2c-ocores.c:334:15: warning: cast from pointer to integer of different size Fix it by casting the pointer to long. Signed-off-by: NJayachandran C <jchandra@broadcom.com> Acked-by: NPeter Korsgaard <jacmet@sunsite.dk> Acked-by: NAndreas Larsson <andreas@gaisler.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 16 2月, 2013 3 次提交
-
-
由 Laxman Dewangan 提交于
If timeout error occurs in the i2c transfer then it was dumping warning of call stack. Remove the warning dump as there is may be possibility that some slave devices are busy and not responding the i2c communication. Signed-off-by: NLaxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
由 Randy Dunlap 提交于
Fix printk format warning. dma_addr_t can be 32-bit or 64-bit, so cast it to long long for printing. This also matches the printk format specifier that is already used. drivers/i2c/busses/i2c-ismt.c:532:3: warning: format '%llX' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat] Signed-off-by: NRandy Dunlap <rdunlap@infradead.org> Acked-by: NNeil Horman <nhorman@tuxdriver.com> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
由 James Ralston 提交于
This patch adds the SMBus Device IDs for the Intel Wellsburg PCH Signed-off-by: NJames Ralston <james.d.ralston@intel.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
- 12 2月, 2013 1 次提交
-
-
由 Stephen Warren 提交于
This implements a very basic I2C host driver for the BCM2835 SoC. Missing features so far are: * 10-bit addressing. * DMA. Reviewed-by: NGrant Likely <grant.likely@secretlab.ca> Signed-off-by: NStephen Warren <swarren@wwwdotorg.org> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
- 11 2月, 2013 10 次提交
-
-
由 Amaury Decrême 提交于
This patch corrects checkpatch errors. The changes has also been removed as it has less meaning with version control tools. Signed-off-by: NAmaury Decrême <amaury.decreme@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
由 Amaury Decrême 提交于
This patch corrects the display of the acpi_base unsigned hex value. Signed-off-by: NAmaury Decrême <amaury.decreme@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
由 Amaury Decrême 提交于
This patch replaces hexadecimal values by constants for SMBus commands. Signed-off-by: NAmaury Decrême <amaury.decreme@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
由 Amaury Decrême 提交于
Datasheet on collision: SMBus Collision (SMBCOL_STS) This bit is set when a SMBus Collision condition occurs and SMBus Host loses in the bus arbitration. The software should clear this bit and re-start SMBus operation. As the status will be cleared in transaction_end, we can remove the sis630_write and prepare to return -EAGAIN to retry. Signed-off-by: NAmaury Decrême <amaury.decreme@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
由 Amaury Decrême 提交于
The sticky bits must be cleared at the end of the transaction by writing a 1 to all fields. Datasheet: SMBus Status (SMB_STS) The following registers are all sticky bits and only can be cleared by writing a one to their corresponding fields. Signed-off-by: NAmaury Decrême <amaury.decreme@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
由 Amaury Decrême 提交于
Signed-off-by: NAmaury Decrême <amaury.decreme@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
由 Alexander Stein 提交于
It was observed the Host Clock Divider was not written by the driver. It was still set to (default) 0, if not already set by BIOS, which caused garbage on SMBus. This driver adds a parameters which is used to calculate the divider appropriately for a default bitrate of 100 KHz. This new divider is only applied if the clock divider is still default 0. Signed-off-by: NAlexander Stein <alexander.stein@systec-electronic.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
由 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>
-
由 Neil Horman 提交于
The iSMT (Intel SMBus Message Transport) supports multi-master I2C/SMBus, as well as IPMI. It's operation is DMA-based and utilizes descriptors to initiate transactions on the bus. The iSMT hardware can act as both a master and a target, although this driver only supports being a master. Signed-off-by: NNeil Horman <nhorman@tuxdriver.com> Signed-off-by: NBill Brown <bill.e.brown@intel.com> Tested-by: NSeth Heasley <seth.heasley@intel.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-
由 Guennadi Liakhovetski 提交于
By default there should be no stop bit on I2C between single messages within transfers. Fix the driver to comply and only send a stop bit at the end of transfers or if I2C_M_STOP is set. Signed-off-by: NGuennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
-