Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
243e1ef8
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
243e1ef8
编写于
12月 16, 2009
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'toshiba-bt' into release
上级
7d8c2206
42b4e9ee
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
160 addition
and
0 deletion
+160
-0
drivers/platform/x86/Kconfig
drivers/platform/x86/Kconfig
+15
-0
drivers/platform/x86/Makefile
drivers/platform/x86/Makefile
+1
-0
drivers/platform/x86/toshiba_bluetooth.c
drivers/platform/x86/toshiba_bluetooth.c
+144
-0
未找到文件。
drivers/platform/x86/Kconfig
浏览文件 @
243e1ef8
...
...
@@ -449,4 +449,19 @@ config ACPI_TOSHIBA
If you have a legacy free Toshiba laptop (such as the Libretto L1
series), say Y.
config TOSHIBA_BT_RFKILL
tristate "Toshiba Bluetooth RFKill switch support"
depends on ACPI
---help---
This driver adds support for Bluetooth events for the RFKill
switch on modern Toshiba laptops with full ACPI support and
an RFKill switch.
This driver handles RFKill events for the TOS6205 Bluetooth,
and re-enables it when the switch is set back to the 'on'
position.
If you have a modern Toshiba laptop with a Bluetooth and an
RFKill switch (such as the Portege R500), say Y.
endif # X86_PLATFORM_DEVICES
drivers/platform/x86/Makefile
浏览文件 @
243e1ef8
...
...
@@ -22,3 +22,4 @@ obj-$(CONFIG_MSI_WMI) += msi-wmi.o
obj-$(CONFIG_ACPI_ASUS)
+=
asus_acpi.o
obj-$(CONFIG_TOPSTAR_LAPTOP)
+=
topstar-laptop.o
obj-$(CONFIG_ACPI_TOSHIBA)
+=
toshiba_acpi.o
obj-$(CONFIG_TOSHIBA_BT_RFKILL)
+=
toshiba_bluetooth.o
drivers/platform/x86/toshiba_bluetooth.c
0 → 100644
浏览文件 @
243e1ef8
/*
* Toshiba Bluetooth Enable Driver
*
* Copyright (C) 2009 Jes Sorensen <Jes.Sorensen@gmail.com>
*
* Thanks to Matthew Garrett for background info on ACPI innards which
* normal people aren't meant to understand :-)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Note the Toshiba Bluetooth RFKill switch seems to be a strange
* fish. It only provides a BT event when the switch is flipped to
* the 'on' position. When flipping it to 'off', the USB device is
* simply pulled away underneath us, without any BT event being
* delivered.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
MODULE_AUTHOR
(
"Jes Sorensen <Jes.Sorensen@gmail.com>"
);
MODULE_DESCRIPTION
(
"Toshiba Laptop ACPI Bluetooth Enable Driver"
);
MODULE_LICENSE
(
"GPL"
);
static
int
toshiba_bt_rfkill_add
(
struct
acpi_device
*
device
);
static
int
toshiba_bt_rfkill_remove
(
struct
acpi_device
*
device
,
int
type
);
static
void
toshiba_bt_rfkill_notify
(
struct
acpi_device
*
device
,
u32
event
);
static
int
toshiba_bt_resume
(
struct
acpi_device
*
device
);
static
const
struct
acpi_device_id
bt_device_ids
[]
=
{
{
"TOS6205"
,
0
},
{
""
,
0
},
};
MODULE_DEVICE_TABLE
(
acpi
,
bt_device_ids
);
static
struct
acpi_driver
toshiba_bt_rfkill_driver
=
{
.
name
=
"Toshiba BT"
,
.
class
=
"Toshiba"
,
.
ids
=
bt_device_ids
,
.
ops
=
{
.
add
=
toshiba_bt_rfkill_add
,
.
remove
=
toshiba_bt_rfkill_remove
,
.
notify
=
toshiba_bt_rfkill_notify
,
.
resume
=
toshiba_bt_resume
,
},
.
owner
=
THIS_MODULE
,
};
static
int
toshiba_bluetooth_enable
(
acpi_handle
handle
)
{
acpi_status
res1
,
res2
;
acpi_integer
result
;
/*
* Query ACPI to verify RFKill switch is set to 'on'.
* If not, we return silently, no need to report it as
* an error.
*/
res1
=
acpi_evaluate_integer
(
handle
,
"BTST"
,
NULL
,
&
result
);
if
(
ACPI_FAILURE
(
res1
))
return
res1
;
if
(
!
(
result
&
0x01
))
return
0
;
printk
(
KERN_INFO
"toshiba_bluetooth: Re-enabling Toshiba Bluetooth
\n
"
);
res1
=
acpi_evaluate_object
(
handle
,
"AUSB"
,
NULL
,
NULL
);
res2
=
acpi_evaluate_object
(
handle
,
"BTPO"
,
NULL
,
NULL
);
if
(
!
ACPI_FAILURE
(
res1
)
||
!
ACPI_FAILURE
(
res2
))
return
0
;
printk
(
KERN_WARNING
"toshiba_bluetooth: Failed to re-enable "
"Toshiba Bluetooth
\n
"
);
return
-
ENODEV
;
}
static
void
toshiba_bt_rfkill_notify
(
struct
acpi_device
*
device
,
u32
event
)
{
toshiba_bluetooth_enable
(
device
->
handle
);
}
static
int
toshiba_bt_resume
(
struct
acpi_device
*
device
)
{
return
toshiba_bluetooth_enable
(
device
->
handle
);
}
static
int
toshiba_bt_rfkill_add
(
struct
acpi_device
*
device
)
{
acpi_status
status
;
acpi_integer
bt_present
;
int
result
=
-
ENODEV
;
/*
* Some Toshiba laptops may have a fake TOS6205 device in
* their ACPI BIOS, so query the _STA method to see if there
* is really anything there, before trying to enable it.
*/
status
=
acpi_evaluate_integer
(
device
->
handle
,
"_STA"
,
NULL
,
&
bt_present
);
if
(
!
ACPI_FAILURE
(
status
)
&&
bt_present
)
{
printk
(
KERN_INFO
"Detected Toshiba ACPI Bluetooth device - "
"installing RFKill handler
\n
"
);
result
=
toshiba_bluetooth_enable
(
device
->
handle
);
}
return
result
;
}
static
int
__init
toshiba_bt_rfkill_init
(
void
)
{
int
result
;
result
=
acpi_bus_register_driver
(
&
toshiba_bt_rfkill_driver
);
if
(
result
<
0
)
{
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"Error registering driver
\n
"
));
return
result
;
}
return
0
;
}
static
int
toshiba_bt_rfkill_remove
(
struct
acpi_device
*
device
,
int
type
)
{
/* clean up */
return
0
;
}
static
void
__exit
toshiba_bt_rfkill_exit
(
void
)
{
acpi_bus_unregister_driver
(
&
toshiba_bt_rfkill_driver
);
}
module_init
(
toshiba_bt_rfkill_init
);
module_exit
(
toshiba_bt_rfkill_exit
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录