Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48699
b: refs/heads/master
c: 57ede70
h: refs/heads/master
i:
  48697: beda2ef
  48695: 43185b8
v: v3
  • Loading branch information
Mattia Dongili authored and Len Brown committed Feb 13, 2007
1 parent d067f10 commit 749d8c8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4465857d5f99079bae00621626adf74ed8256296
refs/heads/master: 57ede701af3bc0c153070133e7831332ffa1d761
44 changes: 25 additions & 19 deletions trunk/drivers/acpi/sony_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static struct backlight_properties sony_backlight_properties = {

static struct sony_acpi_value {
char *name; /* name of the entry */
struct proc_dir_entry *proc; /* /proc entry */
struct proc_dir_entry *proc; /* /proc entry */
char *acpiget;/* name of the ACPI get function */
char *acpiset;/* name of the ACPI get function */
int min; /* minimum allowed value or -1 */
Expand All @@ -78,6 +78,7 @@ static struct sony_acpi_value {
int debug; /* active only in debug mode ? */
} sony_acpi_values[] = {
{
/* for backward compatibility only */
.name = "brightness",
.acpiget = "GBRT",
.acpiset = "SBRT",
Expand Down Expand Up @@ -106,6 +107,14 @@ static struct sony_acpi_value {
.max = 1,
.debug = 0,
},
{
.name = "cdpower",
.acpiget = "GCDP",
.acpiset = "CDPW",
.min = 0,
.max = 1,
.debug = 0,
},
{
.name = "audiopower",
.acpiget = "GAZP",
Expand Down Expand Up @@ -356,27 +365,24 @@ static int sony_acpi_add(struct acpi_device *device)
if (!debug && item->debug)
continue;

if (item->acpiget &&
ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle,
item->acpiget, &handle)))
proc_file_mode = S_IRUSR;
else
printk(LOG_PFX "unable to get ACPI handle for %s (get)\n",
item->name);

if (item->acpiset &&
ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle,
item->acpiset, &handle)))
proc_file_mode |= S_IWUSR;
else
printk(LOG_PFX "unable to get ACPI handle for %s (set)\n",
item->name);
if (item->acpiget) {
if (ACPI_FAILURE(acpi_get_handle(sony_acpi_handle,
item->acpiget, &handle)))
continue;

if (proc_file_mode == 0)
continue;
proc_file_mode |= S_IRUSR;
}

if (item->acpiset) {
if (ACPI_FAILURE(acpi_get_handle(sony_acpi_handle,
item->acpiset, &handle)))
continue;

proc_file_mode |= S_IWUSR;
}

item->proc = create_proc_entry(item->name, proc_file_mode,
acpi_device_dir(device));
acpi_device_dir(device));
if (!item->proc) {
printk(LOG_PFX "unable to create proc entry\n");
result = -EIO;
Expand Down

0 comments on commit 749d8c8

Please sign in to comment.