/**
* The version of this device
*/
-#define BATTERY_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,1)
+#define BATTERY_HARDWARE_DEVICE_VERSION MAKE_VERSION(0, 1)
struct battery_info {
char *name;
#include <stdint.h>
-#define MAKE_TAG_CONSTANT(A,B,C,D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D))
-#define HARDWARE_INFO_TAG MAKE_TAG_CONSTANT('T','H','I','T')
+#define MAKE_TAG_CONSTANT(A, B, C, D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D))
+#define HARDWARE_INFO_TAG MAKE_TAG_CONSTANT('T', 'H', 'I', 'T')
struct hw_common;
struct hw_info {
struct hw_info *info;
};
-#define MAKE_VERSION(maj,min) \
+#define MAKE_VERSION(maj, min) \
((((maj) & 0xff) << 8) | ((min) & 0xff))
/**
* Version of the struct hw_info
*/
-#define HARDWARE_INFO_VERSION MAKE_VERSION(1,0)
+#define HARDWARE_INFO_VERSION MAKE_VERSION(1, 0)
/**
* Name of the hardware info symbolic (Tizen Hardware Info)
/**
* The version of this device
*/
-#define CPU_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,1)
+#define CPU_HARDWARE_DEVICE_VERSION MAKE_VERSION(0, 1)
struct cpu_device {
struct hw_common common;
/**
* The version of this device
*/
-#define DISPLAY_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,2)
+#define DISPLAY_HARDWARE_DEVICE_VERSION MAKE_VERSION(0, 2)
enum display_state {
DISPLAY_ON, /* In use */
/**
* The version of this device
*/
-#define DISPLAY_INTERNAL_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,2)
+#define DISPLAY_INTERNAL_HARDWARE_DEVICE_VERSION MAKE_VERSION(0, 2)
typedef enum display_internal_enhance_mode {
ENHANCE_MODE_NONE = 1001,
/**
* The version of this device
*/
-#define EXTERNAL_CONNECTION_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,1)
+#define EXTERNAL_CONNECTION_HARDWARE_DEVICE_VERSION MAKE_VERSION(0, 1)
struct connection_info {
char *name;
/**
* The version of this device
*/
-#define IR_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,1)
+#define IR_HARDWARE_DEVICE_VERSION MAKE_VERSION(0, 1)
struct ir_device {
struct hw_common common;
/**
* The version of this device
*/
-#define LED_HARDWARE_DEVICE_VERSION MAKE_VERSION(1,0)
+#define LED_HARDWARE_DEVICE_VERSION MAKE_VERSION(1, 0)
/**
* The id of led devices
/* the id of this device */
#define SENSOR_HARDWARE_DEVICE_ID "sensor"
-#define SENSOR_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,1)
+#define SENSOR_HARDWARE_DEVICE_VERSION MAKE_VERSION(0, 1)
/**
* Sensor types
/**
* The version of this device
*/
-#define THERMAL_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,1)
+#define THERMAL_HARDWARE_DEVICE_VERSION MAKE_VERSION(0, 1)
typedef enum _thermal_state {
THERMAL_STATE_LOW,
/**
* The version of this device
*/
-#define TOUCHSCREEN_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,1)
+#define TOUCHSCREEN_HARDWARE_DEVICE_VERSION MAKE_VERSION(0, 1)
enum touchscreen_state {
TOUCHSCREEN_OFF, /* Disable touchscreen */
/**
* The version of this device
*/
-#define USB_CLIENT_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,1)
+#define USB_CLIENT_HARDWARE_DEVICE_VERSION MAKE_VERSION(0, 1)
struct usb_client {
struct hw_common common;
/**
* The version of this device
*/
-#define USB_GADGET_DEVICE_VERSION MAKE_VERSION(0,1)
+#define USB_GADGET_DEVICE_VERSION MAKE_VERSION(0, 1)
#ifndef container_of
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
+#define container_of(ptr, type, member) ({ \
+ const typeof(((type *)0)->member) *__mptr = (ptr); \
+ (type *)((char *)__mptr - offsetof(type, member)); })
#endif
#define _HELPER_Y(x) ((x) & -(x))
#define DEFINE_SIMPLE_USB_FUNCTION(_id, _name) \
static struct usb_function _##_name##_function = { \
.function_group = USB_FUNCTION_GROUP_SIMPLE, \
- .id = _id, \
+ .id = _id, \
.name = #_name, \
.instance = "default", \
.free_func = free_simple_func, \
/**
* @par Description:
- * device type enum
+ * device type enum
*/
-enum device_type
-{
+enum device_type {
DEVICE_TYPE_DISPLAY, /**< display */
DEVICE_TYPE_VIBRATOR, /**< vibrator */
DEVICE_TYPE_EXTCON, /**< extcon - Micro USB, 3.5 pi jack etc */
/**
* @par Description:
- * DEVICE_TYPE_DISPLAY property for generic APIs
+ * DEVICE_TYPE_DISPLAY property for generic APIs
*/
enum {
PROP_DISPLAY_DISPLAY_COUNT,
/**
* @par Description:
- * DEVICE_TYPE_JACK property for generic APIs
+ * DEVICE_TYPE_JACK property for generic APIs
*/
enum {
PROP_EXTCON_TA_ONLINE, /**< Travel Adapter(Charger) */
/**
* @par Description:
- * DEVICE_TYPE_LED property for generic APIs
+ * DEVICE_TYPE_LED property for generic APIs
*/
enum {
PROP_LED_BRIGHTNESS,
/**
* @par Description:
- * DEVICE_TYPE_POWER property for generic APIs
+ * DEVICE_TYPE_POWER property for generic APIs
*/
enum {
PROP_POWER_CAPACITY, /**< Current remaining battery */
/**
* @par Description:
- * DEVICE_TYPE_MEMORY property for generic APIs
+ * DEVICE_TYPE_MEMORY property for generic APIs
*/
enum {
PROP_MEMORY_NODE,
/**
* @par Description:
- * DEVICE_TYPE_CPU property for generic APIs
+ * DEVICE_TYPE_CPU property for generic APIs
*/
enum {
PROP_CPU_CPUINFO_MAX_FREQ,
/**
* @par Description:
- * DEVICE_TYPE_PROCESS property for generic APIs
+ * DEVICE_TYPE_PROCESS property for generic APIs
*/
enum {
PROP_PROCESS_NODE,
/**
* @fn int device_get_property(enum device_type devtype, int property, int *value)
* @par Description:
- * This generic API is used to get the property values of supported devices.\n
- * If the caller process does not have permission, it returns failure.
+ * This generic API is used to get the property values of supported devices.\n
+ * If the caller process does not have permission, it returns failure.
* @param[in] devtype device type that you want to get the value
* @param[in] property value property that you want to get the value
* @param[out] *value current value of device property
* @see device_set_property()
* @par Example:
* @code
- * ...
- * if( device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CAPACITY, &val) < 0 )
- * printf("Fail to get property\n");
- * else
- * printf("Property is %d\n", val);
- * ...
+ * ...
+ * if( device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CAPACITY, &val) < 0 )
+ * printf("Fail to get property\n");
+ * else
+ * printf("Property is %d\n", val);
+ * ...
* @endcode
*/
int device_get_property(enum device_type devtype, int property, int *value);
/**
* @fn int device_set_property(enum device_type devtype, int property, int value)
* @par Description:
- * This generic API is used to set the property values of supported devices.\n
- * If the caller process does not have permission, it returns failure.
+ * This generic API is used to set the property values of supported devices.\n
+ * If the caller process does not have permission, it returns failure.
* @param[in] devtype device type that you want to set the value
* @param[in] property value property that you want to set the value
* @param[in] value value that you want to set
#include "device-internal.h"
#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
+ const typeof(((type *)0)->member) *__mptr = (ptr); \
+ (type *)((char *)__mptr - offsetof(type, member)); })
static GList *dev_head;
static void *dlopen_handle;
return 0;
}
-static int OEM_sys_get_hardkey_backlight(int *value){
+static int OEM_sys_get_hardkey_backlight(int *value)
+{
return 0;
}
-static int OEM_sys_set_hardkey_backlight(int value){
+static int OEM_sys_set_hardkey_backlight(int value)
+{
return 0;
}
.OEM_sys_get_battery_charge_now = &OEM_sys_get_battery_charge_now,
.OEM_sys_get_battery_present = &OEM_sys_get_battery_present,
.OEM_sys_get_battery_health = &OEM_sys_get_battery_health,
- .OEM_sys_get_battery_polling_required= &OEM_sys_get_battery_polling_required,
+ .OEM_sys_get_battery_polling_required = &OEM_sys_get_battery_polling_required,
.OEM_sys_get_battery_support_insuspend_charging = &OEM_sys_get_battery_support_insuspend_charging,
/* Connection interfaces */
.OEM_sys_set_irled_control = &OEM_sys_set_irled_control,
.OEM_sys_get_hardkey_backlight = &OEM_sys_get_hardkey_backlight,
- .OEM_sys_set_hardkey_backlight= &OEM_sys_set_hardkey_backlight
+ .OEM_sys_set_hardkey_backlight = &OEM_sys_set_hardkey_backlight
};