[Intel-gfx] [PATCH] Use enable bit for LVDS detect
Jesse Barnes
jbarnes at virtuousgeek.org
Tue Nov 25 18:32:26 CET 2008
On Monday, November 24, 2008 11:37 pm Zhenyu Wang wrote:
> From d7e88919beb65483f637cd3d9aeeb5798cddea46 Mon Sep 17 00:00:00 2001
> From: Zhenyu Wang <zhenyu.z.wang at intel.com>
> Date: Tue, 25 Nov 2008 23:19:12 +0800
> Subject: [PATCH] Try to add LVDS detect support
>
> This one trys to use lid status for LVDS detect,
> which works when internal panel is not used as primary
> display alone, or there's no internal panel at all.
> ACPI button driver's lid state interface is preferred,
> and SWF state is also checked if ACPI method failed.
Looks pretty reasonable aside from the ACPI lid API which isn't your fault.
> ---
> src/i810_reg.h | 2 +
> src/i830_lvds.c | 123
> +++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 122
> insertions(+), 3 deletions(-)
>
> diff --git a/src/i810_reg.h b/src/i810_reg.h
> index e2ffba1..fbfdb51 100644
> --- a/src/i810_reg.h
> +++ b/src/i810_reg.h
> @@ -2768,6 +2768,8 @@ typedef enum {
> #define SWF12 SWF2
> #define SWF13 SWF3
> #define SWF14 SWF4
> +/* SWF14 lid switch status */
> +#define LID_SWITCH_CLOSE (1 << 29)
> #define SWF15 SWF5
> #define SWF16 SWF6
I've got all these defined in i830_bios.h now if you want to use those
versions.
> + while (1) {
> + lid_dent = readdir(lid_dir);
> + if (lid_dent == NULL) {
> + /* no LID object */
> + closedir(lid_dir);
> + goto out;
> + }
> + if (strcmp(lid_dent->d_name, ".") &&
> + strcmp(lid_dent->d_name, "..")) {
> + closedir(lid_dir);
> + break;
> + }
> + }
So you just find the first non-special directory entry in the lid dir? Is one
always guaranteed to exist?
--
Jesse Barnes, Intel Open Source Technology Center
More information about the Intel-gfx
mailing list