Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235899
b: refs/heads/master
c: 55bb5f4
h: refs/heads/master
i:
  235897: 95621f1
  235895: aa94811
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Feb 9, 2011
1 parent 3f60068 commit d19086c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 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: 1540e350ddef5e6bfd27c222684ca8fdec4ad2f8
refs/heads/master: 55bb5f4bf26ca968ff7ee026fed1ad377803ce03
25 changes: 17 additions & 8 deletions trunk/drivers/staging/samsung-laptop/samsung-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ struct sabi_header_offsets {
};

struct sabi_commands {
/* Brightness is 0 - 8, as described above. Value 0 is for the BIOS to use */
/*
* Brightness is 0 - 8, as described above.
* Value 0 is for the BIOS to use
*/
u8 get_brightness;
u8 set_brightness;

/* first byte:
/*
* first byte:
* 0x00 - wireless is off
* 0x01 - wireless is on
* second byte:
Expand Down Expand Up @@ -358,7 +362,8 @@ static u8 read_brightness(void)
int user_brightness = 0;
int retval;

retval = sabi_get_command(sabi_config->commands.get_brightness, &sretval);
retval = sabi_get_command(sabi_config->commands.get_brightness,
&sretval);
if (!retval)
user_brightness = sretval.retval[0];
if (user_brightness != 0)
Expand All @@ -368,7 +373,8 @@ static u8 read_brightness(void)

static void set_brightness(u8 user_brightness)
{
sabi_set_command(sabi_config->commands.set_brightness, user_brightness + 1);
sabi_set_command(sabi_config->commands.set_brightness,
user_brightness + 1);
}

static int get_brightness(struct backlight_device *bd)
Expand Down Expand Up @@ -443,7 +449,8 @@ static ssize_t get_performance_level(struct device *dev,
int pLevel;

/* Read the state */
retval = sabi_get_command(sabi_config->commands.get_performance_level, &sretval);
retval = sabi_get_command(sabi_config->commands.get_performance_level,
&sretval);
if (retval)
return retval;

Expand All @@ -466,7 +473,7 @@ static ssize_t set_performance_level(struct device *dev,
&sabi_config->performance_levels[pLevel];
if (!strncasecmp(level->name, buf, strlen(level->name))) {
sabi_set_command(sabi_config->commands.set_performance_level,
level->value);
level->value);
break;
}
}
Expand Down Expand Up @@ -610,13 +617,15 @@ static int __init samsung_init(void)
test_backlight();
test_wireless();

retval = sabi_get_command(sabi_config->commands.get_brightness, &sretval);
retval = sabi_get_command(sabi_config->commands.get_brightness,
&sretval);
printk(KERN_DEBUG "brightness = 0x%02x\n", sretval.retval[0]);
}

/* Turn on "Linux" mode in the BIOS */
if (sabi_config->commands.set_linux != 0xff) {
retval = sabi_set_command(sabi_config->commands.set_linux, 0x81);
retval = sabi_set_command(sabi_config->commands.set_linux,
0x81);
if (retval) {
printk(KERN_ERR KBUILD_MODNAME ": Linux mode was not set!\n");
goto error_no_platform;
Expand Down

0 comments on commit d19086c

Please sign in to comment.