[FEATURE] add lcd support for swap_energy module
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 18 Sep 2013 05:34:37 +0000 (09:34 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 18 Sep 2013 06:26:27 +0000 (10:26 +0400)
Change-Id: Iaee26d7015217bc0615887d454bd8fbcba049df5
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
energy/Kbuild
energy/lcd/lcd_base.c [new file with mode: 0644]
energy/lcd/lcd_base.h [new file with mode: 0644]

index 365fd84..a9e10ed 100644 (file)
@@ -1,4 +1,4 @@
 EXTRA_CFLAGS := $(extra_cflags)
 
 obj-m := swap_energy.o
-swap_energy-y := energy.o
+swap_energy-y := energy.o lcd/lcd_base.o
diff --git a/energy/lcd/lcd_base.c b/energy/lcd/lcd_base.c
new file mode 100644 (file)
index 0000000..88f2e37
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ *  Dynamic Binary Instrumentation Module based on KProbes
+ *  energy/lcd/lcd_base.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright (C) Samsung Electronics, 2013
+ *
+ * 2013         Vyacheslav Cherkashin <v.cherkashin@samsung.com>
+ *
+ */
+
+
+#include <linux/module.h>
+#include "lcd_base.h"
+
+
+void set_backlight(int val)
+{
+       /* TODO: implement */
+}
+
+void set_power(int val)
+{
+       /* TODO: implement */
+}
+
+static struct lcd_ops_set ops_set = {
+       .set_backlight = set_backlight,
+       .set_power = set_power
+};
+
+static struct lcd_ops_get ops_get = { NULL, NULL };
+
+int lcd_init(void)
+{
+       int ret;
+
+       ret = lcd_mach_init(&ops_set, &ops_get);
+       if (ret)
+               return ret;
+
+       return ret;
+}
+
+void lcd_exit(void)
+{
+       lcd_mach_exit();
+}
diff --git a/energy/lcd/lcd_base.h b/energy/lcd/lcd_base.h
new file mode 100644 (file)
index 0000000..16911b4
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef _LCD_BASE_H
+#define _LCD_BASE_H
+
+/*
+ *  Dynamic Binary Instrumentation Module based on KProbes
+ *  energy/lcd/lcd_base.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright (C) Samsung Electronics, 2013
+ *
+ * 2013         Vyacheslav Cherkashin <v.cherkashin@samsung.com>
+ *
+ */
+
+struct lcd_ops_get {
+       int (*get_backlight)(void);
+       int (*get_power)(void);
+};
+
+struct lcd_ops_set {
+       void (*set_backlight)(int val);
+       void (*set_power)(int val);
+};
+
+int lcd_mach_init(struct lcd_ops_set *ops_set, struct lcd_ops_get *ops_get);
+void lcd_mach_exit(void);
+
+int lcd_init(void);
+void lcd_exit(void);
+
+#endif /* _LCD_BASE_H */