2008-08-01 19:37:55 +04:00
/*
2015-06-16 17:27:48 +03:00
* Copyright ( C ) 2015 Red Hat Inc .
* Hans de Goede < hdegoede @ redhat . com >
2008-08-01 19:37:55 +04:00
* Copyright ( C ) 2008 SuSE Linux Products GmbH
* Thomas Renninger < trenn @ suse . de >
*
* May be copied or modified under the terms of the GNU General Public License
*
* video_detect . c :
* After PCI devices are glued with ACPI devices
2009-06-10 23:56:00 +04:00
* acpi_get_pci_dev ( ) can be called to identify ACPI graphics
2008-08-01 19:37:55 +04:00
* devices for which a real graphics card is plugged in
*
* Depending on whether ACPI graphics extensions ( cmp . ACPI spec Appendix B )
* are available , video . ko should be used to handle the device .
*
2011-12-15 11:27:37 +04:00
* Otherwise vendor specific drivers like thinkpad_acpi , asus - laptop ,
2010-12-06 10:04:21 +03:00
* sony_acpi , . . . can take care about backlight brightness .
2008-08-01 19:37:55 +04:00
*
2015-06-16 17:27:48 +03:00
* Backlight drivers can use acpi_video_get_backlight_type ( ) to determine
* which driver should handle the backlight .
2008-08-01 19:37:55 +04:00
*
2015-06-16 17:27:48 +03:00
* If CONFIG_ACPI_VIDEO is neither set as " compiled in " ( y ) nor as a module ( m )
* this file will not be compiled and acpi_video_get_backlight_type ( ) will
* always return acpi_backlight_vendor .
2008-08-01 19:37:55 +04:00
*/
2011-10-27 00:22:14 +04:00
# include <linux/export.h>
2008-08-01 19:37:55 +04:00
# include <linux/acpi.h>
2015-06-16 17:27:48 +03:00
# include <linux/backlight.h>
2008-08-01 19:37:55 +04:00
# include <linux/dmi.h>
2015-06-16 17:27:47 +03:00
# include <linux/module.h>
2009-06-10 23:56:00 +04:00
# include <linux/pci.h>
2015-06-16 17:27:48 +03:00
# include <linux/types.h>
2015-08-13 19:53:37 +03:00
# include <linux/workqueue.h>
2015-06-16 17:27:48 +03:00
# include <acpi/video.h>
2008-08-01 19:37:55 +04:00
2015-06-16 17:28:13 +03:00
void acpi_video_unregister_backlight ( void ) ;
2015-06-16 17:27:52 +03:00
static bool backlight_notifier_registered ;
static struct notifier_block backlight_nb ;
2015-08-13 19:53:37 +03:00
static struct work_struct backlight_notify_work ;
2015-06-16 17:27:52 +03:00
2015-06-16 17:27:48 +03:00
static enum acpi_backlight_type acpi_backlight_cmdline = acpi_backlight_undef ;
static enum acpi_backlight_type acpi_backlight_dmi = acpi_backlight_undef ;
2008-08-01 19:37:55 +04:00
2015-06-16 17:27:47 +03:00
static void acpi_video_parse_cmdline ( void )
{
if ( ! strcmp ( " vendor " , acpi_video_backlight_string ) )
2015-06-16 17:27:48 +03:00
acpi_backlight_cmdline = acpi_backlight_vendor ;
2015-06-16 17:27:47 +03:00
if ( ! strcmp ( " video " , acpi_video_backlight_string ) )
2015-06-16 17:27:48 +03:00
acpi_backlight_cmdline = acpi_backlight_video ;
if ( ! strcmp ( " native " , acpi_video_backlight_string ) )
acpi_backlight_cmdline = acpi_backlight_native ;
if ( ! strcmp ( " none " , acpi_video_backlight_string ) )
acpi_backlight_cmdline = acpi_backlight_none ;
2015-06-16 17:27:47 +03:00
}
2008-08-01 19:37:55 +04:00
static acpi_status
find_video ( acpi_handle handle , u32 lvl , void * context , void * * rv )
{
long * cap = context ;
2009-06-10 23:56:00 +04:00
struct pci_dev * dev ;
2008-08-01 19:37:55 +04:00
struct acpi_device * acpi_dev ;
2015-06-13 15:26:59 +03:00
static const struct acpi_device_id video_ids [ ] = {
2008-08-01 19:37:55 +04:00
{ ACPI_VIDEO_HID , 0 } ,
{ " " , 0 } ,
} ;
if ( acpi_bus_get_device ( handle , & acpi_dev ) )
return AE_OK ;
if ( ! acpi_match_device_ids ( acpi_dev , video_ids ) ) {
2009-06-10 23:56:00 +04:00
dev = acpi_get_pci_dev ( handle ) ;
2008-08-01 19:37:55 +04:00
if ( ! dev )
return AE_OK ;
2009-06-10 23:56:00 +04:00
pci_dev_put ( dev ) ;
2013-03-05 01:30:41 +04:00
* cap | = acpi_is_video_device ( handle ) ;
2008-08-01 19:37:55 +04:00
}
return AE_OK ;
}
2012-06-13 11:32:04 +04:00
/* Force to use vendor driver when the ACPI device is known to be
* buggy */
static int video_detect_force_vendor ( const struct dmi_system_id * d )
{
2015-06-16 17:27:48 +03:00
acpi_backlight_dmi = acpi_backlight_vendor ;
2012-06-13 11:32:04 +04:00
return 0 ;
}
2015-06-16 17:27:51 +03:00
static int video_detect_force_video ( const struct dmi_system_id * d )
{
acpi_backlight_dmi = acpi_backlight_video ;
return 0 ;
}
static int video_detect_force_native ( const struct dmi_system_id * d )
{
acpi_backlight_dmi = acpi_backlight_native ;
return 0 ;
}
2017-07-13 03:45:57 +03:00
static int video_detect_force_none ( const struct dmi_system_id * d )
{
acpi_backlight_dmi = acpi_backlight_none ;
return 0 ;
}
2015-06-13 15:26:59 +03:00
static const struct dmi_system_id video_detect_dmi_table [ ] = {
2012-06-13 11:32:04 +04:00
/* On Samsung X360, the BIOS will set a flag (VDRV) if generic
* ACPI backlight device is used . This flag will definitively break
2019-03-25 21:34:00 +03:00
* the backlight interface ( even the vendor interface ) until next
2012-06-13 11:32:04 +04:00
* reboot . It ' s why we should prevent video . ko from being used here
* and we can ' t rely on a later call to acpi_video_unregister ( ) .
*/
{
. callback = video_detect_force_vendor ,
. ident = " X360 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " SAMSUNG ELECTRONICS CO., LTD. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " X360 " ) ,
DMI_MATCH ( DMI_BOARD_NAME , " X360 " ) ,
} ,
} ,
2012-11-30 16:02:50 +04:00
{
. callback = video_detect_force_vendor ,
. ident = " Asus UL30VT " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " ASUSTeK Computer Inc. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " UL30VT " ) ,
} ,
} ,
2013-05-19 15:52:33 +04:00
{
. callback = video_detect_force_vendor ,
. ident = " Asus UL30A " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " ASUSTeK Computer Inc. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " UL30A " ) ,
} ,
} ,
2019-04-01 04:24:39 +03:00
{
. callback = video_detect_force_vendor ,
2020-12-02 09:39:42 +03:00
. ident = " GIGABYTE GB-BXBT-2807 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " GIGABYTE " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " GB-BXBT-2807 " ) ,
} ,
} ,
{
2021-03-12 06:24:30 +03:00
. callback = video_detect_force_vendor ,
2019-04-01 04:24:39 +03:00
. ident = " Sony VPCEH3U1E " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " Sony Corporation " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " VPCEH3U1E " ) ,
} ,
} ,
2015-06-16 17:27:51 +03:00
/*
* These models have a working acpi_video backlight control , and using
* native backlight causes a regression where backlight does not work
* when userspace is not handling brightness key events . Disable
* native_backlight on these to fix this :
* https : //bugzilla.kernel.org/show_bug.cgi?id=81691
*/
{
. callback = video_detect_force_video ,
. ident = " ThinkPad T420 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " LENOVO " ) ,
DMI_MATCH ( DMI_PRODUCT_VERSION , " ThinkPad T420 " ) ,
} ,
} ,
{
. callback = video_detect_force_video ,
. ident = " ThinkPad T520 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " LENOVO " ) ,
DMI_MATCH ( DMI_PRODUCT_VERSION , " ThinkPad T520 " ) ,
} ,
} ,
{
. callback = video_detect_force_video ,
. ident = " ThinkPad X201s " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " LENOVO " ) ,
DMI_MATCH ( DMI_PRODUCT_VERSION , " ThinkPad X201s " ) ,
} ,
} ,
2020-11-05 05:06:00 +03:00
{
. callback = video_detect_force_video ,
. ident = " ThinkPad X201T " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " LENOVO " ) ,
DMI_MATCH ( DMI_PRODUCT_VERSION , " ThinkPad X201T " ) ,
} ,
} ,
2015-06-16 17:27:51 +03:00
/* The native backlight controls do not work on some older machines */
{
/* https://bugs.freedesktop.org/show_bug.cgi?id=81515 */
. callback = video_detect_force_video ,
. ident = " HP ENVY 15 Notebook " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " Hewlett-Packard " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " HP ENVY 15 Notebook PC " ) ,
} ,
} ,
{
. callback = video_detect_force_video ,
. ident = " SAMSUNG 870Z5E/880Z5E/680Z5E " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " SAMSUNG ELECTRONICS CO., LTD. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " 870Z5E/880Z5E/680Z5E " ) ,
} ,
} ,
{
. callback = video_detect_force_video ,
. ident = " SAMSUNG 370R4E/370R4V/370R5E/3570RE/370R5V " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " SAMSUNG ELECTRONICS CO., LTD. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME ,
" 370R4E/370R4V/370R5E/3570RE/370R5V " ) ,
} ,
} ,
{
/* https://bugzilla.redhat.com/show_bug.cgi?id=1186097 */
. callback = video_detect_force_video ,
. ident = " SAMSUNG 3570R/370R/470R/450R/510R/4450RV " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " SAMSUNG ELECTRONICS CO., LTD. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME ,
" 3570R/370R/470R/450R/510R/4450RV " ) ,
} ,
} ,
2018-03-19 20:01:45 +03:00
{
/* https://bugzilla.redhat.com/show_bug.cgi?id=1557060 */
. callback = video_detect_force_video ,
. ident = " SAMSUNG 670Z5E " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " SAMSUNG ELECTRONICS CO., LTD. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " 670Z5E " ) ,
} ,
} ,
2015-06-16 17:27:51 +03:00
{
/* https://bugzilla.redhat.com/show_bug.cgi?id=1094948 */
. callback = video_detect_force_video ,
. ident = " SAMSUNG 730U3E/740U3E " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " SAMSUNG ELECTRONICS CO., LTD. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " 730U3E/740U3E " ) ,
} ,
} ,
{
/* https://bugs.freedesktop.org/show_bug.cgi?id=87286 */
. callback = video_detect_force_video ,
. ident = " SAMSUNG 900X3C/900X3D/900X3E/900X4C/900X4D " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " SAMSUNG ELECTRONICS CO., LTD. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME ,
" 900X3C/900X3D/900X3E/900X4C/900X4D " ) ,
} ,
} ,
2015-10-26 17:20:46 +03:00
{
/* https://bugzilla.redhat.com/show_bug.cgi?id=1272633 */
. callback = video_detect_force_video ,
. ident = " Dell XPS14 L421X " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " Dell Inc. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " XPS L421X " ) ,
} ,
} ,
2015-06-16 17:27:51 +03:00
{
/* https://bugzilla.redhat.com/show_bug.cgi?id=1163574 */
. callback = video_detect_force_video ,
. ident = " Dell XPS15 L521X " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " Dell Inc. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " XPS L521X " ) ,
} ,
} ,
2015-12-30 08:11:24 +03:00
{
/* https://bugzilla.kernel.org/show_bug.cgi?id=108971 */
. callback = video_detect_force_video ,
. ident = " SAMSUNG 530U4E/540U4E " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " SAMSUNG ELECTRONICS CO., LTD. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " 530U4E/540U4E " ) ,
} ,
} ,
2020-09-14 01:34:03 +03:00
/* https://bugs.launchpad.net/bugs/1894667 */
{
. callback = video_detect_force_video ,
. ident = " HP 635 Notebook " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " Hewlett-Packard " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " HP 635 Notebook PC " ) ,
} ,
} ,
2015-06-16 17:27:51 +03:00
/* Non win8 machines which need native backlight nevertheless */
2015-10-21 14:45:03 +03:00
{
/* https://bugzilla.redhat.com/show_bug.cgi?id=1201530 */
. callback = video_detect_force_native ,
. ident = " Lenovo Ideapad S405 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " LENOVO " ) ,
DMI_MATCH ( DMI_BOARD_NAME , " Lenovo IdeaPad S405 " ) ,
} ,
} ,
2015-06-16 17:27:51 +03:00
{
/* https://bugzilla.redhat.com/show_bug.cgi?id=1187004 */
. callback = video_detect_force_native ,
. ident = " Lenovo Ideapad Z570 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " LENOVO " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " 102434U " ) ,
} ,
} ,
2019-12-16 12:55:12 +03:00
{
. callback = video_detect_force_native ,
. ident = " Lenovo E41-25 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " LENOVO " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " 81FS " ) ,
} ,
} ,
{
. callback = video_detect_force_native ,
. ident = " Lenovo E41-45 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " LENOVO " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " 82BK " ) ,
} ,
} ,
2015-06-16 17:27:51 +03:00
{
/* https://bugzilla.redhat.com/show_bug.cgi?id=1217249 */
. callback = video_detect_force_native ,
. ident = " Apple MacBook Pro 12,1 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " Apple Inc. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " MacBookPro12,1 " ) ,
} ,
} ,
2015-12-22 21:09:52 +03:00
{
. callback = video_detect_force_native ,
. ident = " Dell Vostro V131 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " Dell Inc. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " Vostro V131 " ) ,
} ,
} ,
2016-11-29 17:32:15 +03:00
{
/* https://bugzilla.redhat.com/show_bug.cgi?id=1123661 */
. callback = video_detect_force_native ,
. ident = " Dell XPS 17 L702X " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " Dell Inc. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " Dell System XPS L702X " ) ,
} ,
} ,
2017-06-14 11:29:16 +03:00
{
. callback = video_detect_force_native ,
. ident = " Dell Precision 7510 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " Dell Inc. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " Precision 7510 " ) ,
} ,
} ,
2020-03-31 15:36:23 +03:00
{
. callback = video_detect_force_native ,
. ident = " Acer Aspire 5738z " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " Acer " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " Aspire 5738 " ) ,
DMI_MATCH ( DMI_BOARD_NAME , " JV50 " ) ,
} ,
} ,
2020-05-22 15:22:28 +03:00
{
/* https://bugzilla.kernel.org/show_bug.cgi?id=207835 */
. callback = video_detect_force_native ,
. ident = " Acer TravelMate 5735Z " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " Acer " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " TravelMate 5735Z " ) ,
DMI_MATCH ( DMI_BOARD_NAME , " BA51_MV " ) ,
} ,
} ,
2021-04-19 10:39:17 +03:00
{
. callback = video_detect_force_native ,
. ident = " ASUSTeK COMPUTER INC. GA401 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " ASUSTeK COMPUTER INC. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " GA401 " ) ,
} ,
} ,
{
. callback = video_detect_force_native ,
. ident = " ASUSTeK COMPUTER INC. GA502 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " ASUSTeK COMPUTER INC. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " GA502 " ) ,
} ,
} ,
{
. callback = video_detect_force_native ,
. ident = " ASUSTeK COMPUTER INC. GA503 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " ASUSTeK COMPUTER INC. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " GA503 " ) ,
} ,
} ,
2019-12-17 22:08:11 +03:00
/*
* Desktops which falsely report a backlight and which our heuristics
* for this do not catch .
*/
2017-07-13 03:45:57 +03:00
{
. callback = video_detect_force_none ,
. ident = " Dell OptiPlex 9020M " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " Dell Inc. " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " OptiPlex 9020M " ) ,
} ,
} ,
2019-12-17 22:08:11 +03:00
{
. callback = video_detect_force_none ,
. ident = " MSI MS-7721 " ,
. matches = {
DMI_MATCH ( DMI_SYS_VENDOR , " MSI " ) ,
DMI_MATCH ( DMI_PRODUCT_NAME , " MS-7721 " ) ,
} ,
} ,
2012-06-13 11:32:04 +04:00
{ } ,
} ;
2015-08-13 19:53:37 +03:00
/* This uses a workqueue to avoid various locking ordering issues */
static void acpi_video_backlight_notify_work ( struct work_struct * work )
{
if ( acpi_video_get_backlight_type ( ) ! = acpi_backlight_video )
acpi_video_unregister_backlight ( ) ;
}
2015-06-16 17:27:52 +03:00
static int acpi_video_backlight_notify ( struct notifier_block * nb ,
unsigned long val , void * bd )
{
struct backlight_device * backlight = bd ;
/* A raw bl registering may change video -> native */
if ( backlight - > props . type = = BACKLIGHT_RAW & &
2015-08-13 19:53:37 +03:00
val = = BACKLIGHT_REGISTERED )
schedule_work ( & backlight_notify_work ) ;
2015-06-16 17:27:52 +03:00
return NOTIFY_OK ;
}
2008-08-01 19:37:55 +04:00
/*
2015-06-16 17:27:48 +03:00
* Determine which type of backlight interface to use on this system ,
* First check cmdline , then dmi quirks , then do autodetect .
*
* The autodetect order is :
* 1 ) Is the acpi - video backlight interface supported - >
* no , use a vendor interface
* 2 ) Is this a win8 " ready " BIOS and do we have a native interface - >
* yes , use a native interface
* 3 ) Else use the acpi - video interface
2008-08-01 19:37:55 +04:00
*
2015-06-16 17:27:48 +03:00
* Arguably the native on win8 check should be done first , but that would
* be a behavior change , which may causes issues .
2008-08-01 19:37:55 +04:00
*/
2015-06-16 17:27:48 +03:00
enum acpi_backlight_type acpi_video_get_backlight_type ( void )
2008-08-01 19:37:55 +04:00
{
2015-06-16 17:27:48 +03:00
static DEFINE_MUTEX ( init_mutex ) ;
static bool init_done ;
static long video_caps ;
2012-06-13 11:32:04 +04:00
2015-06-16 17:27:48 +03:00
/* Parse cmdline, dmi and acpi only once */
mutex_lock ( & init_mutex ) ;
if ( ! init_done ) {
acpi_video_parse_cmdline ( ) ;
2012-06-13 11:32:04 +04:00
dmi_check_system ( video_detect_dmi_table ) ;
2015-06-16 17:27:48 +03:00
acpi_walk_namespace ( ACPI_TYPE_DEVICE , ACPI_ROOT_OBJECT ,
2009-11-13 05:06:08 +03:00
ACPI_UINT32_MAX , find_video , NULL ,
2015-06-16 17:27:48 +03:00
& video_caps , NULL ) ;
2015-08-13 19:53:37 +03:00
INIT_WORK ( & backlight_notify_work ,
acpi_video_backlight_notify_work ) ;
2015-06-16 17:27:52 +03:00
backlight_nb . notifier_call = acpi_video_backlight_notify ;
backlight_nb . priority = 0 ;
if ( backlight_register_notifier ( & backlight_nb ) = = 0 )
backlight_notifier_registered = true ;
2015-06-16 17:27:48 +03:00
init_done = true ;
2008-08-01 19:37:55 +04:00
}
2015-06-16 17:27:48 +03:00
mutex_unlock ( & init_mutex ) ;
if ( acpi_backlight_cmdline ! = acpi_backlight_undef )
return acpi_backlight_cmdline ;
if ( acpi_backlight_dmi ! = acpi_backlight_undef )
return acpi_backlight_dmi ;
if ( ! ( video_caps & ACPI_VIDEO_BACKLIGHT ) )
return acpi_backlight_vendor ;
2016-04-27 15:45:03 +03:00
if ( acpi_osi_is_win8 ( ) & & backlight_device_get_by_type ( BACKLIGHT_RAW ) )
2015-06-16 17:27:48 +03:00
return acpi_backlight_native ;
return acpi_backlight_video ;
2008-08-01 19:37:55 +04:00
}
2015-06-16 17:27:48 +03:00
EXPORT_SYMBOL ( acpi_video_get_backlight_type ) ;
2008-08-01 19:37:55 +04:00
2015-06-16 17:27:48 +03:00
/*
* Set the preferred backlight interface type based on DMI info .
* This function allows DMI blacklists to be implemented by external
* platform drivers instead of putting a big blacklist in video_detect . c
*/
void acpi_video_set_dmi_backlight_type ( enum acpi_backlight_type type )
2008-08-01 19:37:55 +04:00
{
2015-06-16 17:27:48 +03:00
acpi_backlight_dmi = type ;
2015-06-16 17:27:49 +03:00
/* Remove acpi-video backlight interface if it is no longer desired */
if ( acpi_video_get_backlight_type ( ) ! = acpi_backlight_video )
acpi_video_unregister_backlight ( ) ;
2012-06-13 11:32:01 +04:00
}
2015-06-16 17:27:48 +03:00
EXPORT_SYMBOL ( acpi_video_set_dmi_backlight_type ) ;
2012-06-13 11:32:01 +04:00
2015-06-16 17:27:52 +03:00
void __exit acpi_video_detect_exit ( void )
{
if ( backlight_notifier_registered )
backlight_unregister_notifier ( & backlight_nb ) ;
}