]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/drivers/lcd/src/lcd.c
update
[l4.git] / l4 / pkg / drivers / lcd / src / lcd.c
1 /*
2  * Some generic functions for LCD drivers.
3  */
4
5 #include <l4/drivers/lcd.h>
6
7 enum { nr_drivers = 10 };
8 static struct arm_lcd_ops *ops[nr_drivers];
9 static int ops_alloced;
10
11 struct arm_lcd_ops *arm_lcd_probe(const char *configstr)
12 {
13   int i;
14
15   for (i = 0; i < ops_alloced; i++)
16     if (ops[i]->probe && ops[i]->probe(configstr))
17       return ops[i];
18
19   return NULL;
20 }
21
22 void arm_lcd_register_driver(struct arm_lcd_ops *_ops)
23 {
24   if (ops_alloced < nr_drivers)
25     ops[ops_alloced++] = _ops;
26 }