samples: move mic/mpssd example code from Documentation

am: faf6aa4b12

Change-Id: I7ed0b2c9987635d6e46fa9207cc9c7457896b536
This commit is contained in:
Shuah Khan 2017-03-12 08:10:58 +00:00 committed by android-build-merger
commit 249dd69807
10 changed files with 28 additions and 23 deletions

View file

@ -1,4 +1,4 @@
subdir-y := accounting auxdisplay blackfin connector \
filesystems filesystems ia64 laptops mic misc-devices \
filesystems filesystems ia64 laptops misc-devices \
networking pcmcia prctl ptp spi timers vDSO video4linux \
watchdog

View file

@ -1 +0,0 @@
subdir-y := mpssd

View file

@ -1,21 +0,0 @@
ifndef CROSS_COMPILE
# List of programs to build
hostprogs-$(CONFIG_X86_64) := mpssd
mpssd-objs := mpssd.o sysfs.o
# Tell kbuild to always build the programs
always := $(hostprogs-y)
HOSTCFLAGS += -I$(objtree)/usr/include -I$(srctree)/tools/include
ifdef DEBUG
HOSTCFLAGS += -DDEBUG=$(DEBUG)
endif
HOSTLOADLIBES_mpssd := -lpthread
install:
install mpssd /usr/sbin/mpssd
install micctrl /usr/sbin/micctrl
endif

View file

@ -0,0 +1,27 @@
ifndef CROSS_COMPILE
uname_M := $(shell uname -m 2>/dev/null || echo not)
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
ifeq ($(ARCH),x86)
PROGS := mpssd
CC = $(CROSS_COMPILE)gcc
CFLAGS := -I../../../usr/include -I../../../tools/include
ifdef DEBUG
CFLAGS += -DDEBUG=$(DEBUG)
endif
all: $(PROGS)
mpssd: mpssd.c sysfs.c
$(CC) $(CFLAGS) mpssd.c sysfs.c -o mpssd -lpthread
install:
install mpssd /usr/sbin/mpssd
install micctrl /usr/sbin/micctrl
clean:
rm -fr $(PROGS)
endif
endif

View file

View file