Skip to content
This repository was archived by the owner on May 20, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4aa7e21
Changed symbol task_work_func_t to task_worker_func_t as it conflicts…
cdorn0 Mar 19, 2021
8cf80a0
Changed V4L_TYPE_GRABBER to VFL_TYPE_VIDEO as the symbol is deprecated
cdorn0 Mar 19, 2021
7dcc7af
Changed ktime symbols and functions to use ktime64
cdorn0 Mar 19, 2021
7894671
Removed vfs_fstat as it is not needed and no longer exported; Changed…
cdorn0 Mar 19, 2021
b7790aa
moved library to lib folder and extracted it to shipped objects; adap…
cdorn0 Mar 19, 2021
d6b426a
Added .idea files to gitignore
cdorn0 Mar 19, 2021
b8789d3
renamed cx511h board to gc573
cdorn0 Mar 19, 2021
6e29735
modified insmod and install files to fit gc573 board
cdorn0 Mar 19, 2021
ec3ade6
fixed typo in install.sh
cdorn0 Mar 19, 2021
2f1365d
fixup! renamed cx511h board to gc573
cdorn0 Mar 20, 2021
ac4b6a8
fixup! renamed cx511h board to gc573
cdorn0 Mar 20, 2021
05e7d65
Partly applied updates from new driver version
cdorn0 Mar 20, 2021
71da4ce
Changed kernel messages/debugging to use module name prefix
cdorn0 Mar 20, 2021
ce70873
Removed function printk spamming
cdorn0 Mar 20, 2021
3f5b465
fixed warnings/ignore variable length array warning
cdorn0 Mar 20, 2021
0195166
fixed install and build files; fixed support for bmp pictures
cdorn0 Jan 9, 2022
07233c8
moved declaradion of board init/exit
cdorn0 Jan 9, 2022
1b3e498
fixed warn_unused_result warnings
cdorn0 Jan 9, 2022
dc951df
fixed scheduling while atomic bug that leads to system crash
cdorn0 Jan 9, 2022
857f042
changed debug messages to use kernel print macros
cdorn0 Jan 9, 2022
8616675
changed bus_info to be v4l2 compliant
cdorn0 Jan 9, 2022
19a64a2
changed EDID to fit to lg4k on windows
cdorn0 Jan 9, 2022
7b3b128
applied updates for new driver version; fixed bytesperline for obs to…
cdorn0 Jan 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ modules.order
Module.symvers
Mkfile.old
dkms.conf

#IntelliJ CLion Files
.idea/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can set up a global gitignore for all your local clones with this global gitignore being local to your computer this way:

git config --global core.excludesfile ~/some/path/to/your/global/gitignore

This way you won't have to add lines specific to your own setup on any project you work on. =)

2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
make -C driver clean
make -C driver
cp driver/cx511h.ko ./
cp driver/gc573.ko ./
31 changes: 19 additions & 12 deletions driver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ else
KERNEL_VER:=$(shell uname -r)
endif

BOARD ?= cx511h
BOARD ?= gc573

ifeq ($(MAKELEVEL),0)
export BASE_DIR:=$(realpath $(dir $(MAKEFILE_LIST)))/
Expand All @@ -23,46 +23,53 @@ include $(BASE_DIR)helper.mk

MODULE_NAME ?= $(BOARD)
UTILS_DIR := $(BASE_DIR)utils/
LIB_DIR := $(BASE_DIR)lib/

ifeq ($(call check_dir,$(BOARD_BASE_DIR)/$(BOARD)),$(NULL))
$(error no board $(BOARD) exists)
endif

lib_file:=../AverMediaLib_64.a
basic-objs := entry.o cxt_mgr.o


basic-objs := entry.o cxt_mgr.o
utils := $(call dirs, $(UTILS_DIR))
utils_src := $(call rpath, $(foreach util, $(utils), $(call list_files_from_file, $(UTILS_DIR)$(util)SOURCE)))
utils_objs := $(patsubst %.c, %.o, $(utils_src))
utils_inc := $(foreach util, $(utils), $(addprefix -I, $(UTILS_DIR)$(util)include))
board_src:=$(call rpath,$(call list_files_from_file,$(BOARD_BASE_DIR)/$(BOARD)/SOURCE))

board_src:=$(call rpath,$(call list_files_from_file, $(BOARD_BASE_DIR)/$(BOARD)/SOURCE))
board_objs:=$(patsubst %.c,%.o,$(board_src))

lib_src:=$(call rpath,$(wildcard $(LIB_DIR)*.c) $(wildcard $(LIB_DIR)*.o) $(subst _shipped,,$(wildcard $(LIB_DIR)*.o_shipped)))
lib_objs := $(patsubst %.c, %.o, $(lib_src))
lib_cmd := $(addprefix $(call rpath, $(LIB_DIR))., $(addsuffix .cmd, $(subst _shipped,, $(notdir $(wildcard $(LIB_DIR)*.o_shipped)))))
lib_inc := $(addprefix -I, $(LIB_DIR)include)

common-include-dir := $(BASE_DIR)include
common-include := $(addprefix -I, $(common-include-dir))
common-include += $(utils_inc)
common-include += $(utils_inc) $(lib_inc)

$(MODULE_NAME)-objs += $(basic-objs)
$(MODULE_NAME)-objs += $(utils_objs)
$(MODULE_NAME)-objs += $(board_objs)
$(MODULE_NAME)-objs += AverMediaLib_64.o
$(MODULE_NAME)-objs += $(lib_objs)

#$(call add_cflags, $(MODULE_NAME)-objs, common-include) -fno-common

EXTRA_CFLAGS += $(common-include) -Wno-maybe-uninitialized
EXTRA_LDFLAGS += --whole-archive
EXTRA_CFLAGS += -Wno-vla -Wno-declaration-after-statement $(common-include) -Wno-maybe-uninitialized
EXTRA_LDFLAGS += --whole-archive
obj-m += $(MODULE_NAME).o


build:
cp $(lib_file) AverMediaLib_64.o
build:
$(info test1 $(lib_cmd))
$(info test $(call rpath, $(LIB_DIR)))
$(shell touch $(lib_cmd))
make -C $(KDIR) M=$(BASE_DIR) modules

all: buildlib build
make -C $(KDIR) M=$(BASE_DIR) modules

clean:
$(shell rm $(lib_cmd))
$(MAKE) -C $(KDIR) M=$(BASE_DIR) clean

.PHONY: all clean buildlib build
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ typedef struct
BASIC_CXT_HANDLE_DECLARE;
alsa_model_handle_t alsa_handle;
handle_t aver_xilinx_handle;
handle_t i2c_chip_handle[CL511H_I2C_CHIP_COUNT];
handle_t i2c_chip_handle[GC573_I2C_CHIP_COUNT];
}board_alsa_cxt_t;

static board_chip_desc_t cl511h_chip_desc[CL511H_I2C_CHIP_COUNT]=
static board_chip_desc_t gc573_chip_desc[GC573_I2C_CHIP_COUNT]=
{
[CL511H_I2C_CHIP_ITE6805_0]=
[GC573_I2C_CHIP_ITE6805_0]=
{
.name=ITE6805_DRVNAME,
.index=1,
},

};

static alsa_model_pcm_info_t cl511h_pcm_info=
static alsa_model_pcm_info_t gc573_pcm_info=
{
.name="cl511h capture pcm",
.name="gc573 capture pcm",
.capture_count=1,

};
Expand Down Expand Up @@ -76,7 +76,7 @@ static void board_alsa_capture_start(void *data)
{
board_alsa_cxt_t *board_alsa=data;
aver_xilinx_audio_cbinfo_t audio_cbinfo;
//handle_t ite6805_handle=board_alsa->i2c_chip_handle[CL511H_I2C_CHIP_ITE6805_0];
//handle_t ite6805_handle=board_alsa->i2c_chip_handle[GC573_I2C_CHIP_ITE6805_0];
//enum ite6805_audio_sample fe_audioinfo=0;
//aver_xilinx_audio_cfg_t cfg;

Expand Down Expand Up @@ -126,11 +126,11 @@ void board_alsa_init(cxt_mgr_handle_t cxt_mgr)
break;
}
if (subsystem_id == 0x5730)
alsa_info.name="AVerMedia CL511H";
alsa_info.pcm_count=sizeof(cl511h_pcm_info)/sizeof(alsa_model_pcm_info_t);
alsa_info.name="AVerMedia GC573";
alsa_info.pcm_count=sizeof(gc573_pcm_info)/sizeof(alsa_model_pcm_info_t);
alsa_info.support_fmt_mask=BIT_ALSA_MODEL_FMT_S16_LE | BIT_ALSA_MODEL_FMT_S24_LE;
alsa_info.support_rate_mask=BIT_ALSA_MODEL_RATE_32K|BIT_ALSA_MODEL_RATE_44_1K|BIT_ALSA_MODEL_RATE_48K| BIT_ALSA_MODEL_RATE_96K | BIT_ALSA_MODEL_RATE_192K;
alsa_info.pcm_info=&cl511h_pcm_info;
alsa_info.pcm_info=&gc573_pcm_info;
alsa_info.period_size=7680*4;//12*1024;
alsa_info.max_period_num=128;
board_alsa->alsa_handle=alsa_model_init(cxt_mgr,&alsa_info);
Expand All @@ -155,9 +155,9 @@ void board_alsa_init(cxt_mgr_handle_t cxt_mgr)
break;
}

for(i=0;i<CL511H_I2C_CHIP_COUNT;i++)
for(i=0;i<GC573_I2C_CHIP_COUNT;i++)
{
board_alsa->i2c_chip_handle[i]=i2c_model_get_nth_driver_handle(i2c_mgr,cl511h_chip_desc[i].name,cl511h_chip_desc[i].index);
board_alsa->i2c_chip_handle[i]=i2c_model_get_nth_driver_handle(i2c_mgr,gc573_chip_desc[i].name,gc573_chip_desc[i].index);
debug_msg("board_alsa i2c_chip_handle[%d] %p\n",i,board_alsa->i2c_chip_handle[i]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ static char *no_signal_pic = NULL;
module_param(no_signal_pic, charp, 0444);
MODULE_PARM_DESC(no_signal_pic, "Loading this bitmap file and display it when the input is no signal");

//static char *out_of_range_pic = NULL;
//module_param(out_of_range_pic, charp, 0444);
//MODULE_PARM_DESC(out_of_range_pic, "Loading this bitmap file and display it when the content is out of range");
static char *out_of_range_pic = NULL;
module_param(out_of_range_pic, charp, 0444);
MODULE_PARM_DESC(out_of_range_pic, "Loading this bitmap file and display it when the content is out of range");

static char *copy_protetion_pic = NULL;
module_param(copy_protetion_pic, charp, 0444);
MODULE_PARM_DESC(copy_protetion_pic, "Loading this bitmap file and display it when the content was protected");
static char *copy_protection_pic = NULL;
module_param(copy_protection_pic, charp, 0444);
MODULE_PARM_DESC(copy_protection_pic, "Loading this bitmap file and display it when the content was protected");

int board_init(void);
void board_exit(void);

const char *BOARD_NAME="CL511H";
const char *BOARD_NAME="GC573";
//pci_model_driver_setup_t pci_setup;
extern int subsystem_id;

Expand All @@ -54,7 +54,7 @@ pci_model_id_t id_table[]={
.device=0x0054, //according to hw DEVICE ID config
.sub_vendor = 0x1461,
.sub_device = 0x5730,
.driver_data=CL511H,
.driver_data=GC573,
},
{
0
Expand Down Expand Up @@ -170,14 +170,14 @@ int board_probe(struct device *dev,unsigned long driver_info)
ret=board_gpio_init(cxt_mgr);
if(ret!=0)
{
mesg("board_gpio_init\n");
pr_err("board_gpio_init failed\n");
err=ERROR_BOARD_GPIO_INIT;
break;
}
ret=board_i2c_init(cxt_mgr,driver_info);
if(ret!=0)
{
mesg("board_i2c_init\n");
pr_err("board_i2c_init failed\n");
err=ERROR_BOARD_I2C_INIT;
break;
}
Expand All @@ -186,13 +186,14 @@ int board_probe(struct device *dev,unsigned long driver_info)
ite6805_handle_1=i2c_model_get_driver_handle(i2c_mgr,ITE6805_DRVNAME);
if(!ite6805_handle_1)
{
break;
pr_err("error getting ite6805 handle\n");
break;
}
ite6805_add_trace(ite6805_handle_1,trace_handle);

mesg("%s subsystem_id=%x\n",__func__,subsystem_id);
pr_info("subsystem_id=%x\n", subsystem_id);

pic_bmp_init(cxt_mgr, no_signal_pic, NULL, copy_protetion_pic);
pic_bmp_init(cxt_mgr, no_signal_pic, out_of_range_pic, copy_protection_pic);
board_alsa_init(cxt_mgr);
board_v4l2_init(cxt_mgr,subsystem_id);
//aver_xilinx_sha204_init(aver_xilinx_handle);
Expand All @@ -206,10 +207,13 @@ int board_probe(struct device *dev,unsigned long driver_info)
{
case ERROR_AVER_XILINX:
cxt_manager_unref_context(i2c_mgr);
// fall through
case ERROR_I2C_MGR:
cxt_manager_unref_context(gpio_mgr);
// fall through
case ERROR_GPIO_MGR:
cxt_manager_unref_context(trace_handle);
// fall through
case ERROR_TRACE_HANDLE:

case NO_PCI_HANDLE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ int board_gpio_init(cxt_mgr_handle_t cxt_mgr)
// board_gpio_cxt->gpio_pin_handle[i]=gpio_model_request_pin_handle(gpio_mgr,pin_name[i]);
// if(board_gpio_cxt->gpio_pin_handle[i]==GPIO_MODEL_BAD_PIN_HANDLE)
// {
// printk(" request %s failed\n",pin_name[i]);
// pr_info(" request %s failed\n",pin_name[i]);
// }
// }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static ite6805_cfg_t ite6805_cfg={
};


static i2c_dev_info_t cx511h_i2c_bus1_devices[]=
static i2c_dev_info_t gc573_i2c_bus1_devices[]=
{
{
.name=ITE6805_DRVNAME,
Expand All @@ -55,7 +55,7 @@ static i2c_dev_info_t cx511h_i2c_bus1_devices[]=

static i2c_dev_info_t *board_i2c_bus_devices[SUPPORT_BOARD_NUM][BOARD_I2C_BUS_NUM]=
{
[CL511H][I2C_BUS_COM]= &cx511h_i2c_bus1_devices[0], //reserved one I2C
[GC573][I2C_BUS_COM]= &gc573_i2c_bus1_devices[0], //reserved one I2C

};

Expand Down
Loading