SET(TARGET_SRCS
- devices/cpu.c
devices/display.c
devices/extcon.c
devices/led.c
- devices/memory.c
devices/power.c
- devices/process.c
- devices/vibrator.c
)
+++ /dev/null
-/*
- * device-node
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include "device-internal.h"
-
-static int cpu_get_prop(int prop, int *val)
-{
- switch (prop) {
- case PROP_CPU_CPUINFO_MAX_FREQ:
- return PLUGIN_GET(cpufreq_cpuinfo_max_freq, val);
- case PROP_CPU_CPUINFO_MIN_FREQ:
- return PLUGIN_GET(cpufreq_cpuinfo_min_freq, val);
- case PROP_CPU_SCALING_MAX_FREQ:
- return PLUGIN_GET(cpufreq_scaling_max_freq, val);
- case PROP_CPU_SCALING_MIN_FREQ:
- return PLUGIN_GET(cpufreq_scaling_min_freq, val);
- }
-
- return -1;
-}
-
-static int cpu_set_prop(int prop, int val)
-{
- switch (prop) {
- case PROP_CPU_SCALING_MAX_FREQ:
- return PLUGIN_SET(cpufreq_scaling_max_freq, val);
- case PROP_CPU_SCALING_MIN_FREQ:
- return PLUGIN_SET(cpufreq_scaling_min_freq, val);
- }
-
- return -1;
-}
-
-static const struct device cpu = {
- .name = "cpu",
- .set_prop = cpu_set_prop,
- .get_prop = cpu_get_prop,
- .type = DEVICE_TYPE_CPU,
-};
-
-static void __CONSTRUCTOR__ module_init(void)
-{
- add_device(&(cpu.type));
-}
-
-static void __DESTRUCTOR__ module_fini(void)
-{
- remove_device(&(cpu.type));
-}
+++ /dev/null
-/*
- * device-node
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include "device-internal.h"
-
-static int memory_get_prop(int prop, int *val)
-{
- switch (prop) {
- case PROP_MEMORY_NODE:
- return PLUGIN_GET(memnotify_node, (char*)val);
- case PROP_MEMORY_VICTIM_TASK:
- return PLUGIN_GET(memnotify_victim_task, val);
- }
-
- return -1;
-}
-
-static int memory_set_prop(int prop, int val)
-{
- switch (prop) {
- case PROP_MEMORY_THRESHOLD_LV1:
- return PLUGIN_SET(memnotify_threshold_lv1, val);
- case PROP_MEMORY_THRESHOLD_LV2:
- return PLUGIN_SET(memnotify_threshold_lv2, val);
- }
-
- return -1;
-}
-
-static const struct device memory = {
- .name = "memory",
- .set_prop = memory_set_prop,
- .get_prop = memory_get_prop,
- .type = DEVICE_TYPE_MEMORY,
-};
-
-static void __CONSTRUCTOR__ module_init(void)
-{
- add_device(&(memory.type));
-}
-
-static void __DESTRUCTOR__ module_fini(void)
-{
- remove_device(&(memory.type));
-}
+++ /dev/null
-/*
- * device-node
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include "device-internal.h"
-
-static int process_get_prop(int prop, int *val)
-{
- switch (prop) {
- case PROP_PROCESS_NODE:
- return PLUGIN_GET(process_monitor_node, (char*)val);
- }
-
- return -1;
-}
-
-static int process_set_prop(int prop, int val)
-{
- switch (prop) {
- case PROP_PROCESS_MP_PNP:
- return PLUGIN_SET(process_monitor_mp_pnp, val);
- case PROP_PROCESS_MP_VIP:
- return PLUGIN_SET(process_monitor_mp_vip, val);
- }
-
- return -1;
-}
-
-static const struct device process = {
- .name = "process",
- .set_prop = process_set_prop,
- .get_prop = process_get_prop,
- .type = DEVICE_TYPE_PROCESS,
-};
-
-static void __CONSTRUCTOR__ module_init(void)
-{
- add_device(&(process.type));
-}
-
-static void __DESTRUCTOR__ module_fini(void)
-{
- remove_device(&(process.type));
-}
+++ /dev/null
-/*
- * device-node
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include "device-internal.h"
-
-static int vibrator_get_prop(int prop, int *val)
-{
- switch (prop) {
- case PROP_VIBRATOR_LEVEL:
- return PLUGIN_GET(haptic_vibetones_level, val);
- case PROP_VIBRATOR_LEVEL_MAX:
- return PLUGIN_GET(haptic_vibetones_level_max, val);
- }
-
- return -1;
-}
-
-static int vibrator_set_prop(int prop, int val)
-{
- switch (prop) {
- case PROP_VIBRATOR_ENABLE:
- return PLUGIN_SET(haptic_vibetones_enable, val);
- case PROP_VIBRATOR_LEVEL:
- return PLUGIN_SET(haptic_vibetones_level, val);
- case PROP_VIBRATOR_ONESHOT:
- return PLUGIN_SET(haptic_vibetones_oneshot, val);
- }
-
- return -1;
-}
-
-static const struct device vibrator = {
- .name = "vibrator",
- .set_prop = vibrator_set_prop,
- .get_prop = vibrator_get_prop,
- .type = DEVICE_TYPE_VIBRATOR,
-};
-
-static void __CONSTRUCTOR__ module_init(void)
-{
- add_device(&(vibrator.type));
-}
-
-static void __DESTRUCTOR__ module_fini(void)
-{
- remove_device(&(vibrator.type));
-}
*/
#define DISPLAY_INTERNAL_HARDWARE_DEVICE_VERSION MAKE_VERSION(0,2)
-typedef enum display_internal_enhance_mode {
- ENHANCE_MODE_NONE = 1001,
- ENHANCE_MODE_DYNAMIC,
- ENHANCE_MODE_STANDARD,
- ENHANCE_MODE_NATURAL,
- ENHANCE_MODE_GRAYSCALE,
- ENHANCE_MODE_MOVIE,
- ENHANCE_MODE_AUTO,
-} display_internal_enhance_mode_e;
-
-typedef enum display_internal_enhance_scenario {
- ENHANCE_SCENARIO_NONE = 2001,
- ENHANCE_SCENARIO_NORMAL,
- ENHANCE_SCENARIO_GALLERY,
- ENHANCE_SCENARIO_VIDEO,
- ENHANCE_SCENARIO_VTCALL,
- ENHANCE_SCENARIO_CAMERA,
- ENHANCE_SCENARIO_BROWSER,
- ENHANCE_SCENARIO_NEGATIVE,
- ENHANCE_SCENARIO_EMAIL,
- ENHANCE_SCENARIO_EBOOK,
- ENHANCE_SCENARIO_GRAYSCALE,
-} display_intermal_enhance_scenario_e;
-
-struct display_internal_device {
- struct hw_common common;
-
- int (*set_enhance_mode)(display_internal_enhance_mode_e mode);
- int (*get_enhance_mode)(display_internal_enhance_mode_e *mode);
-
- int (*set_enhance_scenario)(display_internal_enhance_scenario_e scenario);
- int (*get_enhance_scenario)(display_internal_enhance_scenario_e *scenario);
-
- int (*set_enhance)(display_internal_enhance_mode_e mode,
- display_internal_enhance_scenario_e scenario);
- int (*get_enhance)(display_internal_enhance_mode_e *mode,
- display_internal_enhance_scenario_e *scenario);
-
-};
-
#endif
enum device_type
{
DEVICE_TYPE_DISPLAY, /**< display */
- DEVICE_TYPE_VIBRATOR, /**< vibrator */
DEVICE_TYPE_EXTCON, /**< extcon - Micro USB, 3.5 pi jack etc */
DEVICE_TYPE_LED, /**< LED */
DEVICE_TYPE_POWER, /**< battery, PMIC, etc about power */
- DEVICE_TYPE_MEMORY, /**< memory */
- DEVICE_TYPE_CPU, /**< cpu */
- DEVICE_TYPE_PROCESS, /**< process */
DEVICE_TYPE_MAX,
};
PROP_DISPLAY_IMAGE_ENHANCE_INFO,
};
-/**
- * @par Description:
- * DEVICE_TYPE_HAPTIC property for generic APIs
- */
-enum {
- PROP_VIBRATOR_LEVEL_MAX,
- PROP_VIBRATOR_LEVEL,
- PROP_VIBRATOR_ENABLE,
- PROP_VIBRATOR_ONESHOT,
-};
-
/**
* @par Description:
* DEVICE_TYPE_JACK property for generic APIs
PROP_POWER_INSUSPEND_CHARGING_SUPPORT,
};
-/**
- * @par Description:
- * DEVICE_TYPE_MEMORY property for generic APIs
- */
-enum {
- PROP_MEMORY_NODE,
- PROP_MEMORY_VICTIM_TASK,
- PROP_MEMORY_THRESHOLD_LV1,
- PROP_MEMORY_THRESHOLD_LV2,
-};
-
-/**
- * @par Description:
- * DEVICE_TYPE_CPU property for generic APIs
- */
-enum {
- PROP_CPU_CPUINFO_MAX_FREQ,
- PROP_CPU_CPUINFO_MIN_FREQ,
- PROP_CPU_SCALING_MAX_FREQ,
- PROP_CPU_SCALING_MIN_FREQ,
-};
-
-/**
- * @par Description:
- * DEVICE_TYPE_PROCESS property for generic APIs
- */
-enum {
- PROP_PROCESS_NODE,
- PROP_PROCESS_MP_PNP,
- PROP_PROCESS_MP_VIP,
-};
-
/**
* @fn int device_get_property(enum device_type devtype, int property, int *value)
* @par Description:
#ifndef __DEVMAN_PLUGIN_INTF_H__
#define __DEVMAN_PLUGIN_INTF_H__
-enum {
- STATUS_OFFLINE = 0,
- STATUS_ONLINE,
-};
-
-enum {
- STATUS_OFF = 0,
- STATUS_ON,
-};
-
enum {
PATH_CP = 0,
PATH_AP,
};
-enum {
- BATTERY_NOT_FULLY_CHARGED = 0,
- BATTERY_FULLY_CHARGED,
-};
-
enum {
BATTERY_UNKNOWN = 0,
BATTERY_GOOD,
POWER_STATE_POST_RESUME,
};
-enum {
- LUX_DECREMENT,
- LUX_NOCHANGE,
- LUX_INCREMENT,
-};
-
-enum {
- WM_MODE_MIN = 0x00,
- WM_MODE_NORMAL = WM_MODE_MIN,
- WM_MODE_CONSERVATIVE,
- WM_MODE_MEDIUM,
- WM_MODE_AGGRESSIVE,
- WM_MODE_OUTDOOR,
- WM_MODE_MAX = WM_MODE_OUTDOOR
-};
-
typedef struct {
int (*OEM_sys_get_display_count) (int *value);
int (*OEM_sys_get_usb_path) (int *value);
int (*OEM_sys_set_usb_path) (int value);
- int (*OEM_sys_get_haptic_vibetones_level_max) (int *value);
- int (*OEM_sys_get_haptic_vibetones_level) (int *value);
- int (*OEM_sys_set_haptic_vibetones_level) (int value);
- int (*OEM_sys_set_haptic_vibetones_enable) (int value);
- int (*OEM_sys_set_haptic_vibetones_oneshot) (int value);
-
int (*OEM_sys_get_battery_capacity) (int *value);
int (*OEM_sys_get_battery_capacity_raw) (int *value);
int (*OEM_sys_get_battery_charge_full) (int *value);
int (*OEM_sys_get_power_wakeup_count) (int *value);
int (*OEM_sys_set_power_wakeup_count) (int value);
- int (*OEM_sys_get_memnotify_node) (char *node);
- int (*OEM_sys_get_memnotify_victim_task) (int *value);
- int (*OEM_sys_set_memnotify_threshold_lv1) (int value);
- int (*OEM_sys_set_memnotify_threshold_lv2) (int value);
-
- int (*OEM_sys_get_process_monitor_node) (char *node);
- int (*OEM_sys_set_process_monitor_mp_pnp) (int value);
- int (*OEM_sys_set_process_monitor_mp_vip) (int value);
-
- int (*OEM_sys_get_cpufreq_cpuinfo_max_freq) (int *value);
- int (*OEM_sys_get_cpufreq_cpuinfo_min_freq) (int *value);
- int (*OEM_sys_get_cpufreq_scaling_max_freq) (int *value);
- int (*OEM_sys_set_cpufreq_scaling_max_freq) (int value);
- int (*OEM_sys_get_cpufreq_scaling_min_freq) (int *value);
- int (*OEM_sys_set_cpufreq_scaling_min_freq) (int value);
-
int (*OEM_sys_get_backlight_brightness_by_lux) (int lux, int *value);
int (*OEM_sys_get_whitemagic_mode) (int index, int *value);
return 0;
}
-static int OEM_sys_get_haptic_vibetones_level_max(int *value)
-{
- return 0;
-}
-
-static int OEM_sys_get_haptic_vibetones_level(int *value)
-{
- return 0;
-}
-
-static int OEM_sys_set_haptic_vibetones_level(int value)
-{
- return 0;
-}
-
-static int OEM_sys_set_haptic_vibetones_enable(int value)
-{
- return 0;
-}
-
-static int OEM_sys_set_haptic_vibetones_oneshot(int value)
-{
- return 0;
-}
-
static int OEM_sys_get_battery_capacity(int *value)
{
return 0;
return 0;
}
-static int OEM_sys_get_memnotify_node(char *node)
-{
- return 0;
-}
-
-static int OEM_sys_get_memnotify_victim_task(int *value)
-{
- return 0;
-}
-
-static int OEM_sys_set_memnotify_threshold_lv1(int value)
-{
- return 0;
-}
-
-static int OEM_sys_set_memnotify_threshold_lv2(int value)
-{
- return 0;
-}
-
-static int OEM_sys_get_process_monitor_node(char *node)
-{
- return 0;
-}
-
-static int OEM_sys_set_process_monitor_mp_pnp(int value)
-{
- return 0;
-}
-
-static int OEM_sys_set_process_monitor_mp_vip(int value)
-{
- return 0;
-}
-
-static int OEM_sys_get_cpufreq_cpuinfo_max_freq(int *value)
-{
- return 0;
-}
-
-static int OEM_sys_get_cpufreq_cpuinfo_min_freq(int *value)
-{
- return 0;
-}
-
-static int OEM_sys_get_cpufreq_scaling_max_freq(int *value)
-{
- return 0;
-}
-
-static int OEM_sys_set_cpufreq_scaling_max_freq(int value)
-{
- return 0;
-}
-
-static int OEM_sys_get_cpufreq_scaling_min_freq(int *value)
-{
- return 0;
-}
-
-static int OEM_sys_set_cpufreq_scaling_min_freq(int value)
-{
- return 0;
-}
-
static int OEM_sys_get_backlight_brightness_by_lux(int lux, int *value)
{
return 0;
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_usb_path = &OEM_sys_get_usb_path,
.OEM_sys_set_usb_path = &OEM_sys_set_usb_path,
- /* Vibrator interfaces */
- .OEM_sys_get_haptic_vibetones_level_max = &OEM_sys_get_haptic_vibetones_level_max,
- .OEM_sys_get_haptic_vibetones_level = &OEM_sys_get_haptic_vibetones_level,
- .OEM_sys_set_haptic_vibetones_level = &OEM_sys_set_haptic_vibetones_level,
- .OEM_sys_set_haptic_vibetones_enable = &OEM_sys_set_haptic_vibetones_enable,
- .OEM_sys_set_haptic_vibetones_oneshot = &OEM_sys_set_haptic_vibetones_oneshot,
-
/* Battery interfaces */
.OEM_sys_get_battery_capacity = &OEM_sys_get_battery_capacity,
.OEM_sys_get_battery_capacity_raw = &OEM_sys_get_battery_capacity_raw,
.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_get_power_wakeup_count = &OEM_sys_get_power_wakeup_count,
.OEM_sys_set_power_wakeup_count = &OEM_sys_set_power_wakeup_count,
- /* OOM interfaces */
- .OEM_sys_get_memnotify_node = &OEM_sys_get_memnotify_node,
- .OEM_sys_get_memnotify_victim_task = &OEM_sys_get_memnotify_victim_task,
- .OEM_sys_set_memnotify_threshold_lv1 = &OEM_sys_set_memnotify_threshold_lv1,
- .OEM_sys_set_memnotify_threshold_lv2 = &OEM_sys_set_memnotify_threshold_lv2,
-
- /* Process monitor interfaces */
- .OEM_sys_get_process_monitor_node = &OEM_sys_get_process_monitor_node,
- .OEM_sys_set_process_monitor_mp_pnp = &OEM_sys_set_process_monitor_mp_pnp,
- .OEM_sys_set_process_monitor_mp_vip = &OEM_sys_set_process_monitor_mp_vip,
-
- /* UART path interfaces */
- .OEM_sys_get_cpufreq_cpuinfo_max_freq = &OEM_sys_get_cpufreq_cpuinfo_max_freq,
- .OEM_sys_get_cpufreq_cpuinfo_min_freq = &OEM_sys_get_cpufreq_cpuinfo_min_freq,
- .OEM_sys_get_cpufreq_scaling_max_freq = &OEM_sys_get_cpufreq_scaling_max_freq,
- .OEM_sys_set_cpufreq_scaling_max_freq = &OEM_sys_set_cpufreq_scaling_max_freq,
- .OEM_sys_get_cpufreq_scaling_min_freq = &OEM_sys_get_cpufreq_scaling_min_freq,
- .OEM_sys_set_cpufreq_scaling_min_freq = &OEM_sys_set_cpufreq_scaling_min_freq,
-
.OEM_sys_get_backlight_brightness_by_lux = &OEM_sys_get_backlight_brightness_by_lux,
.OEM_sys_get_whitemagic_mode = &OEM_sys_get_whitemagic_mode,
.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
};