From 80b8cf6b4fbaf61e970e175e798415e45c164269 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Wed, 18 Sep 2013 09:34:37 +0400 Subject: [PATCH] [FEATURE] add lcd support for swap_energy module Change-Id: Iaee26d7015217bc0615887d454bd8fbcba049df5 Signed-off-by: Vyacheslav Cherkashin --- energy/Kbuild | 2 +- energy/lcd/lcd_base.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ energy/lcd/lcd_base.h | 44 +++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 energy/lcd/lcd_base.c create mode 100644 energy/lcd/lcd_base.h diff --git a/energy/Kbuild b/energy/Kbuild index 365fd84..a9e10ed 100644 --- a/energy/Kbuild +++ b/energy/Kbuild @@ -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 index 0000000..88f2e37 --- /dev/null +++ b/energy/lcd/lcd_base.c @@ -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 + * + */ + + +#include +#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 index 0000000..16911b4 --- /dev/null +++ b/energy/lcd/lcd_base.h @@ -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 + * + */ + +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 */ -- 2.7.4