diff --git a/drivers/Kconfig b/drivers/Kconfig index ae2f4090fc2..add7e4b5bb7 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -188,4 +188,6 @@ source "drivers/soc/Kconfig" source "drivers/firmware/Kconfig" +source "drivers/android/Kconfig" + endmenu diff --git a/drivers/Makefile b/drivers/Makefile index c9a13dc4c30..3e15d25fb9b 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -166,3 +166,4 @@ obj-$(CONFIG_ESOC) += esoc/ obj-$(CONFIG_BIF) += bif/ obj-$(CONFIG_SENSORS) += sensors/ obj-$(CONFIG_SENSORS_SSC) += sensors/ +obj-$(CONFIG_ANDROID) += android/ diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig new file mode 100644 index 00000000000..06723755562 --- /dev/null +++ b/drivers/android/Kconfig @@ -0,0 +1,59 @@ +menu "Android" + +config ANDROID + bool "Android Drivers" + ---help--- + Enable support for various drivers needed on the Android platform + +if ANDROID + +config ANDROID_BINDER_IPC + bool "Android Binder IPC Driver" + depends on MMU + default n + ---help--- + Binder is used in Android for both communication between processes, + and remote method invocation. + + This means one Android process can call a method/routine in another + Android process, using Binder to identify, invoke and pass arguments + between said processes. + +config ANDROID_BINDER_IPC_32BIT + bool + depends on !64BIT && ANDROID_BINDER_IPC + default y + ---help--- + The Binder API has been changed to support both 32 and 64bit + applications in a mixed environment. + + Enable this to support an old 32-bit Android user-space (v4.4 and + earlier). + + Note that enabling this will break newer Android user-space. + +config ANDROID_BINDER_DEVICES + string "Android Binder devices" + depends on ANDROID_BINDER_IPC + default "binder,hwbinder,vndbinder" + ---help--- + Default value for the binder.devices parameter. + + The binder.devices parameter is a comma-separated list of strings + that specifies the names of the binder device nodes that will be + created. Each binder device has its own context manager, and is + therefore logically separated from the other devices. + +config ANDROID_BINDER_IPC_SELFTEST + bool "Android Binder IPC Driver Selftest" + depends on ANDROID_BINDER_IPC + ---help--- + This feature allows binder selftest to run. + + Binder selftest checks the allocation and free of binder buffers + exhaustively with combinations of various buffer sizes and + alignments. + +endif # if ANDROID + +endmenu diff --git a/drivers/android/Makefile b/drivers/android/Makefile new file mode 100644 index 00000000000..a01254c43ee --- /dev/null +++ b/drivers/android/Makefile @@ -0,0 +1,4 @@ +ccflags-y += -I$(src) # needed for trace events + +obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o binder_alloc.o +obj-$(CONFIG_ANDROID_BINDER_IPC_SELFTEST) += binder_alloc_selftest.o diff --git a/drivers/staging/android/binder.c b/drivers/android/binder.c similarity index 100% rename from drivers/staging/android/binder.c rename to drivers/android/binder.c diff --git a/drivers/staging/android/binder.h b/drivers/android/binder.h similarity index 95% rename from drivers/staging/android/binder.h rename to drivers/android/binder.h index eb0834656df..5dc6a66b066 100644 --- a/drivers/staging/android/binder.h +++ b/drivers/android/binder.h @@ -24,7 +24,7 @@ #define BINDER_IPC_32BIT 1 #endif -#include "uapi/binder.h" +#include #endif /* _LINUX_BINDER_H */ diff --git a/drivers/staging/android/binder_alloc.c b/drivers/android/binder_alloc.c similarity index 100% rename from drivers/staging/android/binder_alloc.c rename to drivers/android/binder_alloc.c diff --git a/drivers/staging/android/binder_alloc.h b/drivers/android/binder_alloc.h similarity index 100% rename from drivers/staging/android/binder_alloc.h rename to drivers/android/binder_alloc.h diff --git a/drivers/staging/android/binder_alloc_selftest.c b/drivers/android/binder_alloc_selftest.c similarity index 100% rename from drivers/staging/android/binder_alloc_selftest.c rename to drivers/android/binder_alloc_selftest.c diff --git a/drivers/staging/android/binder_trace.h b/drivers/android/binder_trace.h similarity index 100% rename from drivers/staging/android/binder_trace.h rename to drivers/android/binder_trace.h diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig index 519d20b3868..e1dcea0d9de 100644 --- a/drivers/staging/android/Kconfig +++ b/drivers/staging/android/Kconfig @@ -1,54 +1,7 @@ menu "Android" -config ANDROID - bool "Android Drivers" - default N - ---help--- - Enable support for various drivers needed on the Android platform - if ANDROID -config ANDROID_BINDER_IPC - bool "Android Binder IPC Driver" - default n - ---help--- - Binder is used in Android for both communication between processes, - and remote method invocation. - - This means one Android process can call a method/routine in another - Android process, using Binder to identify, invoke and pass arguments - between said processes. - -config ANDROID_BINDER_IPC_32BIT - bool "Use old (Android 4.4 and earlier) 32-bit binder API" - depends on !64BIT && ANDROID_BINDER_IPC - default y - ---help--- - Enable to support an old 32-bit Android user-space. Breaks the new - Android user-space. - -config ANDROID_BINDER_DEVICES - string "Android Binder devices" - depends on ANDROID_BINDER_IPC - default "binder,hwbinder,vndbinder" - ---help--- - Default value for the binder.devices parameter. - - The binder.devices parameter is a comma-separated list of strings - that specifies the names of the binder device nodes that will be - created. Each binder device has its own context manager, and is - therefore logically separated from the other devices. - -config ANDROID_BINDER_IPC_SELFTEST - bool "Android Binder IPC Driver Selftest" - depends on ANDROID_BINDER_IPC - ---help--- - This feature allows binder selftest to run. - - Binder selftest checks the allocation and free of binder buffers - exhaustively with combinations of various buffer sizes and - alignments. - config ASHMEM bool "Enable the Anonymous Shared Memory Subsystem" default n diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile index 23dac924cd5..ba27dc66e52 100644 --- a/drivers/staging/android/Makefile +++ b/drivers/staging/android/Makefile @@ -3,8 +3,6 @@ ccflags-y += -I$(src) # needed for trace events obj-y += ion/ obj-$(CONFIG_FIQ_DEBUGGER) += fiq_debugger/ -obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o binder_alloc.o -obj-$(CONFIG_ANDROID_BINDER_IPC_SELFTEST) += binder_alloc_selftest.o obj-$(CONFIG_ASHMEM) += ashmem.o obj-$(CONFIG_ANDROID_LOGGER) += logger.o obj-$(CONFIG_ANDROID_TIMED_OUTPUT) += timed_output.o diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index f2e22f8cac9..ba69f970a8e 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild @@ -1,4 +1,5 @@ # UAPI Header export list +header-y += android/ header-y += byteorder/ header-y += can/ header-y += caif/ diff --git a/include/uapi/linux/android/Kbuild b/include/uapi/linux/android/Kbuild new file mode 100644 index 00000000000..ca011eec252 --- /dev/null +++ b/include/uapi/linux/android/Kbuild @@ -0,0 +1,2 @@ +# UAPI Header export list +header-y += binder.h diff --git a/drivers/staging/android/uapi/binder.h b/include/uapi/linux/android/binder.h similarity index 100% rename from drivers/staging/android/uapi/binder.h rename to include/uapi/linux/android/binder.h