aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2010-01-13 16:26:24 -0500
committerCorentin Chary <corentincj@iksaif.net>2010-02-28 13:35:11 -0500
commit4d4415138060870670a18d0768fe1d597f505f98 (patch)
treea548edcc047bdf8f4be1d67f246792120093897d /drivers/platform
parent17e78f6260fbc8f55c279cca081c26c88d96ec00 (diff)
asus-laptop: rename function talking directly to acpi with asus_xxx scheme
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/asus-laptop.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index 2349e88bbc75..ae4f80886577 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -394,7 +394,7 @@ ASUS_LED_HANDLER(gled, GLED_ON);
394/* 394/*
395 * Keyboard backlight (also a LED) 395 * Keyboard backlight (also a LED)
396 */ 396 */
397static int get_kled_lvl(void) 397static int asus_kled_lvl(void)
398{ 398{
399 unsigned long long kblv; 399 unsigned long long kblv;
400 struct acpi_object_list params; 400 struct acpi_object_list params;
@@ -409,12 +409,12 @@ static int get_kled_lvl(void)
409 rv = acpi_evaluate_integer(kled_get_handle, NULL, &params, &kblv); 409 rv = acpi_evaluate_integer(kled_get_handle, NULL, &params, &kblv);
410 if (ACPI_FAILURE(rv)) { 410 if (ACPI_FAILURE(rv)) {
411 pr_warning("Error reading kled level\n"); 411 pr_warning("Error reading kled level\n");
412 return 0; 412 return -ENODEV;
413 } 413 }
414 return kblv; 414 return kblv;
415} 415}
416 416
417static int set_kled_lvl(struct asus_laptop *asus, int kblv) 417static int asus_kled_set(struct asus_laptop *asus, int kblv)
418{ 418{
419 if (kblv > 0) 419 if (kblv > 0)
420 kblv = (1 << 7) | (kblv & 0x7F); 420 kblv = (1 << 7) | (kblv & 0x7F);
@@ -441,12 +441,12 @@ static void kled_led_update(struct work_struct *work)
441{ 441{
442 struct asus_laptop *asus = work_to_asus(work, kled); 442 struct asus_laptop *asus = work_to_asus(work, kled);
443 443
444 set_kled_lvl(asus, asus->leds.kled_wk); 444 asus_kled_set(asus, asus->leds.kled_wk);
445} 445}
446 446
447static enum led_brightness kled_led_get(struct led_classdev *led_cdev) 447static enum led_brightness kled_led_get(struct led_classdev *led_cdev)
448{ 448{
449 return get_kled_lvl(); 449 return asus_kled_lvl();
450} 450}
451 451
452#define ASUS_LED_UNREGISTER(object) \ 452#define ASUS_LED_UNREGISTER(object) \
@@ -555,7 +555,7 @@ static void lcd_blank(struct asus_laptop *asus, int blank)
555 } 555 }
556} 556}
557 557
558static int read_brightness(struct backlight_device *bd) 558static int asus_read_brightness(struct backlight_device *bd)
559{ 559{
560 unsigned long long value; 560 unsigned long long value;
561 acpi_status rv = AE_OK; 561 acpi_status rv = AE_OK;
@@ -567,7 +567,7 @@ static int read_brightness(struct backlight_device *bd)
567 return value; 567 return value;
568} 568}
569 569
570static int set_brightness(struct backlight_device *bd, int value) 570static int asus_set_brightness(struct backlight_device *bd, int value)
571{ 571{
572 if (write_acpi_int(brightness_set_handle, NULL, value)) { 572 if (write_acpi_int(brightness_set_handle, NULL, value)) {
573 pr_warning("Error changing brightness\n"); 573 pr_warning("Error changing brightness\n");
@@ -582,7 +582,7 @@ static int update_bl_status(struct backlight_device *bd)
582 int rv; 582 int rv;
583 int value = bd->props.brightness; 583 int value = bd->props.brightness;
584 584
585 rv = set_brightness(bd, value); 585 rv = asus_set_brightness(bd, value);
586 if (rv) 586 if (rv)
587 return rv; 587 return rv;
588 588
@@ -591,7 +591,7 @@ static int update_bl_status(struct backlight_device *bd)
591} 591}
592 592
593static struct backlight_ops asusbl_ops = { 593static struct backlight_ops asusbl_ops = {
594 .get_brightness = read_brightness, 594 .get_brightness = asus_read_brightness,
595 .update_status = update_bl_status, 595 .update_status = update_bl_status,
596}; 596};
597 597
@@ -612,7 +612,7 @@ static int asus_backlight_init(struct asus_laptop *asus)
612 asus->backlight_device = bd; 612 asus->backlight_device = bd;
613 613
614 bd->props.max_brightness = 15; 614 bd->props.max_brightness = 15;
615 bd->props.brightness = read_brightness(NULL); 615 bd->props.brightness = asus_read_brightness(NULL);
616 bd->props.power = FB_BLANK_UNBLANK; 616 bd->props.power = FB_BLANK_UNBLANK;
617 backlight_update_status(bd); 617 backlight_update_status(bd);
618 } 618 }
@@ -818,7 +818,7 @@ static ssize_t store_bluetooth(struct device *dev,
818/* 818/*
819 * Display 819 * Display
820 */ 820 */
821static void set_display(struct asus_laptop *asus, int value) 821static void asus_set_display(struct asus_laptop *asus, int value)
822{ 822{
823 /* no sanity check needed for now */ 823 /* no sanity check needed for now */
824 if (write_acpi_int(display_set_handle, NULL, value)) 824 if (write_acpi_int(display_set_handle, NULL, value))
@@ -874,14 +874,14 @@ static ssize_t store_disp(struct device *dev, struct device_attribute *attr,
874 874
875 rv = parse_arg(buf, count, &value); 875 rv = parse_arg(buf, count, &value);
876 if (rv > 0) 876 if (rv > 0)
877 set_display(asus, value); 877 asus_set_display(asus, value);
878 return rv; 878 return rv;
879} 879}
880 880
881/* 881/*
882 * Light Sens 882 * Light Sens
883 */ 883 */
884static void set_light_sens_switch(struct asus_laptop *asus, int value) 884static void asus_als_switch(struct asus_laptop *asus, int value)
885{ 885{
886 if (write_acpi_int(ls_switch_handle, NULL, value)) 886 if (write_acpi_int(ls_switch_handle, NULL, value))
887 pr_warning("Error setting light sensor switch\n"); 887 pr_warning("Error setting light sensor switch\n");
@@ -904,12 +904,12 @@ static ssize_t store_lssw(struct device *dev, struct device_attribute *attr,
904 904
905 rv = parse_arg(buf, count, &value); 905 rv = parse_arg(buf, count, &value);
906 if (rv > 0) 906 if (rv > 0)
907 set_light_sens_switch(asus, value ? 1 : 0); 907 asus_als_switch(asus, value ? 1 : 0);
908 908
909 return rv; 909 return rv;
910} 910}
911 911
912static void set_light_sens_level(struct asus_laptop *asus, int value) 912static void asus_als_level(struct asus_laptop *asus, int value)
913{ 913{
914 if (write_acpi_int(ls_level_handle, NULL, value)) 914 if (write_acpi_int(ls_level_handle, NULL, value))
915 pr_warning("Error setting light sensor level\n"); 915 pr_warning("Error setting light sensor level\n");
@@ -934,7 +934,7 @@ static ssize_t store_lslvl(struct device *dev, struct device_attribute *attr,
934 if (rv > 0) { 934 if (rv > 0) {
935 value = (0 < value) ? ((15 < value) ? 15 : value) : 0; 935 value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
936 /* 0 <= value <= 15 */ 936 /* 0 <= value <= 15 */
937 set_light_sens_level(asus, value); 937 asus_als_level(asus, value);
938 } 938 }
939 939
940 return rv; 940 return rv;
@@ -1419,7 +1419,7 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus)
1419 1419
1420 /* Keyboard Backlight is on by default */ 1420 /* Keyboard Backlight is on by default */
1421 if (kled_set_handle) 1421 if (kled_set_handle)
1422 set_kled_lvl(asus, 1); 1422 asus_kled_set(asus, 1);
1423 1423
1424 /* LED display is off by default */ 1424 /* LED display is off by default */
1425 asus->ledd_status = 0xFFF; 1425 asus->ledd_status = 0xFFF;
@@ -1429,10 +1429,10 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus)
1429 asus->light_level = 5; /* level 5 for sensor sensitivity */ 1429 asus->light_level = 5; /* level 5 for sensor sensitivity */
1430 1430
1431 if (ls_switch_handle) 1431 if (ls_switch_handle)
1432 set_light_sens_switch(asus, asus->light_switch); 1432 asus_als_switch(asus, asus->light_switch);
1433 1433
1434 if (ls_level_handle) 1434 if (ls_level_handle)
1435 set_light_sens_level(asus, asus->light_level); 1435 asus_als_level(asus, asus->light_level);
1436 1436
1437 /* GPS is on by default */ 1437 /* GPS is on by default */
1438 asus_gps_switch(asus, 1); 1438 asus_gps_switch(asus, 1);