浏览代码

lcd4linux: import from oldpackages

* Update to latest version
* Refresh patches
* Update copyright years
* Fix musl build issues (patches already applied upstream)

Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
Jonathan McCrohan 9 年前
父节点
当前提交
4f086bc2a3

+ 489
- 0
utils/lcd4linux/Config.in 查看文件

@@ -0,0 +1,489 @@
1
+if PACKAGE_lcd4linux-custom
2
+
3
+config LCD4LINUX_CUSTOM_NEEDS_libdbus
4
+	bool
5
+
6
+#config LCD4LINUX_CUSTOM_NEEDS_libftdi
7
+#	bool
8
+
9
+config LCD4LINUX_CUSTOM_NEEDS_libgd
10
+	bool
11
+
12
+config LCD4LINUX_CUSTOM_NEEDS_libiconv
13
+	bool
14
+
15
+config LCD4LINUX_CUSTOM_NEEDS_libjpeg
16
+	bool
17
+
18
+config LCD4LINUX_CUSTOM_NEEDS_libmpdclient
19
+	bool
20
+
21
+config LCD4LINUX_CUSTOM_NEEDS_libmysqlclient
22
+	bool
23
+
24
+config LCD4LINUX_CUSTOM_NEEDS_libncurses
25
+	bool
26
+
27
+config LCD4LINUX_CUSTOM_NEEDS_libnmeap
28
+	bool
29
+
30
+config LCD4LINUX_CUSTOM_NEEDS_libsqlite3
31
+	bool
32
+
33
+config LCD4LINUX_CUSTOM_NEEDS_libusb
34
+	bool
35
+
36
+#config LCD4LINUX_CUSTOM_NEEDS_libX11
37
+#	bool
38
+
39
+config LCD4LINUX_CUSTOM_NEEDS_ppp
40
+	bool
41
+
42
+config LCD4LINUX_CUSTOM_NEEDS_python
43
+	bool
44
+
45
+
46
+comment "Drivers ---"
47
+
48
+config LCD4LINUX_CUSTOM_DRIVER_ASTUSB
49
+	bool
50
+	prompt "ASTUSB"
51
+
52
+config LCD4LINUX_CUSTOM_DRIVER_BeckmannEgle
53
+	bool
54
+	prompt "BeckmannEgle"
55
+
56
+config LCD4LINUX_CUSTOM_DRIVER_BWCT
57
+	bool
58
+	prompt "BWCT"
59
+	select LCD4LINUX_CUSTOM_NEEDS_libusb
60
+
61
+config LCD4LINUX_CUSTOM_DRIVER_CrystalFontz
62
+	bool
63
+	prompt "CrystalFontz"
64
+
65
+config LCD4LINUX_CUSTOM_DRIVER_Curses
66
+	bool
67
+	prompt "Curses"
68
+	select LCD4LINUX_CUSTOM_NEEDS_libncurses
69
+
70
+config LCD4LINUX_CUSTOM_DRIVER_Cwlinux
71
+	bool
72
+	prompt "Cwlinux"
73
+
74
+config LCD4LINUX_CUSTOM_DRIVER_D4D
75
+	bool
76
+	prompt "D4D"
77
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
78
+
79
+config LCD4LINUX_CUSTOM_DRIVER_dpf
80
+	bool
81
+	prompt "dpf"
82
+	select LCD4LINUX_CUSTOM_NEEDS_libdpf
83
+
84
+config LCD4LINUX_CUSTOM_DRIVER_EA232graphic
85
+	bool
86
+	prompt "EA232graphic"
87
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
88
+
89
+config LCD4LINUX_CUSTOM_DRIVER_EFN
90
+	bool
91
+	prompt "EFN"
92
+
93
+config LCD4LINUX_CUSTOM_DRIVER_FutabaVFD
94
+	bool
95
+	prompt "FutabaVFD"
96
+
97
+config LCD4LINUX_CUSTOM_DRIVER_FW8888
98
+	bool
99
+	prompt "FW8888"
100
+
101
+config LCD4LINUX_CUSTOM_DRIVER_G15
102
+	bool
103
+	prompt "G15"
104
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
105
+	select LCD4LINUX_CUSTOM_NEEDS_libusb
106
+
107
+config LCD4LINUX_CUSTOM_DRIVER_GLCD2USB
108
+	bool
109
+	prompt "GLCD2USB"
110
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
111
+	select LCD4LINUX_CUSTOM_NEEDS_libusb
112
+
113
+config LCD4LINUX_CUSTOM_DRIVER_HD44780
114
+	bool
115
+	prompt "HD44780"
116
+	depends on BROKEN
117
+
118
+config LCD4LINUX_CUSTOM_DRIVER_HD44780-I2C
119
+	bool
120
+	prompt "HD44780-I2C"
121
+	depends on BROKEN
122
+
123
+config LCD4LINUX_CUSTOM_DRIVER_IRLCD
124
+	bool
125
+	prompt "IRLCD"
126
+	select LCD4LINUX_CUSTOM_NEEDS_libusb
127
+
128
+config LCD4LINUX_CUSTOM_DRIVER_LCD2USB
129
+	bool
130
+	prompt "LCD2USB"
131
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
132
+	select LCD4LINUX_CUSTOM_NEEDS_libusb
133
+
134
+config LCD4LINUX_CUSTOM_DRIVER_LCDLinux
135
+	bool
136
+	prompt "LCDLinux"
137
+	depends on BROKEN
138
+
139
+config LCD4LINUX_CUSTOM_DRIVER_LCDTerm
140
+	bool
141
+	prompt "LCDTerm"
142
+
143
+config LCD4LINUX_CUSTOM_DRIVER_LEDMatrix
144
+	bool
145
+	prompt "LEDMatrix"
146
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
147
+
148
+config LCD4LINUX_CUSTOM_DRIVER_LPH7508
149
+	bool
150
+	prompt "LPH7508"
151
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
152
+
153
+config LCD4LINUX_CUSTOM_DRIVER_LUIse
154
+	bool
155
+	prompt "LUIse"
156
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
157
+	#select LCD4LINUX_CUSTOM_NEEDS_libluise
158
+	depends on BROKEN
159
+
160
+config LCD4LINUX_CUSTOM_DRIVER_LW_ABP
161
+	bool
162
+	prompt "LW_ABP"
163
+
164
+config LCD4LINUX_CUSTOM_DRIVER_M50530
165
+	bool
166
+	prompt "M50530"
167
+
168
+config LCD4LINUX_CUSTOM_DRIVER_MatrixOrbital
169
+	bool
170
+	prompt "MatrixOrbital"
171
+
172
+config LCD4LINUX_CUSTOM_DRIVER_MatrixOrbitalGX
173
+	bool
174
+	prompt "MatrixOrbitalGX"
175
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
176
+	select LCD4LINUX_CUSTOM_NEEDS_libusb
177
+
178
+config LCD4LINUX_CUSTOM_DRIVER_mdm166a
179
+	bool
180
+	prompt "mdm166a"
181
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
182
+
183
+config LCD4LINUX_CUSTOM_DRIVER_MilfordInstruments
184
+	bool
185
+	prompt "MilfordInstruments"
186
+
187
+config LCD4LINUX_CUSTOM_DRIVER_Newhaven
188
+	bool
189
+	prompt "Newhaven"
190
+
191
+config LCD4LINUX_CUSTOM_DRIVER_Noritake
192
+	bool
193
+	prompt "Noritake"
194
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
195
+
196
+config LCD4LINUX_CUSTOM_DRIVER_NULL
197
+	bool
198
+	prompt "NULL"
199
+	default y
200
+
201
+config LCD4LINUX_CUSTOM_DRIVER_Pertelian
202
+	bool
203
+	prompt "Pertelian"
204
+
205
+config LCD4LINUX_CUSTOM_DRIVER_PHAnderson
206
+	bool
207
+	prompt "PHAnderson"
208
+
209
+config LCD4LINUX_CUSTOM_DRIVER_PICGraphic
210
+	bool
211
+	prompt "PICGraphic"
212
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
213
+
214
+config LCD4LINUX_CUSTOM_DRIVER_picoLCD
215
+	bool
216
+	prompt "picoLCD"
217
+	select LCD4LINUX_CUSTOM_NEEDS_libusb
218
+
219
+config LCD4LINUX_CUSTOM_DRIVER_picoLCDGraphic
220
+	bool
221
+	prompt "picoLCDGraphic"
222
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
223
+	select LCD4LINUX_CUSTOM_NEEDS_libusb
224
+
225
+config LCD4LINUX_CUSTOM_DRIVER_PNG
226
+	bool
227
+	prompt "PNG"
228
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
229
+
230
+config LCD4LINUX_CUSTOM_DRIVER_PPM
231
+	bool
232
+	prompt "PPM"
233
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
234
+
235
+config LCD4LINUX_CUSTOM_DRIVER_RouterBoard
236
+	bool
237
+	prompt "RouterBoard"
238
+	depends on TARGET_rb532
239
+
240
+config LCD4LINUX_CUSTOM_DRIVER_SamsungSPF
241
+	bool
242
+	prompt "SamsungSPF"
243
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
244
+	select LCD4LINUX_CUSTOM_NEEDS_libjpeg
245
+
246
+config LCD4LINUX_CUSTOM_DRIVER_serdisplib
247
+	bool
248
+	prompt "serdisplib"
249
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
250
+	select LCD4LINUX_CUSTOM_NEEDS_serdisplib
251
+
252
+config LCD4LINUX_CUSTOM_DRIVER_ShuttleVFD
253
+	bool
254
+	prompt "ShuttleVFD"
255
+	select LCD4LINUX_CUSTOM_NEEDS_libusb
256
+
257
+config LCD4LINUX_CUSTOM_DRIVER_SimpleLCD
258
+	bool
259
+	prompt "SimpleLCD"
260
+
261
+config LCD4LINUX_CUSTOM_DRIVER_st2205
262
+	bool
263
+	prompt "st2205"
264
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
265
+	select LCD4LINUX_CUSTOM_NEEDS_st2205tool
266
+
267
+config LCD4LINUX_CUSTOM_DRIVER_T6963
268
+	bool
269
+	prompt "T6963"
270
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
271
+
272
+config LCD4LINUX_CUSTOM_DRIVER_TeakLCM
273
+	bool
274
+	prompt "TeakLCM"
275
+
276
+config LCD4LINUX_CUSTOM_DRIVER_TEW673GRU
277
+	bool
278
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
279
+	depends on TARGET_ar71xx
280
+	default TARGET_ar71xx
281
+
282
+config LCD4LINUX_CUSTOM_DRIVER_Trefon
283
+	bool
284
+	prompt "Trefon"
285
+	select LCD4LINUX_CUSTOM_NEEDS_libusb
286
+
287
+#config LCD4LINUX_CUSTOM_DRIVER_ULA200
288
+#	bool
289
+#	prompt "ULA200"
290
+#	select LCD4LINUX_CUSTOM_NEEDS_libftdi
291
+#	select LCD4LINUX_CUSTOM_NEEDS_libusb
292
+
293
+config LCD4LINUX_CUSTOM_DRIVER_USBHUB
294
+	bool
295
+	prompt "USBHUB"
296
+	select LCD4LINUX_CUSTOM_NEEDS_libusb
297
+
298
+config LCD4LINUX_CUSTOM_DRIVER_USBLCD
299
+	bool
300
+	prompt "USBLCD"
301
+	select LCD4LINUX_CUSTOM_NEEDS_libusb
302
+
303
+config LCD4LINUX_CUSTOM_DRIVER_VNC
304
+	bool
305
+	prompt "VNC"
306
+	select LCD4LINUX_CUSTOM_NEEDS_libgd
307
+	select LCD4LINUX_CUSTOM_NEEDS_libvncserver
308
+
309
+config LCD4LINUX_CUSTOM_DRIVER_WincorNixdorf
310
+	bool
311
+	prompt "WincorNixdorf"
312
+
313
+#config LCD4LINUX_CUSTOM_DRIVER_X11
314
+#	bool
315
+#	prompt "X11"
316
+#	select LCD4LINUX_CUSTOM_NEEDS_libgd
317
+#	select LCD4LINUX_CUSTOM_NEEDS_libX11
318
+
319
+
320
+comment "Plugins ---"
321
+
322
+config LCD4LINUX_CUSTOM_PLUGIN_apm
323
+	bool
324
+	prompt "apm"
325
+
326
+config LCD4LINUX_CUSTOM_PLUGIN_asterisk
327
+	bool
328
+	prompt "asterisk"
329
+
330
+config LCD4LINUX_CUSTOM_PLUGIN_button_exec
331
+	bool
332
+	prompt "button_exec"
333
+
334
+config LCD4LINUX_CUSTOM_PLUGIN_cpuinfo
335
+	bool
336
+	prompt "cpuinfo"
337
+	default y
338
+
339
+config LCD4LINUX_CUSTOM_PLUGIN_dbus
340
+	bool
341
+	prompt "dbus"
342
+	select LCD4LINUX_CUSTOM_NEEDS_libdbus
343
+
344
+config LCD4LINUX_CUSTOM_PLUGIN_diskstats
345
+	bool
346
+	prompt "diskstats"
347
+
348
+config LCD4LINUX_CUSTOM_PLUGIN_dvb
349
+	bool
350
+	prompt "dvb"
351
+
352
+config LCD4LINUX_CUSTOM_PLUGIN_event
353
+	bool
354
+	prompt "event"
355
+
356
+config LCD4LINUX_CUSTOM_PLUGIN_exec
357
+	bool
358
+	prompt "exec"
359
+
360
+config LCD4LINUX_CUSTOM_PLUGIN_fifo
361
+	bool
362
+	prompt "fifo"
363
+
364
+config LCD4LINUX_CUSTOM_PLUGIN_file
365
+	bool
366
+	prompt "file"
367
+
368
+config LCD4LINUX_CUSTOM_PLUGIN_gps
369
+	bool
370
+	prompt "gps"
371
+	select LCD4LINUX_CUSTOM_NEEDS_libnmeap
372
+
373
+config LCD4LINUX_CUSTOM_PLUGIN_hddtemp
374
+	bool
375
+	prompt "hddtemp"
376
+
377
+config LCD4LINUX_CUSTOM_PLUGIN_huawei
378
+	bool
379
+	prompt "huawei"
380
+
381
+config LCD4LINUX_CUSTOM_PLUGIN_i2c_sensors
382
+	bool
383
+	prompt "i2c_sensors"
384
+
385
+config LCD4LINUX_CUSTOM_PLUGIN_iconv
386
+	bool
387
+	prompt "iconv"
388
+	select LCD4LINUX_CUSTOM_NEEDS_libiconv
389
+
390
+config LCD4LINUX_CUSTOM_PLUGIN_imon
391
+	bool
392
+	prompt "imon"
393
+
394
+config LCD4LINUX_CUSTOM_PLUGIN_isdn
395
+	bool
396
+	prompt "isdn"
397
+
398
+config LCD4LINUX_CUSTOM_PLUGIN_kvv
399
+	bool
400
+	prompt "kvv"
401
+
402
+config LCD4LINUX_CUSTOM_PLUGIN_loadavg
403
+	bool
404
+	prompt "loadavg"
405
+	default y
406
+
407
+config LCD4LINUX_CUSTOM_PLUGIN_meminfo
408
+	bool
409
+	prompt "meminfo"
410
+	default y
411
+
412
+config LCD4LINUX_CUSTOM_PLUGIN_mpd
413
+	bool
414
+	prompt "mpd"
415
+	select LCD4LINUX_CUSTOM_NEEDS_libmpdclient
416
+
417
+config LCD4LINUX_CUSTOM_PLUGIN_mpris_dbus
418
+	bool
419
+	prompt "mpris_dbus"
420
+	select LCD4LINUX_CUSTOM_NEEDS_libdbus
421
+
422
+config LCD4LINUX_CUSTOM_PLUGIN_mysql
423
+	bool
424
+	prompt "mysql"
425
+	select LCD4LINUX_CUSTOM_NEEDS_libmysqlclient
426
+
427
+config LCD4LINUX_CUSTOM_PLUGIN_netdev
428
+	bool
429
+	prompt "netdev"
430
+
431
+config LCD4LINUX_CUSTOM_PLUGIN_netinfo
432
+	bool
433
+	prompt "netinfo"
434
+
435
+config LCD4LINUX_CUSTOM_PLUGIN_pop3
436
+	bool
437
+	prompt "pop3"
438
+
439
+config LCD4LINUX_CUSTOM_PLUGIN_ppp
440
+	bool
441
+	prompt "ppp"
442
+	select LCD4LINUX_CUSTOM_NEEDS_ppp
443
+
444
+config LCD4LINUX_CUSTOM_PLUGIN_proc_stat
445
+	bool
446
+	prompt "proc_stat"
447
+	default y
448
+
449
+#config LCD4LINUX_CUSTOM_PLUGIN_python
450
+#	bool
451
+#	prompt "python"
452
+#	select LCD4LINUX_CUSTOM_NEEDS_python
453
+
454
+config LCD4LINUX_CUSTOM_PLUGIN_qnaplog
455
+	bool
456
+	prompt "qnaplog"
457
+	select LCD4LINUX_CUSTOM_NEEDS_libsqlite3
458
+
459
+config LCD4LINUX_CUSTOM_PLUGIN_seti
460
+	bool
461
+	prompt "seti"
462
+
463
+config LCD4LINUX_CUSTOM_PLUGIN_statfs
464
+	bool
465
+	prompt "statfs"
466
+
467
+config LCD4LINUX_CUSTOM_PLUGIN_uname
468
+	bool
469
+	prompt "uname"
470
+
471
+config LCD4LINUX_CUSTOM_PLUGIN_uptime
472
+	bool
473
+	prompt "uptime"
474
+	default y
475
+
476
+config LCD4LINUX_CUSTOM_PLUGIN_w1retap
477
+	bool
478
+	prompt "w1retap"
479
+
480
+config LCD4LINUX_CUSTOM_PLUGIN_wireless
481
+	bool
482
+	prompt "wireless"
483
+	depends on BROKEN
484
+
485
+config LCD4LINUX_CUSTOM_PLUGIN_xmms
486
+	bool
487
+	prompt "xmms"
488
+
489
+endif

+ 309
- 0
utils/lcd4linux/Makefile 查看文件

@@ -0,0 +1,309 @@
1
+#
2
+# Copyright (C) 2007-2015 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=lcd4linux
11
+PKG_REV:=1203
12
+PKG_VERSION:=r$(PKG_REV)
13
+PKG_RELEASE:=1
14
+
15
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16
+PKG_SOURCE_URL:=https://ssl.bulix.org/svn/lcd4linux/trunk/
17
+PKG_SOURCE_SUBDIR:=lcd4linux-$(PKG_VERSION)
18
+PKG_SOURCE_VERSION:=$(PKG_REV)
19
+PKG_SOURCE_PROTO:=svn
20
+
21
+LCD4LINUX_DRIVERS:= \
22
+	ASTUSB \
23
+	BeckmannEgle \
24
+	BWCT \
25
+	CrystalFontz \
26
+	Curses \
27
+	Cwlinux \
28
+	D4D \
29
+	$(if $(CONFIG_BROKEN),DPF) \
30
+	EA232graphic \
31
+	EFN \
32
+	FutabaVFD \
33
+	FW8888 \
34
+	G15 \
35
+	GLCD2USB \
36
+	IRLCD \
37
+	$(if $(CONFIG_BROKEN),HD44780) \
38
+	$(if $(CONFIG_BROKEN),HD44780-I2C) \
39
+	LCD2USB \
40
+	$(if $(CONFIG_BROKEN),LCDLinux) \
41
+	LCDTerm \
42
+	LEDMatrix \
43
+	LPH7508 \
44
+	$(if $(CONFIG_BROKEN),LUIse) \
45
+	LW_ABP \
46
+	M50530 \
47
+	MatrixOrbital \
48
+	MatrixOrbitalGX \
49
+	MilfordInstruments \
50
+	Newhaven \
51
+	Noritake \
52
+	NULL \
53
+	Pertelian \
54
+	PHAnderson \
55
+	PICGraphic \
56
+	picoLCD \
57
+	picoLCDGraphic \
58
+	PNG \
59
+	PPM \
60
+	$(if $(CONFIG_TARGET_rb532),RouterBoard) \
61
+	$(if $(CONFIG_BROKEN),SamsungSPF) \
62
+	ShuttleVFD \
63
+	SimpleLCD \
64
+	st2205 \
65
+	T6963 \
66
+	TeakLCM \
67
+	$(if $(CONFIG_TARGET_ar71xx),TEW673GRU) \
68
+	Trefon \
69
+	USBHUB \
70
+	USBLCD \
71
+	VNC \
72
+	WincorNixdorf \
73
+#	ULA200 \
74
+#	X11 \
75
+
76
+LCD4LINUX_PLUGINS:= \
77
+	apm \
78
+	asterisk \
79
+	button_exec \
80
+	cpuinfo \
81
+	dbus \
82
+	diskstats \
83
+	dvb \
84
+	event \
85
+	exec \
86
+	fifo \
87
+	file \
88
+	gps \
89
+	hddtemp \
90
+	huawei \
91
+	i2c_sensors \
92
+	iconv \
93
+	imon \
94
+	isdn \
95
+	kvv \
96
+	loadavg \
97
+	netdev \
98
+	netinfo \
99
+	meminfo \
100
+	mpd \
101
+	mpris_dbus \
102
+	mysql \
103
+	netdev \
104
+	pop3 \
105
+	ppp \
106
+	proc_stat \
107
+	qnaplog \
108
+	seti \
109
+	statfs \
110
+	uname \
111
+	uptime \
112
+	w1retap \
113
+	$(if $(CONFIG_BROKEN),wireless) \
114
+	xmms \
115
+#	python \
116
+
117
+PKG_FIXUP:=autoreconf
118
+PKG_INSTALL:=1
119
+
120
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
121
+
122
+PKG_BUILD_DEPENDS:= \
123
+	libdbus \
124
+	libgd \
125
+	libmpdclient \
126
+	libmysqlclient \
127
+	libncurses \
128
+	libnmeap \
129
+	libsqlite3 \
130
+	ppp \
131
+#	libftdi \
132
+#	libX11 \
133
+#	python \
134
+
135
+PKG_CONFIG_DEPENDS:= \
136
+	$(patsubst %,CONFIG_LCD4LINUX_CUSTOM_DRIVER_%,$(LCD4LINUX_DRIVERS)) \
137
+	$(patsubst %,CONFIG_LCD4LINUX_CUSTOM_PLUGIN_%,$(LCD4LINUX_PLUGINS)) \
138
+
139
+include $(INCLUDE_DIR)/package.mk
140
+include $(INCLUDE_DIR)/nls.mk
141
+
142
+define Package/lcd4linux/Default
143
+  SECTION:=utils
144
+  CATEGORY:=Utilities
145
+  PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
146
+  TITLE:=LCD display utility
147
+  URL:=http://lcd4linux.bulix.org/
148
+endef
149
+
150
+define Package/lcd4linux/Default/description
151
+ LCD4Linux is a small program that grabs information from the kernel and
152
+ some subsystems and displays it on an external liquid crystal display.
153
+endef
154
+
155
+
156
+define Package/lcd4linux-custom
157
+$(call Package/lcd4linux/Default)
158
+  DEPENDS:= \
159
+	+LCD4LINUX_CUSTOM_NEEDS_libdbus:libdbus \
160
+	+LCD4LINUX_CUSTOM_NEEDS_libgd:libgd \
161
+	$(if $(ICONV_FULL),+LCD4LINUX_CUSTOM_NEEDS_libiconv:libiconv-full) \
162
+	+LCD4LINUX_CUSTOM_NEEDS_libjpeg:libjpeg \
163
+	+LCD4LINUX_CUSTOM_NEEDS_libmpdclient:libmpdclient \
164
+	+LCD4LINUX_CUSTOM_NEEDS_libmysqlclient:libmysqlclient \
165
+	+LCD4LINUX_CUSTOM_NEEDS_libncurses:libncurses \
166
+	+LCD4LINUX_CUSTOM_NEEDS_libsqlite3:libsqlite3 \
167
+	+LCD4LINUX_CUSTOM_NEEDS_libusb:libusb-compat \
168
+#	+LCD4LINUX_CUSTOM_NEEDS_libftdi:libftdi \
169
+#	+LCD4LINUX_CUSTOM_NEEDS_libX11:libX11 \
170
+#	+LCD4LINUX_CUSTOM_NEEDS_python:python
171
+  MENU:=1
172
+  PROVIDES:=lcd4linux
173
+  VARIANT=custom
174
+endef
175
+
176
+define Package/lcd4linux-custom/config
177
+	source "$(SOURCE)/Config.in"
178
+endef
179
+
180
+define Package/lcd4linux-custom/description
181
+$(call Package/lcd4linux/Default/description)
182
+ .
183
+ This package contains a customized version of LCD4Linux.
184
+endef
185
+
186
+
187
+define Package/lcd4linux-full
188
+$(call Package/lcd4linux/Default)
189
+  DEPENDS:= @DEVEL \
190
+	+libdbus \
191
+	+libgd \
192
+	$(if $(ICONV_FULL),+libiconv-full) \
193
+	+libmpdclient \
194
+	+libmysqlclient \
195
+	+libncurses \
196
+	+libsqlite3 \
197
+	+libusb-compat \
198
+#	+libftdi \
199
+#	+libX11 \
200
+#	+python
201
+  PROVIDES:=lcd4linux
202
+  VARIANT=full
203
+endef
204
+
205
+define Package/lcd4linux-full/description
206
+$(call Package/lcd4linux/Default/description)
207
+ .
208
+ This package contains a version of LCD4Linux built with all supported
209
+ drivers and plugins.
210
+endef
211
+
212
+
213
+CONFIGURE_ARGS+= \
214
+	--disable-rpath \
215
+
216
+EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
217
+
218
+ifeq ($(BUILD_VARIANT),custom)
219
+
220
+  LCD4LINUX_CUSTOM_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \
221
+    $(if $(CONFIG_LCD4LINUX_CUSTOM_DRIVER_$(c)),$(c),) \
222
+ ))
223
+  ifeq ($(LCD4LINUX_CUSTOM_DRIVERS),)
224
+    LCD4LINUX_CUSTOM_DRIVERS:=Sample
225
+  endif
226
+
227
+  LCD4LINUX_CUSTOM_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \
228
+    $(if $(CONFIG_LCD4LINUX_CUSTOM_PLUGIN_$(c)),$(c)) \
229
+  ))
230
+  ifeq ($(LCD4LINUX_CUSTOM_PLUGINS),)
231
+    LCD4LINUX_CUSTOM_PLUGINS:=sample
232
+  endif
233
+
234
+  CONFIGURE_ARGS+= \
235
+	--with-drivers="$(LCD4LINUX_CUSTOM_DRIVERS)" \
236
+	--with-plugins="$(LCD4LINUX_CUSTOM_PLUGINS)" \
237
+
238
+  ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libiconv),)
239
+    CONFIGURE_ARGS+= --with-libiconv-prefix="$(ICONV_PREFIX)"
240
+  else
241
+    CONFIGURE_ARGS+= --without-libiconv-prefix
242
+  endif
243
+
244
+  ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libmysqlclient),)
245
+    EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
246
+  endif
247
+
248
+#  ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_python),)
249
+#    CONFIGURE_ARGS+= --with-python
250
+#  else
251
+    CONFIGURE_ARGS+= --without-python
252
+#  endif
253
+
254
+#  ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libX11),)
255
+#    CONFIGURE_ARGS+= --with-x
256
+#  else
257
+    CONFIGURE_ARGS+= --without-x
258
+#  endif
259
+
260
+endif
261
+
262
+ifeq ($(BUILD_VARIANT),full)
263
+
264
+  LCD4LINUX_FULL_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \
265
+    $(c) \
266
+  ))
267
+
268
+  LCD4LINUX_FULL_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \
269
+    $(c) \
270
+  ))
271
+
272
+  CONFIGURE_ARGS+= \
273
+	--with-drivers="$(LCD4LINUX_FULL_DRIVERS)" \
274
+	--with-plugins="$(LCD4LINUX_FULL_PLUGINS)" \
275
+	--with-libiconv-prefix="$(ICONV_PREFIX)" \
276
+	--without-python \
277
+	--without-x \
278
+
279
+  EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
280
+
281
+endif
282
+
283
+
284
+define Package/lcd4linux/conffiles
285
+/etc/lcd4linux.conf
286
+endef
287
+
288
+define Package/lcd4linux/install
289
+	$(INSTALL_DIR) $(1)/usr/bin
290
+	$(CP) $(PKG_INSTALL_DIR)/usr/bin/lcd4linux $(1)/usr/bin/
291
+	$(INSTALL_DIR) $(1)/etc
292
+	$(INSTALL_CONF) $(PKG_BUILD_DIR)/lcd4linux.conf.sample $(1)/etc/lcd4linux.conf
293
+	$(INSTALL_DIR) $(1)/etc/init.d
294
+	$(INSTALL_BIN) ./files/lcd4linux.init $(1)/etc/init.d/lcd4linux
295
+	$(SED) "s|^\(Display 'GLCD2USB'\)|#\1|g" \
296
+	    -e "s|^\(Layout 'TestLayer'\)|#\1|g" \
297
+	    -e "s|^#\(Display 'Image'\)|\1|g" \
298
+	    -e "s|^#\(Layout 'Default'\)|\1|g" \
299
+	     $(1)/etc/lcd4linux.conf
300
+endef
301
+
302
+Package/lcd4linux-custom/conffiles = $(Package/lcd4linux/conffiles)
303
+Package/lcd4linux-custom/install = $(Package/lcd4linux/install)
304
+
305
+Package/lcd4linux-full/conffiles = $(Package/lcd4linux/conffiles)
306
+Package/lcd4linux-full/install = $(Package/lcd4linux/install)
307
+
308
+$(eval $(call BuildPackage,lcd4linux-custom))
309
+$(eval $(call BuildPackage,lcd4linux-full))

+ 15
- 0
utils/lcd4linux/files/lcd4linux.init 查看文件

@@ -0,0 +1,15 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2007-2015 OpenWrt.org
3
+
4
+START=98
5
+
6
+SERVICE_USE_PID=1
7
+
8
+start() {
9
+	service_start /usr/bin/lcd4linux -o /tmp/lcd4linux.png -q
10
+}
11
+
12
+stop() {
13
+	service_stop /usr/bin/lcd4linux
14
+}
15
+

+ 11
- 0
utils/lcd4linux/patches/100-drv_RouterBoard.patch 查看文件

@@ -0,0 +1,11 @@
1
+--- a/drv_RouterBoard.c
2
++++ b/drv_RouterBoard.c
3
+@@ -106,7 +106,7 @@
4
+ #include <string.h>
5
+ #include <errno.h>
6
+ #include <unistd.h>
7
+-#include <sys/io.h>
8
++#include <asm/io.h>
9
+ 
10
+ #include "debug.h"
11
+ #include "cfg.h"

+ 11
- 0
utils/lcd4linux/patches/110-uclibc-logarithm-fix.patch 查看文件

@@ -0,0 +1,11 @@
1
+--- a/plugin_netinfo.c
2
++++ b/plugin_netinfo.c
3
+@@ -264,7 +264,7 @@ static void my_netmask_short(RESULT * re
4
+     sin = get_netmask(arg1);
5
+     if (NULL != sin) {
6
+ 	logval = (long double) (get_netmask(arg1)->sin_addr.s_addr);
7
+-	netlen = (int) rint(log2l(logval) / log2l(2.0));
8
++	netlen = (int) rint(log2f(logval) / log2f(2.0));
9
+ 	qprintf(value, sizeof(value), "/%d", netlen);
10
+     } else {
11
+ 	qprintf(value, sizeof(value), "/?");

+ 11
- 0
utils/lcd4linux/patches/120-remove-as-needed-linker-option.patch 查看文件

@@ -0,0 +1,11 @@
1
+--- a/Makefile.am
2
++++ b/Makefile.am
3
+@@ -18,7 +18,7 @@ ACLOCAL_AMFLAGS=-I m4
4
+ # use this for lots of warnings
5
+ #AM_CFLAGS = -D_GNU_SOURCE -std=c99 -m64 -Wall -W -pedantic -Wno-variadic-macros -fno-strict-aliasing
6
+ 
7
+-lcd4linux_LDFLAGS ="-Wl,--as-needed"
8
++lcd4linux_LDFLAGS = 
9
+ lcd4linux_LDADD   = @DRIVERS@ @PLUGINS@ @DRVLIBS@ @PLUGINLIBS@
10
+ lcd4linux_DEPENDENCIES = @DRIVERS@ @PLUGINS@
11
+ 

+ 22
- 0
utils/lcd4linux/patches/140-no_repnop_T6963.patch 查看文件

@@ -0,0 +1,22 @@
1
+--- a/drv_T6963.c
2
++++ b/drv_T6963.c
3
+@@ -114,7 +114,9 @@ static void drv_T6_status1(void)
4
+     /* wait for STA0=1 and STA1=1 */
5
+     n = 0;
6
+     do {
7
++#if 0
8
+ 	rep_nop();
9
++#endif
10
+ 	if (++n > 1000) {
11
+ 	    debug("hang in status1");
12
+ 	    bug = 1;
13
+@@ -150,7 +152,9 @@ static void drv_T6_status2(void)
14
+     /* wait for STA3=1 */
15
+     n = 0;
16
+     do {
17
++#if 0
18
+ 	rep_nop();
19
++#endif
20
+ 	if (++n > 1000) {
21
+ 	    debug("hang in status2");
22
+ 	    bug = 1;

+ 2624
- 0
utils/lcd4linux/patches/150-addlibmpdclient.patch
文件差异内容过多而无法显示
查看文件


+ 24
- 0
utils/lcd4linux/patches/160-uinput_defs.patch 查看文件

@@ -0,0 +1,24 @@
1
+--- a/drv_G15.c
2
++++ b/drv_G15.c
3
+@@ -42,6 +42,7 @@
4
+ 
5
+ #include <usb.h>
6
+ #include <fcntl.h>
7
++#include <linux/version.h>
8
+ #include <linux/input.h>
9
+ #include <linux/uinput.h>
10
+ 
11
+@@ -269,8 +270,13 @@ void drv_G15_initKeyHandling(char *devic
12
+     }
13
+     memset(&device, 0, sizeof(device));
14
+     strncpy(device.name, "G15 Keys", UINPUT_MAX_NAME_SIZE);
15
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
16
+     device.id.bustype = BUS_USB;
17
+     device.id.version = 4;
18
++#else
19
++    device.idbus = BUS_USB;
20
++    device.idversion = 4;
21
++#endif
22
+ 
23
+     ioctl(uinput_fd, UI_SET_EVBIT, EV_KEY);
24
+ 

+ 195
- 0
utils/lcd4linux/patches/170-add-generic-spidev-driver.patch 查看文件

@@ -0,0 +1,195 @@
1
+--- a/Makefile.am
2
++++ b/Makefile.am
3
+@@ -71,6 +71,8 @@ drv_generic_i2c.c             \
4
+ drv_generic_i2c.h             \
5
+ drv_generic_keypad.c          \
6
+ drv_generic_keypad.h          \
7
++drv_generic_spidev.c          \
8
++drv_generic_spidev.h          \
9
+ drv_ASTUSB.c                  \
10
+ drv_BeckmannEgle.c            \
11
+ drv_BWCT.c                    \
12
+--- /dev/null
13
++++ b/drv_generic_spidev.c
14
+@@ -0,0 +1,89 @@
15
++/* $Id$
16
++ * $URL$
17
++ *
18
++ * generic driver helper for displays connected via SPI bus
19
++ *
20
++ * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
21
++ *
22
++ * This file is part of LCD4Linux.
23
++ *
24
++ * LCD4Linux is free software; you can redistribute it and/or modify
25
++ * it under the terms of the GNU General Public License as published by
26
++ * the Free Software Foundation; either version 2, or (at your option)
27
++ * any later version.
28
++ *
29
++ * LCD4Linux is distributed in the hope that it will be useful,
30
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
31
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32
++ * GNU General Public License for more details.
33
++ *
34
++ * You should have received a copy of the GNU General Public License
35
++ * along with this program; if not, write to the Free Software
36
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
37
++ *
38
++ */
39
++
40
++#include "config.h"
41
++
42
++#include <stdlib.h>
43
++#include <stdio.h>
44
++#include <string.h>
45
++#include <errno.h>
46
++#include <unistd.h>
47
++#include <fcntl.h>
48
++#include <sys/types.h>
49
++#include <sys/ioctl.h>
50
++
51
++#include "debug.h"
52
++#include "qprintf.h"
53
++#include "cfg.h"
54
++#include "drv_generic_spidev.h"
55
++
56
++static char *generic_spidev_section = "";
57
++static char *generic_spidev_driver = "";
58
++static int generic_spidev_fd;
59
++
60
++int drv_generic_spidev_open(const char *section, const char *driver)
61
++{
62
++    char *spidev;
63
++
64
++    udelay_init();
65
++
66
++    generic_spidev_section = (char *) section;
67
++    generic_spidev_driver = (char *) driver;
68
++
69
++    spidev = cfg_get(generic_spidev_section, "Port", NULL);
70
++
71
++    info("%s: initializing SPI device %s", generic_spidev_driver, spidev);
72
++    generic_spidev_fd = open(spidev, O_WRONLY);
73
++    if (generic_spidev_fd < 0) {
74
++	error("%s: unable to open SPI device %s!\n", generic_spidev_driver, spidev);
75
++	goto exit_error;
76
++    }
77
++
78
++    return 0;
79
++
80
++  exit_error:
81
++    free(spidev);
82
++    return -1;
83
++}
84
++
85
++int drv_generic_spidev_close(void)
86
++{
87
++    close(generic_spidev_fd);
88
++    return 0;
89
++}
90
++
91
++int drv_generic_spidev_transfer(const int count, struct spi_ioc_transfer *tr)
92
++{
93
++    int ret;
94
++
95
++    ret = ioctl(generic_spidev_fd, SPI_IOC_MESSAGE(count), tr);
96
++    if (ret < count) {
97
++	error("%s: can't send SPI message! (%s)\n",
98
++		generic_spidev_driver, strerror(errno));
99
++	return -1;
100
++    }
101
++
102
++    return 0;
103
++}
104
+--- /dev/null
105
++++ b/drv_generic_spidev.h
106
+@@ -0,0 +1,54 @@
107
++/* $Id$
108
++ * $URL$
109
++ *
110
++ * generic driver helper for displays connected via SPI bus
111
++ *
112
++ * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
113
++ * Copyright (C) 2012 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
114
++ *
115
++ * This file is part of LCD4Linux.
116
++ *
117
++ * LCD4Linux is free software; you can redistribute it and/or modify
118
++ * it under the terms of the GNU General Public License as published by
119
++ * the Free Software Foundation; either version 2, or (at your option)
120
++ * any later version.
121
++ *
122
++ * LCD4Linux is distributed in the hope that it will be useful,
123
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
124
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
125
++ * GNU General Public License for more details.
126
++ *
127
++ * You should have received a copy of the GNU General Public License
128
++ * along with this program; if not, write to the Free Software
129
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
130
++ *
131
++ */
132
++
133
++/*
134
++ *
135
++ * exported fuctions:
136
++ *
137
++ * int drv_generic_spidev_open (const char *section, const char *driver)
138
++ *   reads 'Port' entry from config and opens
139
++ *   the SPI device
140
++ *   returns 0 if ok, -1 on failure
141
++ *
142
++ * int drv_generic_spidev_close (void)
143
++ *   closes SPI device
144
++ *   returns 0 if ok, -1 on failure
145
++ *
146
++ * void drv_generic_spidev_transfer (int count, struct spi_ioc_transfer *tr)
147
++ *   transfer data to/from the SPI device
148
++ *
149
++ */
150
++
151
++#ifndef _DRV_GENERIC_SPIDEV_H_
152
++#define _DRV_GENERIC_SPIDEV_H_
153
++
154
++#include <linux/spi/spidev.h>
155
++
156
++int drv_generic_spidev_open(const char *section, const char *driver);
157
++int drv_generic_spidev_close(void);
158
++int drv_generic_spidev_transfer(const int count, struct spi_ioc_transfer *tr);
159
++
160
++#endif /* _DRV_GENERIC_SPIDEV_H_ */
161
+--- a/drivers.m4
162
++++ b/drivers.m4
163
+@@ -301,6 +301,7 @@ PARPORT="no"
164
+ SERIAL="no"
165
+ I2C="no"
166
+ KEYPAD="no"
167
++SPIDEV="no"
168
+ 
169
+ # generic libraries
170
+ LIBUSB="no"
171
+@@ -936,6 +937,12 @@ if test "$LIBJPEG" = "yes"; then
172
+    DRVLIBS="$DRVLIBS -ljpeg"
173
+ fi
174
+ 
175
++# generic spidev driver
176
++if test "$SPIDEV" = "yes"; then
177
++   DRIVERS="$DRIVERS drv_generic_spidev.o"
178
++   AC_DEFINE(WITH_SPIDEV, 1, [SPIDEV driver])
179
++fi
180
++
181
+ # libusb
182
+ if test "$LIBUSB" = "yes"; then
183
+    DRVLIBS="$DRVLIBS -lusb"
184
+--- a/configure.ac
185
++++ b/configure.ac
186
+@@ -115,6 +115,9 @@ AC_ARG_WITH(outb,
187
+ 
188
+ AC_CHECK_HEADERS([asm/io.h] [linux/parport.h linux/ppdev.h], [has_parport="true"], [has_parport="false"])
189
+ 
190
++# check for spidev
191
++AC_CHECK_HEADERS([linux/spi/spidev.h], [has_spidev="true"], [has_spidev="false"])
192
++
193
+ # drivers
194
+ sinclude(drivers.m4)
195
+ 

+ 45
- 0
utils/lcd4linux/patches/171-allow-to-specify-drv_generic_graphic_real_clear.patch 查看文件

@@ -0,0 +1,45 @@
1
+--- a/drv_generic_graphic.c
2
++++ b/drv_generic_graphic.c
3
+@@ -24,7 +24,7 @@
4
+  *
5
+  */
6
+ 
7
+-/* 
8
++/*
9
+  *
10
+  * exported functions:
11
+  *
12
+@@ -98,6 +98,9 @@ static int INVERTED = 0;
13
+ /* must be implemented by the real driver */
14
+ void (*drv_generic_graphic_real_blit) () = NULL;
15
+ 
16
++/* can be implemented by the real driver */
17
++void (*drv_generic_graphic_real_clear) () = NULL;
18
++
19
+ 
20
+ /****************************************/
21
+ /*** generic Framebuffer stuff        ***/
22
+@@ -691,7 +694,10 @@ int drv_generic_graphic_clear(void)
23
+ 	for (i = 0; i < LCOLS * LROWS; i++)
24
+ 	    drv_generic_graphic_FB[l][i] = NO_COL;
25
+ 
26
+-    drv_generic_graphic_blit(0, 0, LROWS, LCOLS);
27
++    if (drv_generic_graphic_real_clear)
28
++	drv_generic_graphic_real_clear(NO_COL);
29
++    else
30
++	drv_generic_graphic_blit(0, 0, LROWS, LCOLS);
31
+ 
32
+     return 0;
33
+ }
34
+--- a/drv_generic_graphic.h
35
++++ b/drv_generic_graphic.h
36
+@@ -40,6 +40,9 @@ extern RGBA NO_COL;		/* no color (comple
37
+ /* these functions must be implemented by the real driver */
38
+ extern void (*drv_generic_graphic_real_blit) (const int row, const int col, const int height, const int width);
39
+ 
40
++/* these functions can be implemented by the real driver */
41
++void (*drv_generic_graphic_real_clear) (const RGBA rgba);
42
++
43
+ /* helper function to get pixel color or gray value */
44
+ extern RGBA drv_generic_graphic_rgb(const int row, const int col);
45
+ extern unsigned char drv_generic_graphic_gray(const int row, const int col);

+ 552
- 0
utils/lcd4linux/patches/172-add-TEW673GRU-driver.patch 查看文件

@@ -0,0 +1,552 @@
1
+--- a/drivers.m4
2
++++ b/drivers.m4
3
+@@ -39,7 +39,7 @@ AC_ARG_WITH(
4
+   [                        Newhaven, Noritake, NULL, Pertelian, PHAnderson,]
5
+   [                        PICGraphic, picoLCD, picoLCDGraphic, PNG, PPM, RouterBoard,]
6
+   [                        Sample, SamsungSPF, serdisplib, ShuttleVFD, SimpleLCD, st2205, T6963,]
7
+-  [                        TeakLCM, Trefon, ULA200, USBHUB, USBLCD, VNC, WincorNixdorf, X11],
8
++  [                        TeakLCM, TEW673GRU, Trefon, ULA200, USBHUB, USBLCD, VNC, WincorNixdorf, X11],
9
+   drivers=$withval,
10
+   drivers=all
11
+ )
12
+@@ -107,6 +107,7 @@ for driver in $drivers; do
13
+ 	 SHUTTLEVFD="yes"
14
+          SIMPLELCD="yes"
15
+          T6963="yes"
16
++         TEW673GRU="yes"
17
+          TeakLCM="yes"
18
+          Trefon="yes"
19
+          ULA200="yes"
20
+@@ -260,6 +261,9 @@ for driver in $drivers; do
21
+       TeakLCM)
22
+          TeakLCM=$val
23
+          ;;
24
++      TEW673GRU)
25
++         TEW673GRU=$val
26
++         ;;
27
+       Trefon)
28
+          Trefon=$val
29
+          ;;
30
+@@ -797,6 +801,18 @@ if test "$TeakLCM" = "yes"; then
31
+    AC_DEFINE(WITH_TEAK_LCM,1,[TeakLCM driver])
32
+ fi
33
+ 
34
++if test "$TEW673GRU" = "yes"; then
35
++   if test "$has_spidev" = "true"; then
36
++      GRAPHIC="yes"
37
++      TEXT="yes"
38
++      SPIDEV="yes"
39
++      DRIVERS="$DRIVERS drv_TEW673GRU.o"
40
++      AC_DEFINE(WITH_TEW673GRU,1,[TEW673GRU driver])
41
++   else
42
++      AC_MSG_WARN(linux/spi/spidev.h not found: TEW673GRU driver disabled)
43
++   fi
44
++fi
45
++
46
+ if test "$Trefon" = "yes"; then
47
+    if test "$has_usb" = "true"; then
48
+       TEXT="yes"
49
+--- a/drv.c
50
++++ b/drv.c
51
+@@ -92,6 +92,7 @@ extern DRIVER drv_serdisplib;
52
+ extern DRIVER drv_ShuttleVFD;
53
+ extern DRIVER drv_SimpleLCD;
54
+ extern DRIVER drv_T6963;
55
++extern DRIVER drv_TEW673GRU;
56
+ extern DRIVER drv_TeakLCM;
57
+ extern DRIVER drv_Trefon;
58
+ extern DRIVER drv_ula200;
59
+@@ -248,6 +249,9 @@ DRIVER *Driver[] = {
60
+ #ifdef WITH_TEAK_LCM
61
+     &drv_TeakLCM,
62
+ #endif
63
++#ifdef WITH_TEW673GRU
64
++    &drv_TEW673GRU,
65
++#endif
66
+ #ifdef WITH_TREFON
67
+     &drv_Trefon,
68
+ #endif
69
+--- a/Makefile.am
70
++++ b/Makefile.am
71
+@@ -119,6 +119,7 @@ drv_ShuttleVFD.c              \
72
+ drv_SimpleLCD.c               \
73
+ drv_T6963.c                   \
74
+ drv_TeakLCM.c                 \
75
++drv_TEW673GRU.c               \
76
+ drv_Trefon.c                  \
77
+ drv_ula200.c                  \
78
+ drv_USBHUB.c                  \
79
+--- /dev/null
80
++++ b/drv_TEW673GRU.c
81
+@@ -0,0 +1,457 @@
82
++/* $Id$
83
++ * $URL$
84
++ *
85
++ * TRENDnet TEW673GRU LCD4linux driver
86
++ *
87
++ * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
88
++ *
89
++ * based on the Sample driver which is:
90
++ * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at>
91
++ * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
92
++ *
93
++ * This file is part of LCD4Linux.
94
++ *
95
++ * LCD4Linux is free software; you can redistribute it and/or modify
96
++ * it under the terms of the GNU General Public License as published by
97
++ * the Free Software Foundation; either version 2, or (at your option)
98
++ * any later version.
99
++ *
100
++ * LCD4Linux is distributed in the hope that it will be useful,
101
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
102
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
103
++ * GNU General Public License for more details.
104
++ *
105
++ * You should have received a copy of the GNU General Public License
106
++ * along with this program; if not, write to the Free Software
107
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
108
++ *
109
++ */
110
++
111
++/*
112
++ * exported fuctions:
113
++ *
114
++ * struct DRIVER drv_TEW673GRU
115
++ */
116
++
117
++#include "config.h"
118
++
119
++#include <stdlib.h>
120
++#include <stdio.h>
121
++#include <unistd.h>
122
++#include <string.h>
123
++#include <errno.h>
124
++
125
++#include "debug.h"
126
++#include "cfg.h"
127
++#include "qprintf.h"
128
++#include "udelay.h"
129
++#include "plugin.h"
130
++#include "widget.h"
131
++#include "widget_text.h"
132
++#include "widget_icon.h"
133
++#include "widget_bar.h"
134
++#include "drv.h"
135
++
136
++#include "drv_generic_text.h"
137
++#include "drv_generic_graphic.h"
138
++#include "drv_generic_spidev.h"
139
++
140
++#ifdef WITH_DMALLOC
141
++#include <dmalloc.h>
142
++#endif
143
++
144
++#define TEW673GRU_NUM_COLS	220
145
++#define TEW673GRU_NUM_ROWS	176
146
++#define TEW673GRU_BPP		2	/* bytes per pixel */
147
++
148
++#define TEW673GRU_CMD_SIZE	9
149
++#define TEW673GRU_NUM_ROW_BYTES (TEW673GRU_NUM_COLS * TEW673GRU_BPP)
150
++
151
++enum {
152
++	CMD_SHOW_STRING		= 49,
153
++	CMD_SHOW_IMAGE_DIR	= 52,
154
++	CMD_SCREEN_COLOR	= 54,
155
++};
156
++
157
++static char Name[] = "TEW673GRU";
158
++
159
++static char *drv_TEW673GRU_FB;
160
++static long FB_SIZE;
161
++static int MODE;
162
++
163
++static unsigned int RGBAto16(RGBA rgb)
164
++{
165
++    return (((rgb.R >> 3) << 11) | ((rgb.G >> 2) << 5) | (rgb.B >> 3));
166
++}
167
++
168
++static unsigned char color_msb(unsigned int color)
169
++{
170
++    return color >> 8;
171
++}
172
++
173
++static unsigned char color_lsb(unsigned int color)
174
++{
175
++    return color & 0xff;
176
++}
177
++
178
++static void drv_TEW673GRU_hw_clear(const unsigned int color)
179
++{
180
++    unsigned char cmd[TEW673GRU_CMD_SIZE];
181
++    struct spi_ioc_transfer tr[1];
182
++
183
++    memset(tr, '\0', sizeof(tr));
184
++    memset(cmd, '\0', sizeof(cmd));
185
++
186
++    cmd[0] = CMD_SCREEN_COLOR;
187
++    cmd[7] = color_msb(color);
188
++    cmd[8] = color_lsb(color);
189
++
190
++    tr[0].tx_buf = (unsigned long) cmd;
191
++    tr[0].len = sizeof(cmd);
192
++
193
++    drv_generic_spidev_transfer(1, tr);
194
++}
195
++
196
++static void drv_TEW673GRU_hw_send_row(const int row, const int col, const char *data, const int width)
197
++{
198
++    unsigned char cmd[TEW673GRU_CMD_SIZE];
199
++    struct spi_ioc_transfer tr[2];
200
++    int datasize;
201
++
202
++    memset(tr, '\0', sizeof(tr));
203
++    memset(cmd, '\0', sizeof(cmd));
204
++
205
++    datasize =  width * TEW673GRU_BPP;
206
++
207
++    cmd[0] = CMD_SHOW_IMAGE_DIR;
208
++    cmd[1] = col;
209
++    cmd[2] = col + width;
210
++    cmd[3] = row;
211
++    cmd[4] = row;
212
++    cmd[5] = datasize >> 8;
213
++    cmd[6] = datasize & 0xff;
214
++
215
++    tr[0].tx_buf = (unsigned long) cmd;
216
++    tr[0].len = sizeof(cmd);
217
++    tr[1].tx_buf = (unsigned long) data;
218
++    tr[1].len = datasize;
219
++
220
++    drv_generic_spidev_transfer(2, tr);
221
++}
222
++
223
++static void drv_TEW673GRU_hw_write_string(const int row, const int col, const char *data, const int datasize)
224
++{
225
++    unsigned char cmd[TEW673GRU_CMD_SIZE];
226
++    struct spi_ioc_transfer tr[2];
227
++    unsigned char len;
228
++
229
++    memset(tr, '\0', sizeof(tr));
230
++    memset(cmd, '\0', sizeof(cmd));
231
++
232
++    len = datasize & 0xff;
233
++    cmd[0] = CMD_SHOW_STRING;
234
++    cmd[1] = col;
235
++    cmd[2] = col + (XRES * len);
236
++    cmd[3] = row;
237
++    cmd[4] = row + YRES;
238
++    cmd[7] = 0;
239
++    cmd[8] = len;
240
++
241
++    tr[0].tx_buf = (unsigned long) cmd;
242
++    tr[0].len = sizeof(cmd);
243
++    tr[1].tx_buf = (unsigned long) data;
244
++    tr[1].len = datasize;
245
++
246
++    drv_generic_spidev_transfer(2, tr);
247
++}
248
++
249
++static void drv_TEW673GRU_FB_set_pixel(const int col, const unsigned int color)
250
++{
251
++    int pos;
252
++
253
++    pos = col * TEW673GRU_BPP;
254
++    drv_TEW673GRU_FB[pos] = color_msb(color);
255
++    drv_TEW673GRU_FB[pos + 1] = color_lsb(color);
256
++}
257
++
258
++static void drv_TEW673GRU_blit(const int row, const int col, const int height, const int width)
259
++{
260
++    int r, c;
261
++
262
++    debug("%s: update area r:%d c:%d w:%d h:%d", Name, row, col, height, width);
263
++
264
++    for (r = row; r < row + height; r++) {
265
++	for (c = col; c < col + width; c++) {
266
++	    unsigned int color;
267
++	    RGBA rgb;
268
++
269
++	    rgb = drv_generic_graphic_rgb(r, c);
270
++	    color = RGBAto16(rgb);
271
++            drv_TEW673GRU_FB_set_pixel(c, color);
272
++	}
273
++
274
++	if (width) {
275
++	    char *data;
276
++
277
++	    data = &drv_TEW673GRU_FB[col * TEW673GRU_BPP];
278
++	    drv_TEW673GRU_hw_send_row(r, col, data, width);
279
++	    udelay(100 + width * 50);
280
++	}
281
++    }
282
++}
283
++
284
++static void drv_TEW673GRU_clear(RGBA rgba)
285
++{
286
++    unsigned int color;
287
++
288
++    color = RGBAto16(rgba);
289
++    drv_TEW673GRU_hw_clear(color);
290
++}
291
++
292
++static void drv_TEW673GRU_write(const int row, const int col, const char *data, const int len)
293
++{
294
++    int i;
295
++
296
++    for (i = 0; i < len; i++) {
297
++	drv_TEW673GRU_hw_write_string(row * YRES, (col + i) * XRES, " ", 1);
298
++	udelay(10000);
299
++	drv_TEW673GRU_hw_write_string(row * YRES, 2 + (col + i) * XRES, " ", 1);
300
++	udelay(10000);
301
++	drv_TEW673GRU_hw_write_string(row * YRES, (col + i) * XRES, &data[i], 1);
302
++	udelay(10000);
303
++    }
304
++}
305
++
306
++static int drv_TEW673GRU_open(const char *section)
307
++{
308
++    int err;
309
++
310
++    err = drv_generic_spidev_open(section, Name);
311
++    if (err < 0)
312
++	return err;
313
++
314
++    return 0;
315
++}
316
++
317
++static int drv_TEW673GRU_close(void)
318
++{
319
++    drv_generic_spidev_close();
320
++    return 0;
321
++}
322
++
323
++static void drv_TEW673GRU_clear_screen(void)
324
++{
325
++    if (MODE) {
326
++	drv_generic_graphic_clear();
327
++    } else {
328
++	memset(drv_TEW673GRU_FB, ' ', FB_SIZE);
329
++	drv_TEW673GRU_hw_clear(0x0000);
330
++    }
331
++}
332
++
333
++static int drv_TEW673GRU_init_font(const char *section)
334
++{
335
++    char *font;
336
++    int ret = -1;
337
++
338
++    font = cfg_get(section, "Font", "6x8");
339
++    if (font == NULL) {
340
++	error("%s: no '%s.Font' entry from %s", Name, section, cfg_source());
341
++	goto out;
342
++    }
343
++
344
++    if (*font == '\0') {
345
++	error("%s: invalid '%s.Font' entry in %s", Name, section, cfg_source());
346
++	goto out_free;
347
++    }
348
++
349
++    XRES = -1;
350
++    YRES = -1;
351
++    if (sscanf(font, "%dx%d", &XRES, &YRES) != 2 ||
352
++	XRES < 1 ||
353
++	YRES < 1) {
354
++	error("%s: bad Font '%s' from %s", Name, font, cfg_source());
355
++	goto out_free;
356
++    }
357
++
358
++    if (XRES != 6 && YRES != 8) {
359
++	error("%s: bad Font '%s' from %s (only 6x8 at the moment)",
360
++	      Name, font, cfg_source());
361
++	goto out_free;
362
++    }
363
++
364
++    error("%s: font '%s' selected", Name, font);
365
++
366
++    ret = 0;
367
++
368
++out_free:
369
++    free(font);
370
++out:
371
++    return ret;
372
++}
373
++
374
++static int drv_TEW673GRU_start(const char *section)
375
++{
376
++    int ret;
377
++
378
++    DCOLS = TEW673GRU_NUM_COLS;
379
++    DROWS = TEW673GRU_NUM_ROWS;
380
++
381
++    if (MODE) {
382
++	ret = drv_TEW673GRU_init_font(section);
383
++	if (ret)
384
++	    goto err;
385
++
386
++	FB_SIZE = DCOLS * TEW673GRU_BPP;
387
++    } else {
388
++	XRES = 10;
389
++	YRES = 16;
390
++	DCOLS = DCOLS / XRES;
391
++	DROWS = DROWS / YRES;
392
++
393
++	FB_SIZE = DCOLS * DROWS;
394
++    }
395
++
396
++    if (FB_SIZE) {
397
++	drv_TEW673GRU_FB = malloc(FB_SIZE);
398
++	if (drv_TEW673GRU_FB == NULL) {
399
++	    error("%s: framebuffer could not be allocated", Name);
400
++	    goto err;
401
++	}
402
++    }
403
++
404
++    ret = drv_TEW673GRU_open(section);
405
++    if (ret < 0)
406
++        goto err_free;
407
++
408
++    if (MODE == 0)
409
++    	drv_TEW673GRU_clear_screen();
410
++
411
++    return 0;
412
++
413
++ err_free:
414
++    if (drv_TEW673GRU_FB)
415
++	free(drv_TEW673GRU_FB);
416
++ err:
417
++    return -1;
418
++}
419
++
420
++static int drv_TEW673GRU_greet(const char *msg1, const char *msg2)
421
++{
422
++    if (MODE)
423
++	return drv_generic_graphic_greet(msg1, msg2);
424
++
425
++    return drv_generic_text_greet(msg1, msg2);
426
++}
427
++
428
++
429
++/****************************************/
430
++/***        widget callbacks          ***/
431
++/****************************************/
432
++
433
++
434
++/* using drv_generic_text_draw(W) */
435
++/* using drv_generic_text_icon_draw(W) */
436
++/* using drv_generic_text_bar_draw(W) */
437
++/* using drv_generic_gpio_draw(W) */
438
++
439
++
440
++/****************************************/
441
++/***        exported functions        ***/
442
++/****************************************/
443
++
444
++int drv_TEW673GRU_list(void)
445
++{
446
++    printf("TEW673GRU driver");
447
++    return 0;
448
++}
449
++
450
++int drv_TEW673GRU_init(const char *section, const int quiet)
451
++{
452
++    WIDGET_CLASS wc;
453
++    int ret;
454
++
455
++    cfg_number(section, "Mode", 0, 0, 1, &MODE);
456
++
457
++    if (MODE) {
458
++	drv_generic_graphic_real_blit = drv_TEW673GRU_blit;
459
++	drv_generic_graphic_real_clear = drv_TEW673GRU_clear;
460
++    } else {
461
++	drv_generic_text_real_write = drv_TEW673GRU_write;
462
++    }
463
++
464
++    ret = drv_TEW673GRU_start(section);
465
++    if (ret)
466
++	return ret;
467
++
468
++    if (MODE) {
469
++	ret = drv_generic_graphic_init(section, Name);
470
++	if (ret)
471
++	    return ret;
472
++    } else {
473
++	ret = drv_generic_text_init(section, Name);
474
++	if (ret)
475
++	    return ret;
476
++
477
++	ret = drv_generic_text_icon_init();
478
++	if (ret != 0)
479
++	    return ret;
480
++
481
++	ret = drv_generic_text_bar_init(1);
482
++	if (ret != 0)
483
++	    return ret;
484
++
485
++	drv_generic_text_bar_add_segment(0, 0, 255, ' ');
486
++	drv_generic_text_bar_add_segment(255, 255, 255, '#');
487
++
488
++	wc = Widget_Text;
489
++	wc.draw = drv_generic_text_draw;
490
++	widget_register(&wc);
491
++
492
++	wc = Widget_Icon;
493
++	wc.draw = drv_generic_text_icon_draw;
494
++	widget_register(&wc);
495
++
496
++	wc = Widget_Bar;
497
++	wc.draw = drv_generic_text_bar_draw;
498
++	widget_register(&wc);
499
++    }
500
++
501
++    if (!quiet) {
502
++	char buffer[40];
503
++	qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS);
504
++	drv_TEW673GRU_greet(buffer, "www.openwrt.org");
505
++	sleep(3);
506
++	drv_TEW673GRU_clear_screen();
507
++    }
508
++
509
++    return 0;
510
++}
511
++
512
++int drv_TEW673GRU_quit(const int quiet)
513
++{
514
++
515
++    info("%s: shutting down.", Name);
516
++
517
++    drv_TEW673GRU_clear_screen();
518
++
519
++    if (!quiet)
520
++	drv_TEW673GRU_greet("goodbye!", NULL);
521
++
522
++    if (MODE)
523
++	drv_generic_graphic_quit();
524
++    else
525
++	drv_generic_text_quit();
526
++
527
++    debug("closing connection");
528
++    drv_TEW673GRU_close();
529
++
530
++    return (0);
531
++}
532
++
533
++DRIVER drv_TEW673GRU = {
534
++    .name = Name,
535
++    .list = drv_TEW673GRU_list,
536
++    .init = drv_TEW673GRU_init,
537
++    .quit = drv_TEW673GRU_quit,
538
++};
539
+--- a/lcd4linux.conf.sample
540
++++ b/lcd4linux.conf.sample
541
+@@ -581,6 +581,11 @@ Display FutabaVFD {
542
+     }
543
+ }
544
+ 
545
++Display TEW673GRU {
546
++    Driver       'TEW673GRU'
547
++    Font         '6x8'
548
++    Port         '/dev/spidev1.0'
549
++}
550
+ 
551
+ #Plugin KVV {
552
+ #    StationID '12_701'