ps3av:
- Move the definition of struct ps3av to ps3av.c, as it's locally used only.
- Kill ps3av.sem, use the existing ps3av.mutex instead.
- Make the 512-byte buffer in ps3av_do_pkt() static to reduce stack usage.
Its use is protected by a semaphore anyway.
Convert non-highmem kmap_atomic() to static inline function
Convert kmap_atomic() in the non-highmem case from a macro to a static
inline function, for better type-checking and the ability to pass void
pointers instead of struct page pointers.
Finn Thain [Wed, 2 May 2007 02:55:56 +0000 (12:55 +1000)]
SONIC interrupt handling
Install the built-in macsonic interrupt handler on both IRQs when using
via_alt_mapping. Otherwise the rare interrupt that still comes from the
nubus slot will wedge the nubus.
$ cat /proc/interrupts
auto 2: 89176 via2
auto 3: 744367 sonic
auto 4: 0 scc
auto 6: 318363 via1
auto 7: 0 NMI
mac 9: 119413 framebuffer vbl
mac 10: 1971 ADB
mac 14: 198517 timer
mac 17: 89104 nubus
mac 19: 72 Mac ESP SCSI
mac 56: 629 sonic
mac 62: 1142593 ide0
Version 1 of this patch had a bug where a nubus sonic card would register
two interrupt handlers. Only a built-in sonic needs both.
Versions 2 and 3 needed some cleanups, as Raylynn Knight and Christoph
Hellwig pointed out (thanks).
Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Finn Thain [Tue, 1 May 2007 20:33:01 +0000 (22:33 +0200)]
m68k: macmace fixes
Fix a race condition in the transmit code, where the dma interrupt could update
the free tx buffer count concurrently and wedge the tx queue.
Fix the misuse of the rx frame status and rx frame length registers: no more
"fifo overrun" errors caused by the OFLOW bit being tested in the frame length
register (instead of the status register), and no more missed packets due to
incorrect length taken from status register (instead of the frame length
register).
Fix a panic (skb_over_panic BUG) caused by allocating and then copying an
incoming packet while the packet length register was changing.
Cut-and-paste the reset code from the powermac mace driver (mace.c), so the NIC
functions when MacOS does not initialise it (important for anyone wanting to
use the Emile boot loader).
Cut-and-paste the error counting and timeout recovery code from mace.c.
Fix over allocation of rx buffer memory (it's page order, not page count).
Converted to driver model.
Converted to DMA API.
Since I've run out of ways to make it fail, and since it performs well now,
promote the driver from EXPERIMENTAL status. Tested on both quadra 840av and
660av.
Finn Thain [Tue, 1 May 2007 20:33:00 +0000 (22:33 +0200)]
CUDA ADB fixes
Fix the flakiness in the CUDA ADB driver on m68k macs (keypresses getting
wedged down or ADB just going AWOL altogether).
The only IRQ used by this driver is the VIA shift register IRQ. The PowerMac
conditional code disables the other VIA IRQ sources, so don't mess with the
other IRQ flags in the common code -- m68k macs need them.
When polling, don't disable local interrupts when we only need to disable the
CUDA interrupt.
Unless polling, don't clear the shift register IRQ flag. On m68k macs this
creates a race that often breaks CUDA ADB.
Tested on Quadra 840av and LC630 (both m68k); also Beige G3 (powerpc).
Finn Thain [Tue, 1 May 2007 20:32:59 +0000 (22:32 +0200)]
m68k: Mac II ADB fixes
Fix a crash caused by requests placed in the queue with the completed flag
already set. This lead to some ADB_SYNC requests returning early and their
request structs being popped off the stack while still queued. Stack corruption
ensued or an invalid request callback pointer was invoked or both. Eliminate
macii_retransmit() and its buggy implementation of macii_write(). Have
macii_queue_poll() fully initialise the request queues.
Fix a bug in macii_queue_poll() where the last_req pointer was not being set.
This caused some requests to leave the queue before being completed (and would
also corrupt the stack under certain conditions).
Fix a race in macii_start that could set the state machine to "reading" while
current_req was null.
No longer send poll commands with the ADBREQ_REPLY flag -- doing that caused
the replies to be stored in the request buffer where they were forgotten
about.
Don't autopoll by continuously sending new Talk commands. Get the controller to
do that for us. This reduces the ADB interrupt rate on an idle bus to about 5
per second. Only autopoll the devices that were probed.
Explicitly clear the interrupt flag when polling.
Use disable_irq rather than local_irq_save when polling.
Remove excess local_irq_save/restore pairs.
Improve bus timeout and service request detection.
Finn Thain [Tue, 1 May 2007 20:32:58 +0000 (22:32 +0200)]
m68k: Mac IRQ cleanup
There are no slow IRQs on Macs since Roman Zippel's IRQ reorganisation that
went into 2.6.16 and removed mac_irq_list[] and the do_mac_irq_list()
dispatcher. (They were implemented in do_mac_irq_list() by lowering the IPL.)
Hence there's no more use for mutual exclusion in the Mac interrupt
dispatchers. Remove it.
Finn Thain [Tue, 1 May 2007 20:32:57 +0000 (22:32 +0200)]
m68k: Mac nubus IRQ fixes (plan E)
Some Macs lack a slot interrupt enable register. So the existing code makes
disabled and unregistered slot IRQ lines outputs set high. This seems to work
on quadras, but does not work on genuine VIAs (perhaps the card still succeeds
in pulling the line low, or perhaps because this increases the settle time on
the port A input, meaning that the CA1 IRQ could fire before the slot line
reads active).
Because of this, the nubus_active flags were used to mask IRQs, which is
actually worse than the problem it tries to solve. Any interrupt masked by
nubus_active will remain asserted and prevent further transitions on CA1. And
so the nubus gets wedged regardless of hardware (emulated VIA ASIC, real VIA
chip or RBV).
The best solution to this hardware limitation of genuine VIAs is to disable the
umbrella SLOTS IRQ when disabling a slot on those machines. Unfortunately, this
means all slot IRQs get disabled when any slot IRQ is disabled. But it is only
a problem when there's more than 1 device using nubus interrupts.
Another potential problem for genuine VIAs is an unregistered nubus IRQ.
Eventually it will be possible to enable the CA1 interrupt by installing its
handler only _after_ all nubus drivers have loaded but _before_ the kernel
needs them, at which time this last problem can be fixed. For now it can be
worked around:
- disable MacOS extensions
- don't boot MacOS (use the Emile bootloader instead)
- get the bootloaders to disable ROM drivers (Penguin does this for video
cards already, don't know about Emile)
- physically remove unsupported cards
Finn Thain [Tue, 1 May 2007 20:32:56 +0000 (22:32 +0200)]
m68k: Mac IRQ prep
Make sure that there are no slot IRQs asserted before leaving the nubus
handler. If there are and we don't then the nubus gets wedged because this
prevents a CA1 transition, which means no more nubus IRQs.
Make the interrupt dispatch loops terminate sooner.
Explicitly initialise the VIA latches to make the code more easily understood.
Macintosh CS89x0 Ethernet: Netif updates
Addition of netif_stop_queue() before transmission by Michael Schmitz
skb_copy_{from,to}_linear_data() conversion by Geert Uytterhoeven
Michael Schmitz [Tue, 1 May 2007 20:32:39 +0000 (22:32 +0200)]
m68k: Atari fb revival
Update the atari fb to 2.6 by Michael Schmitz,
Reformatting and rewrite of bit plane functions by Roman Zippel,
A few more fixes by Geert Uytterhoeven.
Signed-off-by: Michael Schmitz <schmitz@debian.org> Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Michael Schmitz [Tue, 1 May 2007 20:32:35 +0000 (22:32 +0200)]
m68k: Atari SCSI revival
SCSI should be working on a TT (but someone should really try!) but causes
trouble on a Falcon (as in: it ate a filesystem of mine) at least when
used concurrently with IDE. I have the notion it's because locking of the
ST-DMA interrupt by IDE is broken in 2.6 (the IDE driver always complains
about trying to release an already-released ST-DMA). Needs more work, but
that's on the IDE or m68k interrupt side rather than SCSI.
Signed-off-by: Michael Schmitz <schmitz@debian.org> Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sat, 5 May 2007 00:46:27 +0000 (17:46 -0700)]
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (44 commits)
i2c-s3c2410: Fix bug in releasing driver
i2c-s3c2410: Fix I2C SDA to SCL setup time
i2c: New i2c-tiny-usb bus driver
i2c: Documentation update
i2c: SPIN_LOCK_UNLOCKED cleanup
i2c: Obsolete i2c-ixp2000, i2c-ixp4xx and scx200_i2c
i2c: New Simtec I2C bus driver
i2c: Bitbanging I2C bus driver using the GPIO API
Use menuconfig objects - I2C
i2c: Restore i2c_smbus_read_block_data
i2c-pxa: Clean transaction stop
i2c-algo-bit: Improve debugging
i2c-algo-bit: Implement a 50/50 SCL duty cycle
i2c-omap: Switch to static adapter numbering
i2c: Blackfin Two Wire Interface driver
i2c-algo-sgi: Comment and whitespace cleanups
i2c: Make i2c_del_driver a void function
i2c: Move i2c-isa-only exported symbol declarations
i2c: Document i2c_new_device()
i2c: Add i2c_new_probed_device()
...
Fixed trivial conflict in Documentation/feature-removal-schedule.txt manually.
Cornelia Huck [Fri, 4 May 2007 16:47:51 +0000 (18:47 +0200)]
[S390] dasd: New read device characteristics and read configuration data.
Instead of the deprecated read_dev_chars() and read_conf_data_lpm(),
implement dasd_generic_read_dev_chars() and dasd_eckd_read_conf_lpm().
These should even recover better from error than the original cio
functions.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cornelia Huck [Fri, 4 May 2007 16:47:50 +0000 (18:47 +0200)]
[S390] cio: Deprecate read_dev_chars() and read_conf_data{,_lpm}().
These helper functions are a leftover from 2.4 sync I/O and are a
notorious source for bugs. They lead to device driver specific code
creeping into cio, and some issues can't really be fixed at all.
Device drivers can easily implement those functions themselves in a
more robust manner, so let's get rid of them.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Commit c1821c2e9711adc3cd298a16b7237c92a2cee78d introduced the
uaccess structure that is used to select the correct set of user
copy functions for the different execution modes (standard vs.
noexec vs. z9 optimized user copy). The uaccess symbol is exported
with EXPORT_SYMBOL_GPL. This breaks all non-gpl modules that use
user copy. To make them work again change the export to
EXPORT_SYMBOL.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
And here's a port of the powerpc patch to get rid of the notifier
chain completely to s390. It's ontop of Martins patch as that one
is in mainline already.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Till Harbaum [Tue, 1 May 2007 21:26:35 +0000 (23:26 +0200)]
i2c: New i2c-tiny-usb bus driver
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>
Jean Delvare [Tue, 1 May 2007 21:26:35 +0000 (23:26 +0200)]
i2c: Documentation update
Make the documentation on how to write and port i2c drivers more in
line with the current state of things:
* i2c-isa is deprecated and soon gone, so stop advertising it.
* Drop many sensors-specific references. Most of them were outdated
anyway.
* Update the example code to reflect the recent and not-so-recent
API and coding style preference changes.
* Simplify the example init and cleanup functions.
This should make things less complex to understand for newcomers.
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:
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>
Jean Delvare [Tue, 1 May 2007 21:26:33 +0000 (23:26 +0200)]
i2c-pxa: Clean transaction stop
It was reported to me that the i2c-pxa driver was not able to process
more that 50 transactions per second. Investigation revealed that the
I2C unit was busy for 20 ms after every transaction. The reason seems
to be that we forget to clear the STOP and ACKNACK bits at the end of
the transaction. According to the PXA27x developer's manual, we shall
do so.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Lennert Buytenhek <kernel@wantstofly.org> Cc: Nicolas Pitre <nico@cam.org>
Jean Delvare [Tue, 1 May 2007 21:26:33 +0000 (23:26 +0200)]
i2c-algo-bit: Improve debugging
Improve the debugging features of the i2c-algo-bit driver:
* Make it possible to compile the driver without debugging support
at all, making it much smaller.
* Use dev_dbg() for debugging messages where possible, and dev_err()
for error messages.
* Remove redundant debugging messages.
These changes allowed for minor code cleanups, which are included
as well.
Jean Delvare [Tue, 1 May 2007 21:26:33 +0000 (23:26 +0200)]
i2c-algo-bit: Implement a 50/50 SCL duty cycle
The original i2c-algo-bit implementation uses a 33/66 SCL duty cycle
when bits are being written on the bus. While the I2C specification
doesn't forbid it, this prevents us from driving the I2C bus to its
max speed, limiting us to 66 kbps max on standard I2C busses.
Implementing a 50/50 duty cycle instead lets us max out the bandwidth
up to the theoretical max of 100 kbps on standard I2C busses. This is
particularly important when large amounts of data need to be transfered
over the bus, as is the case with some TV adapters when the firmware is
being uploaded.
In fact this change even allows, at least in theory, fast-mode I2C
support at 125, 166 and 250 kbps. There's no way to reach the
theoretical max of 400 kbps with this implementation. But I don't
think we want to put efforts in that direction anyway: software-driven
I2C is very CPU-intensive and bad for latency.
Other timing changes:
* Don't set SDA high explicitly on error, we're going to issue a stop
condition before we leave anyway.
* If an error occurs when sending the slave address, yield the CPU
before retrying, and remove the additional delay after the new start
condition.
Jean Delvare [Tue, 1 May 2007 21:26:32 +0000 (23:26 +0200)]
i2c: Make i2c_del_driver a void function
Make i2c_del_driver a void function, like all other driver removal
functions. It always returned 0 even when errors occured, and nobody
ever actually checked the return value anyway. And we cannot fail
a module removal anyway.
Jean Delvare [Tue, 1 May 2007 21:26:32 +0000 (23:26 +0200)]
i2c: Move i2c-isa-only exported symbol declarations
Move the declaration of i2c-isa-only exported symbols to i2c-isa
itself, that's the best way to ensure nobody will attempt to use them.
Hopefully we'll get rid of the exports themselves soon anyway.
Jean Delvare [Tue, 1 May 2007 21:26:31 +0000 (23:26 +0200)]
i2c: Add i2c_new_probed_device()
Add a new helper function to instantiate an i2c device. It is meant as a
replacement for i2c_new_device() when you don't know for sure at which
address your I2C/SMBus device lives. This happens frequently on TV
adapters for example, you know there is a tuner chip on the bus, but
depending on the exact board model and revision, it can live at different
addresses. So, the new i2c_new_probed_device() function will probe the bus
according to a list of addresses, and as soon as one of these addresses
responds, it will call i2c_new_device() on that one address.
This function will make it possible to port the old i2c drivers to the
new model quickly.
Jean Delvare [Tue, 1 May 2007 21:26:31 +0000 (23:26 +0200)]
i2c-algo-bit: Add i2c_bit_add_numbered_bus
Add i2c_bit_add_numbered_bus(), which is equivalent to i2c_bit_add_bus
except that it calls i2c_add_numbered_adapter() at the end instead of
i2c_add_adapter().
David Brownell [Tue, 1 May 2007 21:26:31 +0000 (23:26 +0200)]
i2c: Add i2c_add_numbered_adapter()
This adds a call, i2c_add_numbered_adapter(), registering an I2C adapter
with a specific bus number and then creating I2C device nodes for any
pre-declared devices on that bus. It builds on previous patches adding
I2C probe() and remove() support, and that pre-declaration of devices.
This completes the core support for "new style" I2C device drivers.
Those follow the standard driver model for binding devices to drivers
(using probe and remove methods) rather than a legacy model (where the
driver tries to autoconfigure each bus, and registers devices itself).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
David Brownell [Tue, 1 May 2007 21:26:31 +0000 (23:26 +0200)]
i2c: Add i2c_board_info and i2c_new_device()
This provides partial support for new-style I2C driver binding. It builds
on "struct i2c_board_info" declarations that identify I2C devices on a given
board. This is needed on systems with I2C devices that can't be fully probed
and/or autoconfigured, such as many embedded Linux configurations where the
way a given I2C device is wired may affect how it must be used.
There are two models for declaring such devices:
* LATE -- using a public function i2c_new_device(). This lets modules
declare I2C devices found *AFTER* a given I2C adapter becomes available.
For example, a PCI card could create adapters giving access to utility
chips on that card, and this would be used to associate those chips with
those adapters.
* EARLY -- from arch_initcall() level code, using a non-exported function
i2c_register_board_info(). This copies the declarations *BEFORE* such
an i2c_adapter becomes available, arranging that i2c_new_device() will
be called later when i2c-core registers the relevant i2c_adapter.
For example, arch/.../.../board-*.c files would declare the I2C devices
along with their platform data, and I2C devices would behave much like
PNPACPI devices. (That is, both enumerate from board-specific tables.)
To match the exported i2c_new_device(), the previously-private function
i2c_unregister_device() is now exported.
Pending later patches using these new APIs, this is effectively a NOP.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
David Brownell [Tue, 1 May 2007 21:26:30 +0000 (23:26 +0200)]
i2c: i2c stack can probe()
One of a series of I2C infrastructure updates to support enumeration using
the standard Linux driver model.
This patch updates probe() and associated hotplug/coldplug support, but
not remove(). Nothing yet _uses_ it to create I2C devices, so those
hotplug/coldplug mechanisms will be the only externally visible change.
This patch will be an overall NOP since the I2C stack doesn't yet create
clients/devices except as part of binding them to legacy drivers.
Some code is moved earlier in the source code, helping group more of the
per-device infrastructure in one place and simplifying handling per-device
attributes.
Terminology being adopted: "legacy drivers" create devices (i2c_client)
themselves, while "new style" ones follow the driver model (the i2c_client
is handed to the probe routine). It's an either/or thing; the two models
don't mix, and drivers that try mixing them won't even be registered.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Jean Delvare [Tue, 1 May 2007 21:26:30 +0000 (23:26 +0200)]
i2c-pca-isa: Port to the new device driver model
Port the i2c-pca-isa driver to the new device driver model. I'm
using Rene Herman's new isa bus type, as it fits the needs nicely. One
benefit is that we can now give a proper parent to our i2c adapter.
Jean Delvare [Tue, 1 May 2007 21:26:30 +0000 (23:26 +0200)]
i2c-elektor: Port to the new device driver model
Port the i2c-elektor driver to the new device driver model. I'm
using Rene Herman's new isa bus type, as it fits the needs nicely. One
benefit is that we can now give a proper parent to our i2c adapter.
Jean Delvare [Tue, 1 May 2007 21:26:30 +0000 (23:26 +0200)]
scx200_acb: Fix PCI device reference count
The scx200_acb driver supports two kind of devices, PCI ones and ISA
ones. Even ISA ones are detected using the presence of a given PCI
device, and we get a reference to it, but never put it back, so we
have a leak. Fix it.
Jean Delvare [Tue, 1 May 2007 21:26:29 +0000 (23:26 +0200)]
i2c-parport: Optimize binary size
Initialize the fields of the i2c_adapter structure individually,
rather than copying a whole static template structure. This shaves
off 474 bytes or 14% (on i386) from the binary size.
Jean Delvare [Tue, 1 May 2007 21:26:29 +0000 (23:26 +0200)]
i2c-algo-bit: Emulate SMBus block read
Now that i2c-core lets the i2c bus drivers emulate the SMBus block read
and SMBus block process call transaction types, let's implement that in
the popular i2c bit-banging driver. This will also act as a reference
implementation for other bus drivers which want to do the same.
Jean Delvare [Tue, 1 May 2007 21:26:29 +0000 (23:26 +0200)]
i2c: Emulate SMBus block read over I2C
Let the I2C bus drivers emulate the SMBus Block Read and Block Process
Call transactions if they wish. This requires to define a new message
flag, which i2c-core will use to let the underlying I2C bus driver
know that the first received byte will specify the length of the read
message.
Jean Delvare [Tue, 1 May 2007 21:26:28 +0000 (23:26 +0200)]
i2c-algo-bit: Always send a stop condition before leaving
The i2c-algo-bit driver doesn't behave well on read errors: it'll
bail out without even sending a stop condition on the bus, so the bus
will be stuck. So make sure that we always send a stop condition on
the bus before we leave. The best way to make sure is to always send
it at the end of function bit_xfer.
David Brownell [Tue, 1 May 2007 21:26:28 +0000 (23:26 +0200)]
i2c: Rename dev_to_i2c_adapter()
Rename dev_to_i2c_adapter() as to_i2c_adapter(), since the previous
syntax was a surprising and needless difference from normal naming
conventions in Linux.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
David Brownell [Tue, 1 May 2007 21:26:28 +0000 (23:26 +0200)]
i2c: Shrink struct i2c_client
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>
Jean Delvare [Tue, 1 May 2007 21:26:28 +0000 (23:26 +0200)]
i2c: i2c_adapter devices need no driver
Kill i2c_adapter_driver as it doesn't make sense and it prevents
further i2c-core cleanups. i2c_adapter devices are virtual devices
(ex-class devices) and as such they don't need a driver.
Jean Delvare [Tue, 1 May 2007 21:26:27 +0000 (23:26 +0200)]
i2c: Kill i2c_adapter.class_dev
Kill i2c_adapter.class_dev. Instead, set the class of i2c_adapter.dev
to i2c_adapter_class, so that a symlink will be created for every
i2c_adapter in /sys/class/i2c-adapter.
The same change must be mirrored to i2c-isa as it duplicates some
of the i2c-core functionalities.
User-space tools and libraries might need some adjustments. In
particular, libsensors from lm_sensors 2.10.3 or later is required for
proper discovery of i2c adapter names after this change.
Linus Torvalds [Tue, 1 May 2007 00:43:48 +0000 (17:43 -0700)]
libata: honour host controllers that want just one host
The Marvell IDE interface on my machine would hit a BUG_ON() in
lib/iomem.c because it was calling ata_pci_init_one() specifying just a
single port on the host, but that would actually end up trying to
initialize two ports, the second one with bogus information.
This fixes "ata_pci_init_one()" so that it actually passes down the
n_ports variable that it got from the low-level driver to the host
allocation routine ("ata_host_alloc_pinfo()"), which results in the ATA
layer actually having the correct port number information.
And in order to make it all work, I also needed to fix a few places that
had incorrectly hard-coded the fact that a host always had exactly two
ports (both ata_pci_init_bmdma() and ata_request_legacy_irqs() would
just always iterate over both ports).
Acked-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Johannes Berg [Mon, 30 Apr 2007 22:09:55 +0000 (15:09 -0700)]
power management: force pm_ops.valid callback to be assigned
This patch changes the docs and behaviour from "all states valid" to "no
states valid" if no .valid callback is assigned. Users of pm_ops that only
need mem sleep can assign pm_valid_only_mem without any overhead, others
will require more elaborate callbacks.
Now that all users of pm_ops have a .valid callback this is a safe thing to
do and prevents things from getting messy again as they were before.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Pavel Machek <pavel@ucw.cz> Looks-okay-to: Rafael J. Wysocki <rjw@sisk.pl> Cc: <linux-pm@lists.linux-foundation.org> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>