aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c/busses
AgeCommit message (Collapse)Author
2009-06-13i2c: OMAP3: Better noise suppression for fast/standard modesAaro Koskinen
Use longer noise filter period for fast and standard mode. Based on an earlier patch by Eero Nurkkala. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-13i2c: OMAP2/3: Fix scll/sclh calculationsAaro Koskinen
Fix scll/sclh calculations for HS and fast modes. Currently the driver uses equal (roughly) low/high times which will result in too short low time. OMAP3430 TRM gives the following equations: F/S: tLow = (scll + 7) * internal_clk tHigh = (sclh + 5) * internal_clk HS: tLow = (scll + 7) * fclk tHigh = (sclh + 5) * fclk Furthermore, the I2C specification sets the following minimum values for HS tLow/tHigh for capacitive bus loads 100 pF (maximum speed 3400) and 400 pF (maximum speed 1700): speed tLow tHigh 3400 160 ns 60 ns 1700 320 ns 120 ns and for F/S: speed tLow tHigh 400 1300 ns 600 ns 100 4700 ns 4000 ns By using duty cycles 33/66 (HS, F) and 50/50 (S) we stay above these minimum values. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-13i2c: Blackfin TWI: implement I2C_FUNC_SMBUS_I2C_BLOCK functionalityMichael Hennerich
Some drivers need i2c_smbus_read_i2c_block_data() functionality, so add support for it to the Blackfin I2C bus driver. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> [ben-linux@fluff.org: shortened subject] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-13i2c: Blackfin TWI: fix transfer errors with repeat startFrank Shew
We have a custom BF537 board with an I2C RTC (MAX DS3231) running uclinux 2007R1 for some time. Recently during migration to 2008R1.5-RC3 we losted access to the RTC. The RTC driver calls 'i2c_transfer()' which in turns calls 'bfin_twi_master_xfer()' in i2c-bfin-twi.c. Compared with 2007R1, it looks like the 2008R1.5 version of i2c-bin-twi.c has a new mode 'TWI_I2C-MODE_REPEAT' which corresponds to the Repeat Start Condition described in the HRM. However, according to the HRM, at XMIT or RECV interrupt and when the data count is 0, not only is the RESTART bit supposed to be set, but MDIR must also be set if the next operation is a receive sequence, and cleared if not. Currently there is no code that looks at the I2C_M_RD bit in the flag from the next cur_msg and set/clear the MDIR flag accordingly at the same time that the RSTART bit is set. Instead, MDIR is set or cleared (by OR'ing with 0?) after the RESTART bit has been cleared during handling of MCOMP interrupt. It appears that this is causing our failure with reading the RTC, as a quick patch to set/clear MDIR when RESTART is set seem to solve our problem. Signed-off-by: Frank Shew <fshew@geometrics.com> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bryan Wu <cooloney@kernel.org> [ben-linux@fluff.org: shorted subject] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-13i2c: Blackfin TWI: fix REPEAT START mode doesn't repeatSonic Zhang
Avoid rewrite TWI MASTER_CTL reg when issue next message In i2c repeat transfer mode, byte count of next message should be filled into part of the TWI MASTER_CTL reg when interrupt MCOMP of last message transfer is triggered. But, other bits in this reg should not be touched. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bryan Wu <cooloney@kernel.org> [ben-linux@fluff.org: shorted subject] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-13i2c: Blackfin TWI: make sure we don't end up with a CLKDIV=0Michael Hennerich
Make sure we don't end up with an invalid CLKDIV=0 in case someone specifies 20kHz SCL or less (5 * 1024 / 20 = 0x100). Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bryan Wu <cooloney@kernel.org> [ben-linux@fluff.org: shortened subject line] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-12Merge commit 'origin/master' into nextBenjamin Herrenschmidt
Manual merge of: arch/powerpc/kernel/asm-offsets.c
2009-06-05[ARM] pxa: move mach/i2c.h to plat/i2c.hEric Miao
Signed-off-by: Paul Shen <paul.shen@marvell.com> Signed-off-by: Eric Miao <eric.miao@marvell.com>
2009-06-05[ARM] pxa: add platform device ID table to pxa i2c driverEric Miao
Signed-off-by: Eric Miao <eric.miao@marvell.com>
2009-06-04i2c: Fix confusing i2c-ibm_iic messageSean MacLennan
The i2c-ibm_iic driver printed messages in an odd order that seemed to list devices before the driver was probed. Here is an example: at24 0-0052: 512 byte 24c04 EEPROM (writable) ibm-iic ef600700.i2c: using standard (100 kHz) mode ad7414 0-004a: chip found This changes the order to print the i2c driver message before scanning for devices so that the logs show the driver, then the devices. Signed-off-by: Sean MacLennan <smaclennan@pikatech.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
2009-05-26Merge branch 'sh/clkfwk'Paul Mundt
2009-05-13sh: clkfwk: module_clk -> peripheral_clk rename.Paul Mundt
For consistenct naming, and to allow us to fix up some confusion in the SH-Mobile clock framework, amongst other places. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12Merge branch 'i2c-for-2630-rc5' of git://aeryn.fluff.org.uk/bjdooks/linuxLinus Torvalds
* 'i2c-for-2630-rc5' of git://aeryn.fluff.org.uk/bjdooks/linux: i2c-cpm: Pass dev ptr to dma_*_coherent rather than NULL i2c: Enable i2c-s3c2410 for S3C64XX too i2c-mpc: bug fix for MPC52xx clock setting and printout i2c-pxa.c: timeouts off by 1
2009-05-12i2c-cpm: Pass dev ptr to dma_*_coherent rather than NULLMark Ware
Recent DMA changes result in a BUG() when NULL is passed to dma_alloc_coherent in place of a device. Signed-off-by: Mark Ware <mware@elphinstone.net> [ben-linux@fluff.org: fix patch moves] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-12i2c: Enable i2c-s3c2410 for S3C64XX tooMark Brown
This controller is also present on the S3C64xx series processors so enable the driver in Kconfig for those platforms. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-12i2c-mpc: bug fix for MPC52xx clock setting and printoutWolfgang Grandegger
The clock setting did not work for the MPC52xx due to a stupid bug. Furthermore, the dev info output "clock=0" for old device trees was misleading. This patch fixes both issues. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-05i2c: Timeouts off by 1Roel Kluin
with while (timeout++ < MAX_TIMEOUT); timeout reaches MAX_TIMEOUT + 1 after the loop, so the tests below are off by one. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-05-03i2c-pxa.c: timeouts off by 1Roel Kluin
With `while (timeout--)' timeout reaches -1 after the loop, so the tests below are off by one. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-04-13i2c-voodoo3: Deprecate in favor of tdfxfbJean Delvare
Support for I2C/DDC was recently added to the tdfxfb driver, which means that the i2c-voodoo3 driver can be deprecated. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
2009-04-07i2c: imx: Make disable_delay a per-device variableWolfram Sang
'disable_delay' was static which is wrong as it is calculated using the per-device bus speed. This patch turns 'disable_delay' into a per-device variable. Reported-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-04-07i2c: xtensa s6000 i2c driverOskar Schirmer
Support for the s6000 on-chip i2c controller. Signed-off-by: Oskar Schirmer <os@emlix.com> Signed-off-by: Daniel Glöckner <dg@emlix.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-04-07i2c: i2c-mpc: make I2C bus speed configurableWolfgang Grandegger
This patch makes the I2C bus speed configurable by using the I2C node property "clock-frequency". If the property is not defined, the old fixed clock settings will be used for backward comptibility. The generic I2C clock properties, especially the CPU-specific source clock pre-scaler are defined via the OF match table: static const struct of_device_id mpc_i2c_of_match[] = { ... {.compatible = "fsl,mpc8543-i2c", .data = &(struct fsl_i2c_match_data) { .setclock = mpc_i2c_setclock_8xxx, .prescaler = 2, }, }, The "data" field defines the relevant I2C setclock function and the relevant pre-scaler for the I2C source clock frequency. It uses arch-specific tables and functions to determine resonable Freqency Divider Register (fdr) values for MPC83xx, MPC85xx, MPC86xx, MPC5200 and MPC5200B. The i2c->flags field and the corresponding FSL_I2C_DEV_* definitions have been removed as they are obsolete. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-04-07i2c: i2c-mpc: use dev based printout functionWolfgang Grandegger
This patch used the dev_dbg, dev_err, etc. functions for debug and error output instead of printk and pr_debug. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-04-07i2c: i2c-mpc: various coding style fixesWolfgang Grandegger
Fix errors reported by checkpatch (indention, long lines, trailing white space, etc.). Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-04-07i2c: imx: Add missing request_mem_region in probe()Darius Augulis
Signed-off-by: Darius Augulis <augulis.darius@gmail.com> [ben-linux@fluff.org: fix minor patch fault in remove] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-04-07i2c: i2c-s3c2410: Initialise Samsung I2C controller earlyMark Brown
This is required in order to ensure that core system devices such as voltage regulators attached via I2C are avaiable early in boot. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-04-07i2c-s3c2410: Simplify bus frequency calculationDaniel Silverstone
The platform data for the i2c-s3c2410 driver used to allow a min, max and desired frequency for the I2C bus. This patch reduces it to simply a desired frequency ceiling and corrects all the uses of the platform data appropriately. This means, for example, that on a system with a 66MHz fclk, a request for 100KHz will achieve 65KHz which is safe and acceptable, rather than 378KHz which it would have achieved without this change. Signed-off-by: Simtec Linux Team <linux@simtec.co.uk> Signed-off-by: Daniel Silverstone <dsilvers@simtec.co.uk> [ben-linux@fluff.org: tidy subject and description] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-04-07i2c-s3c2410: sda_delay should be in ns, not clock ticksBen Dooks
The sda_delay field should be specified in ns, not in clock ticks as when using cpufreq we could be changing the bus rate. Signed-off-by: Ben Dooks <ben@simtec.co.uk>
2009-04-07i2c: iMX/MXC supportDarius Augulis
Implementation of I2C Adapter/Algorithm Driver for I2C Bus integrated in Freescale's i.MX/MXC processors. Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Tested-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-03-30Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6Linus Torvalds
* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: hwmon: (fschmd) Add support for the FSC Hades IC hwmon: (fschmd) Add support for the FSC Syleus IC i2c-i801: Instantiate FSC hardware montioring chips dmi: Let dmi_walk() users pass private data hwmon: Define a standard interface for chassis intrusion detection Move the pcf8591 driver to hwmon hwmon: (w83627ehf) Only expose in6 or temp3 on the W83667HG hwmon: (w83627ehf) Add support for W83667HG hwmon: (w83627ehf) Invert fan pin variables logic hwmon: (hdaps) Fix Thinkpad X41 axis inversion hwmon: (hdaps) Allow inversion of separate axis hwmon: (ds1621) Clean up documentation hwmon: (ds1621) Avoid unneeded register access hwmon: (ds1621) Clean up register access hwmon: (ds1621) Reorder code statements
2009-03-30i2c-i801: Instantiate FSC hardware montioring chipsHans de Goede
Detect various FSC hwmon IC's based on DMI tables and then let the i2c-i801 driver instantiate the i2c client devices. Note that some of the info in the added table is indentical for all rows, still this is kept in the table to keep the code general and thus (hopefully) easily extensible in the future. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-03-30Merge commit 'origin/master' into nextBenjamin Herrenschmidt
Manual merge of: arch/powerpc/include/asm/elf.h drivers/i2c/busses/i2c-mpc.c
2009-03-28Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6Linus Torvalds
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: i2c-core: Some style cleanups i2c-piix4: Add support for the Broadcom HT1100 chipset i2c-piix4: Add support to SB800 SMBus changes i2c-pca-platform: Use defaults if no platform_data given i2c-algo-pca: Use timeout for checking the state machine i2c-algo-pca: Rework waiting for a free bus i2c-algo-pca: Add PCA9665 support i2c: Adapt debug macros for KERN_* constants i2c-davinci: Fix timeout handling i2c: Adapter timeout is in jiffies i2c: Set a default timeout value for all adapters i2c: Add missing KERN_* constants to printks i2c-algo-pcf: Handle timeout correctly i2c-algo-pcf: Style cleanups eeprom/at24: Remove EXPERIMENTAL i2c-nforce2: Add support for MCP67, MCP73, MCP78S and MCP79 i2c: Clarify which clients are auto-removed i2c: Let checkpatch shout on users of the legacy model i2c: Document the different ways to instantiate i2c devices
2009-03-28i2c-piix4: Add support for the Broadcom HT1100 chipsetFlavio Leitner
Add support for the Broadcom HT1100 LD chipset (SMBus function.) Signed-off-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-03-28i2c-piix4: Add support to SB800 SMBus changesShane Huang
Add support for the AMD SB800 Family series of products. Major changes include the changes to addressing the SMBus registers at different location from the locations in the previous compatible parts from AMD such as SB400/SB600/SB700. For SB800, the main features and register definitions of SMBus and other interfaces are still compatible with the previous products with the only change being in how to access the internal registers for these blocks. Signed-off-by: Shane Huang <shane.huang@amd.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-03-28i2c-pca-platform: Use defaults if no platform_data givenWolfram Sang
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-03-28i2c-algo-pca: Use timeout for checking the state machineWolfram Sang
We now timeout also if the state machine does not change within the given time. For that, the driver-specific completion-functions are extended to return true or false depending on the timeout. This then gets checked in the algorithm. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-03-28i2c-algo-pca: Rework waiting for a free busWolfram Sang
Waiting for a free bus now accepts the timeout value in jiffies and does proper checking using time_before. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-03-28i2c-algo-pca: Add PCA9665 supportMarco Aurelio da Costa
Add support for the PCA9665 I2C controller. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-03-28i2c-davinci: Fix timeout handlingJean Delvare
Properly set the adapter timeout value in jiffies, and then use that value in the driver, rather than a hard-coded constant. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Troy Kisky <troy.kisky@boundarydevices.com> Cc: Kevin Hilman <khilman@mvista.com>
2009-03-28i2c: Adapter timeout is in jiffiesJean Delvare
i2c_adapter.timeout is in jiffies. Fix all drivers which thought otherwise. It didn't really matter as long as the value was only used inside the driver, but soon i2c-core will use it too so it must have the proper unit. Note: for the i2c-mpc driver, this fixes a bug in polling mode. Timeout would trigger after 1 jiffy, which is most probably not what the author wanted. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Clifford Wolf <clifford@clifford.at> Acked-by: Sean MacLennan <smaclennan@pikatech.com> Cc: Stefan Roese <sr@denx.de> Acked-by: Lennert Buytenhek <kernel@wantstofly.org> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Grant Likely <grant.likely@secretlab.ca> Acked-by: Mark A. Greer <mgreer@mvista.com>
2009-03-28i2c: Add missing KERN_* constants to printksFrank Seidel
According to kerneljanitors todo list all printk calls (beginning a new line) should have an according KERN_* constant. Those are the missing pieces here for the i2c subsystem. Signed-off-by: Frank Seidel <frank@f-seidel.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-03-28i2c-nforce2: Add support for MCP67, MCP73, MCP78S and MCP79Jean Delvare
The MCP78S and MCP79 appear to be compatible with the previous nForce chips as far as the SMBus controller is concerned. The MCP67 and MCP73 were not tested yet but I'd be very surprised if they weren't compatible too. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Oleg Ryjkov <olegr@olegr.ca> Cc: Malcolm Lalkaka <mlalkaka@gmail.com> Cc: Zbigniew Luszpinski <zbiggy@o2.pl>
2009-03-25[ARM] acorn,ebsa110,footbridge,integrator,sa1100: Convert asm/io.h to linux/io.hRussell King
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-03-19Merge branch 'omap-clks3' into develRussell King
Conflicts: arch/arm/mach-omap2/clock.c
2009-03-13Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into develRussell King
Conflicts: arch/arm/mach-at91/gpio.c
2009-03-11Merge commit 'origin/master' into nextBenjamin Herrenschmidt
2009-03-09i2c-mpc: do not allow interruptions when waiting for I2C to completeTimur Tabi
The i2c_wait() function is using wait_event_interruptible_timeout() to wait for the I2C controller to signal that it has completed an I2C bus operation. If the process that causes the I2C operation terminated abruptly, the wait will be interrupted, returning an error. It is better to let the I2C operation finished before the process exits. It is safe to use wait_event_timeout() instead, because the timeout will allow the process to exit if the I2C bus hangs. It's also better to allow the I2C operation to finish, because unacknowledged I2C operations can cause the I2C bus to hang. Signed-off-by: Timur Tabi <timur@freescale.com> Acked-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-03-03Merge master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds
* master.kernel.org:/home/rmk/linux-2.6-arm: [ARM] fix lots of ARM __devexit sillyness [ARM] 5417/1: Set the correct cacheid for ARMv6 CPUs with ARMv7 style MMU [ARM] 5416/1: Use unused address in v6_early_abort [ARM] 5411/1: S3C64XX: Fix EINT unmask [ARM] at91: fix for Atmel AT91 powersaving [ARM] RiscPC: Fix etherh oops
2009-03-03[ARM] fix lots of ARM __devexit sillynessRussell King
`iop_adma_remove' referenced in section `.data' of drivers/built-in.o: defined in discarded section `.devexit.text' of drivers/built-in.o `mv_xor_remove' referenced in section `.data' of drivers/built-in.o: defined in discarded section `.devexit.text' of drivers/built-in.o `mv64xxx_i2c_unmap_regs' referenced in section `.devinit.text' of drivers/built-in.o: defined in discarded section `.devexit.text' of drivers/built-in.o `mv64xxx_i2c_remove' referenced in section `.data' of drivers/built-in.o: defined in discarded section `.devexit.text' of drivers/built-in.o `orion_nand_remove' referenced in section `.data' of drivers/built-in.o: defined in discarded section `.devexit.text' of drivers/built-in.o `pxafb_remove' referenced in section `.data' of drivers/built-in.o: defined in discarded section `.devexit.text' of drivers/built-in.o Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>