Re: [PATCH 1/4] ACPI: EC: Add ec_get_handle()

From: Thomas Renninger
Date: Thu Dec 15 2011 - 20:52:31 EST


On Friday 16 December 2011 01:33:33 Matthew Garrett wrote:
> On Fri, Dec 16, 2011 at 01:22:35AM +0100, Thomas Renninger wrote:
>
> > I think best is to move the thinkpad implementation of getting
> > ACPI handles based on HIDs to osl.c and make it global.
> > I'll send patches.
> > Please review them carefully, they are only compile tested.
>
> The ec driver is already finding the hardware on the basis of the HID -
> is there any reason to do this twice rather than just exporting the
> information the ec driver already has?
Exporting the EC handle is static, you do not want to export all
kind of ACPI devices as soon as other drivers need them.

The question is how long it takes to do:
acpi_ns_walk_namespace(ACPI_TYPE_DEVICE, ...
in worst case (not found).

Ok, the EC may be somewhat special because it's the most likely
candidate to get shared (or say needed by other drivers)
and its driver has to be compiled in.
.
thinkpad_acpi should at least also make use of Seth's approach and get the
ec_handle quickly/directly.

And my patches should still be added, because others could use
them as well. Beside thinkpad_acpi grabbing the video handle, there
is another re-implementation of my acpi_handle_locate (eeepc_wmi.c):
static acpi_status eeepc_wmi_parse_device(acpi_handle handle, u32 level,
void *context, void **retval)
{
pr_warn("Found legacy ATKD device (%s)\n", EEEPC_ACPI_HID);
*(bool *)context = true;
return AE_CTRL_TERMINATE;
}

static int eeepc_wmi_check_atkd(void)
{
acpi_status status;
bool found = false;

status = acpi_get_devices(EEEPC_ACPI_HID, eeepc_wmi_parse_device,
&found, NULL);

if (ACPI_FAILURE(status) || !found)
return 0;
return -1;
}


If you agree I can send something tomorrow.


Thomas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/