Convert the i2c-au1550 bus driver to platform driver, and
register a platform device for the Alchemy Db/Pb series of
boards.
Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Zero-bytes transfers would leave the bus transaction unfinished
(no i2c stop is sent), with the following transfer actually
sending the slave address to the previously addressed device,
resulting in weird device failures (e.g. reset minute register
values in my RTC).
This patch instructs the controller to send an I2C STOP right after
the slave address in case of a zero-byte transfer.
Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Propagate the error values returned by i2c_wait() instead of overriding
them with a meaningless -1.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Add support for another variant of the VT8237. I couldn't test
I2C block support but I assume it is present as well.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Checking the PCI function number doesn't add any value, and it makes
adding dynamic IDs to the driver more difficult. Drop this check.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
The i2c-amd756 and i2c-viapro drivers make use of the driver_data
field of the PCI device ID. When adding device IDs dynamically (by
writing to the new_id sysfs file) you cannot set the value of this
field by default. It has to be allowed explicitly. Do that, and
check the value so that the user can't crash the kernel accidentally.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Add polling I2C transfer implementation for PXA I2C. This is needed
for cases where I2C transactions have to occur at times interrups are
disabled.
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
The implementation is unsafe, and anyway one can achieve the same from
userspace using i2c-dev + i2cdetect.
Also tag i2c_sibyte_add_bus __init.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
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>
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>
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>
The framebuffer drivers for these pieces of hardware include support
for the DDC/I2C buses, so there is no need for separate drivers.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
I2C adapter drivers are supposed to handle retries on nack by themselves
if they do, so there's no point in setting .retries if they don't.
As this retry mechanism is going away (at least in its current form),
clean this up now so that we don't get build failures later.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
remove #ifdef CONFIG_PXA27x .. #endif and use cpu_is_pxaXXXX() macros
so that a single binary can support PXA25x/PXA27x/PXA3xx at run-time.
Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
This patch contains the overdue removal of three I2C drivers.
[JD: In fact only i2c-ixp4xx can be removed at the moment, the other two
platforms don't implement the generic GPIO layer yet.]
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Use numbered adapter registration to always have the same hardware bus
show up at the same number.
PWRficient 1682M has three buses, they are all on the same PCI device but
different functions. So do the simple thing and register them based on
function number. Future products, if having a different number of busses,
are expected to have similar behaviour w.r.t. device/function layout.
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
My guess is that all the chips supported by this driver support block
transactions and reset, but for now we play it safe and only list the
ones for which this was actually tested.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Oleg Ryjkov <olegr@olegr.ca>
I2C adapter drivers are supposed to handle retries on nack by themselves
if they do, so there's no point in setting .retries if they don't.
As this retry mechanism is going away (at least in its current form),
clean this up now so that we don't get build failures later.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Mark A. Greer <mgreer@mvista.com>
The motivation for this change is to allow other chips, like the
Marvell Orion ARM SoC family, to use the existing i2c-mv64xxx driver.
Signed-off-by: Tzachi Perelstein <tzachi@marvell.com>
Acked-by: Nicolas Pitre <nico@marvell.com>
Acked-by: Dale Farnsworth <dale@farnsworth.org>
Acked-by: Mark A. Greer <mgreer@mvista.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
If the registration of the second I2C channel fails, we really want to
unregister the first one before we return with an error.
While we're here, fix the printk right above so that it displays the
real driver name.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
This patch fixes bug #9581 reported by Marcio Buss. If kzalloc fails,
omap_i2c_write_reg() tries to reset an unallocated I2C controller.
Cc: Marcio Buss <marciobuss@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
This is required to let hwmon drivers attach to the adapter.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Turns out we don't actually check the status to see if there was a
device out there to talk to, just if we had a timeout when doing so.
Add the proper check, so we don't falsly think there are devices
on the bus that are not there, etc.
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Most of these fixes were already submitted for old kernel versions, and were
approved, but for some reason they never made it into the releases.
Because this is a consolidation of a couple old missed patches, it touches both
Kconfigs and documentation texts.
Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
* Convert files to UTF-8.
* Also correct some people's names
(one example is Eißfeldt, which was found in a source file.
Given that the author used an ß at all in a source file
indicates that the real name has in fact a 'ß' and not an 'ss',
which is commonly used as a substitute for 'ß' when limited to
7bit.)
* Correct town names (Goettingen -> Göttingen)
* Update Eberhard Mönkeberg's address (http://lkml.org/lkml/2007/1/8/313)
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
i2c-pxa, rename BIT macro to PXA_BIT
BIT macro will be global definiton of (1 << x)
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Nicolas Pitre <nico@cam.org>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Found these while looking at printk uses.
Add missing newlines to dev_<level> uses
Add missing KERN_<level> prefixes to multiline dev_<level>s
Fixed a wierd->weird spelling typo
Added a newline to a printk
Signed-off-by: Joe Perches <joe@perches.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Tilman Schmidt <tilman@imap.cc>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Greg KH <greg@kroah.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Cc: James Smart <James.Smart@Emulex.Com>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (95 commits)
[ARM] 4578/1: CM-x270: PCMCIA support
[ARM] 4577/1: ITE 8152 PCI bridge support
[ARM] 4576/1: CM-X270 machine support
[ARM] pxa: Avoid pxa_gpio_mode() in gpio_direction_{in,out}put()
[ARM] pxa: move pxa_set_mode() from pxa2xx_mainstone.c to mainstone.c
[ARM] pxa: move pxa_set_mode() from pxa2xx_lubbock.c to lubbock.c
[ARM] pxa: Make cpu_is_pxaXXX dependent on configuration symbols
[ARM] pxa: PXA3xx base support
[NET] smc91x: fix PXA DMA support code
[SERIAL] Fix console initialisation ordering
[ARM] pxa: tidy up arch/arm/mach-pxa/Makefile
[ARM] Update arch/arm/Kconfig for drivers/Kconfig changes
[ARM] 4600/1: fix kernel build failure with build-id-supporting binutils
[ARM] 4599/1: Preserve ATAG list for use with kexec (2.6.23)
[ARM] Rename consistent_sync() as dma_cache_maint()
[ARM] 4572/1: ep93xx: add cirrus logic edb9307 support
[ARM] 4596/1: S3C2412: Correct IRQs for SDI+CF and add decoding support
[ARM] 4595/1: ns9xxx: define registers as void __iomem * instead of volatile u32
[ARM] 4594/1: ns9xxx: use the new gpio functions
[ARM] 4593/1: ns9xxx: implement generic clockevents
...
This patch is to add an abort function that will bring back the MCP51/55
controller if it was blocked by a block-read operation, in particular.
(When a slave sends a wrong byte count on a byte read, the host gets
locked up). I've only tested it on an MCP51 and MCP55. However, I'm
almost certain it will also work on MCP65, I just did not have the board
to test it on. Thus for now the abort function will only be called
if an MCP51/55 was detected.
Signed-off-by: Oleg Ryjkov <olegr@olegr.ca>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
This is the first part of the patch that adds a function to reset the
nvidia MCP51/55 i2c controller, if something bad happens to it (e.g.
a slave sends a wrong byte count during a block transaction).
This patch just adds nforce2_check_status function. It was originally
written by Hans-Frieder Vogt.
The reason that I'm the one sending it is:
- I relied on it for the second part of the patch,
- It makes the driver code cleaner/better.
Signed-off-by: Oleg Ryjkov <olegr@olegr.ca>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Fix a "mis-used register" problem on the AMD MIPS Alchemy au1550
I2C interface.
In summary, the programmable serial controller seems to hang the kernel
when I send a single 'address' byte on the I2C bus. The patch
essentially uses the PSC_SMBSTAT register's TE (transmit FIFO empty)
bit to check when the transmit FIFO is empty, instead of using the
PSC_SMBEVNT register's TU (transmit underflow) bit. Using the TE bit
fixed the hang problem.
Signed-off-by: Chris David <cd@chrisdavid.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
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>
Mark the i2c-at91 driver BROKEN in Kconfig, and explain just
why it's broken. (Summary: hardware design issues.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
This removes NOP implementations of i2c_algorithm.algo_control.
With this change, there are no implementations of this hook in
the kernel.org tree ... that hook seems about ripe to remove.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Add support for multiple chips to i2c-stub. I've changed the memory
allocation scheme from static to dynamic, so that we don't waste too
much memory.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Mark M. Hoffman <mhoffman@lightlink.com>
Remove this unneeded mutex. Indeed it was used to serialize access to
the hardware, but this is already done by the i2c-core layer, see
'bus_lock' mutex used by i2c_transfer().
Signed-off-by: Francis Moreau <francis.moro@gmail.com>
Acked-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Vladimir Barinov <vbarinov@ru.mvista.com>
Acked-by: Trilok Soni <soni.trilok@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Use i2c_bit_add_numbered_adapter() if device id specified, so that the
i2c-ibm_iic adapter works well with new-style pre-declared devices.
Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
It turns out that platform_device.id is a "u32" so testing it for being
nonnegative is useless when setting up an i2c adapte. Instead,
do what the platform_bus code does and test it against the value "-1".
Signed-off-by: Jean Delvare <khali@linux-fr.org>
It turns out that platform_device.id is a "u32" so testing it for being
nonnegative is useless when setting up an i2c bitbang device. Instead,
do what the platform_bus code does and test it against the value "-1".
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
We find that SB700 and SB800 use the same SMBus device ID as SB600, which is
0x4385, instead of the already submitted 0x4395.
Besides removing the wrong SB700 device ID, add SB800 support to kernel, by
renaming the PCI_DEVICE_ID_ATI_IXP600_SMBUS into
PCI_DEVICE_ID_ATI_SBX00_SMBUS.
Signed-off-by: Shane Huang <shane.huang@amd.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Fixup the include files after the arch moves that
where included in 2.6.23.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Under certain conditions, the mv64xxx I2C bus can hang preventing
further operation. To make the driver more robust, we now reset
the I2C hardware and the driver state machine when such hangs are
detected.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Acked-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Disabling module on stop doesn't work on some CPUs (ie. mpc8241,
as reported by Guennadi Liakhovetski), so remove that.
Disable I2C module on errors/interrupts to prevent it from
locking up on mpc5200b.
Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
In order to be able to use sensors on the IOP3xx SoCs, one needs to set
the adapter class to I2C_CLASS_HWMON.
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
* 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6: (44 commits)
i2c: Delete the i2c-isa pseudo bus driver
hwmon: refuse to load abituguru driver on non-Abit boards
hwmon: fix Abit Uguru3 driver detection on some motherboards
hwmon/w83627ehf: Be quiet when no chip is found
hwmon/w83627ehf: No need to initialize fan_min
hwmon/w83627ehf: Export the thermal sensor types
hwmon/w83627ehf: Enable VBAT monitoring
hwmon/w83627ehf: Add support for the VID inputs
hwmon/w83627ehf: Fix timing issues
hwmon/w83627ehf: Add error messages for two error cases
hwmon/w83627ehf: Convert to a platform driver
hwmon/w83627ehf: Update the Kconfig entry
make coretemp_device_remove() static
hwmon: Add LM93 support
hwmon: Improve the pwmN_enable documentation
hwmon/smsc47b397: Don't report missing fans as spinning at 82 RPM
hwmon: Add support for newer uGuru's
hwmon/f71805f: Add temperature-tracking fan control mode
hwmon/w83627ehf: Preserve speed reading when changing fan min
hwmon: fix detection of abituguru volt inputs
...
Manual fixup of trivial conflict in MAINTAINERS file
It depends on tristate I2C and it's trivial to make modular. The
current Kconfig allows I2C=m, I2C_ACORN=y, which doesn't work at
all; alternatives are dependency on I2C=y and making I2C_ACORN
itself a tristate. The latter is the right thing to do...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (34 commits)
PCI: Only build PCI syscalls on architectures that want them
PCI: limit pci_get_bus_and_slot to domain 0
PCI: hotplug: acpiphp: avoid acpiphp "cannot get bridge info" PCI hotplug failure
PCI: hotplug: acpiphp: remove hot plug parameter write to PCI host bridge
PCI: hotplug: acpiphp: fix slot poweroff problem on systems without _PS3
PCI: hotplug: pciehp: wait for 1 second after power off slot
PCI: pci_set_power_state(): check for PM capabilities earlier
PCI: cpci_hotplug: Convert to use the kthread API
PCI: add pci_try_set_mwi
PCI: pcie: remove SPIN_LOCK_UNLOCKED
PCI: ROUND_UP macro cleanup in drivers/pci
PCI: remove pci_dac_dma_... APIs
PCI: pci-x-pci-express-read-control-interfaces cleanups
PCI: Fix typo in include/linux/pci.h
PCI: pci_ids, remove double or more empty lines
PCI: pci_ids, add atheros and 3com_2 vendors
PCI: pci_ids, reorder some entries
PCI: i386: traps, change VENDOR to DEVICE
PCI: ATM: lanai, change VENDOR to DEVICE
PCI: Change all drivers to use pci_device->revision
...
This driver has been broken forever. It depends on i2c-algo-8xx which
has never been in the mainline kernel.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Work around a problem reported on:
http://ozlabs.org/pipermail/linuxppc-embedded/2005-July/019038.html
Without this patch I2C on mpc5200 becomes unusable after a while.
Tested on mpc5200 boards by Matthias Fechner and me.
Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Add TWI driver for the PMC-Sierra MSP71xx devices.
[JD: Drop the probe hack, don't set algo_data as we never use it, return
the right error code if the driver registration fails.]
Signed-off-by: Marc St-Jean <Marc_St-Jean@pmc-sierra.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
This is a new I2C bus driver for the TAOS evaluation modules. Developped
and tested on the TAOS TSL2550 EVM.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
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>
* 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_gpio_getsda() and i2c_gpio_getscl() are only used in this file.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Use i2c_bit_add_numbered_bus() so that the i2c-gpio adapter works well
with new-style pre-declared devices.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Update the IOP3xx I2C driver to use i2c_add_numbered_adapter(), so that
later patches can convert boards to using new-style drivers.
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Tested-by: Voipio Riku <Riku.Voipio@movial.fi>
Cc: Dan J Williams <dan.j.williams@intel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Let the i2c-sis5595 driver release its PCI device after registering.
This is to allow the sis5595 hardware monitoring driver to also
access this PCI device. The same trick is already used in the
i2c-viapro and via686a drivers to let them both load.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Add support for SMBus block read/write transactions to i2c-nforce2
driver, in particular to host controllers MCP51 and MCP55.
Signed-off-by: Oleg Ryjkov <olegr@google.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Move the i2c-mpc driver over to using the new i2c infrastructure.
Specifically, it now uses i2c_add_numbered_adapter so that the bus number
can be determined ahead of time and used to register i2c clients before
the bus is instantiated.
Tested on an MPC5200 based board
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Convert the Marvell mv64xxx I2C driver to use the new i2c infrastructure,
by calling i2c_add_numbered_adapter(). This allows clients to be
registered before the bus is instantiated.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Acked-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Let the drivers specify how many bytes they want to read with
i2c_smbus_read_i2c_block_data(). So far, the block count was
hard-coded to I2C_SMBUS_BLOCK_MAX (32), which did not make much sense.
Many driver authors complained about this before, and I believe it's
about time to fix it. Right now, authors have to do technically stupid
things, such as individual byte reads or full-fledged I2C messaging,
to work around the problem. We do not want to encourage that.
I even found that some bus drivers (e.g. i2c-amd8111) already
implemented I2C block read the "right" way, that is, they didn't
follow the old, broken standard. The fact that it was never noticed
before just shows how little i2c_smbus_read_i2c_block_data() was used,
which isn't that surprising given how broken its prototype was so far.
There are some obvious compatiblity considerations:
* This changes the i2c_smbus_read_i2c_block_data() prototype. Users
outside the kernel tree will notice at compilation time, and will
have to update their code.
* User-space has access to i2c_smbus_xfer() directly using i2c-dev, so
the changed expectations would affect tools such as i2cdump. In order
to preserve binary compatibility, we give I2C_SMBUS_I2C_BLOCK_DATA
a new numeric value, and define I2C_SMBUS_I2C_BLOCK_BROKEN with the
old numeric value. When i2c-dev receives a transaction with the
old value, it can convert it to the new format on the fly.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
The scx200_acb driver use a semaphore as mutex. Use the mutex API
instead of the (binary) semaphore.
Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Jordan Crouse <jordan.crouse@amd.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Instead of all drivers reading pci config space to get the revision
ID, they can now use the pci_device->revision member.
This exposes some issues where drivers where reading a word or a dword
for the revision number, and adding useless error-handling around the
read. Some drivers even just read it for no purpose of all.
In devices where the revision ID is being copied over and used in what
appears to be the equivalent of hotpath, I have left the copy code
and the cached copy as not to influence the driver's performance.
Compile tested with make all{yes,mod}config on x86_64 and i386.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Using lockdep validator causes warnings like
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
[<c00241a0>] (dump_stack+0x0/0x14) from [<c00520f8>] (__lock_acquire+0x150/0xc40)
[<c0051fa8>] (__lock_acquire+0x0/0xc40) from [<c00530a0>] (lock_acquire+0x5c/0x70)
[<c0053044>] (lock_acquire+0x0/0x70) from [<c01d9e44>] (_spin_lock_irq+0x48/0x58)
r7:c07e5144 r6:00000000 r5:c015fb94 r4:c07e50b8
[<c01d9dfc>] (_spin_lock_irq+0x0/0x58) from [<c015fb94>] (i2c_pxa_xfer+0x110/0x2e0)
r5:c07e50b8 r4:0000001f
This is caused by memcpy'ing a statical initialized spin-lock. This patch
removes a static pxa_i2c structure which was used only as a source for this
memcpy() operation. Instead of, members and the spinlock will be
initialized manually.
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Fix for the following build warning:
CC drivers/i2c/busses/i2c-s3c2410.o
drivers/i2c/busses/i2c-s3c2410.c: In function 's3c24xx_i2c_probe':
drivers/i2c/busses/i2c-s3c2410.c:839: warning: format '%ld' expects type 'long int', but argument 4 has type 'resource_size_t'
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
CC drivers/i2c/busses/i2c-at91.o
drivers/i2c/busses/i2c-at91.c: In function 'at91_i2c_probe':
drivers/i2c/busses/i2c-at91.c:213: warning: implicit declaration of function 'IS_ERR'
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Make i2c-at91 register as i2c adapter zero (none of these chips seem to
have more than one TWI controllers) to let it kick in any board-specific
device declarations; also make it hotplug/coldplug.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
From commit 7d054817b7:
> According to the PXA27x developer's manual, we shall do so.
We shall also at least compile test our changes.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Remove includes of <linux/smp_lock.h> where it is not used/needed.
Suggested by Al Viro.
Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
sparc64, and arm (all 59 defconfigs).
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Update some of the layered parport_driver code to use parport->dev:
- i2c-parport (parent of i2c_adapter)
- spi_butterfly (parent of spi_master, allowing cruft removal)
- lp (creating class_device)
- ppdev (parent of parportN device)
- tipar (creating class_device)
There are still drivers that should be updated, like some of the input
drivers; but they won't be any worse off than they are today.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Greg KH <greg@kroah.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (59 commits)
PCI: Free resource files in error path of pci_create_sysfs_dev_files()
pci-quirks: disable MSI on RS400-200 and RS480
PCI hotplug: Use menuconfig objects
PCI: ZT5550 CPCI Hotplug driver fix
PCI: rpaphp: Remove semaphores
PCI: rpaphp: Ensure more pcibios_add/pcibios_remove symmetry
PCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically
PCI: rpaphp: Document is_php_dn()
PCI: rpaphp: Document find_php_slot()
PCI: rpaphp: Rename rpaphp_register_pci_slot() to rpaphp_enable_slot()
PCI: rpaphp: refactor tail call to rpaphp_register_slot()
PCI: rpaphp: remove rpaphp_set_attention_status()
PCI: rpaphp: remove print_slot_pci_funcs()
PCI: rpaphp: Remove setup_pci_slot()
PCI: rpaphp: remove a call that does nothing but a pointer lookup
PCI: rpaphp: Remove another wrappered function
PCI: rpaphp: Remve another call that is a wrapper
PCI: rpaphp: remove a function that does nothing but wrap debug printks
PCI: rpaphp: Remove un-needed goto
PCI: rpaphp: Fix a memleak; slot->location string was never freed
...
I noticed that many source files include <linux/pci.h> while they do
not appear to need it. Here is an attempt to clean it all up.
In order to find all possibly affected files, I searched for all
files including <linux/pci.h> but without any other occurence of "pci"
or "PCI". I removed the include statement from all of these, then I
compiled an allmodconfig kernel on both i386 and x86_64 and fixed the
false positives manually.
My tests covered 66% of the affected files, so there could be false
positives remaining. Untested files are:
arch/alpha/kernel/err_common.c
arch/alpha/kernel/err_ev6.c
arch/alpha/kernel/err_ev7.c
arch/ia64/sn/kernel/huberror.c
arch/ia64/sn/kernel/xpnet.c
arch/m68knommu/kernel/dma.c
arch/mips/lib/iomap.c
arch/powerpc/platforms/pseries/ras.c
arch/ppc/8260_io/enet.c
arch/ppc/8260_io/fcc_enet.c
arch/ppc/8xx_io/enet.c
arch/ppc/syslib/ppc4xx_sgdma.c
arch/sh64/mach-cayman/iomap.c
arch/xtensa/kernel/xtensa_ksyms.c
arch/xtensa/platform-iss/setup.c
drivers/i2c/busses/i2c-at91.c
drivers/i2c/busses/i2c-mpc.c
drivers/media/video/saa711x.c
drivers/misc/hdpuftrs/hdpu_cpustate.c
drivers/misc/hdpuftrs/hdpu_nexus.c
drivers/net/au1000_eth.c
drivers/net/fec_8xx/fec_main.c
drivers/net/fec_8xx/fec_mii.c
drivers/net/fs_enet/fs_enet-main.c
drivers/net/fs_enet/mac-fcc.c
drivers/net/fs_enet/mac-fec.c
drivers/net/fs_enet/mac-scc.c
drivers/net/fs_enet/mii-bitbang.c
drivers/net/fs_enet/mii-fec.c
drivers/net/ibm_emac/ibm_emac_core.c
drivers/net/lasi_82596.c
drivers/parisc/hppb.c
drivers/sbus/sbus.c
drivers/video/g364fb.c
drivers/video/platinumfb.c
drivers/video/stifb.c
drivers/video/valkyriefb.c
include/asm-arm/arch-ixp4xx/dma.h
sound/oss/au1550_ac97.c
I would welcome test reports for these files. I am fine with removing
the untested files from the patch if the general opinion is that these
changes aren't safe. The tested part would still be nice to have.
Note that this patch depends on another header fixup patch I submitted
to LKML yesterday:
[PATCH] scatterlist.h needs types.h
http://lkml.org/lkml/2007/3/01/141
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
When compiled as a module, the i2c-s3c2410 driver does not
free either the IRQ or the i2c adapter it attached to the system.
As part of this fix, move to the usual kernel style
of freeing items as part of the probe error path
making the remove process easier.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Fix the setup time for SDA to SCL due to the way
the S3C24XX I2C controller works.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Add a driver for the i2c-tiny-usb interface. This is a simple
do-it-yourself USB to I2C interface targeted at experimental and
home use. See the i2c-tiny-usb homepage for hardware details:
http://www.harbaum.org/till/i2c_tiny_usb
Signed-off-by: Till Harbaum <till@harbaum.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
The new generic i2c-gpio driver should be used instead.
The obsolete drivers will be removed in September 2007.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Deepak Saxena <dsaxena@plexity.net>
Cc: Jordan Crouse <jordan.crouse@amd.com>
Platform driver for the Simtec CPLD based simple I2C logic.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
This is a very simple bitbanging I2C bus driver utilizing the new
arch-neutral GPIO API. Useful for chips that don't have a built-in
I2C controller, additional I2C busses, or testing purposes.
To use, include something similar to the following in the
board-specific setup code:
#include <linux/i2c-gpio.h>
static struct i2c_gpio_platform_data i2c_gpio_data = {
.sda_pin = GPIO_PIN_FOO,
.scl_pin = GPIO_PIN_BAR,
};
static struct platform_device i2c_gpio_device = {
.name = "i2c-gpio",
.id = 0,
.dev = {
.platform_data = &i2c_gpio_data,
},
};
Register this platform_device, set up the I2C pins as GPIO if
required and you're ready to go. This will use default values for
udelay and timeout, and will work with GPIO hardware that does not
support open drain mode, but allows sensing of the SDA and SCL lines
even when they are being driven.
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Allow the whole I2C menu to be disabled at once without diving into
the submenus for deselecting all options (should the user desire so).
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>