summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/compal-laptop.c
AgeCommit message (Collapse)AuthorFilesLines
2014-01-21compal-laptop: Use devm_hwmon_device_register_with_groupsGuenter Roeck1-29/+23
Simplify the code and create hwmon attributes as well as hwmon device in one go. With the new hwmon API, hwmon attributes are now attached to the hwmon device. Therefore, split hwmon and device attributes into two separate groups. Platform attributes are still attached to the platform device. Also use devm_kzalloc to allocate local data structures for further simplification. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-01-21compal-laptop: Replace SENSOR_DEVICE_ATTR with DEVICE_ATTRGuenter Roeck1-33/+33
The extra argument to SENSOR_DEVICE_ATTR is not used. It is therefore not necessary to use SENSOR_DEVICE_ATTR in the first place. Replace it with DEVICE_ATTR. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2014-01-21compal-laptop: Use devm_kzalloc to allocate local data structureGuenter Roeck1-7/+2
Reduce code size and simplify error path. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-09-05platform: x86: remove unnecessary platform_set_drvdata()Jingoo Han1-1/+0
The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-09-05platform: replace strict_strto*() with kstrto*()Jingoo Han1-2/+4
The usage of strict_strtoul() and strict_strtol() is not preferred, because strict_strtoul() and strict_strtol() are obsolete. Thus, kstrtoul() and kstrtol() should be used. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-01-03Drivers: platform: x86: remove __dev* attributes.Greg Kroah-Hartman1-5/+5
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Joey Lee <jlee@novell.com> Cc: Matthew Garrett <mjg@redhat.com> Cc: Peter Feuerer <peter@piie.net> Cc: Corentin Chary <corentin.chary@gmail.com> Cc: Cezary Jackiewicz <cezary.jackiewicz@gmail.com> Cc: Robert Gerlach <khnz@gmx.de> Cc: Ike Panhc <ike.pan@canonical.com> Cc: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-20compal-laptop: switch to using use MODULE_DEVICE_TABLEDmitry Torokhov1-13/+1
Use MODULE_DEVCE_TABLE instead of rolling MODULE_ALIAS by hand. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-01-13module_param: make bool parameters really bool (drivers & misc)Rusty Russell1-1/+1
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-07-07drivers/platform/x86: Fix memory leakAndre Bartke1-1/+3
data is not freed in the error case of compal_probe(). Signed-off-by: Andre Bartke <andre.bartke@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-05-29Merge branch 'for_linus' of ↵Linus Torvalds1-13/+9
git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86 * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86: (43 commits) acer-wmi: support integer return type from WMI methods msi-laptop: fix section mismatch in reference from the function load_scm_model_init acer-wmi: support to set communication device state by new wmid method acer-wmi: allow 64-bits return buffer from WMI methods acer-wmi: check the existence of internal 3G device when set capability platform/x86:delete two unused variables support wlan hotkey on Acer Travelmate 5735Z platform-x86: intel_mid_thermal: Fix memory leak platform/x86: Fix Makefile for intel_mid_powerbtn platform/x86: Simplify intel_mid_powerbtn acer-wmi: Delete out-of-date documentation acerhdf: Clean up includes acerhdf: Drop pointless dependency on THERMAL_HWMON acer-wmi: Update MAINTAINERS wmi: Orphan ACPI-WMI driver tc1100-wmi: Orphan driver acer-wmi: does not allow negative number set to initial device state platform/oaktrail: ACPI EC Extra driver for Oaktrail thinkpad_acpi: Convert printks to pr_<level> thinkpad_acpi: Correct !CONFIG_THINKPAD_ACPI_VIDEO warning ...
2011-05-29Merge branch 'ec-cleanup' into releaseLen Brown1-7/+7
Conflicts: drivers/platform/x86/compal-laptop.c
2011-05-27compal-laptop: Convert printks to pr_<level>Joe Perches1-13/+9
Add pr_fmt. Convert printks to pr_<level> removing DRIVER_NAME prefix. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-04-01ACPI EC: remove dead codeThomas Renninger1-6/+6
static void acpi_ec_gpe_query(void *ec_cxt); -> The function is right above this declaration -> not needed. poll_force is also not used, cleaned up in ec.c and its users: compal-laptop and msi-laptop. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2011-03-28platform-drivers: x86: fix common misspellingsLucas De Marchi1-1/+1
Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-03-28platform-driver-x86: fix wrong merge for compal-laptop.cAxel Lin1-3/+3
I found the commit 80183a4b "compal-laptop/fujitsu-laptop/msi-laptop: make dmi_check_cb to return 1 instead of 0" has wrong patch merge. The original patch change the return value for dmi_check_cb(): https://lkml.org/lkml/2010/7/2/88 But commit 80183a4b changed the return value for set_backlight_level. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-03-22backlight: add backlight typeMatthew Garrett1-0/+1
There may be multiple ways of controlling the backlight on a given machine. Allow drivers to expose the type of interface they are providing, making it possible for userspace to make appropriate policy decisions. Signed-off-by: Matthew Garrett <mjg@redhat.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: David Airlie <airlied@linux.ie> Cc: Alex Deucher <alexdeucher@gmail.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Len Brown <lenb@kernel.org> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-07Support KHLB2 in the compal laptop driverAlbert Astals Cid1-0/+8
Add the KHLB2 model identifier to the list of supported models Signed-off-by: Albert Astals Cid <aacid@kde.org> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16platform/x86: move rfkill for Dell Mini 1012 to compal-laptopVictor van den Elzen1-0/+9
Like others in the Mini series, the Dell Mini 1012 does not support the smbios hook required by dell-laptop. Signed-off-by: Victor van den Elzen <victor.vde@gmail.com> Cc: stable <stable@kernel.org> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03compal-laptop/fujitsu-laptop/msi-laptop: make dmi_check_cb to return 1 ↵Axel Lin1-1/+1
instead of 0 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> Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au> Cc: Matthew Garrett <mjg@redhat.com>a Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-03compal-laptop: add JHL90, battery & hwmon interfaceRoald Frederickx1-105/+822
The driver now supports the Compal JHL90 (which I use) and it has some added features. The biggest novelties are a battery interface (power_supply) and a temperature and fan control interface (hmwon). It also adds a power-off feature to the backlight subsystem and it exports a few files that can enable/disable wake_on_XXX events. Much of the original code of the old features is still there, but I've changed some names to keep the naming more coherent with the added functionalities. (Sorry for the huge patch) Some technical stuff about the new driver: First of all, I'm not sure if the extra features also work on the other Compal boards. Currently they only get enabled if the DMI data indicates you are on a JHL90 board. Secondly, I've noticed a quirk in my fan controller. I have to re-send the wanted pwm-level to the controller every so often. If I don't do this, the fanspeed will slowly rise until after a couple of minutes it's at full speed. (Note that every normal userland application will probably update the pwm-level every so often anyway, based on temperature readings, so this might not be an issue in practice) If this turns out to be a problem with all the controllers, maybe we should implement a kernel timer and have the driver re-send the pwm level every XX seconds to make this transparent to userspace? (However, I couldn't immediately find a way to do this cleanly.) Additional information can be found in the source comments. [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: add missing semicolon] Signed-off-by: Roald Frederickx <roald.frederickx@gmail.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-03-16backlight: Allow properties to be passed at registrationMatthew Garrett1-4/+7
Values such as max_brightness should be set before backlights are registered, but the current API doesn't allow that. Add a parameter to backlight_device_register and update drivers to ensure that they set this correctly. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-25compal-laptop: Replace sysfs support with rfkill supportMario Limonciello1-138/+63
This drops the support for manually groking the files in sysfs to turn on and off the WLAN and BT for Compal laptops in favor of platform rfkill support. It has been combined into a single patch to not introduce regressions in the process of simply adding rfkill support Signed-off-by: Mario Limonciello <Mario_Limonciello@Dell.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com> Cc: Cezary Jackiewicz <cezary.jackiewicz@gmail.com>
2010-02-25compal-laptop: Add support for known Compal made Dell laptopsMario Limonciello1-0/+46
The following Dell laptops are known to have been manufacturer by Compal and are supported by the compal-laptop platform driver - Mini 9 - Mini 10 - Mini 12 - Mini 10v - Inspiron 11z Signed-off-by: Mario Limonciello <Mario_Limonciello@Dell.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com> Cc: Cezary Jackiewicz <cezary.jackiewicz@gmail.com>
2009-12-12drop explicit include of autoconf.hSam Ravnborg1-1/+0
kbuild.h forces include of autoconf.h on the commandline using -include - so we do not need to include the file explicit. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2008-12-19create drivers/platform/x86/ from drivers/misc/Len Brown1-0/+406
Move x86 platform specific drivers from drivers/misc/ to a new home under drivers/platform/x86/. The community has been maintaining x86 vendor-specific platform specific drivers under /drivers/misc/ for a few years. The oldest ones started life under drivers/acpi. They moved out of drivers/acpi/ because they don't actually implement the ACPI specification, but either simply use ACPI, or implement vendor-specific ACPI extensions. In the future we anticipate... drivers/misc/ will go away. other architectures will create drivers/platform/<arch> Signed-off-by: Len Brown <len.brown@intel.com>