mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
drv8424_mmi: stepper motor driver
Initial driver code for TI DRV8424 stepper motor. Based on AW8646 from Awinic. This is just to create an entry point. Needs a lot of work Change-Id: Ied7eb3f05801f457494feff098c3b78b3813d30b Signed-off-by: Konstantin Makariev <hcv867@motorola.com> Reviewed-on: https://gerrit.mot.com/2231338 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Qing Chang <qing@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
73592187f2
commit
f488925336
5 changed files with 1879 additions and 0 deletions
8
drivers/misc/drv8424/Android.mk
Normal file
8
drivers/misc/drv8424/Android.mk
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
DLKM_DIR := motorola/kernel/modules
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := drv8424_mmi.ko
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
|
||||
include $(DLKM_DIR)/AndroidKernelModule.mk
|
||||
10
drivers/misc/drv8424/Kbuild
Normal file
10
drivers/misc/drv8424/Kbuild
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# add -Wall to try to catch everything we can.
|
||||
EXTRA_CFLAGS += -Wall
|
||||
EXTRA_CFLAGS += -I$(TOP)/motorola/kernel/modules/include
|
||||
|
||||
#ifeq ($(CONFIG_LIBER_DTB), y)
|
||||
#EXTRA_CFLAGS += -DCONFIG_USE_HW_CLK
|
||||
#endif
|
||||
|
||||
obj-m := drv8424_mmi.o
|
||||
drv8424_mmi-objs := drv8424.o
|
||||
10
drivers/misc/drv8424/Makefile
Normal file
10
drivers/misc/drv8424/Makefile
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
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
|
||||
215
drivers/misc/drv8424/device_tree.dtsi
Normal file
215
drivers/misc/drv8424/device_tree.dtsi
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
&tlmm {
|
||||
drv8424_gpios {
|
||||
drv8424_mode0_low: drv8424_mode0_low {
|
||||
mux {
|
||||
pins = "gpio70";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio70";
|
||||
drive-strength = <2>; /* 2 MA */
|
||||
output-low;
|
||||
};
|
||||
};
|
||||
drv8424_mode0_high: drv8424_mode0_high {
|
||||
mux {
|
||||
pins = "gpio70";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio70";
|
||||
drive-strength = <2>; /* 2 MA */
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
drv8424_mode0_disable: drv8424_mode0_disable {
|
||||
mux {
|
||||
pins = "gpio70";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio70";
|
||||
input-enable;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
drv8424_mode1_low: drv8424_mode1_low {
|
||||
mux {
|
||||
pins = "gpio71";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio71";
|
||||
drive-strength = <2>; /* 2 MA */
|
||||
output-low;
|
||||
};
|
||||
};
|
||||
drv8424_mode1_high: drv8424_mode1_high {
|
||||
mux {
|
||||
pins = "gpio71";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio71";
|
||||
drive-strength = <2>; /* 2 MA */
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
drv8424_mode1_disable: drv8424_mode1_disable {
|
||||
mux {
|
||||
pins = "gpio71";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio71";
|
||||
input-enable;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
drv8424_t0_low: drv8424_t0_low {
|
||||
mux {
|
||||
pins = "gpio49";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio49";
|
||||
drive-strength = <2>; /* 2 MA */
|
||||
output-low;
|
||||
};
|
||||
};
|
||||
drv8424_t0_high: drv8424_t0_high {
|
||||
mux {
|
||||
pins = "gpio49";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio49";
|
||||
drive-strength = <2>; /* 2 MA */
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
drv8424_t0_disable: drv8424_t0_disable {
|
||||
mux {
|
||||
pins = "gpio49";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio49";
|
||||
input-enable;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
drv8424_t1_low: drv8424_t1_low {
|
||||
mux {
|
||||
pins = "gpio33";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio33";
|
||||
drive-strength = <2>; /* 2 MA */
|
||||
output-low;
|
||||
};
|
||||
};
|
||||
drv8424_t1_high: drv8424_t1_high {
|
||||
mux {
|
||||
pins = "gpio33";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio33";
|
||||
drive-strength = <2>; /* 2 MA */
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
drv8424_t1_disable: drv8424_t1_disable {
|
||||
mux {
|
||||
pins = "gpio33";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio33";
|
||||
input-enable;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
drv8424_int_default: drv8424_int_default {
|
||||
mux {
|
||||
pins = "gpio57";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio57";
|
||||
drive-strength = <6>;
|
||||
input-enable;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
drv8424_clk_active: drv8424_clk_active {
|
||||
mux {
|
||||
pins = "gpio21";
|
||||
function = "gcc_gp2";
|
||||
};
|
||||
config {
|
||||
pins = "gpio21";
|
||||
drive-strength = <2>; /* 2 MA */
|
||||
bias-pull-none;
|
||||
};
|
||||
};
|
||||
drv8424_clk_sleep: drv8424_clk_sleep {
|
||||
mux {
|
||||
pins = "gpio21";
|
||||
function = "gpio";
|
||||
};
|
||||
config {
|
||||
pins = "gpio21";
|
||||
/* drive-strength = <2>; */ /* 2 MA */
|
||||
/* bias-pull-down; */
|
||||
input-enable;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
moto_drv8424_support {
|
||||
compatible = "moto,drv8424";
|
||||
status = "ok"
|
||||
pinctrl-names = "m0_low", "m0_high", "m0_disable",
|
||||
"m1_low", "m1_high", "m1_disable",
|
||||
"t0_low", "t0_high", "t0_disable",
|
||||
"t1_low", "t1_high", "t1_disable",
|
||||
"drv8424_int_default",
|
||||
"drv8424_clk_active", "drv8424_clk_sleep";
|
||||
pinctrl-0 = <&drv8424_mode0_low>;
|
||||
pinctrl-1 = <&drv8424_mode0_high>;
|
||||
pinctrl-2 = <&drv8424_mode0_disable>;
|
||||
pinctrl-3 = <&drv8424_mode1_low>;
|
||||
pinctrl-4 = <&drv8424_mode1_high>;
|
||||
pinctrl-5 = <&drv8424_mode1_disable>;
|
||||
pinctrl-6 = <&drv8424_t0_low>;
|
||||
pinctrl-7 = <&drv8424_t0_high>;
|
||||
pinctrl-8 = <&drv8424_t0_disable>;
|
||||
pinctrl-9 = <&drv8424_t1_low>;
|
||||
pinctrl-10 = <&drv8424_t1_high>;
|
||||
pinctrl-11 = <&drv8424_t1_disable>;
|
||||
pinctrl-12 = <&drv8424_int_default>;
|
||||
pinctrl-13 = <&drv8424_clk_active>;
|
||||
pinctrl-14 = <&drv8424_clk_sleep>;
|
||||
interrupt-parent = <&tlmm>;
|
||||
interrupts = <57 0x2002>;
|
||||
drv8424-gpios = <52 57 21 32 30 51 29 50 49 33>;
|
||||
drv8424-gpios-cells = <10>;
|
||||
drv8424-max-freq = <250000>;
|
||||
clocks = <&clock_gcc 36>;
|
||||
clock-names = "gcc_gp2";
|
||||
vdd-supply = <&pm6150_l13>;
|
||||
enable-hw-clock;
|
||||
power-default-off;
|
||||
};
|
||||
};
|
||||
1636
drivers/misc/drv8424/drv8424.c
Normal file
1636
drivers/misc/drv8424/drv8424.c
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue