mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
UWB bring up for driver
Add UWB driver on kernel module and UWB driver module support dlkm Change-Id: I82302d83438afb104e818e31aa70091f5bb92a47 Reviewed-on: https://gerrit.mot.com/1774769 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Zishang Zhou <zhouzs1@motorola.com> Reviewed-by: Tao Sun <suntao2@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
fcdea9385f
commit
d50ef8d192
5 changed files with 1227 additions and 0 deletions
9
drivers/uwb/sr100/Android.mk
Normal file
9
drivers/uwb/sr100/Android.mk
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
DLKM_DIR := motorola/kernel/modules
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := sr100.ko
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(KERNEL_MODULES_OUT)/mmi_info.ko
|
||||
include $(DLKM_DIR)/AndroidKernelModule.mk
|
||||
7
drivers/uwb/sr100/Kbuild
Normal file
7
drivers/uwb/sr100/Kbuild
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# add -Wall to try to catch everything we can.
|
||||
EXTRA_CFLAGS += -Wall
|
||||
EXTRA_CFLAGS += -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/include
|
||||
|
||||
obj-m += sr100.o
|
||||
|
||||
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../../mmi_info/Module.symvers
|
||||
11
drivers/uwb/sr100/Makefile
Normal file
11
drivers/uwb/sr100/Makefile
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
|
||||
|
||||
all:
|
||||
$(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
|
||||
|
||||
modules_install:
|
||||
$(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
|
||||
|
||||
clean:
|
||||
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean
|
||||
|
||||
1147
drivers/uwb/sr100/sr100.c
Normal file
1147
drivers/uwb/sr100/sr100.c
Normal file
File diff suppressed because it is too large
Load diff
53
include/linux/sr100.h
Normal file
53
include/linux/sr100.h
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/*====================================================================================*/
|
||||
/* */
|
||||
/* Copyright 2018-2019 NXP */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 2 of the License, or */
|
||||
/* (at your option) any later version. */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program; if not, write to the Free Software */
|
||||
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
/* */
|
||||
/*====================================================================================*/
|
||||
|
||||
#include <linux/mmi_device.h>
|
||||
|
||||
#define SR100_MAGIC 0xEA
|
||||
#define SR100_SET_PWR _IOW(SR100_MAGIC, 0x01, long)
|
||||
#define SR100_SET_DBG _IOW(SR100_MAGIC, 0x02, long)
|
||||
#define SR100_SET_POLL _IOW(SR100_MAGIC, 0x03, long)
|
||||
#define SR100_SET_FWD _IOW(SR100_MAGIC, 0x04, long)
|
||||
#define SR100_GET_THROUGHPUT _IOW(SR100_MAGIC, 0x05, long)
|
||||
#define SR100_ESE_RESET _IOW(SR100_MAGIC, 0x06, long)
|
||||
|
||||
#define NORMAL_MODE_HEADER_LEN 4
|
||||
#define HBCI_MODE_HEADER_LEN 4
|
||||
#define NORMAL_MODE_LEN_OFFSET 3
|
||||
#define UCI_NORMAL_PKT_SIZE 0
|
||||
|
||||
#define EXTND_LEN_INDICATOR_OFFSET 1
|
||||
#define EXTND_LEN_INDICATOR_OFFSET_MASK 0x80
|
||||
#define EXTENDED_LENGTH_OFFSET 2
|
||||
|
||||
struct sr100_spi_platform_data {
|
||||
unsigned int irq_gpio;
|
||||
unsigned int ce_gpio;
|
||||
unsigned int spi_handshake_gpio;
|
||||
unsigned int rtc_sync_gpio;
|
||||
unsigned int vdd_1v8_gpio; /* to control VDD for super interposer board */
|
||||
unsigned int vdd_1v8_rf_gpio;
|
||||
unsigned int vbat_3v6_gpio;
|
||||
};
|
||||
enum {
|
||||
PWR_DISABLE = 0,
|
||||
PWR_ENABLE,
|
||||
ABORT_READ_PENDING
|
||||
};
|
||||
Loading…
Reference in a new issue