From 5b31efc8915d59a31c1b9e0defa4a248cedd91e9 Mon Sep 17 00:00:00 2001 From: Daniil Bondarev Date: Fri, 22 Apr 2011 05:39:34 +0800 Subject: [PATCH 1/5] Added Samsung N350. --- README | 1 + samsung-backlight.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README b/README index 22d63ad..44c8b81 100644 --- a/README +++ b/README @@ -18,6 +18,7 @@ Currently supported: * NF110/NF210/NF310 * N220 * N230 +* N350 Not tested: diff --git a/samsung-backlight.c b/samsung-backlight.c index 8d16408..058e537 100644 --- a/samsung-backlight.c +++ b/samsung-backlight.c @@ -1,6 +1,6 @@ /* * Samsung N130, N220, N230 NC10, Np-Q45, R468/R418, X320/X420/X520, X360, - * R518, R510/P510, R410 and NF110/NF210/NF310 Laptop Backlight driver + * R518, R510/P510, R410, NF110/NF210/NF310 and N350 Laptop Backlight driver * * Copyright (C) 2011 Peter Savichev (proton) (psavichev@gmail.com) * Copyright (C) 2010 xonatius (xonatius@gmail.com) @@ -207,7 +207,15 @@ static struct dmi_system_id __initdata samsung_dmi_table[] = { }, .callback = dmi_check_cb, }, - + { + .ident = "N350", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), + DMI_MATCH(DMI_PRODUCT_NAME, "N350"), + DMI_MATCH(DMI_BOARD_NAME, "N350"), + }, + .callback = dmi_check_cb, + }, { }, }; @@ -223,7 +231,7 @@ static int __init samsung_init(void) * The Samsung N120, N130, and NC10 use pci device id 0x27ae, while the * NP-Q45 uses 0x2a02 * R410P, R468/R418, R518, R510/P510, X320/X420/X520 and X360 uses 0x2a42 - * N220 and NF110/NF210/NF310 uses 0xa011 + * N220, NF110/NF210/NF310 and N350 uses 0xa011 * Odds are we might need to add more to the * list over time... */ @@ -282,3 +290,4 @@ MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnR510/P510:*:rnR510/P510:*"); MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnNF110/NF210/NF310:*:rnNF110/NF210/NF310:*"); MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnN220:*:rnN220:*"); MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnN230:*:rnN230:*"); +MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnN350:*:rnN350:*"); From 2dadfdd66b8251c12f711a36176e3e05cd70c892 Mon Sep 17 00:00:00 2001 From: Daniil Bondarev Date: Fri, 22 Apr 2011 05:55:58 +0800 Subject: [PATCH 2/5] README clone fix. --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 44c8b81..f1cc258 100644 --- a/README +++ b/README @@ -32,7 +32,7 @@ Have a similar problem, but need more information to add it (if you are owner of ## Installation -git clone https://xonatius@github.com/xonatius/samsung-backlight.git +git clone git://github.com/xonatius/samsung-backlight.git cd samsung-backlight make sudo make install From c6413b23537c4d1c756fa3d813bb3b2f15accf48 Mon Sep 17 00:00:00 2001 From: Daniil Bondarev Date: Tue, 10 May 2011 07:10:36 +0800 Subject: [PATCH 3/5] Added samsung R470/R420 support refs #5 --- README | 1 + samsung-backlight.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README b/README index f1cc258..990b763 100644 --- a/README +++ b/README @@ -19,6 +19,7 @@ Currently supported: * N220 * N230 * N350 +* R470/R420 Not tested: diff --git a/samsung-backlight.c b/samsung-backlight.c index 058e537..9c71af0 100644 --- a/samsung-backlight.c +++ b/samsung-backlight.c @@ -1,6 +1,7 @@ /* * Samsung N130, N220, N230 NC10, Np-Q45, R468/R418, X320/X420/X520, X360, - * R518, R510/P510, R410, NF110/NF210/NF310 and N350 Laptop Backlight driver + * R518, R510/P510, R410, NF110/NF210/NF310, N350 and R470/R420 + * Laptop Backlight driver * * Copyright (C) 2011 Peter Savichev (proton) (psavichev@gmail.com) * Copyright (C) 2010 xonatius (xonatius@gmail.com) @@ -207,7 +208,7 @@ static struct dmi_system_id __initdata samsung_dmi_table[] = { }, .callback = dmi_check_cb, }, - { + { .ident = "N350", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), @@ -216,6 +217,15 @@ static struct dmi_system_id __initdata samsung_dmi_table[] = { }, .callback = dmi_check_cb, }, + { + .ident = "R470/R420", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), + DMI_MATCH(DMI_PRODUCT_NAME, "R470/R420"), + DMI_MATCH(DMI_BOARD_NAME, "R470/R420"), + }, + .callback = dmi_check_cb, + }, { }, }; @@ -230,7 +240,8 @@ static int __init samsung_init(void) /* * The Samsung N120, N130, and NC10 use pci device id 0x27ae, while the * NP-Q45 uses 0x2a02 - * R410P, R468/R418, R518, R510/P510, X320/X420/X520 and X360 uses 0x2a42 + * R410P, R468/R418, R518, R510/P510, X320/X420/X520, X360 and R470/R420 + * uses 0x2a42 * N220, NF110/NF210/NF310 and N350 uses 0xa011 * Odds are we might need to add more to the * list over time... @@ -291,3 +302,4 @@ MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnNF110/NF210/NF310:*:rnNF110/ MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnN220:*:rnN220:*"); MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnN230:*:rnN230:*"); MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnN350:*:rnN350:*"); +MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnR470/R420:*:rnR470/R420:*"); From fb7173e8aa6947d31fe9b636b7566a29c986c49a Mon Sep 17 00:00:00 2001 From: Daniil Bondarev Date: Sat, 11 Jun 2011 03:57:44 +0800 Subject: [PATCH 4/5] Added R528/R728. ref #7 --- README | 1 + samsung-backlight.c | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README b/README index 990b763..b5b861f 100644 --- a/README +++ b/README @@ -20,6 +20,7 @@ Currently supported: * N230 * N350 * R470/R420 +* R528/R728 Not tested: diff --git a/samsung-backlight.c b/samsung-backlight.c index 9c71af0..7551984 100644 --- a/samsung-backlight.c +++ b/samsung-backlight.c @@ -1,6 +1,6 @@ /* * Samsung N130, N220, N230 NC10, Np-Q45, R468/R418, X320/X420/X520, X360, - * R518, R510/P510, R410, NF110/NF210/NF310, N350 and R470/R420 + * R518, R510/P510, R410, NF110/NF210/NF310, N350, R470/R420, R528/R728 * Laptop Backlight driver * * Copyright (C) 2011 Peter Savichev (proton) (psavichev@gmail.com) @@ -226,6 +226,15 @@ static struct dmi_system_id __initdata samsung_dmi_table[] = { }, .callback = dmi_check_cb, }, + { + .ident = "R528/R728", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), + DMI_MATCH(DMI_PRODUCT_NAME, "R528/R728"), + DMI_MATCH(DMI_BOARD_NAME, "R528/R728"), + }, + .callback = dmi_check_cb, + }, { }, }; @@ -240,8 +249,8 @@ static int __init samsung_init(void) /* * The Samsung N120, N130, and NC10 use pci device id 0x27ae, while the * NP-Q45 uses 0x2a02 - * R410P, R468/R418, R518, R510/P510, X320/X420/X520, X360 and R470/R420 - * uses 0x2a42 + * R410P, R468/R418, R518, R510/P510, X320/X420/X520, X360, R470/R420 + * and R528/R728 uses 0x2a42 * N220, NF110/NF210/NF310 and N350 uses 0xa011 * Odds are we might need to add more to the * list over time... @@ -303,3 +312,4 @@ MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnN220:*:rnN220:*"); MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnN230:*:rnN230:*"); MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnN350:*:rnN350:*"); MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnR470/R420:*:rnR470/R420:*"); +MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnR528/R728:*:rnR528/R728:*"); From 00116d86292b01eff0ba5495f36d49ebd19f800d Mon Sep 17 00:00:00 2001 From: "Peter Savichev (proton)" Date: Wed, 31 Aug 2011 16:43:53 +0400 Subject: [PATCH 5/5] changed brightness levels (lowest level was too high for nighttime) --- samsung-backlight.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/samsung-backlight.c b/samsung-backlight.c index 7551984..eba99f4 100644 --- a/samsung-backlight.c +++ b/samsung-backlight.c @@ -32,9 +32,9 @@ * overkill, that's fine. So let's map the 256 values to 8 different ones: * * userspace 0 1 2 3 4 5 6 7 - * hardware 31 63 95 127 159 195 223 255 + * hardware 3 39 75 111 147 183 219 255 * - * or hardware = ((userspace + 1) * 32)-1 + * or hardware = (userspace * 36) + 3 * * Note, we keep value 0 at a positive value, otherwise the screen goes * blank because HAL likes to set the backlight to 0 at startup when there is @@ -55,7 +55,7 @@ static u8 read_brightness(void) u8 user_brightness = 0; pci_read_config_byte(pci_device, offset, &kernel_brightness); - user_brightness = ((kernel_brightness + 1) / 32) - 1; + user_brightness = (kernel_brightness - 3) / 36; return user_brightness; } @@ -63,7 +63,7 @@ static void set_brightness(u8 user_brightness) { u16 kernel_brightness = 0; - kernel_brightness = ((user_brightness + 1) * 32) - 1; + kernel_brightness = (user_brightness * 36) + 3; pci_write_config_byte(pci_device, offset, (u8)kernel_brightness); } @@ -249,14 +249,14 @@ static int __init samsung_init(void) /* * The Samsung N120, N130, and NC10 use pci device id 0x27ae, while the * NP-Q45 uses 0x2a02 - * R410P, R468/R418, R518, R510/P510, X320/X420/X520, X360, R470/R420 + * R410P, R468/R418, R518, R510/P510, X320/X420/X520, X360, R470/R420 * and R528/R728 uses 0x2a42 * N220, NF110/NF210/NF310 and N350 uses 0xa011 * Odds are we might need to add more to the * list over time... */ pci_device = pci_get_device(PCI_VENDOR_ID_INTEL, 0x27ae, NULL); - if (!pci_device) + if (!pci_device) pci_device = pci_get_device(PCI_VENDOR_ID_INTEL, 0x2a02, NULL); if (!pci_device) pci_device = pci_get_device(PCI_VENDOR_ID_INTEL, 0x2a42, NULL); @@ -264,7 +264,7 @@ static int __init samsung_init(void) pci_device = pci_get_device(PCI_VENDOR_ID_INTEL, 0xa011, NULL); if (!pci_device) return -ENODEV; - + /* create a backlight device to talk to this one */ backlight_device = backlight_device_register("samsung",