On Sat, 17 Mar 2007 16:24:29 -0300 Henrique de Moraes Holschuh <hmh@xxxxxxxxxx> wrote: > On Thu, 15 Mar 2007, Henrique de Moraes Holschuh wrote: > > 3. is_ejectable_bay is too simple-minded. It could work for batteries, if it > > didn't try so hard to detect only sata/ata devices as bays. Maybe it can be > > changed to try to detect anything that can be ejected and which is not a > > dock? It would find thinkpad batteries, then. > > > > Alternatively, I can use the API I asked for (2) to register the battery bay > > handler. But that looks less optimal, right now. > > > > > > I need to do some tests to check what happens in a thinkpad when you swap an > > ATAPI device with a battery, let's hope IBM did the right thing re. the > > event sources since they have two bay handles that belong to the same bay, > > and that Lenovo didn't break it. > > Well, I have done the tests. A quick hack to is_ejectable_bay so that it > registers anything that is not a dock lets ACPI_BAY handle thinkpad bay > batteries almost perfectly in a T43. It is that simple. > > So the first step is to improve is_ejectable_bay. What reason did you have > to limit it only to devices where is_ata returns true? Is there a reason > why anything that is not a dock and is ejectable should not be handled as a > bay ? The only reason the generic bay driver is limited to only ata devices is simply because that's all I decided to implement for the first revision of the driver. So, the perfect time to expand is now :). Yes - there's a reason why we can't just blindly claim anything ejectable that isn't a dock. PCI Hotplug for example. What I think would be ideal would be if the bay driver could register for events on anything ejectable iff no other driver has claimed them. I couldn't find an easy way to do this last time I checked (months ago). Seems like we might have to change the way ACPI notifications are sent - I was hoping they could be changed to be more like interrupts - so that you could have a return code from the notification call that indicates whether the driver handled the event or not - and allow multiple drivers to register for the same event. This would also make it possible to eliminate weird stuff like what I'm doing with the dock driver to allow the bay driver to get dock notifications - the bay driver could just check to see if it's dependent on another object using _EJD and then request events on that object as well. - To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html