summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/samsung-laptop.c
AgeCommit message (Collapse)Author
2013-01-30samsung-laptop: Disable on EFI hardwareMatt Fleming
It has been reported that running this driver on some Samsung laptops with EFI can cause those machines to become bricked as detailed in the following report, https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557 There have also been reports of this driver causing Machine Check Exceptions on recent EFI-enabled Samsung laptops, https://bugzilla.kernel.org/show_bug.cgi?id=47121 So disable it if booting from EFI since this driver relies on grovelling around in the BIOS memory map which isn't going to work. Cc: Corentin Chary <corentincj@iksaif.net> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Colin Ian King <colin.king@canonical.com> Cc: Steve Langasek <steve.langasek@canonical.com> Cc: <stable@vger.kernel.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-07samsung-laptop: Add quirk for broken acpi_video backlight on N250PSeth Forshee
BugLink: http://bugs.launchpad.net/bugs/1086921 Cc: stable@vger.kernel.org # v3.4+ Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2012-09-13drivers-platform-x86: remove useless #ifdef CONFIG_ACPI_VIDEOCorentin Chary
Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-07-28samsung-laptop: support R40/R41Corentin Chary
> Chassis Information > Manufacturer: SAMSUNG ELECTRONICS CO., LTD. > Type: Other Type should be "Notebook", "Laptop", .. not "Other". Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-07-28samsung-laptop: X360 ACPI backlight device is brokenCorentin Chary
Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-07-28drivers-platform-x86: use acpi_video_dmi_promote_vendor()Corentin Chary
Instead of using directly acpi_video_unregister(), use acpi_video_dmi_promote_vendor() (and make it call acpi_video_unregister() if needed) Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-26samsung-laptop: unregister ACPI video module for some well known laptopsCorentin Chary
On these laptops, the ACPI video is not functional, and very unlikely to be fixed by the vendor. Note that intel_backlight works for some of these laptops, and the backlight from samsung-laptop always work. The good news is that newer laptops have functional ACPI video device and won't end up growing this list. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-26samsung-laptop: cleanup return type: mode_t vs umode_tDan Carpenter
This function returns a umode_t (unsigned short) instead of mode_t which is an unsigned int on some architectures. Cleaning this up silences a compile warning: drivers/platform/x86/samsung-laptop.c:1108:2: warning: initialization from incompatible pointer type [enabled by default] Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-26drivers, samsung-laptop: fix usage of isalnumDavid Rientjes
linux/ctype.h is needed for isalnum() to avoid a build error: drivers/platform/x86/samsung-laptop.c: In function ‘samsung_sabi_diag’: drivers/platform/x86/samsung-laptop.c:1306: error: implicit declaration of function ‘isalnum’ Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-26drivers, samsung-laptop: fix initialization of sabi_data in sabi_set_commandbDavid Rientjes
Fields d0, d1, d2, and d3 are members of an anonymous struct inside an anonymous union inside struct sabi_data. Initialization must be done by wrapping the anonymous union and structs with brackets to avoid a build error: drivers/platform/x86/samsung-laptop.c: In function ‘sabi_set_commandb’: drivers/platform/x86/samsung-laptop.c:433: error: unknown field ‘d0’ specified in initializer drivers/platform/x86/samsung-laptop.c:433: warning: missing braces around initializer drivers/platform/x86/samsung-laptop.c:433: warning: (near initialization for ‘in.<anonymous>’) ... Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: fix seclinux rfkill and us it as fallbackCorentin Chary
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: tweak tracesCorentin Chary
- don't output error when probing features at load - print the SABI signature if samsung_sabi_init() succeed Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: dump model and version informationsCorentin Chary
We still need to figure out exactly what each of different fields represent, but they contain at least model and version informations. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: make the dmi check less strictCorentin Chary
This enable the driver for everything that look like a laptop and is from vendor "SAMSUNG ELECTRONICS CO., LTD.". Note that laptop supported by samsung-q10 seem to have a different vendor strict. Also remove every log output until we know that we have a SABI interface (except if the driver is forced to load, or debug is enabled). Keeping a whitelist of laptop with a model granularity is something that can't work without close vendor cooperation (and we don't have that). Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: add true rfkill support for swsmiCorentin Chary
The wireless status get and get commands seems to use one byte per device. First byte is for wlan and third is for bluetooh, we will have to find what the other are for. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: add keyboard backlight supportCorentin Chary
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: add usb charge supportCorentin Chary
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: add battery life extender supportCorentin Chary
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: remove selftestCorentin Chary
We can now do the self test using debugfs, so remove the code and keep the debug flag to enable more traces. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: add a small debugfs interfaceCorentin Chary
This allow to call arbitrary sabi commands wihout modifying the driver at all. For example, setting the keyboard backlight brightness to 5 using debugfs interface can be done like that: ; Set the command echo 0x78 > command ; Set the data echo 0x0582 > d0 ; Fill the rest with 0 echo 0 > d1 echo 0 > d2 echo 0 > d3 ; And issue the command cat call Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: ehance SABI supportCorentin Chary
* SABI command are on 16 bits, not 8 * SABI can read/write up to 11 byte of data * There is not real difference between "get" and "set" commands, so refactorise the code of both functions Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: use a sysfs groupCorentin Chary
Will be usefull later when we will have more platform sysfs files like battery_life_extender or usb_charge. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: don't handle backlight if handled by acpi/videoCorentin Chary
samsung-laptop is not at all related to ACPI, but since this interface is not documented at all, and the driver has to use it at load to understand how it works on the laptop, I think it's a good idea to disable it if a better solution is available. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: move code into init/exit functionsCorentin Chary
Create _init()/_exit() function for each subsystem, remove the local struct samsung_laptop * and only keep a struct platform_device * that can only be used in samsung_init() and samsung_exit(). Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20samsung-laptop: put all local variables in a single structureCorentin Chary
Even if this driver can only be loaded once, it is still a good idea to create some kind of context structure. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-01-13module_param: make bool parameters really bool (drivers & misc)Rusty Russell
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-10-24Platform: samsung_laptop: add support for X520 machines.Tommaso Massimi
my samsung laptop would be very happy if you add these lines to the file drivers/platform/x86/samsung-laptop.c Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24platform: samsung_laptop: add dmi information for Samsung R700 laptopsStefan Beller
My DMI model is this: >dmesg |grep DMI [ 0.000000] DMI present. [ 0.000000] DMI: SAMSUNG ELECTRONICS CO., LTD. SR700/SR700, BIOS 04SR 02/20/2008 adding dmi information of Samsung R700 laptops This adds the dmi information of Samsungs R700 laptops. Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24Platform: Detect samsung laptop quirk when initial level is zeroJohn Serock
This patch depends on the "Platform: Brightness quirk for samsung laptop driver" patch from Jason Stubbs. This patch adds a check for an initial brightness level of 0; if the level is 0, this patch changes the brightness level to 1 before the driver attempts to detect the brightness quirk. The Samsung N150 netbook experiences the brightness quirk. Without Jason's patch, the only brightness levels available on the N150 are 0, 1, and 8. This patch ensures that, when the initial brightness level is 0, the samsang-laptop driver detects the brightness quirk on the N150, thereby making brightness levels 0 through 8 available. Signed-off-by: John Serock <john.serock@gmail.com> Acked-by: Jason Stubbs <jasonbstubbs@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24Platform: fix samsung-laptop DMI identification for N220 modelRaul Gutierrez Segales
This is a follow-up for commit 78a7539b, which didn't cover the Samsung N220 laptop. With this backlight brightness works nicely on the N220 netbook. Signed-off-by: Raul Gutierrez Segales <rgs@collabora.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24Platform: Samsung laptop DMI info for NC210/NC110Jason Stubbs
This patch just adds the DMI info for the samsung laptop driver to work with the NC210/NC110. It needs the brightness quirk patch for proper support. Signed-off-by: Jason Stubbs <jasonbstubbs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24Platform: Brightness quirk for samsung laptop driverJason Stubbs
On some Samsung laptops the brightness regulation works slightly different. All SABI commands except for set_brightness work as expected. The behaviour of set_brightness is as follows: - Setting a new brightness will only step one level toward the new brightness level. For example, setting a level of 5 when the current level is 2 will result in a brightness level of 3. - A spurious KEY_BRIGHTNESS_UP or KEY_BRIGHTNESS_DOWN event is also generated along with the change in brightness. - Neither of the above two issues occur when changing from/to brightness level 0. This patch adds detection and a non-intrusive workaround for the above issues. Signed-off-by: Jason Stubbs <jasonbstubbs@gmail.com> Tested-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24Platform: Fix error path in samsung-laptop initDavid Herrmann
samsung_init() should not return success if not all devices are initialized. Otherwise, samsung_exit() will dereference sdev NULL pointers and others. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24platform: samsung_laptop: fix samsung brightness min/max calculationsJason Stubbs
The min_brightness value of the sabi_config is incorrectly used in brightness calculations. For the config where min_brightness = 1 and max_brightness = 8, the user visible range should be 0 to 7 with hardware being set in the range of 1 to 8. What is actually happening is that the user visible range is 0 to 8 with hardware being set in the range of -1 to 7. This patch fixes the above issue as well as a miscalculation that would occur in the case of min_brightness > 1. Signed-off-by: Jason Stubbs <jasonbstubbs@gmail.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24Platform: samsung_laptop: samsung backlight for R528/R728Smelov Andrey
patch works for me, but I need to add "acpi_backlight=vendor" to kernel params Signed-off-by: Smelov Andrey <xor29a@bk.ru> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-08-05Platform: fix samsung-laptop DMI identification for N150/N210/220/N230Thomas Courbon
Some samsung latop of the N150/N2{10,20,30} serie are badly detected by the samsung-laptop platform driver, see bug # 36082. It appears that N230 identifies itself as N150/N210/N220/N230 whereas the other identify themselves as N150/N210/220. This patch attemtp fix #36082 allowing correct identification for all the said netbook model. Reported-by: Daniel Eklöf <daniel@ekloef.se> Signed-off-by: Thomas Courbon <thcourbon@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-08-05Samsung Laptop platform driver: support N510J Witteveen
The N510 benefits from this code as well. Below is a patch to include support. Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-04-12samsung-laptop: set backlight typeMichal Marek
Cherry-picked from drivers/staging/samsung-laptop/samsung-laptop.c Signed-off-by: Michal Marek <mmarek@suse.cz> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-04-12samsung-laptop: Samsung R410P backlight driverAlberto Mardegan
Here's a trivial patch which adds support to the backlight device found in Samsung R410 Plus laptops. Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> [mmarek: cherry-picked from staging commit d542f180] Signed-off-by: Michal Marek <mmarek@suse.cz> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-04-12samsung-laptop: add support for N230 modelGreg Kroah-Hartman
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> [mmarek: cherry-picked from staging commit 0789b003] Signed-off-by: Michal Marek <mmarek@suse.cz> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-03-28platform-driver-x86: samsung-laptop: make dmi_check_cb to return 1 instead of 0Axel Lin
dmi_check_system() walks the table running matching functions until someone returns non zero or we hit the end. This patch makes dmi_check_cb to return 1 so dmi_check_system() return immediately when a match is found. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-03-28Platform: add Samsung Laptop platform driverGreg Kroah-Hartman
This adds the samsung-laptop driver to the kernel. It now supports all known Samsung laptops that use the SABI interface. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>