Skip to content

Commit

Permalink
add driver of tp、wiegand-gpio and wireless
Browse files Browse the repository at this point in the history
Change-Id: Ie3c11d9d85cf1a05042f5690ac711856fe8b1ad7
  • Loading branch information
sophgo-forum-service authored and carbonfix committed Dec 22, 2023
1 parent 17615a0 commit 213c880
Show file tree
Hide file tree
Showing 5,458 changed files with 4,355,455 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
29 changes: 29 additions & 0 deletions build/cvisetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,32 @@ function clean_middleware()
popd
}

function build_osdrv()
{(
print_notice "Run ${FUNCNAME[0]}() ${1} function"

cd "$BUILD_PATH" || return
make "$ROOTFS_DIR"

local osdrv_target="$1"
if [ -z "$osdrv_target" ]; then
osdrv_target=all
fi

pushd "$OSDRV_PATH"
make KERNEL_DIR="$KERNEL_PATH"/"$KERNEL_OUTPUT_FOLDER" INSTALL_DIR="$SYSTEM_OUT_DIR"/ko "$osdrv_target" || return "$?"
popd
)}

function clean_osdrv()
{
print_notice "Run ${FUNCNAME[0]}() function"

pushd "$OSDRV_PATH"
make KERNEL_DIR="$KERNEL_PATH"/"$KERNEL_OUTPUT_FOLDER" INSTALL_DIR="$SYSTEM_OUT_DIR"/ko clean || return "$?"
popd
}

function clean_ramdisk()
{
rm -rf "${RAMDISK_PATH:?}"/"$RAMDISK_OUTPUT_BASE"
Expand All @@ -304,6 +330,7 @@ function build_all()
# build bsp
build_uboot || return $?
build_kernel || return $?
build_osdrv || return $?
build_middleware || return $?
pack_access_guard_turnkey_app || return $?
pack_ipc_turnkey_app || return $?
Expand All @@ -321,6 +348,7 @@ function clean_all()
clean_uboot
clean_kernel
clean_ramdisk
clean_osdrv
clean_middleware
}

Expand Down Expand Up @@ -420,6 +448,7 @@ function cvi_setup_env()
FREERTOS_PATH="$TOP_DIR"/freertos
ALIOS_PATH="$TOP_DIR"/alios
KERNEL_PATH="$TOP_DIR"/"$KERNEL_SRC"
OSDRV_PATH="$TOP_DIR"/osdrv
RAMDISK_PATH="$TOP_DIR"/ramdisk
BM_BLD_PATH="$TOP_DIR"/bm_bld
TOOLCHAIN_PATH="$TOP_DIR"/host-tools
Expand Down
10 changes: 10 additions & 0 deletions osdrv/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.ko
*.o
*.d
*.mod.c
*.cmd
*.mod

.tmp_versions
Module.symvers
modules.order
81 changes: 81 additions & 0 deletions osdrv/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
SHELL=/bin/bash
-include $(BUILD_PATH)/.config
#
export CVIARCH_L := $(shell echo $(CVIARCH) | tr A-Z a-z)
#
export CHIP_ARCH_L := $(shell echo $(CHIP_ARCH) | tr A-Z a-z)

ifeq ($(KERNEL_DIR), )
$(info Please set KERNEL_DIR global variable!!)
endif

ifeq ($(INSTALL_DIR), )
INSTALL_DIR = ko
endif
CUR_DIR = $(PWD)

$(info ** [ KERNEL_DIR ] ** = $(KERNEL_DIR))
$(info ** [ INSTALL_DIR ] ** = $(INSTALL_DIR))

MAKE_EXT_KO_CP :=
ifneq (${FLASH_SIZE_SHRINK},y)
define MAKE_EXT_KO_CP
find $(1) -name '*.ko' -print -exec cp {} $(INSTALL_DIR)/3rd/ \;;
endef
endif

define MAKE_EXT_KO
( cd $(1) && $(MAKE) KERNEL_DIR=$(KERNEL_DIR) all -j$(shell nproc))
$(call MAKE_EXT_KO_CP, $(1))
endef

SUBDIRS += $(shell find ./extdrv -maxdepth 1 -mindepth 1 -type d | grep -v "git")
exclude_dirs =
SUBDIRS := $(filter-out $(exclude_dirs), $(SUBDIRS))

# prepare ko list
KO_LIST = wiegand-gpio


OTHERS :=

ifeq (y, ${CONFIG_CP_EXT_WIRELESS})
KO_LIST += wireless
OTHERS += cp_ext_wireless
endif

ifeq (, ${CONFIG_NO_TP})
KO_LIST += tp
OTHERS += cp_ext_tp
endif

$(info ** [ KO_LIST ] ** = $(KO_LIST))

export CROSS_COMPILE=$(patsubst "%",%,$(CONFIG_CROSS_COMPILE_KERNEL))
export ARCH=$(patsubst "%",%,$(CONFIG_ARCH))

.PHONY : prepare clean all
all: prepare $(KO_LIST) $(OTHERS)

prepare:
@mkdir -p $(INSTALL_DIR)/3rd

tp:
@$(call MAKE_EXT_KO, extdrv/${@})

wireless:
@$(call MAKE_EXT_KO, extdrv/${@})

wiegand-gpio:
@$(call MAKE_EXT_KO, extdrv/${@})

cp_ext_wireless:
@find extdrv/wireless -name '*.ko' -print -exec cp {} $(INSTALL_DIR)/3rd/ \;

cp_ext_tp:
@find extdrv/tp -name '*.ko' -print -exec cp {} $(INSTALL_DIR)/3rd/ \;

clean:
@for subdir in $(SUBDIRS); do cd $$subdir && $(MAKE) clean && cd $(CUR_DIR); done
@rm -f $(INSTALL_DIR)/*.ko
@rm -f $(INSTALL_DIR)/3rd/*.ko
9 changes: 9 additions & 0 deletions osdrv/extdrv/tp/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# tp device configuration
#

source "osdrv/extdrv/tp/ts_gsl/Kconfig"
source "osdrv/extdrv/tp/ts_gt9xx/Kconfig"



33 changes: 33 additions & 0 deletions osdrv/extdrv/tp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
PWD := $(shell pwd)


obj-m += ts_gsl/
obj-m += ts_gt9xx/

all:
$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL_DIR) M=$(PWD) modules

clean:
#$(MAKE) -C $(KSRC) M=$(shell pwd) clean
# cd hal ; rm -fr */*/*/*.mod.c */*/*/*.mod */*/*/*.o */*/*/.*.cmd */*/*/*.ko
# cd hal ; rm -fr */*/*.mod.c */*/*.mod */*/*.o */*/.*.cmd */*/*.ko
# cd hal ; rm -fr */*.mod.c */*.mod */*.o */.*.cmd */*.ko
# cd hal ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
# cd core ; rm -fr */*.mod.c */*.mod */*.o */.*.cmd */*.ko
# cd core ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
# cd os_dep/linux ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
# cd os_dep ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
# cd platform ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
find . -name *.ko | xargs -i rm -rf {}
find . -name Module.symvers | xargs -i rm -rf {}
find . -name Module.markers | xargs -i rm -rf {}
find . -name modules.order | xargs -i rm -rf {}
find . -name *.mod.c | xargs -i rm -rf {}
find . -name *.mod | xargs -i rm -rf {}
find . -name *.o | xargs -i rm -rf {}
find . -name *.cmd | xargs -i rm -rf {}
find . -name *~ | xargs -i rm -rf {}
rm -fr .tmp_versions
# rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order
# rm -fr *.mod.c *.mod *.o .*.cmd *.ko *~
# rm -fr .tmp_versions
9 changes: 9 additions & 0 deletions osdrv/extdrv/tp/ts_gsl/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Touchscreen driver configuration
#

config TOUCHSCREEN_TSGSL
tristate "betterlife tp"
default m
---help-- -
betterlife fingerprint.
31 changes: 31 additions & 0 deletions osdrv/extdrv/tp/ts_gsl/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
PWD := $(shell pwd)

#ccflags-y += -I./include/
#ccflags-y += -I$(srctree)/drivers/pinctrl/cvitek/
ccflags-y += -I$(src) -I$(src)/$(CHIP) -I$(srctree)/drivers/tee

obj-m := ts_gslX680.o
#gsl_point_id.o

#obj-m += cv_tp.o
# cp gsl_point_id gsl_point_id.o

#$(info CONFIG_TOUCHSCREEN_TSGSL = $(CONFIG_TOUCHSCREEN_TSGSL))

all:modules

modules:
$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL_DIR) M=$(shell pwd) modules

strip:
$(CROSS_COMPILE)strip $(MODULE_NAME).ko --strip-unneeded

clean:
rm -f *.o* *.ko
rm -f Module.symvers modules.order
rm -f cvi_wiegand.mod.c
rm -rf .tmp_versions
rm -f .*cmd
rm -f $(CHIP)/*.o*
rm -f $(CHIP)/.*cmd

Binary file added osdrv/extdrv/tp/ts_gsl/gsl_point_id
Binary file not shown.
Loading

0 comments on commit 213c880

Please sign in to comment.