]> rtime.felk.cvut.cz Git - frescor/frsh.git/commitdiff
Added stub LCD power management.
authorDario <dario@dario-desktop.(none)>
Tue, 5 May 2009 15:07:12 +0000 (17:07 +0200)
committerDario <dario@dario-desktop.(none)>
Tue, 5 May 2009 15:07:12 +0000 (17:07 +0200)
Added stub functions for performing LCD brightness level setting.

frsh_api/Makefile.omk
resources/acpi_lcd/Makefile [new file with mode: 0644]
resources/acpi_lcd/Makefile.omk [new file with mode: 0644]
resources/acpi_lcd/fra_acpi_lcd.c [new file with mode: 0644]
resources/acpi_lcd/fra_acpi_lcd.h [new file with mode: 0644]

index 04ae4b2baf2d929837d4289a2275cbd7e5be8233..297c52bb3d03dc9a40caa2a0f67a1496a1687b51 100644 (file)
@@ -4,7 +4,7 @@ shared_LIBRARIES = frsh
 frsh_SOURCES = frsh_contract.c frsh_vres.c frsh_synchobj.c frsh_distributed.c frsh_core.c \
                frsh_spare_capacity.c frsh_error.c frsh_thread.c frsh_sharedobj.c frsh_power.c frsh_feedback.c
 include_HEADERS = frsh_opaque_types.h frsh_forb.h
-frsh_LIBS = fna fcb_client forb contract synchobj sharedobj acpi_cpu fra ulut fosa $(allocator-libs-y)
+frsh_LIBS = fna fcb_client forb contract synchobj sharedobj acpi_cpu acpi_lcd fra ulut fosa $(allocator-libs-y)
 
 config_include_HEADERS = frsh_resources.h
 frsh_resources_DEFINES = CONFIG_RESOURCE_DUMMY \
diff --git a/resources/acpi_lcd/Makefile b/resources/acpi_lcd/Makefile
new file mode 100644 (file)
index 0000000..b22a357
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/resources/acpi_lcd/Makefile.omk b/resources/acpi_lcd/Makefile.omk
new file mode 100644 (file)
index 0000000..d711011
--- /dev/null
@@ -0,0 +1,7 @@
+shared_LIBRARIES = acpi_lcd
+
+acpi_lcd_SOURCES = fra_acpi_lcd.c
+acpi_lcd_LIBS += fosa rt m acpi
+
+include_HEADERS = fra_acpi_lcd.h
+
diff --git a/resources/acpi_lcd/fra_acpi_lcd.c b/resources/acpi_lcd/fra_acpi_lcd.c
new file mode 100644 (file)
index 0000000..408ec69
--- /dev/null
@@ -0,0 +1,64 @@
+/**
+ * @file   fres_acpi_cpu.c
+ * @author Dario Faggioli <faggioli@gandalf.sssup.it>
+ *        Michael Trimarchi <trimarchimichael@yahoo.it>
+ * 
+ * @brief  Implementation of LCD related ACPI functions.
+ * 
+ */
+
+#include "fra_acpi_lcd.h"
+
+int fra_LCD_brightness_init(int lcd)
+{
+       return 0;
+}
+
+int fra_LCD_get_brightness(int lcd, int level, unsigned long *bright)
+{
+       return 0;
+
+       /*if (!frequency_initialized)
+               return EINVAL;
+
+       if (level >= 3)
+               return EINVAL;
+
+       *freq = freqs[level];
+
+       return 0;*/
+}
+
+int fra_LCD_set_brightness(int lcd, int level)
+{
+       return 0;
+
+       /*if (!frequency_initialized)
+               return EINVAL;
+
+       if (level >= 3)
+               return EINVAL;
+
+       return cpufreq_set_frequency(cpu, freqs[level]);*/
+}
+
+int fra_LCD_get_level(int lcd, int *level)
+{
+       return 0;
+
+       /*unsigned long freq;
+       int i;
+
+       if (!frequency_initialized)
+               return EINVAL;
+
+       freq = cpufreq_get(cpu);
+       for (i = 0; i < 3; i++)
+               if (freqs[i] == freq) {
+                       *level = i;
+                       return 0;
+               }
+
+       return EINVAL;*/
+}
+
diff --git a/resources/acpi_lcd/fra_acpi_lcd.h b/resources/acpi_lcd/fra_acpi_lcd.h
new file mode 100644 (file)
index 0000000..ad4ef2c
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef ACPI_CPU
+#define ACPI_CPU
+
+#include <string.h>
+#include <math.h>
+#include <libacpi.h>
+
+#include <fosa_clocks_and_timers.h>
+#include <fosa.h>
+
+int fra_LCD_brightness_init(int lcd);
+
+int fra_LCD_get_brightness(int lcd, int level, unsigned long *bight);
+
+int fra_LCD_set_brightness(int lcd, int level);
+
+int fra_LCD_get_level(int lcd, int *level);
+
+#endif