summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
AgeCommit message (Collapse)Author
2011-01-12Merge branch 'for-2638/i2c/ocores' into for-linus/i2c-2638Ben Dooks
2011-01-12Merge branch 'for-2638/i2c/iop' into for-linus/i2c-2638Ben Dooks
2011-01-12Merge branch 'for-2638/i2c/omap' into for-linus/i2c-2638Ben Dooks
2011-01-12Merge branch 'for-2638/i2c/mv64xx' into for-linus/i2c-2638Ben Dooks
2011-01-12i2c-bfin-twi: move setup to the earlier subsys initcallMichael Hennerich
Some systems using this bus sometimes have very basic devices such as regulators on the bus, so the I2C bus master needs to be loaded early. This also matches the behavior of many other I2C bus master drivers. Therefore initialize via subsys_initcall(). 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>
2011-01-12i2c-bfin-twi: handle faulty slave devices betterMichael Hennerich
Faulty slave devices might drive SDA low after a transfer finishes. So, when this scenario is detected, have the master generate up to 9 extra clocks until the SDA is properly released. 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>
2011-01-10i2c: Constify i2c_client where possibleJean Delvare
Helper functions for I2C and SMBus transactions don't modify the i2c_client that is passed to them, so it can be marked const. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-01-10i2c-algo-bit: Complain about masters which can't read SCLJean Delvare
The I2C specification explicitly describes both SDA and SCL as bidirectional lines. An I2C master with a read-only SCL is thus not compliant. If a slow slave stretches the clock, errors will happen, so the bus can't be considered as reliable. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-01-10i2c-algo-bit: Refactor adapter registrationJean Delvare
Use a function pointer to decide whether to call i2c_add_adapter or i2c_add_numbered_adapter. This makes the code more compact than the current strategy of having the common code in a separate function. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-01-10i2c: Add generic I2C multiplexer using GPIO APIPeter Korsgaard
Add an i2c mux driver providing access to i2c bus segments using a hardware MUX sitting on a master bus and controlled through gpio pins. E.G. something like: ---------- ---------- Bus segment 1 - - - - - | | SCL/SDA | |-------------- | | | |------------| | | | | | Bus segment 2 | | | Linux | GPIO 1..N | MUX |--------------- Devices | |------------| | | | | | | | Bus segment M | | | |---------------| | ---------- ---------- - - - - - SCL/SDA of the master I2C bus is multiplexed to bus segment 1..M according to the settings of the GPIO pins 1..N. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-01-10i2c-nforce2: Remove unnecessary cast of pci_get_drvdataJoe Perches
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-01-10i2c-i801: Include <linux/slab.h>Ben Hutchings
Commit 5a0e3ad6af8660be21ca98a971cd00f331318c05 added direct inclusion of <linux/slab.h> to those source files that appeared to need it, but somehow missed this. On most architectures <linux/slab.h> is still indirectly included, but there are exceptions such as alpha. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-01-04i2c-mv64xxx: send repeated START between messages in xferRodolfo Giometti
As stated into file include/linux/i2c.h we must send a repeated START between messages in the same xfer groupset: * Except when I2C "protocol mangling" is used, all I2C adapters implement * the standard rules for I2C transactions. Each transaction begins with a * START. That is followed by the slave address, and a bit encoding read * versus write. Then follow all the data bytes, possibly including a byte * with SMBus PEC. The transfer terminates with a NAK, or when all those * bytes have been transferred and ACKed. If this is the last message in a * group, it is followed by a STOP. Otherwise it is followed by the next * @i2c_msg transaction segment, beginning with a (repeated) START. Signed-off-by: Rodolfo Giometti <giometti@linux.it> Signed-off-by: Mauro Barella <mbarella@vds-it.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2011-01-04i2c-nomadik: fix regression on adapter nameLinus Walleij
The Nomadik I2C adapter does not provide a name for the struct passed into i2c_add_numbered_adapter() causing a regression on 2.6.37-rc3 due to commit 2236baa75f704851d3cd3310569058151acb1f06 adding sanity checks for adapters. Fix this by providing a name proper. Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2011-01-04i2c-omap: Set latency requirements only once for several messagesSamu Onkalo
Ordinary I2C read consist of two messages. First a write operation to tell register address and then read operation to get data. CPU wake up latency is set and removed twice in read case. Set latency requirement before the message processing loop and remove the requirement after the loop to remove latency adjustment operations between the messages. Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Acked-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2011-01-04i2c-eg20t: add driver for Intel EG20TTomoya MORINAGA
I2C driver for Intel EG20T PCH Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Reviewed-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Qi Wang <qi.wang@intel.com> [ben-linux@fluff.org: reworded commit message] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2011-01-04i2c-ocores: add some device tree documentationJonas Bonn
This puts some documentation for the device tree configuration at the head of the driver file. Hopefully this can get moved to a common area for this type of documentation at a later date; unfortunately, there isn't really such a place in the kernel tree at this time. Furthermore, the regstep and clock-frequency parameters are really bus parameters and should probably be passed to the driver in a better way. Consider that a TODO. Signed-off-by: Jonas Bonn <jonas@southpole.se> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2011-01-04i2c-ocores: Use devres for resource allocationJonas Bonn
This patch converts the i2c-cores driver to use devres routines for resource allocation. Signed-off-by: Jonas Bonn <jonas@southpole.se> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2011-01-04i2c-ocores: Adapt for device treeJonas Bonn
This patch adapts the i2c-ocores driver for being defined and configured via a device tree description. The device tree bits need to be protected by CONFIG_OF guards as this is still an optional feature. Signed-off-by: Jonas Bonn <jonas@southpole.se> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2011-01-04i2c-iop3xx: add iomem annotationAaro Koskinen
Eliminate unnecessary casts and the following sparse warnings: drivers/i2c/busses/i2c-iop3xx.c:65:9: warning: incorrect type in argument 1 (different base types) drivers/i2c/busses/i2c-iop3xx.c:65:9: expected void const volatile [noderef] <asn:2>*<noident> drivers/i2c/busses/i2c-iop3xx.c:65:9: got unsigned int [ the previous warning is repeated 18 times ] drivers/i2c/busses/i2c-iop3xx.c:456:33: warning: cast removes address space of expression Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-12-22Merge branch 'master' into for-nextJiri Kosina
Conflicts: MAINTAINERS arch/arm/mach-omap2/pm24xx.c drivers/scsi/bfa/bfa_fcpim.c Needed to update to apply fixes for which the old branch was too outdated.
2010-12-20I2C: i2c-omap: Change device name: i2c_omap -> omap_i2cBenoit Cousson
The convention for omap device naming is omap_XXX. Rename the device and driver name in order to stick to this naming convention. Change device name in clock nodes as well. Signed-off-by: Benoit Cousson <b-cousson@ti.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: Rajendra Nayak <rnayak@ti.com> Cc: Ben Dooks <ben-i2c@fluff.org> Acked-by: Paul Walmsley <paul@pwsan.com> Acked-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
2010-12-17Merge branch 'devel-board' into omap-for-linusTony Lindgren
2010-12-14i2c_intel_mid: Fix slash in sysfs nameAlan Cox
This gets caught by the new sanity check code. Instead of the slash use a different symbol. This was originally found by Major Lee who proposed a rather more complex patch which changed the name according to the chip type. On the basis that we are in a late -rc and making Linus grumpy isn't always a good idea (however fun) this is a simple alternative. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-12-10Merge branch 'devel-omap-irq' into omap-for-linusTony Lindgren
2010-11-30Merge branch 'pm-hwmod-i2c' of ↵Tony Lindgren
ssh://master.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-linus
2010-11-22i2c/algos: convert Kconfig to use the menu's `visible' keywordArnaud Lacombe
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-22Revert "i2c: Fix Kconfig dependencies"Arnaud Lacombe
This reverts commit 0a57274ea026c2b7670683947b6cc08b195148cf. Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-15i2c: Sanity checks on adapter registrationJean Delvare
Make sure I2C adapters being registered have the required struct fields set. If they don't, problems will happen later. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-11-15i2c: Mark i2c_adapter.id as deprecatedJean Delvare
It's about time to make it clear that i2c_adapter.id is deprecated. Hopefully this will remind the last user to move over to a different strategy. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Jarod Wilson <jarod@redhat.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
2010-11-09OMAP: I2C: Convert i2c driver to use PM runtime api'sRajendra Nayak
This patch converts the i2c driver to use PM runtime apis Signed-off-by: Rajendra Nayak <rnayak@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Jean Delvare <khali@linux-fr.org> Acked-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2010-11-01tree-wide: fix comment/printk typosUwe Kleine-König
"gadget", "through", "command", "maintain", "maintain", "controller", "address", "between", "initiali[zs]e", "instead", "function", "select", "already", "equal", "access", "management", "hierarchy", "registration", "interest", "relative", "memory", "offset", "already", Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-10-31i2c-i801: Add PCI idents for Patsburg 'IDF' SMBus controllersDavid Woodhouse
These are the extra 'Integrated Device Function' SMBus controllers found on the Patsburg chipset. Mention the absence of slave mode support. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-31i2c-i801: Handle multiple instances instead of keeping global stateDavid Woodhouse
It's poor form to keep driver state in global variables rather than per-instance. It never really mattered in practice when there was only one controller on the chipset, but the latest chipsets do have more than one controller, so now we care. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-31i2c-i801: Add Intel Patsburg device IDSeth Heasley
Add support for the Intel Patsburg PCH SMBus Controller. Signed-off-by: Seth Heasley <seth.heasley@intel.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-29Merge branch 'for-2637/i2c-all' of git://git.fluff.org/bjdooks/linuxLinus Torvalds
* 'for-2637/i2c-all' of git://git.fluff.org/bjdooks/linux: i2c-intel-mid: Driver depends on PCI i2c-intel-mid: support for Moorestown and Medfield platform i2c-nomadik: fixup bus delays i2c-nomadik: support smbus emulation i2c-nomadik: dynamic clocking i2c-nomadik: documentation fixes i2c-s3c2410: Enable i2c clock only when doing some transfert
2010-10-29i2c-intel-mid: Driver depends on PCIRandy Dunlap
i2c-intel-mid driver uses PCI data structs and interfaces, so it should depend on PCI. Fixes these build errors: drivers/i2c/busses/i2c-intel-mid.c:977: error: implicit declaration of function 'pci_request_region' drivers/i2c/busses/i2c-intel-mid.c:1077: error: implicit declaration of function 'pci_release_region' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Ba Zheng <zheng.ba@intel.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: Ben Dooks <ben-linux@fluff.org> Cc: linux-i2c@vger.kernel.org Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-10-28Merge branch 'linux-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (27 commits) x86: allocate space within a region top-down x86: update iomem_resource end based on CPU physical address capabilities x86/PCI: allocate space from the end of a region, not the beginning PCI: allocate bus resources from the top down resources: support allocating space within a region from the top down resources: handle overflow when aligning start of available area resources: ensure callback doesn't allocate outside available space resources: factor out resource_clip() to simplify find_resource() resources: add a default alignf to simplify find_resource() x86/PCI: MMCONFIG: fix region end calculation PCI: Add support for polling PME state on suspended legacy PCI devices PCI: Export some PCI PM functionality PCI: fix message typo PCI: log vendor/device ID always PCI: update Intel chipset names and defines PCI: use new ccflags variable in Makefile PCI: add PCI_MSIX_TABLE/PBA defines PCI: add PCI vendor id for STmicroelectronics x86/PCI: irq and pci_ids patch for Intel Patsburg DeviceIDs PCI: OLPC: Only enable PCI configuration type override on XO-1 ...
2010-10-28Merge branch 'for-2637/i2c/samsung' into next-i2cBen Dooks
2010-10-28Merge branch 'for-2637/i2c/i2c-nomadik' into next-i2cBen Dooks
2010-10-28i2c-intel-mid: support for Moorestown and Medfield platformAlan Cox
(Updated to address Ben's comments. With regard to the message segment restriction it's not something we hit on the actual platform so while I will investigate that further I don't think its a blocker to submission. At worst its a spot over-restrictive) From: Wen Wang <wen.w.wang@intel.com> Initial release of the driver. Updated and verified on hardware. Cleaned up as follows Alan Cox: Squash down the switches into tables, and use the PCI ident field. We could perhaps take this further and put the platform and port number into this. uint32t -> u32 bracketing of case statements spacing and '!' usage Check the speed (which is now 0/1/2) is valid and ignore otherwise. Fix remaining problems/suggestions from Jean's review Fix items from Ben's review Arjan van de Ven: Initial power management hooks Yong Wang <youg.y.wang@intel.com>: Shared IRQ support Wen Wang <wen.w.wang@intel.com>: D3 support Fixes for OCT test runs Interrupt optimisations Hong Liu <hong.liu@intel.com> The runtime PM code is working on the wrong device (i2c_adapter->dev). The correct one should be pci_dev->dev. This breaks attached i2c slave devices with runtime PM enabled. Slave device needs to runtime resume parent device before runtime resuming itself, but we always get error since we don't have pm_runtime callback for i2c_adapter->dev. Bin Yang <bin.yang@intel.com>: Update speed table Saadi Maalem <saadi.maalem@intel.com>: Clear all interrupts in the hardware init Celine Chotard <celinex.chotard@intel.com>: Correct ordering of clear/disable of IRQs Signed-off-by: Wen Wang <wen.w.wang@intel.com> Signed-off-by: Yong Wang <yong.y.wang@intel.com> Signed-off-by: Hong Liu <hong.liu@intel.com> Signed-off-by: Bin Yang <bin.yang@intel.com> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-10-27NULL-terminate all pci_device_id tablesDzianis Kahanovich
NULL-terminating pci_device_id in pch_dma.c and scx200_acb.c for appying MODULE_DEVICE_TABLE (to publish modalias-es). Signed-off-by: Dzianis Kahanovich <mahatma@eu.by> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-10-25Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (110 commits) sh: i2c-sh7760: Replase from ctrl_* to __raw_* sh: clkfwk: Shuffle around to match the intc split up. sh: clkfwk: modify for_each_frequency end condition sh: fix clk_get() error handling sh: clkfwk: Fix fault in frequency iterator. sh: clkfwk: Add a helper for rate rounding by divisor ranges. sh: clkfwk: Abstract rate rounding helper. sh: clkfwk: support clock remapping. sh: pci: Convert to upper/lower_32_bits() helpers. sh: mach-sdk7786: Add support for the FPGA SRAM. sh: Provide a generic SRAM pool for tiny memories. sh: pci: Support secondary FPGA-driven PCIe clocks on SDK7786. sh: pci: Support slot 4 routing on SDK7786. sh: Fix up PMB locking. sh: mach-sdk7786: Add support for fpga gpios. sh: use pr_fmt for clock framework, too. sh: remove name and id from struct clk sh: free-without-alloc fix for sh_mobile_lcdcfb sh: perf: Set up perf_max_events. sh: perf: Support SH-X3 hardware counters. ... Fix up trivial conflicts (perf_max_events got removed) in arch/sh/kernel/perf_event.c
2010-10-25sh: i2c-sh7760: Replase from ctrl_* to __raw_*Nobuhiro Iwamatsu
ctrl_* is deprecated. We should to use __raw_*. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-25i2c-nomadik: fixup bus delaysLinus Walleij
We were missing a transfer delay in one execution path leading to hangs and the bus timeout was too low leading to errors under stress tests. Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-10-25i2c-nomadik: support smbus emulationLinus Walleij
We can do smbus emulation so flag this and drop the duplicate flags implied from smbus emulation. Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-10-25i2c-nomadik: dynamic clockingLinus Walleij
This makes sure the Nomadik I2C bus driver silicon is only clocked when really needed, saving some microamps here and there when there is no I2C traffic. Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-10-25i2c-nomadik: documentation fixesLinus Walleij
This fixes some kerneldoc and assorted documenatation in the Nomadik I2C driver without semantic impact. Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-10-24i2c-viapro: Don't log nacksJean Delvare
Transactions not acked can happen every now and then, in particular during device detection, and various transaction types can be used for this purpose. So stop logging this event, except when debugging is enabled. This is what other similar drivers (e.g. i2c-i801 or i2c-piix4) do. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-24i2c/pca954x: Remove __devinit and __devexit from probe and remove functionsGuenter Roeck
The underlying I2C adapter may or may not be present when this driver gets initialized, and may disappear later, so there is no safe time at which the probe and remove functions can be discarded. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>