1.1 --- a/README.txt Fri Jun 01 22:47:51 2018 +0200 1.2 +++ b/README.txt Fri Jun 01 22:53:02 2018 +0200 1.3 @@ -208,6 +208,12 @@ 1.4 fb-drv <- mips-jz4740-panel.txt Library details 1.5 \-> ... Library with panel data 1.6 1.7 +This method of obtaining a configured library name in order to load it 1.8 +dynamically is effectively equivalent to having a symbolic link identifying 1.9 +the library referencing the desired, specific library to be used. Since the 1.10 +"rom" virtual filesystem does not appear to support symbolic links, this 1.11 +method is used instead. 1.12 + 1.13 By providing well-defined interfacing mechanisms, the behaviour of driver code 1.14 can be parameterised using external components, and a proliferation of 1.15 specially-constructed device drivers is hopefully avoided.
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/conf/landfall-examples/input-keypad.txt Fri Jun 01 22:53:02 2018 +0200 2.3 @@ -0,0 +1,1 @@ 2.4 +libkeypad_qi_lb60.so 2.5 \ No newline at end of file
3.1 --- a/conf/landfall-examples/mips-letux400-input-event-client.cfg Fri Jun 01 22:47:51 2018 +0200 3.2 +++ b/conf/landfall-examples/mips-letux400-input-event-client.cfg Fri Jun 01 22:53:02 2018 +0200 3.3 @@ -132,7 +132,7 @@ 3.4 ev = ev:svr(), 3.5 }, 3.6 }, 3.7 - "rom/dev_input_keypad_letux400"); 3.8 + "rom/dev_input_keypad"); 3.9 3.10 -- Show key event values. 3.11
4.1 --- a/conf/landfall-examples/mips-letux400-input-event-client.list Fri Jun 01 22:47:51 2018 +0200 4.2 +++ b/conf/landfall-examples/mips-letux400-input-event-client.list Fri Jun 01 22:53:02 2018 +0200 4.3 @@ -18,7 +18,9 @@ 4.4 module dev_display_letux400 4.5 module dev_cpm_jz4730 4.6 module dev_keypad_letux400 4.7 -module dev_input_keypad_letux400 4.8 +module dev_input_keypad 4.9 module ex_input_event_client 4.10 module libpanel_letux400.so 4.11 module mips-jz4740-panel.txt 4.12 +module libkeypad_letux400.so 4.13 +module input-keypad.txt
5.1 --- a/conf/landfall-examples/mips-letux400-keypad-demo.cfg Fri Jun 01 22:47:51 2018 +0200 5.2 +++ b/conf/landfall-examples/mips-letux400-keypad-demo.cfg Fri Jun 01 22:53:02 2018 +0200 5.3 @@ -152,7 +152,7 @@ 5.4 ev = ev1:svr(), 5.5 }, 5.6 }, 5.7 - "rom/dev_input_keypad_letux400"); 5.8 + "rom/dev_input_keypad"); 5.9 5.10 -- Show key event values. 5.11 5.12 @@ -174,7 +174,7 @@ 5.13 ev = ev2:svr(), 5.14 }, 5.15 }, 5.16 - "rom/dev_input_keypad_letux400"); 5.17 + "rom/dev_input_keypad"); 5.18 5.19 -- Show key strings. 5.20
6.1 --- a/conf/landfall-examples/mips-letux400-keypad-demo.list Fri Jun 01 22:47:51 2018 +0200 6.2 +++ b/conf/landfall-examples/mips-letux400-keypad-demo.list Fri Jun 01 22:53:02 2018 +0200 6.3 @@ -18,10 +18,12 @@ 6.4 module dev_display_letux400 6.5 module dev_cpm_jz4730 6.6 module dev_keypad_letux400 6.7 -module dev_input_keypad_letux400 6.8 +module dev_input_keypad 6.9 module ex_input_event_client 6.10 module ex_keypad_ds_client 6.11 module ex_letux400_backlight 6.12 module ex_letux400_keypad_physical 6.13 module libpanel_letux400.so 6.14 module mips-jz4740-panel.txt 6.15 +module libkeypad_letux400.so 6.16 +module input-keypad.txt
7.1 --- a/conf/landfall-examples/mips-qi_lb60-input-event-client.cfg Fri Jun 01 22:47:51 2018 +0200 7.2 +++ b/conf/landfall-examples/mips-qi_lb60-input-event-client.cfg Fri Jun 01 22:53:02 2018 +0200 7.3 @@ -130,7 +130,7 @@ 7.4 ev = ev:svr(), 7.5 }, 7.6 }, 7.7 - "rom/dev_input_keypad_qi_lb60"); 7.8 + "rom/dev_input_keypad"); 7.9 7.10 -- Show key event values. 7.11
8.1 --- a/conf/landfall-examples/mips-qi_lb60-input-event-client.list Fri Jun 01 22:47:51 2018 +0200 8.2 +++ b/conf/landfall-examples/mips-qi_lb60-input-event-client.list Fri Jun 01 22:53:02 2018 +0200 8.3 @@ -18,7 +18,9 @@ 8.4 module dev_display_qi_lb60 8.5 module dev_cpm_jz4740 8.6 module dev_keypad_qi_lb60 8.7 -module dev_input_keypad_qi_lb60 8.8 +module dev_input_keypad 8.9 module ex_input_event_client 8.10 module libpanel_qi_lb60.so 8.11 module mips-jz4740-panel.txt 8.12 +module libkeypad_qi_lb60.so 8.13 +module input-keypad.txt
9.1 --- a/conf/landfall-examples/mips-qi_lb60-keypad-demo.cfg Fri Jun 01 22:47:51 2018 +0200 9.2 +++ b/conf/landfall-examples/mips-qi_lb60-keypad-demo.cfg Fri Jun 01 22:53:02 2018 +0200 9.3 @@ -150,7 +150,7 @@ 9.4 ev = ev1:svr(), 9.5 }, 9.6 }, 9.7 - "rom/dev_input_keypad_qi_lb60"); 9.8 + "rom/dev_input_keypad"); 9.9 9.10 -- Show key event values. 9.11 9.12 @@ -172,7 +172,7 @@ 9.13 ev = ev2:svr(), 9.14 }, 9.15 }, 9.16 - "rom/dev_input_keypad_qi_lb60"); 9.17 + "rom/dev_input_keypad"); 9.18 9.19 -- Show key strings. 9.20
10.1 --- a/conf/landfall-examples/mips-qi_lb60-keypad-demo.list Fri Jun 01 22:47:51 2018 +0200 10.2 +++ b/conf/landfall-examples/mips-qi_lb60-keypad-demo.list Fri Jun 01 22:53:02 2018 +0200 10.3 @@ -18,10 +18,12 @@ 10.4 module dev_display_qi_lb60 10.5 module dev_cpm_jz4740 10.6 module dev_keypad_qi_lb60 10.7 -module dev_input_keypad_qi_lb60 10.8 +module dev_input_keypad 10.9 module ex_input_event_client 10.10 module ex_keypad_ds_client 10.11 module ex_qi_lb60_keypad_physical 10.12 module ex_qi_lb60_backlight 10.13 module libpanel_qi_lb60.so 10.14 module mips-jz4740-panel.txt 10.15 +module libkeypad_qi_lb60.so 10.16 +module input-keypad.txt
11.1 --- a/pkg/devices/Control Fri Jun 01 22:47:51 2018 +0200 11.2 +++ b/pkg/devices/Control Fri Jun 01 22:53:02 2018 +0200 11.3 @@ -6,8 +6,7 @@ 11.4 provides: devices-display-letux400 11.5 provides: devices-display-qi_lb60 11.6 provides: devices-fb-jz4740 11.7 -provides: devices-input-keypad-letux400 11.8 -provides: devices-input-keypad-qi_lb60 11.9 +provides: devices-input-keypad-server 11.10 provides: devices-keypad-letux400 11.11 provides: devices-keypad-qi_lb60 11.12 provides: devices-pwm-jz4730 11.13 @@ -24,7 +23,6 @@ 11.14 provides: libdevice-input-event-client 11.15 provides: libdevice-input-event-ops 11.16 provides: libdevice-input-keypad 11.17 -provides: libdevice-input-keypad-server 11.18 provides: libdevice-keypad-client 11.19 provides: libdevice-keypad-ops 11.20 provides: libdevice-keypad-server 11.21 @@ -37,8 +35,9 @@ 11.22 provides: libdrivers-cpm 11.23 provides: libdrivers-gpio 11.24 provides: libdrivers-i2c 11.25 -provides: libdrivers-keypad 11.26 +provides: libdrivers-keypad-headers 11.27 provides: libdrivers-keypad-letux400 11.28 +provides: libdrivers-keypad-loader 11.29 provides: libdrivers-keypad-qi_lb60 11.30 provides: libdrivers-lcd-headers 11.31 provides: libdrivers-lcd-jz4740
12.1 --- a/pkg/devices/input/include/input-event-server.h Fri Jun 01 22:47:51 2018 +0200 12.2 +++ b/pkg/devices/input/include/input-event-server.h Fri Jun 01 22:53:02 2018 +0200 12.3 @@ -59,5 +59,3 @@ 12.4 }; 12.5 12.6 #endif 12.7 - 12.8 -int run(void);
13.1 --- a/pkg/devices/input/src/Makefile Fri Jun 01 22:47:51 2018 +0200 13.2 +++ b/pkg/devices/input/src/Makefile Fri Jun 01 22:53:02 2018 +0200 13.3 @@ -1,10 +1,8 @@ 13.4 PKGDIR ?= ../.. 13.5 L4DIR ?= $(PKGDIR)/../.. 13.6 13.7 -TARGET := client keypad letux400 qi_lb60 server 13.8 +TARGET := client keypad server 13.9 13.10 include $(L4DIR)/mk/subdir.mk 13.11 13.12 -letux400: server 13.13 -qi_lb60: server 13.14 server: keypad
14.1 --- a/pkg/devices/input/src/client/Makefile Fri Jun 01 22:47:51 2018 +0200 14.2 +++ b/pkg/devices/input/src/client/Makefile Fri Jun 01 22:53:02 2018 +0200 14.3 @@ -8,6 +8,6 @@ 14.4 14.5 PRIVATE_INCDIR += $(PKGDIR)/input/include 14.6 14.7 -REQUIRES_LIBS := l4re_c l4re_c-util libdevice-util 14.8 +REQUIRES_LIBS := l4re_c l4re_c-util libdrivers-keypad-headers libdevice-util 14.9 14.10 include $(L4DIR)/mk/lib.mk
15.1 --- a/pkg/devices/input/src/keypad/Makefile Fri Jun 01 22:47:51 2018 +0200 15.2 +++ b/pkg/devices/input/src/keypad/Makefile Fri Jun 01 22:53:02 2018 +0200 15.3 @@ -8,6 +8,6 @@ 15.4 15.5 PRIVATE_INCDIR += $(PKGDIR)/input/include 15.6 15.7 -REQUIRES_LIBS := l4re_c l4re_c-util libdevice-keypad-client libdrivers-keypad 15.8 +REQUIRES_LIBS := l4re_c l4re_c-util libdrivers-keypad-headers libdevice-keypad-client 15.9 15.10 include $(L4DIR)/mk/lib.mk
16.1 --- a/pkg/devices/input/src/letux400/Makefile Fri Jun 01 22:47:51 2018 +0200 16.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 16.3 @@ -1,13 +0,0 @@ 16.4 -PKGDIR ?= ../../.. 16.5 -L4DIR ?= $(PKGDIR)/../.. 16.6 - 16.7 -TARGET = dev_input_keypad_letux400 16.8 -PC_FILENAME := devices-input-keypad-letux400 16.9 - 16.10 -SRC_CC := input-keypad-letux400.cc 16.11 - 16.12 -PRIVATE_INCDIR += $(PKGDIR)/input/include 16.13 - 16.14 -REQUIRES_LIBS := l4re_c l4re_c-util libdevice-input-keypad-server libdrivers-keypad-letux400 16.15 - 16.16 -include $(L4DIR)/mk/prog.mk
17.1 --- a/pkg/devices/input/src/letux400/input-keypad-letux400.cc Fri Jun 01 22:47:51 2018 +0200 17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 17.3 @@ -1,29 +0,0 @@ 17.4 -/* 17.5 - * Export the keypad for the Letux 400 via the "ev" capability. 17.6 - * 17.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 17.8 - * 17.9 - * This program is free software; you can redistribute it and/or 17.10 - * modify it under the terms of the GNU General Public License as 17.11 - * published by the Free Software Foundation; either version 2 of 17.12 - * the License, or (at your option) any later version. 17.13 - * 17.14 - * This program is distributed in the hope that it will be useful, 17.15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 17.16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17.17 - * GNU General Public License for more details. 17.18 - * 17.19 - * You should have received a copy of the GNU General Public License 17.20 - * along with this program; if not, write to the Free Software 17.21 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, 17.22 - * Boston, MA 02110-1301, USA 17.23 - */ 17.24 - 17.25 -#include "input-event-server.h" 17.26 - 17.27 -/* Main program. */ 17.28 - 17.29 -int main() 17.30 -{ 17.31 - return run(); 17.32 -}
18.1 --- a/pkg/devices/input/src/qi_lb60/Makefile Fri Jun 01 22:47:51 2018 +0200 18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 18.3 @@ -1,13 +0,0 @@ 18.4 -PKGDIR ?= ../../.. 18.5 -L4DIR ?= $(PKGDIR)/../.. 18.6 - 18.7 -TARGET = dev_input_keypad_qi_lb60 18.8 -PC_FILENAME := devices-input-keypad-qi_lb60 18.9 - 18.10 -SRC_CC := input-keypad-qi_lb60.cc 18.11 - 18.12 -PRIVATE_INCDIR += $(PKGDIR)/input/include 18.13 - 18.14 -REQUIRES_LIBS := l4re_c l4re_c-util libdevice-input-keypad-server libdrivers-keypad-qi_lb60 18.15 - 18.16 -include $(L4DIR)/mk/prog.mk
19.1 --- a/pkg/devices/input/src/qi_lb60/input-keypad-qi_lb60.cc Fri Jun 01 22:47:51 2018 +0200 19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 19.3 @@ -1,29 +0,0 @@ 19.4 -/* 19.5 - * Export the keypad for the Ben NanoNote via the "ev" capability. 19.6 - * 19.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 19.8 - * 19.9 - * This program is free software; you can redistribute it and/or 19.10 - * modify it under the terms of the GNU General Public License as 19.11 - * published by the Free Software Foundation; either version 2 of 19.12 - * the License, or (at your option) any later version. 19.13 - * 19.14 - * This program is distributed in the hope that it will be useful, 19.15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 19.16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19.17 - * GNU General Public License for more details. 19.18 - * 19.19 - * You should have received a copy of the GNU General Public License 19.20 - * along with this program; if not, write to the Free Software 19.21 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19.22 - * Boston, MA 02110-1301, USA 19.23 - */ 19.24 - 19.25 -#include "input-event-server.h" 19.26 - 19.27 -/* Main program. */ 19.28 - 19.29 -int main() 19.30 -{ 19.31 - return run(); 19.32 -}
20.1 --- a/pkg/devices/input/src/server/Makefile Fri Jun 01 22:47:51 2018 +0200 20.2 +++ b/pkg/devices/input/src/server/Makefile Fri Jun 01 22:53:02 2018 +0200 20.3 @@ -1,13 +1,13 @@ 20.4 PKGDIR ?= ../../.. 20.5 L4DIR ?= $(PKGDIR)/../.. 20.6 20.7 -TARGET = libdevice_input_keypad_server.o.a 20.8 -PC_FILENAME := libdevice-input-keypad-server 20.9 +TARGET = dev_input_keypad 20.10 +PC_FILENAME := devices-input-keypad-server 20.11 20.12 SRC_CC := input-keypad-server.cc 20.13 20.14 PRIVATE_INCDIR += $(PKGDIR)/input/include 20.15 20.16 -REQUIRES_LIBS := l4re_c l4re_c-util libdevice-input-keypad libdevice-util 20.17 +REQUIRES_LIBS := l4re_c l4re_c-util libdevice-input-keypad libdrivers-keypad-loader libdevice-util 20.18 20.19 -include $(L4DIR)/mk/lib.mk 20.20 +include $(L4DIR)/mk/prog.mk
21.1 --- a/pkg/devices/input/src/server/input-keypad-server.cc Fri Jun 01 22:47:51 2018 +0200 21.2 +++ b/pkg/devices/input/src/server/input-keypad-server.cc Fri Jun 01 22:53:02 2018 +0200 21.3 @@ -20,6 +20,7 @@ 21.4 */ 21.5 21.6 #include <l4/devices/dataspace.h> 21.7 +#include <l4/devices/keypad-loader.h> 21.8 #include "input-event-client.h" 21.9 #include "input-event-server.h" 21.10 #include "input-event-ops.h" 21.11 @@ -38,6 +39,8 @@ 21.12 #include <l4/sys/types.h> 21.13 #include <l4/util/util.h> 21.14 21.15 +#include <stdio.h> 21.16 + 21.17 /* Extract a fpage from the message buffers. Provide a Snd_fpage reference for 21.18 modification. */ 21.19 21.20 @@ -151,9 +154,11 @@ 21.21 21.22 21.23 21.24 -int run(void) 21.25 +int main(void) 21.26 { 21.27 - Keypad *keypad = Keypad::get_keypad(); 21.28 + // Load the keypad details from the configured library. 21.29 + 21.30 + Keypad *keypad = load_keypad(); 21.31 Input_keypad_client client(keypad); 21.32 void *buffer; 21.33
22.1 --- a/pkg/devices/lib/keypad/include/Makefile Fri Jun 01 22:47:51 2018 +0200 22.2 +++ b/pkg/devices/lib/keypad/include/Makefile Fri Jun 01 22:53:02 2018 +0200 22.3 @@ -1,4 +1,6 @@ 22.4 PKGDIR = ../../.. 22.5 L4DIR ?= $(PKGDIR)/../.. 22.6 22.7 +PC_FILENAME := libdrivers-keypad-headers 22.8 + 22.9 include $(L4DIR)/mk/include.mk
23.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 23.2 +++ b/pkg/devices/lib/keypad/include/keypad-common.h Fri Jun 01 22:53:02 2018 +0200 23.3 @@ -0,0 +1,54 @@ 23.4 +/* 23.5 + * Common functions for keypad description access. These are provided in a 23.6 + * header file for convenient incorporation into libraries without worrying 23.7 + * about linkage, symbol visibility, and so on. 23.8 + * 23.9 + * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 23.10 + * 23.11 + * This program is free software; you can redistribute it and/or 23.12 + * modify it under the terms of the GNU General Public License as 23.13 + * published by the Free Software Foundation; either version 2 of 23.14 + * the License, or (at your option) any later version. 23.15 + * 23.16 + * This program is distributed in the hope that it will be useful, 23.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 23.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23.19 + * GNU General Public License for more details. 23.20 + * 23.21 + * You should have received a copy of the GNU General Public License 23.22 + * along with this program; if not, write to the Free Software 23.23 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, 23.24 + * Boston, MA 02110-1301, USA 23.25 + */ 23.26 + 23.27 +#pragma once 23.28 + 23.29 +#include "keypad.h" 23.30 + 23.31 +/* Obtain the common instance. */ 23.32 + 23.33 +void *keypad_get(void) 23.34 +{ 23.35 + return reinterpret_cast<void *>(Keypad::get_keypad()); 23.36 +} 23.37 + 23.38 +/* Number of keypad columns. */ 23.39 + 23.40 +int keypad_columns(void *keypad) 23.41 +{ 23.42 + return static_cast<Keypad *>(keypad)->columns(); 23.43 +} 23.44 + 23.45 +/* Number of keypad rows, used by each value in the column array. */ 23.46 + 23.47 +int keypad_rows(void *keypad) 23.48 +{ 23.49 + return static_cast<Keypad *>(keypad)->rows(); 23.50 +} 23.51 + 23.52 +/* Keycode accessors. */ 23.53 + 23.54 +int keypad_code(void *keypad, int column, int row) 23.55 +{ 23.56 + return static_cast<Keypad *>(keypad)->code(column, row); 23.57 +}
24.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 24.2 +++ b/pkg/devices/lib/keypad/include/keypad-loader.h Fri Jun 01 22:53:02 2018 +0200 24.3 @@ -0,0 +1,26 @@ 24.4 +/* 24.5 + * Client access to keypad libraries. 24.6 + * 24.7 + * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 24.8 + * 24.9 + * This program is free software; you can redistribute it and/or 24.10 + * modify it under the terms of the GNU General Public License as 24.11 + * published by the Free Software Foundation; either version 2 of 24.12 + * the License, or (at your option) any later version. 24.13 + * 24.14 + * This program is distributed in the hope that it will be useful, 24.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 24.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24.17 + * GNU General Public License for more details. 24.18 + * 24.19 + * You should have received a copy of the GNU General Public License 24.20 + * along with this program; if not, write to the Free Software 24.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, 24.22 + * Boston, MA 02110-1301, USA 24.23 + */ 24.24 + 24.25 +#pragma once 24.26 + 24.27 +#include "keypad.h" 24.28 + 24.29 +Keypad *load_keypad();
25.1 --- a/pkg/devices/lib/keypad/src/Makefile Fri Jun 01 22:47:51 2018 +0200 25.2 +++ b/pkg/devices/lib/keypad/src/Makefile Fri Jun 01 22:53:02 2018 +0200 25.3 @@ -1,6 +1,6 @@ 25.4 PKGDIR ?= ../../.. 25.5 L4DIR ?= $(PKGDIR)/../.. 25.6 25.7 -TARGET := common letux400 qi_lb60 25.8 +TARGET := letux400 loader qi_lb60 25.9 25.10 include $(L4DIR)/mk/subdir.mk
26.1 --- a/pkg/devices/lib/keypad/src/common/Makefile Fri Jun 01 22:47:51 2018 +0200 26.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 26.3 @@ -1,13 +0,0 @@ 26.4 -PKGDIR ?= ../../../.. 26.5 -L4DIR ?= $(PKGDIR)/../.. 26.6 - 26.7 -TARGET = libkeypad.o.a 26.8 -PC_FILENAME := libdrivers-keypad 26.9 - 26.10 -SRC_CC := keypad.cc 26.11 - 26.12 -PRIVATE_INCDIR += $(PKGDIR)/lib/keypad/include 26.13 - 26.14 -REQUIRES_LIBS := l4re_c l4re_c-util 26.15 - 26.16 -include $(L4DIR)/mk/lib.mk
27.1 --- a/pkg/devices/lib/keypad/src/common/keypad.cc Fri Jun 01 22:47:51 2018 +0200 27.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 27.3 @@ -1,50 +0,0 @@ 27.4 -/* 27.5 - * General keypad mapping support. 27.6 - * 27.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 27.8 - * 27.9 - * This program is free software; you can redistribute it and/or 27.10 - * modify it under the terms of the GNU General Public License as 27.11 - * published by the Free Software Foundation; either version 2 of 27.12 - * the License, or (at your option) any later version. 27.13 - * 27.14 - * This program is distributed in the hope that it will be useful, 27.15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 27.16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27.17 - * GNU General Public License for more details. 27.18 - * 27.19 - * You should have received a copy of the GNU General Public License 27.20 - * along with this program; if not, write to the Free Software 27.21 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, 27.22 - * Boston, MA 02110-1301, USA 27.23 - */ 27.24 - 27.25 -#include "keypad.h" 27.26 - 27.27 -/* Obtain the common instance. */ 27.28 - 27.29 -void *keypad_get(void) 27.30 -{ 27.31 - return reinterpret_cast<void *>(Keypad::get_keypad()); 27.32 -} 27.33 - 27.34 -/* Number of keypad columns. */ 27.35 - 27.36 -int keypad_columns(void *keypad) 27.37 -{ 27.38 - return static_cast<Keypad *>(keypad)->columns(); 27.39 -} 27.40 - 27.41 -/* Number of keypad rows, used by each value in the column array. */ 27.42 - 27.43 -int keypad_rows(void *keypad) 27.44 -{ 27.45 - return static_cast<Keypad *>(keypad)->rows(); 27.46 -} 27.47 - 27.48 -/* Keycode accessors. */ 27.49 - 27.50 -int keypad_code(void *keypad, int column, int row) 27.51 -{ 27.52 - return static_cast<Keypad *>(keypad)->code(column, row); 27.53 -}
28.1 --- a/pkg/devices/lib/keypad/src/letux400/Makefile Fri Jun 01 22:47:51 2018 +0200 28.2 +++ b/pkg/devices/lib/keypad/src/letux400/Makefile Fri Jun 01 22:53:02 2018 +0200 28.3 @@ -1,13 +1,11 @@ 28.4 PKGDIR ?= ../../../.. 28.5 L4DIR ?= $(PKGDIR)/../.. 28.6 28.7 -TARGET = libkeypad_letux400.o.a 28.8 +TARGET = libkeypad_letux400.so 28.9 PC_FILENAME := libdrivers-keypad-letux400 28.10 28.11 SRC_CC := keypad-letux400.cc 28.12 28.13 PRIVATE_INCDIR += $(PKGDIR)/lib/keypad/include 28.14 28.15 -REQUIRES_LIBS := l4re_c l4re_c-util 28.16 - 28.17 include $(L4DIR)/mk/lib.mk
29.1 --- a/pkg/devices/lib/keypad/src/letux400/keypad-letux400.cc Fri Jun 01 22:47:51 2018 +0200 29.2 +++ b/pkg/devices/lib/keypad/src/letux400/keypad-letux400.cc Fri Jun 01 22:53:02 2018 +0200 29.3 @@ -20,6 +20,7 @@ 29.4 */ 29.5 29.6 #include "keypad.h" 29.7 +#include "keypad-common.h" 29.8 #include <l4/re/event_enums.h> 29.9 29.10 enum Jz4730_keypad_gpio
30.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 30.2 +++ b/pkg/devices/lib/keypad/src/loader/Makefile Fri Jun 01 22:53:02 2018 +0200 30.3 @@ -0,0 +1,12 @@ 30.4 +PKGDIR ?= ../../../.. 30.5 +L4DIR ?= $(PKGDIR)/../.. 30.6 + 30.7 +TARGET = libkeypad_loader.a 30.8 +PC_FILENAME := libdrivers-keypad-loader 30.9 + 30.10 +SRC_CC := keypad-loader.cc 30.11 +REQUIRES_LIBS := libdevice-util 30.12 + 30.13 +PRIVATE_INCDIR += $(PKGDIR)/lib/keypad/include 30.14 + 30.15 +include $(L4DIR)/mk/lib.mk
31.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 31.2 +++ b/pkg/devices/lib/keypad/src/loader/keypad-loader.cc Fri Jun 01 22:53:02 2018 +0200 31.3 @@ -0,0 +1,38 @@ 31.4 +/* 31.5 + * Client functionality for keypad library access. 31.6 + * 31.7 + * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 31.8 + * 31.9 + * This program is free software; you can redistribute it and/or 31.10 + * modify it under the terms of the GNU General Public License as 31.11 + * published by the Free Software Foundation; either version 2 of 31.12 + * the License, or (at your option) any later version. 31.13 + * 31.14 + * This program is distributed in the hope that it will be useful, 31.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 31.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31.17 + * GNU General Public License for more details. 31.18 + * 31.19 + * You should have received a copy of the GNU General Public License 31.20 + * along with this program; if not, write to the Free Software 31.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, 31.22 + * Boston, MA 02110-1301, USA 31.23 + */ 31.24 + 31.25 +#include <l4/devices/dl.h> 31.26 +#include "keypad.h" 31.27 +#include "keypad-loader.h" 31.28 + 31.29 +Keypad *load_keypad() 31.30 +{ 31.31 + // Load the keypad library using details in the specified file. 31.32 + 31.33 + void *(*keypad_get)(void); 31.34 + 31.35 + keypad_get = (void *(*)(void)) load_function("rom/input-keypad.txt", "keypad_get"); 31.36 + if (!keypad_get) return 0; 31.37 + 31.38 + // Return the keypad details. 31.39 + 31.40 + return (Keypad *) keypad_get(); 31.41 +}
32.1 --- a/pkg/devices/lib/keypad/src/qi_lb60/Makefile Fri Jun 01 22:47:51 2018 +0200 32.2 +++ b/pkg/devices/lib/keypad/src/qi_lb60/Makefile Fri Jun 01 22:53:02 2018 +0200 32.3 @@ -1,13 +1,11 @@ 32.4 PKGDIR ?= ../../../.. 32.5 L4DIR ?= $(PKGDIR)/../.. 32.6 32.7 -TARGET = libkeypad_qi_lb60.o.a 32.8 +TARGET = libkeypad_qi_lb60.so 32.9 PC_FILENAME := libdrivers-keypad-qi_lb60 32.10 32.11 SRC_CC := keypad-qi_lb60.cc 32.12 32.13 PRIVATE_INCDIR += $(PKGDIR)/lib/keypad/include 32.14 32.15 -REQUIRES_LIBS := l4re_c l4re_c-util 32.16 - 32.17 include $(L4DIR)/mk/lib.mk
33.1 --- a/pkg/devices/lib/keypad/src/qi_lb60/keypad-qi_lb60.cc Fri Jun 01 22:47:51 2018 +0200 33.2 +++ b/pkg/devices/lib/keypad/src/qi_lb60/keypad-qi_lb60.cc Fri Jun 01 22:53:02 2018 +0200 33.3 @@ -20,6 +20,7 @@ 33.4 */ 33.5 33.6 #include "keypad.h" 33.7 +#include "keypad-common.h" 33.8 #include <l4/re/event_enums.h> 33.9 33.10 enum Jz4740_keypad_gpio
34.1 --- a/pkg/landfall-examples/letux400_backlight/Makefile Fri Jun 01 22:47:51 2018 +0200 34.2 +++ b/pkg/landfall-examples/letux400_backlight/Makefile Fri Jun 01 22:53:02 2018 +0200 34.3 @@ -3,6 +3,6 @@ 34.4 34.5 TARGET = ex_letux400_backlight 34.6 SRC_CC = letux400_backlight.cc 34.7 -REQUIRES_LIBS = libio l4re_c-util libdevice-backlight-client libdevice-input-keypad libdrivers-keypad-letux400 34.8 +REQUIRES_LIBS = l4re_c-util libdevice-backlight-client libdevice-input-keypad libdrivers-keypad-loader libdevice-util 34.9 34.10 include $(L4DIR)/mk/prog.mk
35.1 --- a/pkg/landfall-examples/letux400_backlight/letux400_backlight.cc Fri Jun 01 22:47:51 2018 +0200 35.2 +++ b/pkg/landfall-examples/letux400_backlight/letux400_backlight.cc Fri Jun 01 22:53:02 2018 +0200 35.3 @@ -21,6 +21,7 @@ 35.4 35.5 #include <l4/devices/backlight-client.h> 35.6 #include <l4/devices/input-keypad-client.h> 35.7 +#include <l4/devices/keypad-loader.h> 35.8 35.9 #include <l4/re/env> 35.10 #include <l4/sys/capability> 35.11 @@ -28,6 +29,8 @@ 35.12 #include <l4/re/event_enums.h> 35.13 #include <l4/util/util.h> 35.14 35.15 +#include <stdio.h> 35.16 + 35.17 /* Backlight level. */ 35.18 35.19 enum Letux400_backlight_levels 35.20 @@ -93,7 +96,9 @@ 35.21 35.22 int main(void) 35.23 { 35.24 - Keypad *keypad = Keypad::get_keypad(); 35.25 + /* Load the keypad library using details from the configured library. */ 35.26 + 35.27 + Keypad *keypad = (Keypad *) load_keypad(); 35.28 Input_keypad_client client(keypad); 35.29 35.30 /* Obtain a reference to the PWM device. */
36.1 --- a/pkg/landfall-examples/qi_lb60_backlight/Makefile Fri Jun 01 22:47:51 2018 +0200 36.2 +++ b/pkg/landfall-examples/qi_lb60_backlight/Makefile Fri Jun 01 22:53:02 2018 +0200 36.3 @@ -3,6 +3,6 @@ 36.4 36.5 TARGET = ex_qi_lb60_backlight 36.6 SRC_CC = qi_lb60_backlight.cc 36.7 -REQUIRES_LIBS = libio l4re_c-util libdevice-backlight-client libdevice-input-keypad libdrivers-keypad-qi_lb60 36.8 +REQUIRES_LIBS = l4re_c-util libdevice-backlight-client libdevice-input-keypad libdrivers-keypad-loader libdevice-util 36.9 36.10 include $(L4DIR)/mk/prog.mk
37.1 --- a/pkg/landfall-examples/qi_lb60_backlight/qi_lb60_backlight.cc Fri Jun 01 22:47:51 2018 +0200 37.2 +++ b/pkg/landfall-examples/qi_lb60_backlight/qi_lb60_backlight.cc Fri Jun 01 22:53:02 2018 +0200 37.3 @@ -21,6 +21,7 @@ 37.4 37.5 #include <l4/devices/backlight-client.h> 37.6 #include <l4/devices/input-keypad-client.h> 37.7 +#include <l4/devices/keypad-loader.h> 37.8 37.9 #include <l4/re/env> 37.10 #include <l4/sys/capability> 37.11 @@ -28,6 +29,8 @@ 37.12 #include <l4/re/event_enums.h> 37.13 #include <l4/util/util.h> 37.14 37.15 +#include <stdio.h> 37.16 + 37.17 /* Backlight level. */ 37.18 37.19 enum Qi_lb60_backlight_levels 37.20 @@ -106,7 +109,9 @@ 37.21 37.22 int main(void) 37.23 { 37.24 - Keypad *keypad = Keypad::get_keypad(); 37.25 + // Load the keypad details from the configured library. 37.26 + 37.27 + Keypad *keypad = (Keypad *) load_keypad(); 37.28 Input_keypad_client client(keypad); 37.29 37.30 /* Obtain a reference to the backlight device. */
38.1 --- a/tools/checkconfig.sh Fri Jun 01 22:47:51 2018 +0200 38.2 +++ b/tools/checkconfig.sh Fri Jun 01 22:53:02 2018 +0200 38.3 @@ -82,3 +82,15 @@ 38.4 # Write it to the configuration file. 38.5 38.6 echo -n "$PANELLIB" > "$PANELCONF" 38.7 + 38.8 +# Keypad configuration file in the target area. 38.9 + 38.10 +KEYPADCONF="$TARGETDIR/conf/landfall-examples/input-keypad.txt" 38.11 + 38.12 +# Determine the required value of the panel configuration. 38.13 + 38.14 +KEYPADLIB="rom/libkeypad_$PLATFORM.so" 38.15 + 38.16 +# Write it to the configuration file. 38.17 + 38.18 +echo -n "$KEYPADLIB" > "$KEYPADCONF"