summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
Commit message (Collapse)AuthorAgeFilesLines
* i2c-nforce2: Remove redundant error messages on ACPI conflictChase Douglas2010-05-211-6/+4Star
| | | | | | | | | | | | | The ACPI subsystem strictly checks for resource conflicts. When there's a conflict, it outputs a warning message with all the details needed to properly diagnose the underlying issue. However, the i2c-nforce2 driver also prints its own message. Not only is the message redundant, it is at the KERN_ERR level, which overrides some bootsplash screens for no good reason. This change removes the two lines that print out the error messages. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Use <linux/io.h> instead of <asm/io.h>H Hartley Sweeten2010-05-2132-37/+32Star
| | | | | | | | As warned by checkpatch.pl, <linux/io.h> should be used instead of <asm/io.h>. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-algo-pca: Fix coding style issuesFarid Hammane2010-05-211-18/+18
| | | | | | | | | | | Fix up some coding style issues. i2c-algo-pca.c has been built successfully after applying this patch and the binary object is still exactly the same. Other issues found by checkpatch.pl were voluntarily not fixed, either to keep readability, or because of false positive errors. Signed-off-by: Farid Hammane <farid.hammane@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-dev: Fix all coding style issuesFarid Hammane2010-05-211-15/+15
| | | | | | | Fix all coding style issues found by checkpatch.pl. Signed-off-by: Farid Hammane <farid.hammane@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-core: Fix some coding style issuesFarid Hammane2010-05-211-45/+45
| | | | | | | Fix up coding style issues found by the checkpatch.pl tool. Signed-off-by: Farid Hammane <farid.hammane@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-gpio: Move initialization code to subsys_initcall()Marek Szyprowski2010-05-211-1/+1
| | | | | | | | | | | | | | | | | | | GPIO driven I2C bus can be used for controlling the PMIC chip. The example of such configuration is Samsung Aquila board. This patch moves initialization code to subsys_initcall() to ensure that the i2c bus is available early so the regulators can be quickly probed and available for other devices on their probe() call. Such solution has been proposed by Mark Brown to fix the problem of the regulators not beeing available on the peripheral device probe(): http://lists.infradead.org/pipermail/linux-arm-kernel/2010-March/011971.html Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-parport: Make template structure constJean Delvare2010-05-211-1/+1
| | | | | | parport_algo_data is a template so it can be marked const. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-dev: Remove unnecessary castsH Hartley Sweeten2010-05-211-3/+3
| | | | | | | | The private_data member of struct file is a void *, there is no need to cast it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-stub: Expose the default functionality flagsJean Delvare2010-05-211-4/+5
| | | | | | | It is easier to adjust the flags when you know their default value. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Mark M. Hoffman <mhoffman@lightlink.com>
* i2c/scx200_acb: Make PCI device ids constantJean Delvare2010-05-211-1/+1
| | | | | | | | Make PCI device ids constant as we just did for many other i2c bus drivers already. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Márton Németh <nm127@freemail.hu>
* i2c-i801: Fix all checkpatch warningsIvo Manca2010-05-211-10/+10
| | | | | | | Fix all checkpatch warnings. No functional changes are made. Signed-off-by: Ivo Manca <pinkel@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: All newer devices have all the optional featuresJean Delvare2010-05-211-12/+6Star
| | | | | | | | | | | | | | Only the oldest devices lack some of the features supported by this driver. List them explicitly, and default to all features enabled for all other chips, including the ones added through sysfs. This will make future driver maintenance easier. In the unlikely event of a not yet supported device not implementing all the features, one can always use the disable_features module parameter to prevent the driver from attempting to use them. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Seth Heasley <seth.heasley@intel.com>
* i2c-i801: Let the user disable selected driver featuresJean Delvare2010-05-211-1/+20
| | | | | | | | | | Let the user disable selected features normally supported by the device. This makes it possible to work around possible driver or hardware bugs if the feature in question doesn't work as intended for whatever reason. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Felix Rubinstein <felixru@gmail.com>
* Merge branch 'for-linus/i2c-2635' of git://git.fluff.org/bjdooks/linuxLinus Torvalds2010-05-209-174/+337
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-linus/i2c-2635' of git://git.fluff.org/bjdooks/linux: (21 commits) i2c-highlander: remover superflous variable i2c-ibm-iic: drop NO_IRQ i2c-cpm: drop NO_IRQ i2c-mpc: drop NO_IRQ MAINTAINERS: add i2c tree for embedded platforms i2c-pxa: only define 'blue_murder'-function if DEBUG is #defined i2c-pxa: remove unused macro i2c-nomadik: fix operator precedence warning i2c-nomadik: release region when removed OMAP3: I2C: Clean up Errata 1p153 handling OMAP2/3: I2C: Errata ID i207: Clear wrong RDR interrupt omap: i2c: add a timeout to the busy waiting omap: i2c: make errata 1.153 workaround a separate function i2c-omap: add mpu wake up latency constraint in i2c omap: i2c: Add i2c support on omap4 platform i2c-bfin-twi: return completion in interrupt for smbus quick transfers i2c-bfin-twi: remove redundant retry i2c-bfin-twi: fix lost interrupts at high speeds i2c-bfin-twi: add debug output for error status i2c-bfin-twi: integrate timeout timer with completion interface ...
| * i2c-highlander: remover superflous variableWolfram Sang2010-05-201-3/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cppcheck found this flaw [./i2c/busses/i2c-highlander.c:284]: (style) Warning - using char variable in bit operation it was noted that the 'read'-variable could be simply removed as read_write can only be 0 or 1 anyhow. So, we remove the flaw and simplify the code. Reported-by: d binderman <dcb314@hotmail.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Paul Mundt <lethal@linux-sh.org> Acked-by: Jean Delvare <khali@linux-fr.org> Cc: Ben Dooks <ben-linux@fluff.org>
| * i2c-ibm-iic: drop NO_IRQWolfram Sang2010-05-201-7/+7
| | | | | | | | | | | | | | | | | | | | | | Drop NO_IRQ as 0 is the preferred way to describe 'no irq' (http://lkml.org/lkml/2005/11/21/221). This change is safe, as the driver is only used on powerpc, where NO_IRQ is 0 anyhow. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Sean MacLennan <smaclennan@pikatech.com> Cc: Ben Dooks <ben-linux@fluff.org>
| * i2c-cpm: drop NO_IRQWolfram Sang2010-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | Drop NO_IRQ as 0 is the preferred way to describe 'no irq' (http://lkml.org/lkml/2005/11/21/221). This change is safe, as the driver is only used on powerpc, where NO_IRQ is 0 anyhow. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Jochen Friedrich <jochen@scram.de> Cc: Ben Dooks <ben-linux@fluff.org>
| * i2c-mpc: drop NO_IRQWolfram Sang2010-05-201-3/+3
| | | | | | | | | | | | | | | | | | | | Drop NO_IRQ as 0 is the preferred way to describe 'no irq' (http://lkml.org/lkml/2005/11/21/221). This change is safe, as the driver is only used on powerpc, where NO_IRQ is 0 anyhow. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Grant Likely <grant.likely@secretlab.ca> Cc: Ben Dooks <ben-linux@fluff.org>
| * i2c-pxa: only define 'blue_murder'-function if DEBUG is #definedWolfram Sang2010-05-201-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This talkative function is also called on timeouts. As timeouts can happen on regular writes to EEPROMs (no error case), this creates false positives. Giving lots of details is interesting only for developers anyhow, so just use the function if DEBUG is #defined. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Eric Miao <eric.y.miao@gmail.com> Cc: Roel Kluin <roel.kluin@gmail.com> Cc: Pavel Machek <pavel@ucw.cz>
| * i2c-pxa: remove unused macroUwe Kleine-König2010-05-201-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit beea494 ([ARM] Remove EEPROM slave emulation from i2c-pxa driver.) removed all uses of eedbg, so the definition can go, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Roel Kluin <roel.kluin@gmail.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
| * i2c-nomadik: fix operator precedence warningRabin Vincent2010-05-201-1/+2
| | | | | | | | | | | | | | | | | | | | Fix this warning: i2c-nomadik.c:707: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * i2c-nomadik: release region when removedRabin Vincent2010-05-201-0/+3
| | | | | | | | | | | | | | | | | | So that the module can be loaded again after an unload. Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * OMAP3: I2C: Clean up Errata 1p153 handlingmanjugk manjugk2010-05-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | Clean up existing Errata 1p153 handling to use generic errata handling mechanism through dev flag. Signed-off-by: Manjunatha GK <manjugk@ti.com> Cc: Nishanth Menon <nm@ti.com> Cc: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * OMAP2/3: I2C: Errata ID i207: Clear wrong RDR interruptmanjugk manjugk2010-05-201-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under certain rare conditions, I2C_STAT[13].RDR bit may be set and the corresponding interrupt fire, even there is no data in the receive FIFO, or the I2C data transfer is still ongoing. These spurious RDR events must be ignored by the software. This patch handles and ignores RDR spurious interrupts. The below sequence is required in interrupt handler for handling this errata: 1. If RDR is set to 1, clear RDR 2. Read I2C status register and check for BusBusy bit. If BusBusy bit is set, skip remaining steps. 3. If BusBusy bit is not set, perform read operation on I2C status register. 4. If RDR is set, clear the same. Check RDR again and clear if it sets RDR bit again. 5. Perform I2C Data Read operation N number of times(where N is value read from the register BUFSTAT-RXSTAT bit fields). Note: This errata is not applicable for omap2420 and omap4. It is applicable for: 1. omap2430 2. omap34xx(including omap3630). Signed-off-by: Manjunatha GK <manjugk@ti.com> Cc: Hema Kalliguddi <hemahk@ti.com> Cc: Nishanth Menon <nm@ti.com> Cc: Aaro Koskinen <Aaro.Koskinen@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * omap: i2c: add a timeout to the busy waitingAlexander Shishkin2010-05-201-1/+9
| | | | | | | | | | | | | | | | | | | | The errata 1.153 workaround is busy waiting on XUDF bit in interrupt context, which may lead to kernel hangs. The problem can be reproduced by running the bus with wrong (too high) speed. Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * omap: i2c: make errata 1.153 workaround a separate functionAlexander Shishkin2010-05-201-19/+24
| | | | | | | | | | | | | | | | | | This is to avoid insanely long lines and levels of indentation. Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Cc: Nishant Menon <nm@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * i2c-omap: add mpu wake up latency constraint in i2cKalle Jokiniemi2010-05-201-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While waiting for completion of the i2c transfer, the MPU could hit OFF mode and cause several msecs of delay that made i2c transfers fail more often. The extra delays and subsequent re-trys cause i2c clocks to be active more often. This has also an negative effect on power consumption. Created a mechanism for passing and using the constraint setting function in driver code. The used mpu wake up latency constraints are now set individually per bus, and they are calculated based on clock rate and fifo size. Thanks to Jarkko Nikula, Moiz Sonasath, Paul Walmsley, and Nishanth Menon for tuning out the details of this patch. Updates by Kevin as requested by Tony: - Remove omap_set_i2c_constraint_func() in favor of conditionally adding the flag in omap_i2c_add_bus() in order to keep all the OMAP conditional checking in a single location. - Update set_mpu_wkup_lat prototypes to match OMAP PM layer so OMAP PM function can be used directly in pdata. Cc: Moiz Sonasath <m-sonasath@ti.com> Cc: Jarkko Nikula <jhnikula@gmail.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Nishanth Menon <nm@ti.com> Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@digia.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * omap: i2c: Add i2c support on omap4 platformSantosh Shilimkar2010-05-201-32/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is rebased version of earlier post to add I2C driver support to OMAP4 platform. On OMAP4, all I2C register address offsets are changed from OMAP1/2/3 I2C. In order to not have #ifdef's at various places in code, as well as to support multi-OMAP build, an array is created to hold the register addresses with it's offset. This patch was submitted, reviewed and acked on mailing list already. For more details refer below link http://www.mail-archive.com/linux-i2c@vger.kernel.org/msg02281.html This updated verion has a depedancy on "Add support for 16-bit registers" posted on linux-omap. Below is the patch-works link for the same http://patchwork.kernel.org/patch/72295/ Signed-off-by: Syed Rafiuddin <rafiuddin.syed@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Reviewed-by: Paul Walmsley <paul@pwsan.com> Cc: Cory Maccarrone <darkstar6262@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * i2c-bfin-twi: return completion in interrupt for smbus quick transfersSonic Zhang2010-05-201-11/+7Star
| | | | | | | | | | | | | | | | A smbus quick transfer has no data after the address byte. 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>
| * i2c-bfin-twi: remove redundant retrySonic Zhang2010-05-201-18/+2Star
| | | | | | | | | | | | 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>
| * i2c-bfin-twi: fix lost interrupts at high speedsSonic Zhang2010-05-201-24/+13Star
| | | | | | | | | | | | | | | | | | | | i2c event of next read/write byte may trigger before current int state is cleared in the interrupt handler. So, this should be done at the beginning of interrupt handler to avoid losing new i2c events. 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>
| * i2c-bfin-twi: add debug output for error statusMichael Hennerich2010-05-201-0/+12
| | | | | | | | | | | | | | | | Add some debug() code to decode the error register. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * i2c-bfin-twi: integrate timeout timer with completion interfaceSonic Zhang2010-05-201-59/+66
| | | | | | | | | | | | | | | | | | | | There isn't much point in managing our own custom timeout timer when the completion interface already includes support for it. This makes the resulting code much simpler and robust. 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>
| * i2c-s3c2410: Remove unconditional 1ms delay on each transferMark Brown2010-05-201-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The S3C I2C controller indicates completion of I2C transfers before the bus has a stop condition on it. In order to ensure that we do not attempt to start a new transfer before the bus is idle the driver currently inserts a 1ms delay. This is vastly larger than is generally required and has a visible effect on performance under load, such as when bringing up audio CODECs or reading back status information with non-bulk I2C reads. Replace the sleep with a spin on the IIC status register for up to 1ms. This will busy wait but testing on my SMDK6410 system indicates that the overwhelming majority of transactions complete on the first spin, with maximum latencies of less than 10 spins so the absolute overhead of busy waiting should be at worst comprable to msleep(), and the overall system performance is dramatically improved. The main risk is poor interaction with multimaster systems where we may miss the bus going idle before the next transaction. Defend against this by falling back to the original 1ms delay after 20 spins. The overall effect in my testing is an approximately 20% improvement in kernel startup time. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
* | Merge branch 'for-linus' of ↵Linus Torvalds2010-05-201-69/+97
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: PM: PM QOS update fix Freezer / cgroup freezer: Update stale locking comments PM / platform_bus: Allow runtime PM by default i2c: Fix bus-level power management callbacks PM QOS update PM / Hibernate: Fix block_io.c printk warning PM / Hibernate: Group swap ops PM / Hibernate: Move the first_sector out of swsusp_write PM / Hibernate: Separate block_io PM / Hibernate: Snapshot cleanup FS / libfs: Implement simple_write_to_buffer PM / Hibernate: document open(/dev/snapshot) side effects PM / Runtime: Add sysfs debug files PM: Improve device power management document PM: Update device power management document PM: Allow runtime_suspend methods to call pm_schedule_suspend() PM: pm_wakeup - switch to using bool
| * i2c: Fix bus-level power management callbacksRafael J. Wysocki2010-05-101-69/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are three issues with the i2c bus type's power management callbacks at the moment. First, they don't include any hibernate callbacks, although they should at least include the .restore() callback (there's no guarantee that the driver will be present in memory before loading the image kernel and we must restore the pre-hibernation state of the device). Second, the "legacy" callbacks are not going to be invoked by the PM core since the bus type's pm object is not NULL. Finally, the system sleep PM (ie. suspend/resume) callbacks don't check if the device has been already suspended at run time, in which case they should skip suspending it. Also, it looks like the i2c bus type can use the generic subsystem-level runtime PM callbacks. For these reasons, rework the system sleep PM callbacks provided by the i2c bus type to handle hibernation correctly and to invoke the "legacy" callbacks for drivers that provide them. In addition to that make the i2c bus type use the generic subsystem-level runtime PM callbacks. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* | Merge branch 'devel-stable' into develRussell King2010-05-1734-44/+113
|\| | | | | | | | | | | | | Conflicts: arch/arm/Kconfig arch/arm/include/asm/system.h arch/arm/mm/Kconfig
| * i2c-core: Use per-adapter userspace device listsJean Delvare2010-05-041-16/+18
| | | | | | | | | | | | | | | | | | | | Using a single list for all userspace devices leads to a dead lock on multiplexed buses in some circumstances (mux chip instantiated from userspace). This is solved by using a separate list for each bus segment. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Michael Lawnick <ml.lawnick@gmx.de>
| * i2c: Fix probing of FSC hardware monitoring chipsJean Delvare2010-05-041-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some FSC hardware monitoring chips (Syleus at least) doesn't like quick writes we typically use to probe for I2C chips. Use a regular byte read instead for the address they live at (0x73). These are the only known chips living at this address on PC systems. For clarity, this fix should not be needed for kernels 2.6.30 and later, as we started instantiating the hwmon devices explicitly based on DMI data. Still, this fix is valuable in the following two cases: * Support for recent FSC chips on older kernels. The DMI-based device instantiation is more difficult to backport than the device support itself. * Case where the DMI-based device instantiation fails, whatever the reason. We fall back to probing in that case, so it should work. This fixes kernel bug #15634: https://bugzilla.kernel.org/show_bug.cgi?id=15634 Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Cc: stable@kernel.org
| * i2c-core: Erase pointer to clientdata on removalWolfram Sang2010-05-041-2/+6
| | | | | | | | | | | | | | | | | | | | | | After discovering that a lot of i2c-drivers leave the pointer to their clientdata dangling, it was decided to let the core handle this issue. It is assumed that the core may access the private data after remove() as there are no guarantees for the lifetime of such pointers anyhow (see thread starting at http://lkml.org/lkml/2010/3/21/68) Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
| * I2C: Fix section mismatch errors in i2c-octeon.cDavid Daney2010-04-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Daney <ddaney@caviumnetworks.com> To: linux-i2c@vger.kernel.org To: ben-linux@fluff.org To: khali@linux-fr.org Cc: linux-mips@linux-mips.org Cc: rade.bozic.ext@nsn.com Patchwork: http://patchwork.linux-mips.org/patch/1037/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
| * i2c-stu300: off by one issueDan Carpenter2010-04-201-1/+1
| | | | | | | | | | | | | | | | If we don't find the correct rate, we want to end the loop with "i" pointing to the last element in the array. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * i2c-pnx: Add stop conditions for end of transferKevin Wells2010-04-201-0/+6
| | | | | | | | | | | | | | | | | | Add a stop condition bit flag to the last byte in the transfer. This will generate an extra clock to handle the stop condition and prevent devices from staying in an ACK'd state. Signed-off-by: Kevin Wells <wellsk40@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * i2c-pnx: Limit maximum divider to 1023Kevin Wells2010-04-201-0/+2
| | | | | | | | | | | | | | | | | | Limit maximum divider to 0x3ff to divider computations. On high I2C parent clock rates, the divider can exceed 0x3ff. This will help prevent some very odd clock rates. Signed-off-by: Kevin Wells <wellsk40@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * i2c-omap: fix OOPS in omap_i2c_unidle() during probeMika Westerberg2010-04-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d84d3ea317ce0db89ce0903b4037f800c5d4c477 added register shift to allow also 16-bit register access. However, omap_i2c_unidle() is called before these are set which causes the following OOPS: Unhandled fault: alignment exception (0x801) at 0xfa070009 Internal error: : 801 [#1] last sysfs file: Modules linked in: CPU: 0 Not tainted (2.6.34-rc2-00052-gae6be51 #3) PC is at omap_i2c_unidle+0x44/0x138 LR is at trace_hardirqs_on_caller+0x158/0x18c pc : [<c01cd2c4>] lr : [<c00743f8>] psr: 20000013 sp : cfc2bf10 ip : 00000009 fp : 00000000 r10: 00000000 r9 : 00000000 r8 : c0378560 r7 : c0378b88 r6 : c0378558 r5 : cfcadc00 r4 : cfcadc00 r3 : 00000009 r2 : fa070000 r1 : 00000000 r0 : 00000000 Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c5387f Table: 80004019 DAC: 00000017 Process swapper (pid: 1, stack limit = 0xcfc2a2e8) Stack: (0xcfc2bf10 to 0xcfc2c000) bf00: c0372cf8 c027225c 00000000 c0a69678 bf20: cfc3e508 c0500898 c0378560 c0378560 c0500898 cfcac8c0 c04fc280 c017d4f4 bf40: c0378560 c017c63c c0378560 c0378594 c0500898 cfcac8c0 c04fc280 c017c754 bf60: 00000000 c017c6f4 c0500898 c017beac cfc16a5c cfc3fd94 c0023448 c0500898 bf80: c0500898 c017b7d4 c032dc7f 00000093 cfc28d40 c0023448 00000000 c0500898 bfa0: 00000000 00000000 00000000 c017ca48 c0023448 00000000 c001d274 00000000 bfc0: 00000000 c002b344 00000031 00000000 00000000 00000192 00000000 c0023448 bfe0: 00000000 00000000 00000000 c0008578 00000000 c002c304 ffdfffff ffffffff [<c01cd2c4>] (omap_i2c_unidle+0x44/0x138) from [<c027225c>] (omap_i2c_probe+0x1a4/0x398) [<c027225c>] (omap_i2c_probe+0x1a4/0x398) from [<c017d4f4>] (platform_drv_probe+0x18/0x1c) [<c017d4f4>] (platform_drv_probe+0x18/0x1c) from [<c017c63c>] (driver_probe_device+0xc0/0x178) [<c017c63c>] (driver_probe_device+0xc0/0x178) from [<c017c754>] (__driver_attach+0x60/0x84) [<c017c754>] (__driver_attach+0x60/0x84) from [<c017beac>] (bus_for_each_dev+0x44/0x74) [<c017beac>] (bus_for_each_dev+0x44/0x74) from [<c017b7d4>] (bus_add_driver+0x9c/0x218) [<c017b7d4>] (bus_add_driver+0x9c/0x218) from [<c017ca48>] (driver_register+0xa8/0x130) [<c017ca48>] (driver_register+0xa8/0x130) from [<c002b344>] (do_one_initcall+0x5c/0x1b8) [<c002b344>] (do_one_initcall+0x5c/0x1b8) from [<c0008578>] (kernel_init+0x90/0x144) [<c0008578>] (kernel_init+0x90/0x144) from [<c002c304>] (kernel_thread_exit+0x0/0x8) Code: e5942004 e3a0c009 e1a0331c e3a01000 (e18210b3) ---[ end trace 1b75b31a2719ed1c ]--- This patch moves register shift setting before any register accesses are done. Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com> Cc: Cory Maccarrone <darkstar6262@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * i2c-imx: fix error handlingArnaud Patard2010-04-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | - Return -ETIMEDOUT on bus busy error - Fix timeout test "time_after(jiffies, orig_jiffies + HZ / 1000)" : By default, HZ=100 on arm. This means that this test has no chances to work and may result in a dead loop. Set timeout to 500ms. - Don't try to send a new message if we failed to transmit previous one. This was preventing to recover from error on my system Signed-off-by: Arnaud Patard <apatard@mandriva.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| * include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo2010-03-3032-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
| * i2c-scmi: Provide module aliases for automatic loadingDarrick J. Wong2010-03-241-0/+1
| | | | | | | | | | | | | | Provide module aliases for automatic loading. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
| * i2c-scmi: Support IBM SMBus CMI devicesCrane Cai2010-03-241-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | *) add a new HID for IBM SMBus CMI devices *) add methods for IBM SMBus CMI devices *) hook different HID with different control methods set *) minor tweaks as suggested by Jean Delvare Slightly modified by Darrick to use #define'd IBM SMBUS HID from Darrick's ACPI scan quirk patch. Signed-off-by: Crane Cai <crane.cai@amd.com> Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* | ARM: Add Versatile Express supportRussell King2010-05-021-1/+1
|/ | | | Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>