Skip to content

Commit

Permalink
driver: e-Better DTV02-1T1S-U (Digibest ISDB2056) のドライバを試験的に追加
Browse files Browse the repository at this point in the history
それに伴い、px4.c内にあったコードの一部を別の複数のファイルへ移動
なお、DTV02-1T1S-Uが正常に動作するかは未確認
  • Loading branch information
nns779 committed Aug 14, 2019
1 parent 5c004d9 commit bc02e19
Show file tree
Hide file tree
Showing 11 changed files with 1,922 additions and 82 deletions.
11 changes: 5 additions & 6 deletions driver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ INSTALL_DIR := /lib/modules/$(KVER)/misc
CURRENT_DIR := $(shell pwd)
VERBOSE := 0
DEBUG := 0
TARGET := px4_drv.ko

drv-MAX_DEVICE := 0
drv-RINGBUFFER_USE_SPINLOCK := 0
Expand All @@ -26,11 +25,11 @@ ccflags-y += -DRINGBUFFER_USE_SPINLOCK
endif

obj-m := px4_drv.o
px4_drv-objs := px4.o it930x-bus.o it930x.o tc90522.o rt710.o r850.o ringbuffer.o
px4_drv-objs := driver.o module_param.o px4.o isdb2056.o it930x-bus.o it930x.o tc90522.o rt710.o r850.o ringbuffer.o

all: $(TARGET)
all: px4_drv.ko

$(TARGET): FORCE revision.h
px4_drv.ko: FORCE revision.h
$(cmd_prefix)$(MAKE) -C $(KBUILD_DIR) M=$(CURRENT_DIR) KBUILD_VERBOSE=$(VERBOSE) modules

revision.h: FORCE
Expand Down Expand Up @@ -65,7 +64,7 @@ install:
$(cmd_prefix)if [ `grep -e '^px4_drv' /proc/modules | wc -l` -ne 0 ]; then \
modprobe -r px4_drv; \
fi
$(cmd_prefix)install -D -v -m 644 $(TARGET) $(INSTALL_DIR)/$(TARGET)
$(cmd_prefix)install -D -v -m 644 px4_drv.ko $(INSTALL_DIR)/px4_drv.ko
$(cmd_prefix)rm -fv /etc/udev/rules.d/90-px4.rules
$(cmd_prefix)install -D -v -m 644 ../etc/99-px4video.rules /etc/udev/rules.d/99-px4video.rules
$(cmd_prefix)depmod -a $(KVER)
Expand All @@ -75,7 +74,7 @@ uninstall:
$(cmd_prefix)if [ `grep -e '^px4_drv' /proc/modules | wc -l` -ne 0 ]; then \
modprobe -r px4_drv; \
fi
$(cmd_prefix)rm -fv $(INSTALL_DIR)/$(TARGET)
$(cmd_prefix)rm -fv $(INSTALL_DIR)/px4_drv.ko
$(cmd_prefix)if [ `find /lib/modules/ -name px4_drv.ko | wc -l` -eq 0 ]; then \
rm -fv /etc/udev/rules.d/90-px4.rules /etc/udev/rules.d/99-px4video.rules; \
fi
Expand Down
69 changes: 69 additions & 0 deletions driver/driver.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Module initiator of the driver (driver.c)
*
* Copyright (c) 2019 nns779
*/

#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/module.h>

#include "driver.h"
#include "revision.h"
#include "firmware.h"
#include "px4.h"
#include "isdb2056.h"

MODULE_VERSION(DRIVER_VERSION);
MODULE_AUTHOR("nns779");
MODULE_DESCRIPTION("Unofficial Linux driver for PLEX PX-W3U4/Q3U4/W3PE4/Q3PE4 ISDB-T/S receivers");
MODULE_LICENSE("GPL v2");

MODULE_FIRMWARE(FIRMWARE_FILENAME);

static int driver_module_init(void)
{
int ret = 0;

pr_info(KBUILD_MODNAME
#ifdef DRIVER_VERSION
" version " DRIVER_VERSION
#endif
#ifdef REVISION_NUMBER
#if defined(DRIVER_VERSION)
","
#endif
" rev: " REVISION_NUMBER
#endif
#ifdef COMMIT_HASH
#if defined(PX4_DRIVER_VERSION) || defined(REVISION_NUMBER)
","
#endif
" commit: " COMMIT_HASH
#endif
#ifdef REVISION_NAME
" @ " REVISION_NAME
#endif
"\n");

ret = px4_register();
if (ret)
goto exit;

ret = isdb2056_register();
if (ret)
goto exit;

exit:
return ret;
}

static void driver_module_exit(void)
{
px4_unregister();
isdb2056_unregister();
}

module_init(driver_module_init);
module_exit(driver_module_exit);
8 changes: 8 additions & 0 deletions driver/driver.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// driver.h

#ifndef __DRIVER_H__
#define __DRIVER_H__

#define DRIVER_VERSION "0.2.1"

#endif
10 changes: 10 additions & 0 deletions driver/firmware.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// firmware.h

#ifndef __FIRMWARE_H__
#define __FIRMWARE_H__

#if !defined(FIRMWARE_FILENAME)
#define FIRMWARE_FILENAME "it930x-firmware.bin"
#endif

#endif
Loading

0 comments on commit bc02e19

Please sign in to comment.