summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-i801.c
Commit message (Collapse)AuthorAgeFilesLines
* i2c-i801: Include <linux/slab.h>Ben Hutchings2011-01-101-0/+1
| | | | | | | | | | 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>
* i2c-i801: Add PCI idents for Patsburg 'IDF' SMBus controllersDavid Woodhouse2010-10-311-0/+12
| | | | | | | | 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>
* i2c-i801: Handle multiple instances instead of keeping global stateDavid Woodhouse2010-10-311-144/+175
| | | | | | | | | | 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>
* i2c-i801: Add Intel Patsburg device IDSeth Heasley2010-10-311-0/+2
| | | | | | | 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>
* PCI: update Intel chipset names and definesSeth Heasley2010-10-171-5/+5
| | | | | | | | | | | This patch updates the defines for Intel devices in include/linux/pci_ids.h, referenced in arch/x86/pci/irq.c and drivers/i2c/busses/i2c-i801.c, reflecting approved legal branding, and using fuller code-names for products under development. Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Seth Heasley <seth.heasley@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
* hwmon: Fix autoloading of fschmd on recent Fujitsu machinesJean Delvare2010-07-091-6/+2
| | | | | | | | | | | | | | Fujitsu slightly changed the DMI strings in their recent machines, (for example the D2778) and this breaks the automatic loading of the needed fschmd driver. Being more tolerant on string comparison fixes the issue. This closes bug #15634: https://bugzilla.kernel.org/show_bug.cgi?id=15634 Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Sergey Spiridonov <sena@hurd.homeunix.org> Cc: Hans de Goede <hdegoede@redhat.com>
* 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/+6
| | | | | | | | | | | | | | 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>
* i2c-i801: Don't use the block buffer for I2C block writesJean Delvare2010-03-131-2/+4
| | | | | | | | | | | Experience has shown that the block buffer can only be used for SMBus (not I2C) block transactions, even though the datasheet doesn't mention this limitation. Reported-by: Felix Rubinstein <felixru@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Oleg Ryjkov <oryjkov@gmail.com> Cc: stable@kernel.org
* i2c-i801: Add Intel Cougar Point device IDsSeth Heasley2010-03-021-1/+4
| | | | | | | Add the Intel Cougar Point (PCH) SMBus controller device IDs. Signed-off-by: Seth Heasley <seth.heasley@intel.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Make PCI device ids constantMárton Németh2010-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The id_table field of the struct pci_driver is constant in <linux/pci.h> so it is worth to make initialization data also constant. The semantic match that finds this kind of pattern is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ disable decl_init,const_decl_init; identifier I1, I2, x; @@ struct I1 { ... const struct I2 *x; ... }; @s@ identifier r.I1, y; identifier r.x, E; @@ struct I1 y = { .x = E, }; @c@ identifier r.I2; identifier s.E; @@ const struct I2 E[] = ... ; @depends on !c@ identifier r.I2; identifier s.E; @@ + const struct I2 E[] = ...; // </smpl> Signed-off-by: Márton Németh <nm127@freemail.hu> Cc: Julia Lawall <julia@diku.dk> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Retry on lost arbitrationJean Delvare2009-12-061-0/+3
| | | | | | | | The Intel 82801 is sometimes used on systems with a BMC connected. The BMC can access the SMBus, resulting in lost arbitration for the 82801. We should let i2c-core retry transactions for us in this case. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Hide probe errors caused by ACPI resource conflictsJean Delvare2009-10-041-1/+3
| | | | | | | | | | | | When an ACPI resource conflict is detected, error messages are already printed by ACPI. There's no point in causing the driver core to print more error messages, so return one of the error codes for which no message is printed. This fixes bug #14293: http://bugzilla.kernel.org/show_bug.cgi?id=14293 Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Timeouts off by 1Roel Kluin2009-05-051-4/+4
| | | | | | | | 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>
* i2c-i801: Instantiate FSC hardware montioring chipsHans de Goede2009-03-301-0/+77
| | | | | | | | | | | 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>
* i2c: Delete many unused adapter IDsJean Delvare2009-01-261-1/+0
| | | | Signed-off-by: Jean Delvare <khali@linux-fr.org>
* Input: apanel - convert to new i2c bindingJean Delvare2009-01-071-1/+49
| | | | | | | | | | | | | Convert the apanel driver to the new i2c device driver binding model, as the legacy model is going away soon. In the new model, the apanel driver is no longer scanning all the i2c adapters, instead the relevant bus driver (i2c-i801) is instantiating the device as needed. One side benefit is that the apanel driver will now load automatically on all systems where it is needed. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Stephen Hemminger <shemminger@linux-foundation.org>
* i2c-i801: Add support for Intel Ibex PeakSeth Heasley2008-10-221-0/+3
| | | | | | | Adds the Intel Ibex Peak (PCH) SMBus Controller Device IDs. Signed-off-by: Seth Heasley <seth.heasley@intel.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Drop stray references to lm_sensorsJean Delvare2008-07-141-2/+0
| | | | Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Check for ACPI resource conflictsJean Delvare2008-07-141-0/+5
| | | | | | | | | | | | Check for ACPI resource conflicts in i2c bus drivers. I've included all recent SMBus master drivers for PC hardware. I've voluntarily left out: * Drivers that don't run on PCs: they can't conflict with ACPI. * Bit-banged bus device drivers: it's very unlikely that ACPI would deal with such buses. Signed-off-by: Jean Delvare <jdelvare@suse.de>
* i2c-i801: Fix handling of error conditionsJean Delvare2008-07-141-98/+102
| | | | | | | | | | | | | Move the check of pre-transaction and post-transaction conditions to separate functions, and adjust them a bit. Having dedicated functions for that ensures that errors are handled in a consistent way. Bit HOST_BUSY of the status register is read-only, so writing to it is certainly not going to clear it. If this bit is set then we simply don't want to start the transaction, as it means that somebody else (ACPI, SMM?) is already using the controller. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Rename local variable temp to statusJean Delvare2008-07-141-33/+33
| | | | | | "temp" isn't a terribly well chosen name for a local variable. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Properly report bus arbitration lossJean Delvare2008-07-141-6/+4
| | | | | | | Bit BUS_ERR of the status register means that the ICH host controller lost the arbitration. Report this event as such. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Remove verbose debugging messagesJean Delvare2008-07-141-18/+0
| | | | | | | Dumping the register values before and after every transaction was useful during driver development but now it's only spamming the log. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Let bus drivers add SPD to their classJean Delvare2008-07-141-1/+1
| | | | | | | | | | | | | | | | | | Let general purpose I2C/SMBus bus drivers add SPD to their class. Once this is done, we will be able to tell the eeprom driver to only probe for SPD EEPROMs and similar on these buses. Note that I took a conservative approach here, adding I2C_CLASS_SPD to many drivers that have no idea whether they can host SPD EEPROMs or not. This is to make sure that the eeprom driver doesn't stop probing buses where SPD EEPROMs or equivalent live. So, bus driver maintainers and users should feel free to remove the SPD class from drivers those buses never have SPD EEPROMs or they don't want the eeprom driver to bind to them. Likewise, feel free to add the SPD class to any bus driver I might have missed. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Consistently reject unsupported transactionsJean Delvare2008-07-141-1/+0
| | | | | | | | | Many PC SMBus host controller drivers don't properly handle the case where they are requested to achieve a transaction they do not support. Update them so that the consistently print a warning message and return a single error value in this case. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Bus drivers return -Errno not -1David Brownell2008-07-141-21/+23
| | | | | | | | | | | | | | | Tighten error paths used by various i2c adapters (mostly x86) so they return real fault/errno codes instead of a "-1" (which is most often interpreted as "-EPERM"). Build tested, with eyeball review. One minor initial goal is to have adapters consistently return the code "-ENXIO" when addressing a device doesn't get an ACK response, at least in the probe paths where they are already good at stifling related logspam. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Add support for the ICH10Gaston, Jason D2008-02-241-2/+8
| | | | | | | | Add the Intel ICH10 SMBus Controller DeviceID's and updates Tolapai support. Signed-off-by: Jason Gaston <jason.d.gaston@intel.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Implement I2C block read supportJean Delvare2008-01-271-25/+54
| | | | | | | | | | | | I2C block read is supported since the ICH5. I couldn't get it to work using the block buffer, so it's using the old-style byte-by-byte mode for now. Note: I'm also updating the driver author... The i2c-i801 driver was really written by Mark Studebaker, even though he based his work on the i2c-piix4 driver which was written by Philip Edelbrock. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Clear special mode bits as neededJean Delvare2008-01-271-1/+6
| | | | | | | | | | Clear special mode bits (PEC, block buffer) at driver load time, you never know in which state the device was left by its last user. Also make sure that we reset the block buffer mode at the end of every transaction, not only when PEC was used. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: More explicit names for chip featuresJean Delvare2008-01-271-9/+15
| | | | | | | Use separate flags with explicit names to describe the features of the ICH chip. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Document which chip support what featureJean Delvare2008-01-271-24/+33
| | | | | | | Provide a clearer documentation of which additional features each ICH chip support, and which of these the driver supports. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Rename the PEC functionality bitDavid Brownell2007-10-131-1/+1
| | | | | | | | | | | | Rename I2C_FUNC_SMBUS_HWPEC_CALC as I2C_FUNC_SMBUS_PEC, and list that functionality as always available through the software implementation. Update documentation accordingly (and list similar requirements). The way it's currently packaged doesn't present the capability in a useful way. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Add support for the Intel Tolapai SMBusJason Gaston2007-10-131-0/+3
| | | | | | | Add the Intel Tolapai SMBus Controller DID. Signed-off-by: Jason Gaston <jason.d.gaston@intel.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Typo: erroneousJean Delvare2007-08-141-2/+2
| | | | Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Use the internal 32-byte buffer on ICH4+Oleg Ryjkov2007-07-121-51/+100
| | | | | | | | | | | | | | | | Add an ability to utilize the internal SRAM buffer on ICH4 and newer host controllers to speed up execution of block operations. I've split the code so that it is more clear which block transaction is performed. First of all the host controller's type is identified. isich4 is set when we think that the controller has the internal buffer. Then, before every block transaction, if isich4 is set, we attempt to enable the E32B bit in SMBAUXCTL register. Signed-off-by: Oleg Ryjkov <olegr@google.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Various cleanupsOleg Ryjkov2007-07-121-41/+75
| | | | | | | | | * Use defines instead of raw numbers for register bits * Fix several wrong indentations and trailing whitespace * Move hwpec timeout checking to a separate function Signed-off-by: Oleg Ryjkov <olegr@google.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Shrink struct i2c_clientDavid Brownell2007-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | This shrinks the size of "struct i2c_client" by 40 bytes: - Substantially shrinks the string used to identify the chip type - The "flags" don't need to be so big - Removes some internal padding It also adds kerneldoc for that struct, explaining how "name" is really a chip type identifier; it's otherwise potentially confusing. Because the I2C_NAME_SIZE symbol was abused for both i2c_client.name and for i2c_adapter.name, this needed to affect i2c_adapter too. The adapters which used that symbol now use the more-obviously-correct idiom of taking the size of that field. JD: Shorten i2c_adapter.name from 50 to 48 bytes while we're here, to avoid wasting space in padding. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Restore the device state before leavingJean Delvare2007-03-221-0/+25
| | | | | | | | | | | | | Restore the original host configuration on driver unload and on suspend. In particular this returns the SMBus master in I2C mode if it was originally in I2C mode, which should help with suspend/resume if the BIOS expects to find the SMBus master in I2C mode. This fixes bug #6449 (for real this time.) http://bugzilla.kernel.org/show_bug.cgi?id=6449 Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Tommi Kyntola <tommi.kyntola@ray.fi>
* Replace remaining references to "driverfs" with "sysfs".Robert P. J. Day2007-02-171-1/+1
| | | | | | | Globally, s/driverfs/sysfs/g. Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Adrian Bunk <bunk@stusta.de>
* [PATCH] remove many unneeded #includes of sched.hTim Schmielau2007-02-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | After Al Viro (finally) succeeded in removing the sched.h #include in module.h recently, it makes sense again to remove other superfluous sched.h includes. There are quite a lot of files which include it but don't actually need anything defined in there. Presumably these includes were once needed for macros that used to live in sched.h, but moved to other header files in the course of cleaning it up. To ease the pain, this time I did not fiddle with any header files and only removed #includes from .c-files, which tend to cause less trouble. Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha, arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig, allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all configs in arch/arm/configs on arm. I also checked that no new warnings were introduced by the patch (actually, some warnings are removed that were emitted by unnecessarily included header files). Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* i2c: Add IDs to adaptersStephen Hemminger2007-02-131-0/+1
| | | | | | | | | IDs have been defined but not used by most of the I2C adapters. By having a unique ID, clients can check for correct connection during probe. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-i801: Spelling fixJean Delvare2007-02-131-1/+1
| | | | Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Enable PEC on more i2c-i801 devicesJean Delvare2006-12-101-4/+12
| | | | | | | | Enable PEC on recent Intel SMBus controllers (ICH6, ICH7, ICH8, ICH9 and ESB2.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Jason Gaston <jason.d.gaston@intel.com>
* i2c-i801: SMBus patch for Intel ICH9Jason Gaston2006-12-011-0/+2
| | | | | | | | | This updated patch adds the Intel ICH9 LPC and SMBus Controller DID's. Thi= s patch relies on the irq ICH9 patch to pci_ids.h. Signed-off-by: Jason Gaston <jason.d.gaston@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* i2c: Constify i2c_algorithm declarations, part 2Jean Delvare2006-09-261-1/+1
| | | | | | | | | | | | i2c: Constify i2c_algorithm declarations, part 2 Make struct i2c_algorithm declarations const in all i2c bus drivers where it is possible. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] i2c-801: 64bit resource fixAndrew Morton2006-06-301-2/+2
| | | | | | | | | | | drivers/i2c/busses/i2c-i801.c: In function 'i801_probe': drivers/i2c/busses/i2c-i801.c:496: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'resource_size_t' Cc: Greg KH <greg@kroah.com> Cc: Vivek Goyal <vgoyal@in.ibm.com> Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] i2c-i801.c: don't pci_disable_device() after it was just enabledDaniel Ritz2006-06-271-6/+10
| | | | | | | | | | | | | | | | | | Commit 02dd7ae2892e5ceff111d032769c78d3377df970 ("[PATCH] i2c-i801: Merge setup function") has a missing return 0 in the _probe() function. This means the error path is always executed and pci_disable_device() is called even when the device just got successfully enabled. Having the SMBus device disabled makes some systems (eg. Fujitsu-Siemens Lifebook E8010) hang hard during power-off. Intead of reverting the whole commit this patch fixes it up: - don't ever call pci_disable_device(), also not in the _remove() function to avoid hangs - fix missing pci_release_region() in error path Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] i2c-i801: Merge setup functionJean Delvare2006-06-221-66/+55
| | | | | | | | | | | | | | | i2c-i801: Merge setup function Merge i801_setup into i801_probe, as it doesn't make much sense to have them split. This lets us handle errors better. Christopher Hellwig had been suggesting this back in March 2003 when the driver was merged. Also drop two useless debug messages (revision and base address can be obtained from lspci, procfs or sysfs.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud