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 */
int debug; /* active only in debug mode ? */
} sony_acpi_values[] = {
{
+ /* for backward compatibility only */
.name = "brightness",
.acpiget = "GBRT",
.acpiset = "SBRT",
.max = 1,
.debug = 0,
},
+ {
+ .name = "cdpower",
+ .acpiget = "GCDP",
+ .acpiset = "CDPW",
+ .min = 0,
+ .max = 1,
+ .debug = 0,
+ },
{
.name = "audiopower",
.acpiget = "GAZP",
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;