aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-i801.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2009-10-04i2c: Hide probe errors caused by ACPI resource conflictsJean Delvare1-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>
2009-05-05i2c: Timeouts off by 1Roel Kluin1-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>
2009-03-30i2c-i801: Instantiate FSC hardware montioring chipsHans de Goede1-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>
2009-01-26i2c: Delete many unused adapter IDsJean Delvare1-1/+0
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-01-07Input: apanel - convert to new i2c bindingJean Delvare1-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>
2008-10-22i2c-i801: Add support for Intel Ibex PeakSeth Heasley1-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>
2008-07-14i2c: Drop stray references to lm_sensorsJean Delvare1-2/+0
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-07-14i2c: Check for ACPI resource conflictsJean Delvare1-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>
2008-07-14i2c-i801: Fix handling of error conditionsJean Delvare1-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>
2008-07-14i2c-i801: Rename local variable temp to statusJean Delvare1-33/+33
"temp" isn't a terribly well chosen name for a local variable. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-07-14i2c-i801: Properly report bus arbitration lossJean Delvare1-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>
2008-07-14i2c-i801: Remove verbose debugging messagesJean Delvare1-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>
2008-07-14i2c: Let bus drivers add SPD to their classJean Delvare1-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>
2008-07-14i2c: Consistently reject unsupported transactionsJean Delvare1-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>
2008-07-14i2c: Bus drivers return -Errno not -1David Brownell1-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>
2008-02-24i2c-i801: Add support for the ICH10Gaston, Jason D1-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>
2008-01-27i2c-i801: Implement I2C block read supportJean Delvare1-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>
2008-01-27i2c-i801: Clear special mode bits as neededJean Delvare1-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>
2008-01-27i2c-i801: More explicit names for chip featuresJean Delvare1-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>
2008-01-27i2c-i801: Document which chip support what featureJean Delvare1-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>
2007-10-13i2c: Rename the PEC functionality bitDavid Brownell1-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>
2007-10-13i2c-i801: Add support for the Intel Tolapai SMBusJason Gaston1-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>
2007-08-14i2c-i801: Typo: erroneousJean Delvare1-2/+2
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-07-12i2c-i801: Use the internal 32-byte buffer on ICH4+Oleg Ryjkov1-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>
2007-07-12i2c-i801: Various cleanupsOleg Ryjkov1-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>
2007-05-01i2c: Shrink struct i2c_clientDavid Brownell1-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>
2007-03-22i2c-i801: Restore the device state before leavingJean Delvare1-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>
2007-02-17Replace remaining references to "driverfs" with "sysfs".Robert P. J. Day1-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>
2007-02-14[PATCH] remove many unneeded #includes of sched.hTim Schmielau1-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>
2007-02-13i2c: Add IDs to adaptersStephen Hemminger1-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>
2007-02-13i2c-i801: Spelling fixJean Delvare1-1/+1
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2006-12-10i2c: Enable PEC on more i2c-i801 devicesJean Delvare1-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>
2006-12-01i2c-i801: SMBus patch for Intel ICH9Jason Gaston1-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>
2006-09-26i2c: Constify i2c_algorithm declarations, part 2Jean Delvare1-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>
2006-06-30[PATCH] i2c-801: 64bit resource fixAndrew Morton1-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>
2006-06-27[PATCH] i2c-i801.c: don't pci_disable_device() after it was just enabledDaniel Ritz1-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>
2006-06-22[PATCH] i2c-i801: Merge setup functionJean Delvare1-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>
2006-06-22[PATCH] i2c-i801: Better pci subsystem integrationJean Delvare1-11/+27
i2c-i801: Better pci subsystem integration Integrate the i2c-i801 driver better with the pci subsystem, by calling pci_{enable,disable}_device and requesting the I/O region by BAR rather than direct configuration space access. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-22[PATCH] i2c-i801: CleanupsJean Delvare1-19/+13
i2c-i801: Cleanups Various cleanups to the i2c-i801 driver: * Fix documentation file and self file name references. * i801_setup can be marked __devinit. * Drop useless error local variable and label in i801_setup. * Avoid a double PCI configuration register write in some cases. * Use symbolic names for SMBHSTCFG bits. * Transmit the error code returned by i801_setup instead of forcing it to an arbitrary value. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-22[PATCH] i2c-i801: Remove PCI function checkJean Delvare1-4/+0
i2c-i801: Remove PCI function check Remove the PCI function number check when probing devices. This check is redundant, each function has a separate PCI device ID, so checking for that ID is sufficient. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-22[PATCH] i2c-i801: Remove force_addr parameterJean Delvare1-28/+7
i2c-i801: Remove force_addr parameter Remove the force_addr module parameter. It doesn't appear to ever have been needed, and PCI resources shouldn't be arbitrarily changed anyway. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-22[PATCH] i2c-i801: Fix block transaction poll loopsJean Delvare1-2/+2
i2c-i801: Fix block transaction poll loops Two of the three poll loops have the poll and sleep swapped, causing an extra sleep to occur after the polled condition is fulfilled. In practice, this doubles the amount of sleep time for every block transaction. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-20[PATCH] i2c-i801: Fix resume when PEC is usedJean Delvare1-0/+5
Fix for bug #6395: Fail to resume on Tecra M2 with ADM1032 and Intel 82801DBM The BIOS of the Tecra M2 doesn't like it when it has to reboot or resume after the i2c-i801 driver has left the SMBus in PEC mode. The most simple fix is to clear the PEC bit after after every transaction. That's what this driver was doing up to 2.6.15 (inclusive). Thanks to Daniele Gaffuri for the very good report. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-06[PATCH] i2c-i801: I2C patch for Intel ICH8Jason Gaston1-0/+2
This patch adds the Intel ICH8 DID to the i2c-i801.c and Kconfig files for I2C support. Signed-off-by: Jason Gaston <Jason.d.gaston@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-05[PATCH] i2c: i2c-i801 explicitly enables/disables PECMark M. Hoffman1-5/+1
This patch tweaks i2c-i801.c so that the driver always sets the SMBAUXCTL register (which enables/disables PEC) explicitly before each transaction. Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-11-10[PATCH] PCI: removed unneeded .owner field from struct pci_driverGreg Kroah-Hartman1-1/+0
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[PATCH] i2c: i2c-i801 PEC code cleanupsJean Delvare1-14/+10
The tests leading to the use of hardware PEC in the i2c-i801 driver can be simplified. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[PATCH] i2c: SMBus PEC support rewrite, 3 of 3Jean Delvare1-8/+5
The new SMBus PEC implementation doesn't support PEC emulation on non-PEC non-I2C SMBus masters, so we can drop all related code. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[PATCH] i2c: SMBus PEC support rewrite, 1 of 3Jean Delvare1-2/+1
Discard I2C_FUNC_SMBUS_*_PEC defines. i2c clients are not supposed to check for PEC support of i2c bus drivers on individual SMBus transactions, and i2c bus drivers are not supposed to advertise them. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28[PATCH] Owner field additions to many i2c drivers, 1 of 5Laurent Riffard1-0/+1
This patch updates .owner field for various struct pci_driver variables. Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>