aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c
AgeCommit message (Collapse)Author
2011-01-14i2c: Encourage move to dev_pm_ops by warning on use of legacy methodsMark Brown
Since the PM core wishes to transition away from the legacy suspend and resume methods and since removing them makes using PM core features like runtime PM much easier start warning when a driver is registered using the legacy methods. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-01-14i2c: Factor out runtime suspend checks from PM operationsMark Brown
When devices use dev_pm_ops the I2C API is implementing standard functionality for integration with runtime PM and for checking for the presence of a per device op. The PM core provides pm_generic_ functions implementing this behaviour - use them to reduce coupling with future PM updates. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-01-14i2c: Unregister dummy devices last on adapter removalJean Delvare
Remove real devices first and dummy devices last. This gives device driver which instantiated dummy devices themselves a chance to clean them up before we do. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Hans Verkuil <hverkuil@xs4all.nl> Cc: stable@kernel.org
2011-01-14i2c: Convert SCx200 driver from using raw PCI to platform deviceAndres Salomon
The SCx200 ACB driver supports ISA hardware as well as PCI. The PCI hardware is CS5535/CS5536 based, and the device that it grabs is handled by the cs5535-mfd driver. This converts the SCx200 driver to use a platform_driver rather than the previous PCI hackery. The driver used to manually track the iface list (via linked list); now it only does this for ISA devices. PCI ifaces are handled through standard driver model lists. It's unclear what happens in case of errors in the old ISA code; rather than pretending the code actually cares, I've dropped the (implicit) ignorance of return values and marked it with a comment. Signed-off-by: Andres Salomon <dilinger@queued.net> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-01-13Merge branch 'for-linus/i2c-2638' of git://git.fluff.org/bjdooks/linuxLinus Torvalds
* 'for-linus/i2c-2638' of git://git.fluff.org/bjdooks/linux: i2c-bfin-twi: move setup to the earlier subsys initcall i2c-bfin-twi: handle faulty slave devices better i2c-mv64xxx: send repeated START between messages in xfer i2c-nomadik: fix regression on adapter name i2c-omap: Set latency requirements only once for several messages i2c-eg20t: add driver for Intel EG20T i2c-ocores: add some device tree documentation i2c-ocores: Use devres for resource allocation i2c-ocores: Adapt for device tree i2c-iop3xx: add iomem annotation
2011-01-13Merge branch 'for-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits) Documentation/trace/events.txt: Remove obsolete sched_signal_send. writeback: fix global_dirty_limits comment runtime -> real-time ppc: fix comment typo singal -> signal drivers: fix comment typo diable -> disable. m68k: fix comment typo diable -> disable. wireless: comment typo fix diable -> disable. media: comment typo fix diable -> disable. remove doc for obsolete dynamic-printk kernel-parameter remove extraneous 'is' from Documentation/iostats.txt Fix spelling milisec -> ms in snd_ps3 module parameter description Fix spelling mistakes in comments Revert conflicting V4L changes i7core_edac: fix typos in comments mm/rmap.c: fix comment sound, ca0106: Fix assignment to 'channel'. hrtimer: fix a typo in comment init/Kconfig: fix typo anon_inodes: fix wrong function name in comment fix comment typos concerning "consistent" poll: fix a typo in comment ... Fix up trivial conflicts in: - drivers/net/wireless/iwlwifi/iwl-core.c (moved to iwl-legacy.c) - fs/ext4/ext4.h Also fix missed 'diabled' typo in drivers/net/bnx2x/bnx2x.h while at it.
2011-01-12Merge branch 'for-2638/i2c/bfin2' into for-linus/i2c-2638Ben Dooks
2011-01-12Merge branch 'for-2638/i2c/nomadik' into for-linus/i2c-2638Ben Dooks
2011-01-12Merge branch 'for-2638/i2c/intel' into for-linus/i2c-2638Ben Dooks
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>