aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-handheld-4.0/h1940/0001-rfkill-add-IR-type.patch
blob: bc2b855920382884552b6f4fbd9b48ca2c4c0276 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From 332ef0e6aaf772b94cceb46b26fec393e829efa0 Mon Sep 17 00:00:00 2001
From: Vasily Khoruzhick <anarsoul@gmail.com>
Date: Thu, 17 Oct 2013 12:19:47 +0300
Subject: [PATCH 01/15] rfkill: add IR type

Infrared receivers/transmitters can also be disabled,
so add IR type to rfkill subsystem

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 include/uapi/linux/rfkill.h | 2 ++
 net/rfkill/core.c           | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/rfkill.h b/include/uapi/linux/rfkill.h
index 058757f..d4ae526 100644
--- a/include/uapi/linux/rfkill.h
+++ b/include/uapi/linux/rfkill.h
@@ -38,6 +38,7 @@
  * @RFKILL_TYPE_GPS: switch is on a GPS device.
  * @RFKILL_TYPE_FM: switch is on a FM radio device.
  * @RFKILL_TYPE_NFC: switch is on an NFC device.
+ * @RFKILL_TYPE_IR: switch is on an IR device.
  * @NUM_RFKILL_TYPES: number of defined rfkill types
  */
 enum rfkill_type {
@@ -50,6 +51,7 @@ enum rfkill_type {
 	RFKILL_TYPE_GPS,
 	RFKILL_TYPE_FM,
 	RFKILL_TYPE_NFC,
+	RFKILL_TYPE_IR,
 	NUM_RFKILL_TYPES,
 };
 
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index fa7cd79..62f90fa 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -585,7 +585,7 @@ static DEVICE_ATTR_RO(name);
 
 static const char *rfkill_get_type_str(enum rfkill_type type)
 {
-	BUILD_BUG_ON(NUM_RFKILL_TYPES != RFKILL_TYPE_NFC + 1);
+	BUILD_BUG_ON(NUM_RFKILL_TYPES != RFKILL_TYPE_IR + 1);
 
 	switch (type) {
 	case RFKILL_TYPE_WLAN:
@@ -604,6 +604,8 @@ static const char *rfkill_get_type_str(enum rfkill_type type)
 		return "fm";
 	case RFKILL_TYPE_NFC:
 		return "nfc";
+	case RFKILL_TYPE_IR:
+		return "ir";
 	default:
 		BUG();
 	}
-- 
2.3.5