Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d1c30a9be5 | ||
|
2e0bde76a4 | ||
|
575a8aac1f | ||
|
8bdc22653f | ||
|
261d49b489 | ||
|
ec8b1613fe | ||
|
1d9025debd |
10
Config.in
10
Config.in
@ -1,10 +0,0 @@
|
||||
config BR2_PACKAGE_SHARP_DRM
|
||||
bool "sharp-drm"
|
||||
default y
|
||||
depends on BR2_LINUX_KERNEL
|
||||
select BR2_PACKAGE_LIBDRM
|
||||
select BR2_PACKAGE_SPI
|
||||
select BR2_PACKAGE_GPIO
|
||||
select BR2_PACKAGE_RASPI_GPIO
|
||||
help
|
||||
DRM driver for Sharp Memory LCD
|
10
Makefile
10
Makefile
@ -4,7 +4,7 @@ ccflags-y := -g -std=gnu99 -Wno-declaration-after-statement
|
||||
|
||||
dtb-y += sharp-drm.dtbo
|
||||
|
||||
targets += $(dtbo-y)
|
||||
targets += $(dtbo-y)
|
||||
always := $(dtbo-y)
|
||||
|
||||
.PHONY: all clean install uninstall
|
||||
@ -20,6 +20,7 @@ BUILD_DIR := .
|
||||
endif
|
||||
|
||||
BOOT_CONFIG_LINE := dtoverlay=sharp-drm
|
||||
BOOT_CMDLINE_ADD := console=tty2 fbcon=font:VGA8x8 fbcon=map:10
|
||||
|
||||
all:
|
||||
$(MAKE) -C '$(LINUX_DIR)' M='$(shell pwd)'
|
||||
@ -37,14 +38,19 @@ install_aux:
|
||||
install -D -m 0644 $(BUILD_DIR)/sharp-drm.dtbo /boot/overlays/
|
||||
# Add configuration line if it wasn't already there
|
||||
grep -qxF '$(BOOT_CONFIG_LINE)' /boot/config.txt \
|
||||
|| echo '[all]\ndtparam=spi=on\n$(BOOT_CONFIG_LINE)' >> /boot/config.txt
|
||||
|| printf '[all]\ndtparam=spi=on\n$(BOOT_CONFIG_LINE)\n' >> /boot/config.txt
|
||||
# Add auto-load module line if it wasn't already there
|
||||
grep -qxF 'sharp-drm' /etc/modules \
|
||||
|| echo 'sharp-drm' >> /etc/modules
|
||||
# Configure fbcon for display
|
||||
grep -qxF '$(BOOT_CMDLINE_ADD)' /boot/cmdline.txt \
|
||||
|| sed -i.save 's/$$/ $(BOOT_CMDLINE_ADD)/' /boot/cmdline.txt
|
||||
# Rebuild dependencies
|
||||
depmod -A
|
||||
|
||||
uninstall:
|
||||
# Remove fbcon configuration and create a backup file
|
||||
sed -i.save 's/ $(BOOT_CMDLINE_ADD)//' /boot/cmdline.txt
|
||||
# Remove auto-load module line and create a backup file
|
||||
sed -i.save '/sharp-drm/d' /etc/modules
|
||||
# Remove configuration line and create a backup file
|
||||
|
27
README.md
27
README.md
@ -2,6 +2,33 @@
|
||||
|
||||
DRM kernel driver for 2.7" 400x240 Sharp memory LCD panel.
|
||||
|
||||
## Cleaning old drivers
|
||||
|
||||
The `bbqX0kbd` driver has been renamed to `beepy-kbd`, and `sharp` to `sharp-drm`.
|
||||
|
||||
Driver packages will detect if one of these old modules is installed and cancel installation of the package.
|
||||
|
||||
Remove the following files:
|
||||
|
||||
* `/lib/modules/<uname>/extra/bbqX0kbd.ko*`
|
||||
* `/lib/modules/<uname>/extra/sharp.ko*`
|
||||
* `/boot/overlays/i2c-bbqX0kbd.dtbo`
|
||||
* `/boot/overlays/sharp.dtbo`
|
||||
|
||||
Rebuild the module list:
|
||||
|
||||
* `depmod -a`
|
||||
|
||||
Remove the following lines from `/boot/config.txt`:
|
||||
|
||||
* `dtoverlay=bbqX0kbd,irq_pin=4`
|
||||
* `dtoverlay=sharp`
|
||||
|
||||
Remove the following lines from `/etc/modules`:
|
||||
|
||||
* `bbqX0kbd`
|
||||
* `sharp`
|
||||
|
||||
## Installation
|
||||
|
||||
Install the Linux kernel headers
|
||||
|
@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# sharpdrm Loads Sharp DRM driver
|
||||
#
|
||||
|
||||
umask 077
|
||||
|
||||
start() {
|
||||
/sbin/modprobe sharp-drm
|
||||
echo "OK"
|
||||
}
|
||||
stop() {
|
||||
echo "OK"
|
||||
}
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
@ -53,7 +53,7 @@
|
||||
disp-gpios = <&gpio 22 0>;
|
||||
|
||||
spi-cs-high = <1>;
|
||||
spi-max-frequency = <8000000>;
|
||||
spi-max-frequency = <4000000>;
|
||||
buswidth = <8>;
|
||||
debug = <0>;
|
||||
};
|
||||
|
25
sharp-drm.mk
25
sharp-drm.mk
@ -1,25 +0,0 @@
|
||||
SHARP_DRM_VERSION = 1.0
|
||||
SHARP_DRM_SITE = $(BR2_EXTERNAL_BEEPY_DRIVERS_PATH)/package/sharp-drm
|
||||
SHARP_DRM_SITE_METHOD = local
|
||||
|
||||
SHARP_DRM_INSTALL_IMAGES = YES
|
||||
SHARP_DRM_MODULE_SUBDIRS = .
|
||||
|
||||
define SHARP_DRM_BUILD_CMDS
|
||||
for dts in $(@D)/*.dts; do \
|
||||
$(HOST_DIR)/bin/dtc -@ -I dts -O dtb -W no-unit_address_vs_reg -o $${dts%.dts}.dtbo $${dts}; \
|
||||
done
|
||||
endef
|
||||
|
||||
define SHARP_DRM_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -D -m 0755 $(@D)/init/S01sharpdrm $(TARGET_DIR)/etc/init.d/;
|
||||
endef
|
||||
|
||||
define SHARP_DRM_INSTALL_IMAGES_CMDS
|
||||
for dtbo in $(@D)/*.dtbo; do \
|
||||
$(INSTALL) -D -m 0644 $${dtbo} $(BINARIES_DIR)/rpi-firmware/overlays; \
|
||||
done
|
||||
endef
|
||||
|
||||
$(eval $(kernel-module))
|
||||
$(eval $(generic-package))
|
@ -77,7 +77,7 @@ static void vcom_timer_callback(struct timer_list *t)
|
||||
|
||||
// Toggle the GPIO pin
|
||||
vcom_setting = (vcom_setting) ? 0 : 1;
|
||||
gpiod_set_value(panel->gpio_vcom, 1);
|
||||
gpiod_set_value(panel->gpio_vcom, vcom_setting);
|
||||
|
||||
// Reschedule the timer
|
||||
mod_timer(&panel->vcom_timer, jiffies + msecs_to_jiffies(1000));
|
||||
@ -623,7 +623,8 @@ int drm_set_indicator(size_t idx, char c)
|
||||
{
|
||||
struct drm_clip_rect dirty_rect;
|
||||
|
||||
if (!g_panel || !g_panel->fb || !g_panel->fb->funcs->dirty) {
|
||||
if (!g_panel || !g_panel->fb || !g_panel->fb->funcs
|
||||
|| !g_panel->fb->funcs->dirty) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ static struct spi_driver sharp_memory_spi_driver = {
|
||||
};
|
||||
module_spi_driver(sharp_memory_spi_driver);
|
||||
|
||||
MODULE_VERSION("1.0");
|
||||
MODULE_VERSION("1.1");
|
||||
MODULE_DESCRIPTION("Sharp Memory LCD DRM driver");
|
||||
MODULE_AUTHOR("Andrew D'Angelo");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
Loading…
x
Reference in New Issue
Block a user