public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ike Panhc <ike.pan@canonical.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org, corentin.chary@gmail.com,
	Richard Purdie <rpurdie@rpsys.net>
Subject: Re: [PATCH 3/3] ideapad: add backlight driver
Date: Thu, 23 Jun 2011 11:38:56 +0800	[thread overview]
Message-ID: <4E02B550.3030208@canonical.com> (raw)
In-Reply-To: <20110622194049.GB8861@srcf.ucam.org>

On 06/23/2011 03:40 AM, Matthew Garrett wrote:
>> +static int ideapad_backlight_get_brightness(struct backlight_device *blightdev)
>> +{
>> +	unsigned long now;
>> +
>> +	if (read_ec_data(ideapad_handle, 0x12, &now))
>> +		return -EAGAIN;
> 
> Description says you're using commands on the VPC2004 device, but it 
> looks like you're just poking the embedded controller? Are you sure the 
> EC offsets are stable?
> 

Yes, they are stable, though on some machine, some functions are not fully implement.
For example, on s10-3, the brightness control is no function but bl_power works fine.
on B550, the brightness control works fine but only get acpi notify when bl_power
turning on.

function read_ec_data will access VPCW and VPCR methods that exist in every VPC2004
devices. In this case, VPCW will write 0x12 to VCMD and then VPCR read the current
brightness value from VDAT.

So far as I have seen, there are two design for VDAT and VCMD. One way (eg, ideapad
B550) is they are EC registers and embedded controller will do all things. The other
way (eg, ideapad Y530) is they are variables in DSDT, and CPU/DSDT will correct 
informations into VDAT.

Both of the design are ok for ideapad-laptop because we only touch VPCW/VPCR methods
and let DSDT or EC do the rest.

I put DSDTs all I have at http://people.ubuntu.com/~ikepanhc/DSDTs  

  reply	other threads:[~2011-06-23  3:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22  8:03 [PATCH 0/3 v2] ideapad: add backlight driver and changes of sysfs nodes Ike Panhc
2011-06-22  8:05 ` [PATCH 1/3] ideapad: define cfg bits and create sysfs node for cfg Ike Panhc
2011-06-22 19:35   ` Matthew Garrett
2011-06-30 10:59     ` Ike Panhc
2011-06-22  8:06 ` [PATCH 2/3] ideapad: let camera_power node invisiable if no camera Ike Panhc
2011-06-22  8:07 ` [PATCH 3/3] ideapad: add backlight driver Ike Panhc
2011-06-22  9:20   ` Corentin Chary
2011-06-22 19:40   ` Matthew Garrett
2011-06-23  3:38     ` Ike Panhc [this message]
2011-06-23  5:52     ` Ike Panhc
  -- strict thread matches above, loose matches on Subject: below --
2011-06-30 11:49 [PATCH 0/3 v3] ideapad: add backlight driver and changes of sysfs nodes Ike Panhc
2011-06-30 11:50 ` [PATCH 3/3] ideapad: add backlight driver Ike Panhc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E02B550.3030208@canonical.com \
    --to=ike.pan@canonical.com \
    --cc=corentin.chary@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox