Add new device oneplus-onyx (Oneplus X) (#856)

This commit is contained in:
Alex Roth 2017-11-03 22:45:37 -04:00 committed by Oliver Smith
parent 965ad4f4c7
commit f76781ccb7
13 changed files with 4198 additions and 0 deletions

View file

@ -0,0 +1,3 @@
# udev rules file
SUBSYSTEM=="input", ATTRS{name}=="synaptics-rmi", \
ENV{ID_INPUT}="1", ENV{ID_INPUT_TOUCHSCREEN}="1"

View file

@ -0,0 +1,26 @@
pkgname=device-oneplus-onyx
pkgver=1
pkgrel=0
pkgdesc="OnePlus X"
url="https://github.com/postmarketOS"
arch="noarch"
license="MIT"
depends="linux-oneplus-onyx linux-firmware mkbootimg msm-fb-refresher"
makedepends=""
install=""
source="deviceinfo 90-android-touch-dev.rules fb.modes"
options="!check"
package() {
install -Dm644 "$srcdir"/deviceinfo \
"$pkgdir"/etc/deviceinfo
install -Dm644 "$srcdir"/90-android-touch-dev.rules \
"$pkgdir"/etc/udev/rules.d/90-android-touch-dev.rules
install -Dm644 "$srcdir"/fb.modes \
"$pkgdir"/etc/fb.modes
}
sha512sums="73d7778d8e34c65b0ef04c4d0931af3280dee9ac5bb70941313d666a7ccea71a3c250db110c5203a37d1597681c0cbcbb0adba455934be3a7bdebbcb544a8f18 deviceinfo
73963817cab7b798642f91894eb17975212a323d0e8bf8ce4f477fe33ace90b0050180877cbb605a074d07871d640c654cd581f0359532b9edb072013e6346a5 90-android-touch-dev.rules
1452360bab1146643d8c6e0c881bfc145030cd5e3704765fc17f701dcec3f3e890a93db77e1b6afd6884d48b790e7dfc1013bbeedd619ae798baccaeab118847 fb.modes"

View file

@ -0,0 +1,37 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="OnePlus X"
deviceinfo_manufacturer="OnePlus"
deviceinfo_date=""
deviceinfo_keyboard="false"
deviceinfo_nonfree="????"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_external_disk="false"
deviceinfo_external_disk_install="false"
deviceinfo_flash_methods="fastboot"
deviceinfo_arch="armhf"
# Splash screen
deviceinfo_screen_width="1080"
deviceinfo_screen_height="1920"
deviceinfo_msm_refresher="true"
# Fastboot related
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_offset_base="0"
deviceinfo_flash_pagesize="2048"
deviceinfo_kernel_cmdline="console=ttyHSL0,115200,n8 androidboot.hardware=qcom user_debug=23 msm_rtb.filter=0x3b7 ehci-hcd.park=3 androidboot.bootdevice=msm_sdcc.1"
deviceinfo_dev_touchscreen="/dev/input/event1"
# Weston red screen workaround (see issue #54)
deviceinfo_weston_pixman_type="2"

View file

@ -0,0 +1,7 @@
mode "1080x1920-0"
# D: 1.109 MHz, H: 0.860 kHz, V: 0.442 Hz
geometry 1080 1920 1080 1920 16
timings 902093 70 120 4 18 19 2
accel false
rgba 8/24,8/16,8/8,8/0
endmode

View file

@ -0,0 +1,46 @@
From bd447b61c49fc26f0299587db3e6d66da49dc529 Mon Sep 17 00:00:00 2001
From: Chen Gang <gang.chen.5i5j@gmail.com>
Date: Sun, 9 Nov 2014 13:31:11 -0800
Subject: [PATCH] Input: lifebook - use "static inline" instead of "inline" in
lifebook.h
For functions defined in header files we should use static inline rather
than inline, which breaks under the latest upstream gcc (which is really
gcc issue, but static inline is better suited regardless).
The related error (with allmodconfig under tile):
MODPOST 4002 modules
ERROR: "lifebook_detect" [drivers/input/mouse/psmouse.ko] undefined!
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/mouse/lifebook.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/input/mouse/lifebook.h b/drivers/input/mouse/lifebook.h
index 4c4326c6f504..0baf02a70a99 100644
--- a/drivers/input/mouse/lifebook.h
+++ b/drivers/input/mouse/lifebook.h
@@ -16,14 +16,14 @@ void lifebook_module_init(void);
int lifebook_detect(struct psmouse *psmouse, bool set_properties);
int lifebook_init(struct psmouse *psmouse);
#else
-inline void lifebook_module_init(void)
+static inline void lifebook_module_init(void)
{
}
-inline int lifebook_detect(struct psmouse *psmouse, bool set_properties)
+static inline int lifebook_detect(struct psmouse *psmouse, bool set_properties)
{
return -ENOSYS;
}
-inline int lifebook_init(struct psmouse *psmouse)
+static inline int lifebook_init(struct psmouse *psmouse)
{
return -ENOSYS;
}
--
2.14.1

View file

@ -0,0 +1,36 @@
From bde304575f3ecaa9570a9329196dffaadf3adafa Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 22 May 2015 09:56:29 -0700
Subject: [PATCH] Input: sentelic - use "static inline" instead of "inline"
gcc-5 defaults to gnu11 which used c99 inline semantics in c99 'inline' is
not externally visible unlike gnu89, therefore we use 'static inline' which
has same semantics between gnu89 and c99
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/mouse/sentelic.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/mouse/sentelic.h b/drivers/input/mouse/sentelic.h
index aa697ece405b..42df9e3beae8 100644
--- a/drivers/input/mouse/sentelic.h
+++ b/drivers/input/mouse/sentelic.h
@@ -123,11 +123,11 @@ struct fsp_data {
extern int fsp_detect(struct psmouse *psmouse, bool set_properties);
extern int fsp_init(struct psmouse *psmouse);
#else
-inline int fsp_detect(struct psmouse *psmouse, bool set_properties)
+static inline int fsp_detect(struct psmouse *psmouse, bool set_properties)
{
return -ENOSYS;
}
-inline int fsp_init(struct psmouse *psmouse)
+static inline int fsp_init(struct psmouse *psmouse)
{
return -ENOSYS;
}
--
2.14.1

View file

@ -0,0 +1,74 @@
diff --git a/arch/arm/mach-msm/restart.c b/arch/arm/mach-msm/restart.c
index ab211fb0009..61ac4160949 100755
--- a/arch/arm/mach-msm/restart.c
+++ b/arch/arm/mach-msm/restart.c
@@ -452,7 +452,9 @@ void msm_restart(char mode, const char *cmd)
mdelay(1000);
}*/
#endif /* VENDOR_EDIT*/
-
+ pr_info("%s : flush console and then delay 1s waiting log printing", __func__);
+ arm_machine_flush_console();
+ mdelay(1000);
if (!use_restart_v2()) {
__raw_writel(0, msm_tmr0_base + WDT0_EN);
if (!(machine_is_msm8x60_fusion() ||
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 2e1f3adbbe8..9a81afad423 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -30,10 +30,10 @@
#include <linux/of_gpio.h>
#include <linux/spinlock.h>
-#ifdef VENDOR_EDIT
+//#ifdef VENDOR_EDIT
//hefaxi@filesystems, 2015/07/03, add for force dump function
-#include <linux/oem_force_dump.h>
-#endif
+//#include <linux/oem_force_dump.h>
+//#endif
struct gpio_button_data {
const struct gpio_keys_button *button;
@@ -338,7 +338,7 @@ static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
#ifdef VENDOR_EDIT
//hefaxi@filesystems, 2015/07/03, add for force dump function
- oem_check_force_dump_key(button->code,state);
+ //oem_check_force_dump_key(button->code,state);
#endif
if (type == EV_ABS) {
diff --git a/drivers/platform/msm/qpnp-power-on.c b/drivers/platform/msm/qpnp-power-on.c
index c6aae05a514..1de7f84fd01 100755
--- a/drivers/platform/msm/qpnp-power-on.c
+++ b/drivers/platform/msm/qpnp-power-on.c
@@ -24,10 +24,10 @@
#include <linux/log2.h>
#include <linux/qpnp/power-on.h>
-#ifdef VENDOR_EDIT
+//#ifdef VENDOR_EDIT
//hefaxi@filesystems, 2015/07/03, add for force dump function
-#include <linux/oem_force_dump.h>
-#endif
+//#include <linux/oem_force_dump.h>
+//#endif
#define PMIC_VER_8941 0x01
#define PMIC_VERSION_REG 0x0105
@@ -438,10 +438,10 @@ qpnp_pon_input_dispatch(struct qpnp_pon *pon, u32 pon_type)
(pon_rt_sts & pon_rt_bit));
input_sync(pon->pon_input);
-#ifdef VENDOR_EDIT
+//#ifdef VENDOR_EDIT
//hefaxi@filesystems, 2015/07/03, add for force dump function
- oem_check_force_dump_key(cfg->key_code,(pon_rt_sts & pon_rt_bit));
-#endif
+ //oem_check_force_dump_key(cfg->key_code,(pon_rt_sts & pon_rt_bit));
+//#endif
return 0;
}

View file

@ -0,0 +1,49 @@
From aeea3592a13bf12861943e44fc48f1f270941f8d Mon Sep 17 00:00:00 2001
From: Behan Webster <behanw@converseincode.com>
Date: Wed, 24 Sep 2014 01:06:46 +0100
Subject: [PATCH] ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h
With compilers which follow the C99 standard (like modern versions of gcc and
clang), "extern inline" does the wrong thing (emits code for an externally
linkable version of the inline function). In this case using static inline
and removing the NULL version of return_address in return_address.c does
the right thing.
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/include/asm/ftrace.h | 2 +-
arch/arm/kernel/return_address.c | 5 -----
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
index 39eb16b0066f2..bfe2a2f5a644e 100644
--- a/arch/arm/include/asm/ftrace.h
+++ b/arch/arm/include/asm/ftrace.h
@@ -45,7 +45,7 @@ void *return_address(unsigned int);
#else
-extern inline void *return_address(unsigned int level)
+static inline void *return_address(unsigned int level)
{
return NULL;
}
diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c
index fafedd86885dd..f6aa84d5b93c9 100644
--- a/arch/arm/kernel/return_address.c
+++ b/arch/arm/kernel/return_address.c
@@ -63,11 +63,6 @@ void *return_address(unsigned int level)
#warning "TODO: return_address should use unwind tables"
#endif
-void *return_address(unsigned int level)
-{
- return NULL;
-}
-
#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) / else */
EXPORT_SYMBOL_GPL(return_address);

View file

@ -0,0 +1,12 @@
diff --git a/drivers/input/touchscreen/synaptics_driver_s3508.c b/drivers/input/touchscreen/synaptics_driver_s3508.c
index dfc8927b656..8ed66423ef6 100644
--- a/drivers/input/touchscreen/synaptics_driver_s3508.c
+++ b/drivers/input/touchscreen/synaptics_driver_s3508.c
@@ -3475,6 +3475,7 @@ static int synaptics_input_init(struct synaptics_ts_data *ts)
#endif
/* For multi touch */
+ input_set_abs_params(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0, 16, 0, 0);
input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
input_set_abs_params(ts->input_dev, ABS_MT_POSITION_X, 0, ts->max_x, 0, 0);
input_set_abs_params(ts->input_dev, ABS_MT_POSITION_Y, 0, ts->max_y, 0, 0);

View file

@ -0,0 +1,33 @@
source:
https://github.com/ShinySide/HispAsian_Lollipop_G6/commit/b7756b6fc4bb728722b14d2dfdbaf1dc843812e9
* These need to be static to avoid these errors:
drivers/built-in.o: In function `.LANCHOR1':
msm_iommu_sec.c:(.data+0x9298): undefined reference to `kgsl_iommu_sync_lock'
msm_iommu_sec.c:(.data+0x929c): undefined reference to `kgsl_iommu_sync_unlock'
Makefile:877: recipe for target '.tmp_vmlinux1' failed
make: *** [.tmp_vmlinux1] Error 1
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
--- a/drivers/gpu/msm/kgsl_iommu.c
+++ b/drivers/gpu/msm/kgsl_iommu.c
@@ -1010,7 +1010,7 @@ static int kgsl_iommu_init_sync_lock(struct kgsl_mmu *mmu)
*
* Return - int - number of commands.
*/
-inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
+static inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
unsigned int *cmds)
{
struct kgsl_device *device = mmu->device;
@@ -1080,7 +1080,7 @@ inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
*
* Return - int - number of commands.
*/
-inline unsigned int kgsl_iommu_sync_unlock(struct kgsl_mmu *mmu,
+static inline unsigned int kgsl_iommu_sync_unlock(struct kgsl_mmu *mmu,
unsigned int *cmds)
{
struct kgsl_device *device = mmu->device;

View file

@ -0,0 +1,134 @@
#****
# This kernel doesn't work properly!
# The kernel will panic whenever you attempt to use the framebuffer (and probably other things).
# Note that this seems to be a gcc6/pmOS toolchain issue - as applying 00_mt_width_major_params.patch and using
# config-oneplus-onyx.armhf with this kernel source in the Lineage toolchain will build & work fine.
# See https://github.com/postmarketOS/pmbootstrap/issues/848.
#****
# APKBUILD based on linux-oneplus-bacon aport (devices are closely related). Changes:
# - add extra patches to support GCC 6
# - Add 00_dontpanic.patch to prevent device from entering a download mode upon panic (reboot instead). CONFIG_MSM_DLOAD_MODE was also disabled.
# - 00_mt_width_major_params.patch - Fixes touchscreen being rejected by libinput/weston because of params not being set.
# -
#
# Kernel config based on: arch/arm/configs/lineageos_onyx_defconfig
# Changes:
# - Enable devtempfs
# - Disable MSM 3d graphics driver (MSM_KGSL).
# - Enable Virtual Terminal
# - Disable ANDROID_PARANOID_NETWORK
# - Enable SYSVIPC.
_vendor=oneplus
_flavor=oneplus-onyx
_version="c83d4835d228f8330da7e33846eec33c64608349"
_config="config-${_flavor}.armhf"
pkgname=linux-${_flavor}
pkgver=3.4.0
case $pkgver in
*.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;;
esac
pkgrel=0
arch="armhf"
pkgdesc="LineageOS 14.1 kernel for OnePlus X (onyx)"
url="https://github.com/LineageOS/android_kernel_oneplus_onyx"
depends="postmarketos-mkinitfs"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev python2 xz dtbtool"
options="!strip !check !tracedeps"
install=
source="
$pkgname-$_version.tar.gz::https://github.com/LineageOS/android_kernel_oneplus_onyx/archive/${_version}.tar.gz
${_config}
compiler-gcc6.h
00_dontpanic.patch
00_fix_return_address.patch
00_mt_width_major_params.patch
00_Input-sentelic-use-static-inline-instead-of-inline.patch
00_Input-lifebook-use-static-inline-instead-of-inline-i.patch
02_gpu-msm-fix-gcc5-compile.patch
"
subpackages=""
license="GPL2"
_abi_release=${pkgver}
_carch="arm"
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
ksrcdir="$srcdir/android_kernel_oneplus_onyx-${_version}"
prepare() {
local _patch_failed=
cd "$ksrcdir"
# first apply patches in specified order
for i in $source; do
case $i in
*.patch)
msg "Applying $i..."
if ! patch -s -p1 -N -i "$srcdir"/$i; then
echo $i >>failed
_patch_failed=1
fi
;;
esac
done
if ! [ -z "$_patch_failed" ]; then
error "The following patches failed:"
cat failed
return 1
fi
# gcc6 support
cp -v "$srcdir"/compiler-gcc6.h "$ksrcdir"/include/linux/
mkdir -p "$srcdir"/build
cp "$srcdir"/$_config "$srcdir"/build/.config
echo "--[ silentoldconfig ]--"
yes "" | make -C "$ksrcdir" O="$srcdir"/build ARCH="$_carch" HOSTCC="$HOSTCC" \
oldconfig
}
# this is so we can do `abuild menuconfig` to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
echo "--[ menuconfig ]--"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1))-Alpine" CONFIG_NO_ERROR_ON_MISMATCH=y
}
package() {
install -Dm644 "$srcdir"/build/arch/arm/boot/zImage-dtb \
"$pkgdir"/boot/vmlinuz-$_flavor
install -D "$srcdir"/build/include/config/kernel.release \
"$pkgdir"/usr/share/kernel/$_flavor/kernel.release
cd "$srcdir"/build
unset LDFLAGS
}
sha512sums="32557bab4b1526179fcd2303c836dfcf65afcd3172cf1c158cfa13d3a6bd958d55845d4f555510fe85885fc10e93efbbc405a9a741d4f5e2ce15466093159e24 linux-oneplus-onyx-c83d4835d228f8330da7e33846eec33c64608349.tar.gz
dfd6ae95d814e11713e95e4eec50e25e33477c892fbd84394d8239aae127cdad9e275183ab642f80ba7b0aca975e11c6c2582607a22c0bcfb0aa63db4ec7a838 config-oneplus-onyx.armhf
22031601ef1c5655232096d06c36ede0d7d92fa5e09e27d7a739f9be1021eb400e9811405fd51a0eee8a71faddaf46cfac7b33d8c161f4c7e1a2b7c495840dce compiler-gcc6.h
4930be0f01cb771c63c9464ec34fb738e9ebe3872a626841908eb026adc29aba19799d5d1374730e8130a0d755796d08c9002d1369c3a94b44ee5117a16ac586 00_dontpanic.patch
ea1d3b5a234fa565e3c1a792de48f4fc4e6023d281d303c8e319c7ef28edc5739ab0e4dea0139a41f0a5c7d03e27921ccaa214fd0ac5c72245a094ce60128864 00_fix_return_address.patch
35f4ef7f1c7fbda31224741126416c805736bd0ea6157eb1048ba53cdf68ea2221776686cd5b956bff91e6a64bef809a52db3d3152f5c3cfe11ded9a5caec98d 00_mt_width_major_params.patch
2d77d90b501aa8afbf81629e73fc0a2055b373942975f58277e43f398d0835b3dbbff4a1118137ec82873ba90a254fea87c1d73ba7708578f1779bd0b4c6ff2d 00_Input-sentelic-use-static-inline-instead-of-inline.patch
5c49f6ff6773a7dc3067d2b1359648fe7a9f758b6c068d6fa69d9aaf24a291ba8022c960317d926aabc11d020a71b20c4e81a6fcf9b21ef66d9b6d065bae23e9 00_Input-lifebook-use-static-inline-instead-of-inline-i.patch
7be03a9e78b7ac330a54b1f00509caa0621a95c0c55901878ad757f9dd69cc05ba2c8b5ea987063ae1224f92c4d090d515fa5d369e7755181a4871b0d0f82881 02_gpu-msm-fix-gcc5-compile.patch"

View file

@ -0,0 +1,69 @@
// SOURCE:
// https://github.com/NextThingCo/CHIP-u-boot/issues/10#issuecomment-287515505
#ifndef __LINUX_COMPILER_H
#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
#endif
#define __used __attribute__((__used__))
#define __must_check __attribute__((warn_unused_result))
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
//#error "gcc6"
/* Mark functions as cold. gcc will assume any path leading to a call
to them will be unlikely. This means a lot of manual unlikely()s
are unnecessary now for any paths leading to the usual suspects
like BUG(), printk(), panic() etc. [but let's keep them for now for
older compilers]
Early snapshots of gcc 4.3 don't support this and we can't detect this
in the preprocessor, but we can live with this because they're unreleased.
Maketime probing would be overkill here.
gcc also has a __attribute__((__hot__)) to move hot functions into
a special section, but I don't see any sense in this right now in
the kernel context */
#define __cold __attribute__((__cold__))
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
#ifndef __CHECKER__
# define __compiletime_warning(message) __attribute__((warning(message)))
# define __compiletime_error(message) __attribute__((error(message)))
#endif /* __CHECKER__ */
/*
* Mark a position in code as unreachable. This can be used to
* suppress control flow warnings after asm blocks that transfer
* control elsewhere.
*
* Early snapshots of gcc 4.5 don't support this and we can't detect
* this in the preprocessor, but we can live with this because they're
* unreleased. Really, we need to have autoconf for the kernel.
*/
#define unreachable() __builtin_unreachable()
/* Mark a function definition as prohibited from being cloned. */
#define __noclone __attribute__((__noclone__))
/*
* Tell the optimizer that something else uses this function or variable.
*/
#define __visible __attribute__((externally_visible))
/*
* GCC 'asm goto' miscompiles certain code sequences:
*
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
*
* Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
*
* (asm goto is automatically volatile - the naming reflects this.)
*/
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
#define __HAVE_BUILTIN_BSWAP32__
#define __HAVE_BUILTIN_BSWAP64__
#define __HAVE_BUILTIN_BSWAP16__
#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */

File diff suppressed because it is too large Load diff