diff mbox

[v2,02/11] leds: add uapi header file

Message ID 1427464185-27950-3-git-send-email-j.anaszewski@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jacek Anaszewski March 27, 2015, 1:49 p.m. UTC
This patch adds header file for LED subsystem definitions and
declarations. The initial need for the header is allowing the
user space to discover the semantics of flash fault bits.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Bryan Wu <cooloney@gmail.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
---
 include/linux/led-class-flash.h |   16 +---------------
 include/uapi/linux/leds.h       |   34 ++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 15 deletions(-)
 create mode 100644 include/uapi/linux/leds.h

Comments

Sakari Ailus March 28, 2015, 10:35 p.m. UTC | #1
Hi Jacek,

On Fri, Mar 27, 2015 at 02:49:36PM +0100, Jacek Anaszewski wrote:
> This patch adds header file for LED subsystem definitions and
> declarations. The initial need for the header is allowing the
> user space to discover the semantics of flash fault bits.

Where does the user space need these? The fault codes are strings in the
sysfs interface.
Jacek Anaszewski March 30, 2015, 7:22 a.m. UTC | #2
Hi Sakari,

On 03/28/2015 11:35 PM, Sakari Ailus wrote:
> Hi Jacek,
>
> On Fri, Mar 27, 2015 at 02:49:36PM +0100, Jacek Anaszewski wrote:
>> This patch adds header file for LED subsystem definitions and
>> declarations. The initial need for the header is allowing the
>> user space to discover the semantics of flash fault bits.
>
> Where does the user space need these? The fault codes are strings in the
> sysfs interface.
>

Right, this is not needed. Please ignore this patch.
diff mbox

Patch

diff --git a/include/linux/led-class-flash.h b/include/linux/led-class-flash.h
index e97966d..3cf58c4 100644
--- a/include/linux/led-class-flash.h
+++ b/include/linux/led-class-flash.h
@@ -13,25 +13,11 @@ 
 #define __LINUX_FLASH_LEDS_H_INCLUDED
 
 #include <linux/leds.h>
+#include <uapi/linux/leds.h>
 
 struct device_node;
 struct led_classdev_flash;
 
-/*
- * Supported led fault bits - must be kept in synch
- * with V4L2_FLASH_FAULT bits.
- */
-#define LED_FAULT_OVER_VOLTAGE		(1 << 0)
-#define LED_FAULT_TIMEOUT		(1 << 1)
-#define LED_FAULT_OVER_TEMPERATURE	(1 << 2)
-#define LED_FAULT_SHORT_CIRCUIT		(1 << 3)
-#define LED_FAULT_OVER_CURRENT		(1 << 4)
-#define LED_FAULT_INDICATOR		(1 << 5)
-#define LED_FAULT_UNDER_VOLTAGE		(1 << 6)
-#define LED_FAULT_INPUT_VOLTAGE		(1 << 7)
-#define LED_FAULT_LED_OVER_TEMPERATURE	(1 << 8)
-#define LED_NUM_FLASH_FAULTS		9
-
 #define LED_FLASH_SYSFS_GROUPS_SIZE	5
 
 struct led_flash_ops {
diff --git a/include/uapi/linux/leds.h b/include/uapi/linux/leds.h
new file mode 100644
index 0000000..f657f78
--- /dev/null
+++ b/include/uapi/linux/leds.h
@@ -0,0 +1,34 @@ 
+/*
+ * include/uapi/linux/leds.h
+ *
+ * LED subsystem specific definitions and declarations.
+ *
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd.
+ * Author: Jacek Anaszewski <j.anaszewski@samsung.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef __UAPI_LINUX_LEDS_H_
+#define __UAPI_LINUX_LEDS_H_
+
+#define LED_FAULT_OVER_VOLTAGE		(1 << 0)
+#define LED_FAULT_TIMEOUT		(1 << 1)
+#define LED_FAULT_OVER_TEMPERATURE	(1 << 2)
+#define LED_FAULT_SHORT_CIRCUIT		(1 << 3)
+#define LED_FAULT_OVER_CURRENT		(1 << 4)
+#define LED_FAULT_INDICATOR		(1 << 5)
+#define LED_FAULT_UNDER_VOLTAGE		(1 << 6)
+#define LED_FAULT_INPUT_VOLTAGE		(1 << 7)
+#define LED_FAULT_LED_OVER_TEMPERATURE	(1 << 8)
+#define LED_NUM_FLASH_FAULTS		9
+
+#endif /* __UAPI_LINUX_LEDS_H_ */