[Intel-gfx] [PATCH] Use enable bit for LVDS detect
Wang, Zhenyu Z
zhenyu.z.wang at intel.com
Wed Nov 26 02:06:26 CET 2008
On 2008.11.26 01:32:26 +0800, Jesse Barnes wrote:
> 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.
True.
>
> > ---
> > 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.
oh, yes, I haven't noticed it, will use that one instead.
>
> > + 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?
>
If 'lid' dir exists under 'button' dir, that means there's a LID device found,
and acpi button will create a subdir. And above code has also checked if no LID
device was found.
And there's another lid state say 'unsupported' have to be guarded too, only 'open'
or 'closed' tells the real state.
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20081126/6abd7b48/attachment.sig>
More information about the Intel-gfx
mailing list