[haiku-development] Re: acpi_thinkpad: request for assistance

  • From: Michael Weirauch <dev@xxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 22 Nov 2009 22:49:56 +0100

2009/11/22 Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>:
> Since I guess it won't be that voluminous yet, I think having the
> discussion here on that list makes more sense. You could post some code
> excerpts of the things you think might be problematic (and host the
> full sources somewhere, too). For work in progress like this, I don't
> think Trac is the best tool.

I was just about to prepare a ticket ;)

The WIP driver and preflet:
http://www.m-phasis.de/tmp/haiku/haiku-acpi_thinkpad-2009-11-22-B.patch

(Inspired by the present acpi drivers, FreeBSDs acpi_ibm.c; borrowed
PowerStatus icon)

Issue 1: USB-attached bluetooth-dongle does not get reactivated
On disabling, it's unpublished from the USB bus. When enabling it's
not republished.
According to mmlr it seems that the status register bit is not set in
the usb hub(?)
and thus it's not getting recognized again.

Issue 2: Set-Up of the acpi_embedded_controller acpi_device (acpi_device_cookie)
I need an acpi_device reference from that driver for enabling more "features".
An example would be reading the ThinkLight status.
I am making no deal out of it that I have just very little knowledge
about drivers/devices/modules
so please bear with me:

Module deps: (#define taken from Clemens' acpi_embedded_controller)

struct module_dependency module_dependencies[] = {
        { B_DEVICE_MANAGER_MODULE_NAME, (module_info**)&sDeviceManager },
#if WITH_EC
        { ACPI_EC_DEVICE_NAME, (module_info**)&sEC },
#endif
        {}
};

Setting up the acpi_device reference to EC on driver init:

        sDeviceManager->get_driver(parent, (driver_module_info**)&sEC,
                (void**)&driver->ec_device_cookie);

I am absolutely not sure if this makes sense. This uncertainty is underlined
by a failing trial to read out the ThinkLight status and the fact
that some ThinkPad models just need a different means of reading that status.

Testing and comments welcome.

Thanks in advance,
Michael

Other related posts: