summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-i801.c
AgeCommit message (Collapse)Author
2014-11-07i2c: remove FSF addressWolfram Sang
We have a central copy of the GPL for that. Some addresses were already outdated. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2014-10-16i2c: i801: Add Device IDs for Intel Sunrise Point PCHjames.d.ralston@intel.com
This patch adds the I2C/SMBus Device IDs for the Intel Sunrise Point PCH. Signed-off-by: James Ralston <james.d.ralston@intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-08-19i2c: i801: Add PCI ID for Intel BraswellAlan Cox
The SMBus host controller is the same as used in Baytrail so add the new PCI ID to the driver's list of supported IDs. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-07-17i2c: i801: Add device ID for Intel Wildcat Point PCHJean Delvare
Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-07-17i2c: i801: Fix the alignment of the device tableJean Delvare
A long name broke the alignment, shift the columns a bit to fix it and make the table look nice again. While we're here, switch to the standard comment style to make checkpatch happy, and use tabs instead of spaces for column alignment. Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-03-13i2c: remove DEFINE_PCI_DEVICE_TABLE macroJingoo Han
Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro is not preferred. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-03-09i2c: i801: enable Intel BayTrail SMBUSChew, Kean ho
Add Device ID of Intel BayTrail SMBus Controller. Signed-off-by: Chew, Kean ho <kean.ho.chew@intel.com> Signed-off-by: Chew, Chiau Ee <chiau.ee.chew@intel.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-01-29Update Jean Delvare's e-mail addressJean Delvare
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2013-11-14i2c: i801: Add Device IDs for Intel Wildcat Point-LP PCHJames Ralston
This patch adds the SMBus Device IDs for the Intel Wildcat Point-LP PCH. Signed-off-by: James Ralston <james.d.ralston@intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-08-23i2c: move OF helpers into the coreWolfram Sang
I2C of helpers used to live in of_i2c.c but experience (from SPI) shows that it is much cleaner to have this in the core. This also removes a circular dependency between the helpers and the core, and so we can finally register child nodes in the core instead of doing this manually in each driver. So, fix the drivers and documentation, too. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-06-20i2c: i801: SMBus patch for Intel Coleto Creek DeviceIDsSeth Heasley
This patch adds the i801 SMBus Controller DeviceIDs for the Intel Coleto Creek PCH. Signed-off-by: Seth Heasley <seth.heasley@intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-05-17i2c: i801: Document feature bits in modinfoJean Delvare
Duplicate the feature bits documentation in modinfo, as not every user will read the driver's source code or documentation file. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-02-22i2c: Remove unneeded xxx_set_drvdata(..., NULL) callsDoug Anderson
There is simply no reason to be manually setting the private driver data to NULL in the remove/fail to probe cases. This is just extra cruft code that can be removed. A few notes: * Nothing relies on drvdata being set to NULL. * The __device_release_driver() function eventually calls dev_set_drvdata(dev, NULL) anyway, so there's no need to do it twice. * I verified that there were no cases where xxx_get_drvdata() was being called in these drivers and checking for / relying on the NULL return value. This could be cleaned up kernel-wide but for now just take the baby step and remove from the i2c subsystem. Reported-by: Wolfram Sang <wsa@the-dreams.de> Reported-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Jean Delvare <khali@linux-fr.org> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
2013-02-15i2c: i801: Add Device IDs for Intel Wellsburg PCHJames Ralston
This patch adds the SMBus Device IDs for the Intel Wellsburg PCH Signed-off-by: James Ralston <james.d.ralston@intel.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
2013-02-08i2c: i801: SMBus patch for Intel Avoton DeviceIDsSeth Heasley
This patch adds the PCU SMBus DeviceID for the Intel Avoton SOC. Signed-off-by: Seth Heasley <seth.heasley@intel.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
2012-12-22i2c: remove __dev* attributes from subsystemBill Pemberton
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Peter Korsgaard <peter.korsgaard@barco.com> (for ocores and mux-gpio) Acked-by: Havard Skinnemoen <hskinnemoen@gmail.com> (for i2c-gpio) Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn> (for puf3) Acked-by: Barry Song <baohua.song@csr.com> (for sirf) Reviewed-by: Jean Delvare <khali@linux-fr.org> [wsa: Fixed "foo* bar" flaws while we are here] Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
2012-12-16i2c-i801: Enable interrupts for all post-ICH5 chipsJean Delvare
I did not receive a single bug report after interrupt support was added for a limited number of chips. So I'd say the code is good and should be enabled for all supported chips, that is: ICH5 and later. Signed-off-by: Jean Delvare <khali@linux-fr.org> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
2012-12-16i2c-i801: Add device tree supportThierry Reding
Add support for probing slave devices parsed from the device tree. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-10-28i2c-i801: Fix commentJean Delvare
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-10-28i2c-i801: Simplify dependency towards GPIOLIBJean Delvare
Arbitrarily selecting GPIOLIB causes trouble on some architectures, so don't do that. Instead, just make the optional multiplexing code depend on CONFIG_I2C_MUX_GPIO instead of CONFIG_I2C_MUX for now. We can revisit if the i2c-i801 driver ever supports other multiplexing flavors. Also make that optional code depend on DMI, as it won't do anything without that. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Fengguang Wu <fengguang.wu@intel.com>
2012-10-05i2c-i801: Let i2c-mux-gpio find the GPIO chipJean Delvare
Now that i2c-mux-gpio is able to find the GPIO chip by itself, we can delegate this task. The great thing here is that i2c-mux-gpio can defer device probing until the gpio chip is available, so we no longer depend on the module loading order. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-10-05i2c-i801: Support SMBus multiplexing on Asus Z8 seriesJean Delvare
Add support for SMBus multiplexing on Asus Z8 motherboard series. On these boards, the memory slots are behind a GPIO-controlled I2C multiplexer. Models with 6 or 12 memory slots have 2 segments behind the multiplexer, while models with 18 memory slots have 3 such segments. On these boards, only the memory slots are behind the multiplexer, so it is possible to keep the autodetection mechanism. The code is generic enough so it could work on other boards as long as the multiplexer is controlled by GPIO pins. For other forms of multiplexing (for example using an I2C device) additional code will be needed. Thanks to Asus for providing a board to develop and test this feature, as well as all the technical information required. At the moment, the GPIO driver must be loaded before the i2c-i801 driver, but I hope to solve this soon, using deferred probing on the i2c-mux-gpio side. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-09-10i2c-i801: Add Device IDs for Intel Lynx Point-LP PCHJames Ralston
Add the SMBus Device IDs for the Intel Lynx Point-LP PCH. Signed-off-by: James Ralston <james.d.ralston@intel.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-07-24i2c-i801: Enable IRQ for byte_by_byte transactionsDaniel Kurtz
Byte-by-byte transactions are used primarily for accessing I2C devices with an SMBus controller. For these transactions, for each byte that is read or written, the SMBus controller generates a BYTE_DONE IRQ. The isr reads/writes the next byte, and clears the IRQ flag to start the next byte. On the penultimate IRQ, the isr also sets the LAST_BYTE flag. There is no locking around the cmd/len/count/data variables, since the I2C adapter lock ensures there is never multiple simultaneous transactions for the same device, and the driver thread never accesses these variables while interrupts might be occurring. The end result is faster I2C block read and write transactions. Note: This patch has only been tested and verified by doing I2C read and write block transfers on Cougar Point 6 Series PCH, as well as I2C read block transfers on ICH5. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-07-24i2c-i801: Enable interrupts on ICH5/7/8/9/10Jean Delvare
Enable interrupts on more devices. ICH5, ICH7(-M) and ICH10 have been tested to work OK. ICH8 and ICH9 are expected to work just fine as they are very close to ICH7 and ICH10. Ultimately we want to enable this feature on at least every device since the ICH5, but for now we limit the exposure. We'll enable it for other devices if we don't get negative feedback. As a bonus, let the user know when interrupts are used. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Daniel Kurtz <djkurtz@chromium.org>
2012-07-24i2c-i801: Enable IRQ for SMBus transactionsDaniel Kurtz
Add a new 'feature' to i2c-i801 to enable using PCI interrupts. When the feature is enabled, then an isr is installed for the device's PCI IRQ. An I2C/SMBus transaction is always terminated by one of the following interrupt sources: FAILED, BUS_ERR, DEV_ERR, or on success: INTR. When the isr fires for one of these cases, it sets the ->status variable and wakes up the waitq. The waitq then saves off the status code, and clears ->status (in preparation for some future transaction). The SMBus controller generates an INTR irq at the end of each transaction where INTREN was set in the HST_CNT register. No locking is needed around accesses to priv->status since all writes to it are serialized: it is only ever set once in the isr at the end of a transaction, and cleared while no interrupts can occur. In addition, the I2C adapter lock guarantees that entire I2C transactions for a single adapter are always serialized. For this patch, the INTREN bit is set only for SMBus block, byte and word transactions, but not for I2C reads or writes. The use of the DS (BYTE_DONE) interrupt with byte-by-byte I2C transactions is implemented in a subsequent patch. The interrupt feature has only been enabled for COUGARPOINT hardware. In addition, it is disabled if SMBus is using the SMI# interrupt. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-07-24i2c-i801: Consolidate pollingJean Delvare
(Based on earlier work by Daniel Kurtz.) Come up with a consistent, driver-wide strategy for event polling. For intermediate steps of byte-by-byte block transactions, check for BYTE_DONE or any error flag being set. At the end of every transaction (regardless of PEC being used), check for both BUSY being cleared and INTR or any error flag being set. This ensures proper action for all transaction types. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Daniel Kurtz <djkurtz@chromium.org>
2012-07-24i2c-i801: Drop ENABLE_INT9Daniel Kurtz
Later patches enable interrupts. This preliminary patch removes the older unsupported ENABLE_INT9 flag. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-07-24i2c-i801: Rename some SMBHSTCNT bit constantsDaniel Kurtz
Rename the SMBHSTCNT register bit access constants to match the style of other register bits. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-07-24i2c-i801: Check and return errors during byte-by-byte transfersDaniel Kurtz
If an error is detected in the polling loop, abort the transaction and return an error code. * DEV_ERR is set if the device does not respond with an acknowledge, and the SMBus controller times out (minimum 25ms). * BUS_ERR is set if a bus arbitration collision is detected. In other words, when the SMBus controller tries to generate a START condition, but detects that the SMBDATA is being held low, usually by another SMBus/I2C master. * FAILED is only set if a transaction is stopped by software (using the SMBHSTCNT KILL bit). Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-07-24i2c-i801: Clear only status bits in HST_STSDaniel Kurtz
Writing back the whole status register could clear unwanted bits. In particular, it could clear the "INUSE_STS" bit, which is a 'hardware semaphore', that might be useful to use some day. To prepare for this, let's ban writing back the whole status to register HST_STS, of which this is the only instance. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-07-24i2c-i801: Refactor use of LAST_BYTE in i801_block_transaction_byte_by_byteDaniel Kurtz
As a slight optimization, pull some logic out of the polling loop during byte-by-byte transactions by just setting the I801_LAST_BYTE bit, as defined in the i801 (PCH) datasheet, when reading the last byte of a byte-by-byte I2C_SMBUS_READ. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-03-26i2c-i801: Use usleep_range to wait for command completionJean Delvare
Use usleep_range instead of msleep when waiting for command completion. Most SMBus commands complete in less than 2 jiffies so this brings a pleasant performance boost. Strongly inspired from a similar change by Olivier Sobrie to the i2c-isch driver. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Olivier Sobrie <olivier@sobrie.be>
2012-03-26i2c-i801: Add device IDs for Intel Lynx PointSeth Heasley
Add the SMBus controller device IDs for the Intel Lynx Point PCH. Signed-off-by: Seth Heasley <seth.heasley@intel.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-01-12i2c: Convert to DEFINE_PCI_DEVICE_TABLEAxel Lin
Convert static struct pci_device_id *[] to static DEFINE_PCI_DEVICE_TABLE tables. Use DEFINE_PCI_DEVICE_TABLE ensures we make the pci_device_id table const and marked as __devinitconst. This also fixes some warnings from checkpatch: e.g. WARNING: Use DEFINE_PCI_DEVICE_TABLE for struct pci_device_id #1096: FILE: i2c/busses/i2c-intel-mid.c:1096: +static struct pci_device_id intel_mid_i2c_ids[] = { Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Rudolf Marek <r.marek@assembler.cz> Cc: Ben Dooks <ben-linux@fluff.org> Acked-by: Olof Johansson <olof@lixom.net> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Acked-by: Dirk Brandewie <dirk.brandewie@gmail.com> Cc: Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Cc: Feng Tang <feng.tang@intel.com> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-05-24i2c-i801: Don't depend on other kernel driver config optionsJean Delvare
Don't let other driver config options influence us, as it makes the code more complex and fragile for a small benefit. There's nothing wrong with instantiating I2C devices even if they don't have a driver. And we're talking about 835 extra bytes in the binary on x86-64, that's hardly worth arguing about. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: David Woodhouse <david.woodhouse@intel.com> Cc: Hans de Goede <hdegoede@redhat.com>
2011-05-24i2c-i801: Check for vendor Fujitsu before probing for apanelJean Delvare
Scanning the BIOS memory for the apanel information is costly, so avoid doing it on non-Fujitsu machines. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-05-24i2c-i801: Don't probe for slaves on IDF channelsJean Delvare
I don't know if Fujitsu is ever going to produce Patsburg-based machines, but if they do, I'd rather not probe the secondary (IDF) SMBus channels. At least not until we have a good reason for doing so. On a side note, I'm not even sure if it is right to enable detection of HWMON and DDC devices on the IDF channels. Time will tell... Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Acked-by: David Woodhouse <David.Woodhouse@intel.com>
2011-05-24i2c-i801: SMBus patch for Intel Panther Point DeviceIDsSeth Heasley
This patch adds the SMBus controller DeviceID for the Intel Panther Point PCH. Signed-off-by: Seth Heasley <seth.heasley@intel.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2011-05-23Merge 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) PCI: Don't use dmi_name_in_vendors in quirk PCI: remove unused AER functions PCI/sysfs: move bus cpuaffinity to class dev_attrs PCI: add rescan to /sys/.../pci_bus/.../ PCI: update bridge resources to get more big ranges when allocating space (again) KVM: Use pci_store/load_saved_state() around VM device usage PCI: Add interfaces to store and load the device saved state PCI: Track the size of each saved capability data area PCI/e1000e: Add and use pci_disable_link_state_locked() x86/PCI: derive pcibios_last_bus from ACPI MCFG PCI: add latency tolerance reporting enable/disable support PCI: add OBFF enable/disable support PCI: add ID-based ordering enable/disable support PCI hotplug: acpiphp: assume device is in state D0 after powering on a slot. PCI: Set PCIE maxpayload for card during hotplug insertion PCI/ACPI: Report _OSC control mask returned on failure to get control x86/PCI: irq and pci_ids patch for Intel Panther Point DeviceIDs PCI: handle positive error codes PCI: check pci_vpd_pci22_wait() return PCI: Use ICH6_GPIO_EN in ich6_lpc_acpi_gpio ... Fix up trivial conflicts in include/linux/pci_ids.h: commit a6e5e2be4461 moved the intel SMBUS ID definitons to the i2c-i801.c driver.
2011-05-01i2c-i801: Move device ID definitions to driverJean Delvare
Move the SMBus device ID definitions of recent devices from pci_ids.h to the i2c-i801.c driver file. They don't have to be shared, as they are clearly identified and only used in this driver. In the future, such IDs will go to i2c-i801 directly. This will make adding support for new devices much faster and easier, as it will avoid cross- subsystem patch sets and merge conflicts. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Seth Heasley <seth.heasley@intel.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-20i2c-i801: SMBus patch for Intel DH89xxCC DeviceIDsSeth Heasley
Add the SMBus Controller DeviceIDs for the Intel DH89xxCC PCH. Signed-off-by: Seth Heasley <seth.heasley@intel.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>
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-17PCI: update Intel chipset names and definesSeth Heasley
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>
2010-07-09hwmon: Fix autoloading of fschmd on recent Fujitsu machinesJean Delvare
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>
2010-05-21i2c-i801: Fix all checkpatch warningsIvo Manca
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>