Verified Commit 606b7234 authored by Julian Braha's avatar Julian Braha 🤸🏻 Committed by Alexey Min
Browse files

motorola-ali: new device (Motorola Moto G6) (MR 1071)

[ci:skip-build] already built on CI in MR
parent 9e923e05
Pipeline #137529791 passed with stages
in 1 minute and 48 seconds
# Contributor: Julian Braha <julianbraha@gmail.com>
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-motorola-ali
pkgdesc="Motorola Moto G6"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="postmarketos-base linux-motorola-ali mkbootimg mesa-dri-swrast msm-fb-refresher mdss-fb-init-hack"
makedepends="devicepkg-dev"
source="deviceinfo initfs-hook.sh directfbrc fb.modes"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
install -Dm644 "$srcdir"/fb.modes "$pkgdir"/etc/fb.modes
install -Dm644 "$srcdir"/directfbrc "$pkgdir"/etc/directfbrc
}
sha512sums="2ef6a7490b157f16afe11121c1b5d584bfd357a218bff2d04dac6b212dc3a978cf3721c96bd04bc612d079ae3e0f6793c864be2fa89fd417242982b808981278 deviceinfo
977537b59e0f89d0db475108baae1d93a6678569ec4d7ab7c909562ebea7d645efb6a73b509b3e37369c1c556a8760cd9f46ba4e9bbb86e400cabcc0c2960230 initfs-hook.sh
3db3ec596e159be926ea2b5b2496c18e9bc7be24a64a232a56c89a0c9ee710aa2efb2b6fa9fc08efa34759e8242e6c629d08a4ce688ec8aa125830717c191515 directfbrc
e8ee37f49b360e06f7b5d54a93fcd2a7b3261436b2a228e8457a5c44fb52510f6173332155701a9d8ed435466732921ea5836aed73f1e7bc4049635f5a71fb31 fb.modes"
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="Motorola Moto G6"
deviceinfo_manufacturer="Motorola"
deviceinfo_codename="motorola-ali"
deviceinfo_year="2018"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="armv7"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="false"
deviceinfo_screen_width="1080"
deviceinfo_screen_height="2160"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=30 msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 firmware_class.path=/vendor/firmware_mnt/image loop.max_part=7 vmalloc=400M buildvariant=user"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_offset_base="0x80000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"
mode "1080x2160-60"
# D: 156.104 MHz, H: 131.180 kHz, V: 60.009 Hz
geometry 1080 2160 1080 2160 16
timings 6406 53 53 24 1 4 1
accel false
rgba 8/0,8/8,8/16,8/24
endmode
#!/bin/sh
# enable touchscreen
echo 1 > /sys/devices/soc/78b7000.i2c/i2c-3/3-0020/drv_irq
# fixes the "boot to black screen" issue
echo 0 0 > /sys/class/graphics/fb0/pan
From 51a1339a3206ed275b8021958a9a8d237322f9fa Mon Sep 17 00:00:00 2001
From: NeKit <nekit1000@gmail.com>
Date: Sun, 10 Dec 2017 14:41:20 +0300
Subject: [PATCH] Fix compile errors with gcc6 on postmarketOS
Change-Id: I1f426c864a0377b33b27da5cc6476f6ff888b6cb
---
arch/arm/include/asm/ftrace.h | 2 +-
arch/arm/kernel/return_address.c | 5 -----
include/linux/i2c/twl.h | 2 +-
kernel/timeconst.pl | 2 +-
scripts/mod/elf.h | 5 -----
5 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
index f89515adac6..2bb8cac28b9 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 0b13a72f855..8bf0a5abec9 100644
--- a/arch/arm/kernel/return_address.c
+++ b/arch/arm/kernel/return_address.c
@@ -62,11 +62,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);
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 947543a0fba..ec7c8855117 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -735,7 +735,7 @@ static inline int twl4030_remove_script(u8 flags) { return -EINVAL; }
#ifdef CONFIG_TWL6030_POWER
extern void twl6030_power_init(struct twl4030_power_data *power_data);
#else
-extern inline void twl6030_power_init(struct twl4030_power_data *power_data) { }
+static inline void twl6030_power_init(struct twl4030_power_data *power_data) { }
#endif
struct twl4030_codec_audio_data {
diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
index eb51d76e058..2ccb8fb87a1 100644
--- a/kernel/timeconst.pl
+++ b/kernel/timeconst.pl
@@ -370,7 +370,7 @@ if ($hz eq '--can') {
}
@val = @{$canned_values{$hz}};
- if (!defined(@val)) {
+ if (!@val) {
@val = compute_values($hz);
}
output($hz, @val);
diff --git a/scripts/mod/elf.h b/scripts/mod/elf.h
index aba4d0c4c1c..f898d3ee28b 100644
--- a/scripts/mod/elf.h
+++ b/scripts/mod/elf.h
@@ -22,8 +22,6 @@
/* #include <features.h> */
-__BEGIN_DECLS
-
/* Standard ELF types. */
#include <stdint.h>
@@ -2507,7 +2505,4 @@ typedef Elf32_Addr Elf32_Conflict;
/* Keep this the last entry. */
#define R_V850_NUM 25
-
-__END_DECLS
-
#endif /* elf.h */
--
2.13.2
diff --git a/drivers/staging/prima/CORE/VOSS/src/wlan_nv_template_builtin.c b/drivers/staging/prima/CORE/VOSS/src/wlan_nv_template_builtin.c
@@ -582,8 +582,7 @@
(char *)&nvDefaults.tables.hwCalValues.calData),"psSlpTimeOvrHdxLNA5G"},
{"ed",_ID_U8,SINGULAR,0,0,0,
((char *)&(nvDefaults.tables.hwCalValues.calData.psSlpTimeOvrHdxLNA5G) -
- (char *)&nvDefaults.tables.hwCalValues.calData) + sizeof(uint16),
- "nv_TxBBFSel9MHz"},
+ (char *)&nvDefaults.tables.hwCalValues.calData),"nv_TxBBFSel9MHz"},
{"ee",_ID_U8,SINGULAR,0,0,0,
((char *)&(nvDefaults.tables.hwCalValues.calData.hwParam2) -
(char *)&nvDefaults.tables.hwCalValues.calData),"hwParam2"},
@@ -839,4 +838,4 @@
int getTableNoOfFields(int tblIdx)
{
return tableNoOfFieldArray[tblIdx];
-}
+}
diff --git a/drivers/video/msm/msm_dba/msm_dba.c b/drivers/video/msm/msm_dba/msm_dba.c
index cc6512a..eb073a7 100644
--- a/drivers/video/msm/msm_dba/msm_dba.c
+++ b/drivers/video/msm/msm_dba/msm_dba.c
@@ -22,7 +22,7 @@
#include <linux/err.h>
#include <video/msm_dba.h>
-#include <msm_dba_internal.h>
+#include "msm_dba_internal.h"
static DEFINE_MUTEX(register_mutex);
diff --git a/drivers/net/ethernet/msm/rndis_ipa_trace.h b/drivers/net/ethernet/msm/rndis_ipa_trace.h
index c0fc573..c18046b 100644
--- a/drivers/net/ethernet/msm/rndis_ipa_trace.h
+++ b/drivers/net/ethernet/msm/rndis_ipa_trace.h
@@ -77,5 +77,5 @@ TRACE_EVENT(
/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_PATH ../../drivers/net/ethernet/msm/
#include <trace/define_trace.h>
diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h b/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h
index d70abdf..7f7e452 100644
--- a/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h
+++ b/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h
@@ -131,5 +131,5 @@ TRACE_EVENT(
/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_PATH ../../drivers/platform/msm/ipa/ipa_v2/
#include <trace/define_trace.h>
diff --git a/drivers/input/misc/vl53L0/inc/stmvl53l0-cci.h b/drivers/input/misc/vl53L0/inc/stmvl53l0-cci.h
new file mode 100644
index 0000000..d8c3b77
--- /dev/null
+++ b/drivers/input/misc/vl53L0/inc/stmvl53l0-cci.h
@@ -0,0 +1,65 @@
+/*
+ * stmvl53l0-cci.h - Linux kernel modules for STM VL53L0 FlightSense TOF sensor
+ *
+ * Copyright (C) 2015 STMicroelectronics Imaging Division
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/*
+ * Defines
+ */
+#ifndef STMVL53L0_CCI_H
+#define STMVL53L0_CCI_H
+#include <linux/types.h>
+
+#include <soc/qcom/camera2.h>
+#include "msm_camera_i2c.h"
+#include "msm_camera_dt_util.h"
+#include "msm_camera_io_util.h"
+#include "msm_cci.h"
+
+#define MSM_TOF_MAX_VREGS (10)
+
+struct msm_tof_vreg {
+ struct camera_vreg_t *cam_vreg;
+ void *data[MSM_TOF_MAX_VREGS];
+ int num_vreg;
+};
+
+struct cci_data {
+ struct msm_camera_i2c_client g_client;
+ struct msm_camera_i2c_client *client;
+ struct platform_device *pdev;
+ enum msm_camera_device_type_t device_type;
+ enum cci_i2c_master_t cci_master;
+ struct msm_tof_vreg vreg_cfg;
+ struct msm_sd_subdev msm_sd;
+ struct v4l2_subdev sdev;
+ struct v4l2_subdev_ops *subdev_ops;
+ char subdev_initialized;
+ uint32_t subdev_id;
+ uint8_t power_up;
+ uint32_t lowv;
+ uint32_t highv;
+ uint32_t xtalk;
+ struct msm_camera_gpio_conf gconf;
+ struct msm_pinctrl_info pinctrl_info;
+};
+int stmvl53l0_init_cci(void);
+void stmvl53l0_exit_cci(void *);
+int stmvl53l0_power_down_cci(void *);
+int stmvl53l0_power_up_cci(void *, unsigned int *);
+
+#endif /* STMVL53L0_CCI_H */
diff --git a/drivers/input/misc/vl53L0/inc/stmvl53l0-i2c.h b/drivers/input/misc/vl53L0/inc/stmvl53l0-i2c.h
new file mode 100644
index 0000000..a75a9e5
--- /dev/null
+++ b/drivers/input/misc/vl53L0/inc/stmvl53l0-i2c.h
@@ -0,0 +1,47 @@
+/*
+ * stmvl53l0-i2c.h - Linux kernel modules for STM VL53L0 FlightSense TOF sensor
+ *
+ * Copyright (C) 2015 STMicroelectronics Imaging Division
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/*
+ * Defines
+ */
+#ifndef STMVL53L0_I2C_H
+#define STMVL53L0_I2C_H
+#include <linux/types.h>
+#include <soc/qcom/camera2.h>
+#include "msm_camera_i2c.h"
+#include "msm_camera_dt_util.h"
+#include "msm_camera_io_util.h"
+#include "msm_cci.h"
+
+struct i2c_data {
+ struct i2c_client *client;
+ struct regulator *vana;
+ uint8_t power_up;
+ uint32_t lowv;
+ uint32_t highv;
+ uint32_t xtalk;
+ struct msm_camera_gpio_conf gconf;
+ struct msm_pinctrl_info pinctrl_info;
+};
+int stmvl53l0_init_i2c(void);
+void stmvl53l0_exit_i2c(void *);
+int stmvl53l0_power_up_i2c(void *, unsigned int *);
+int stmvl53l0_power_down_i2c(void *);
+
+#endif /* STMVL53L0_I2C_H */
diff --git a/drivers/input/misc/vl53L0/inc/stmvl53l0.h b/drivers/input/misc/vl53L0/inc/stmvl53l0.h
new file mode 100644
index 0000000..4ae84c9
--- /dev/null
+++ b/drivers/input/misc/vl53L0/inc/stmvl53l0.h
@@ -0,0 +1,201 @@
+/*
+ * stmvl53l0.h - Linux kernel modules for STM VL53L0 FlightSense TOF sensor
+ *
+ * Copyright (C) 2015 STMicroelectronics Imaging Division
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/*
+ * Defines
+ */
+#ifndef STMVL53L0_H
+#define STMVL53L0_H
+
+#include <linux/types.h>
+#include <linux/mutex.h>
+#include <linux/workqueue.h>
+#include <linux/miscdevice.h>
+
+#define STMVL53L0_DRV_NAME "stmvl53l0"
+#define STMVL53L0_SLAVE_ADDR (0x52>>1)
+
+#define DRIVER_VERSION "1.1.18"
+#define DRIVER_VERSION_NUM 18
+#define I2C_M_WR 0x00
+/* #define INT_POLLING_DELAY 20 */
+
+/* if don't want to have output from vl6180_dbgmsg, comment out #DEBUG macro */
+/*#define DEBUG*/
+/* #define vl6180_dbgmsg(str, args...) pr_debug("%s: " str, __func__, ##args) */
+#define vl53l0_dbgmsg_en(str, args...) \
+ pr_debug("%s: " str, __func__, ##args)
+
+#define vl53l0_dbgmsg(str, args...) \
+ pr_debug("%s: " str, __func__, ##args)
+/* #define vl6180_errmsg(str, args...) pr_err("%s: " str, __func__, ##args) */
+#define vl53l0_errmsg(str, args...) \
+ printk(KERN_ERR "%s: " str, __func__, ##args)
+
+#define VL53L0_VDD_MIN 2850000
+#define VL53L0_VDD_MAX 2850000
+/*driver working mode*/
+#define OFF_MODE 0
+#define CAM_MODE 1
+#define SAR_MODE 2
+#define SUPER_MODE 3
+#define XTALKCAL_MODE 4
+#define OFFSETCAL_MODE 5
+
+/*user actions*/
+#define CAM_ON 0
+#define CAM_OFF 1
+#define SAR_ON 2
+#define SAR_OFF 3
+#define XTALKCAL_ON 4
+#define OFFSETCAL_ON 5
+#define CAL_OFF 6
+#define RESET 7
+/*parameter types*/
+#define OFFSET_PAR 0
+#define XTALKRATE_PAR 1
+#define XTALKENABLE_PAR 2
+#define SIGMAVAL_PRA 3
+#define SIGMACTL_PRA 4
+#define WRAPAROUNDCTL_PRA 5
+#define INTERMEASUREMENTPERIOD_PAR 6
+#define MEASUREMENTTIMINGBUDGET_PAR 7
+#define SGLVAL_PRA 8
+#define SGLCTL_PRA 9
+#define CUTV_PRA 10
+#define DRVV_PRA 11
+#define PLLPRE_PRA 12
+#define PLLFINAL_PRA 13
+#define CCI_BUS 0
+#define I2C_BUS 1
+
+
+/*
+ * IOCTL register data structs
+ */
+struct stmvl53l0_register {
+ uint32_t is_read; /*1: read 0: #define write*/
+ uint32_t reg_index;
+ uint32_t reg_bytes;
+ uint32_t reg_data;
+ int32_t status;
+};
+
+/*
+ * IOCTL parameter structs
+ */
+struct stmvl53l0_parameter {
+ uint32_t is_read; /*1: Get 0: Set*/
+ uint32_t name;
+ int32_t value;
+ int32_t status;
+};
+
+/*
+ * driver data structs
+ */
+struct stmvl53l0_data {
+ /* embed ST VL53L0 Dev data as "dev_data" */
+ VL53L0_DevData_t Data;
+ /* i2c device address user specific field */
+ uint8_t I2cDevAddr;
+ uint8_t comms_type;
+ uint16_t comms_speed_khz;
+
+ struct cci_data cci_client_object;
+ struct i2c_data i2c_client_object;
+ void *client_object;
+ struct mutex update_lock;
+ struct delayed_work dwork; /* for PS work handler */
+ struct delayed_work initwork;
+ struct delayed_work resetwork;
+ struct delayed_work checkwork;
+ struct input_dev *input_dev_ps;
+ struct kobject *range_kobj;
+
+ const char *dev_name;
+
+ /* misc device */
+ struct miscdevice miscdev;
+
+ int irq;
+ unsigned int reset;
+
+ /* control flag from HAL */
+ unsigned int enable_ps_sensor;
+
+ /* PS parameters */
+ unsigned int ps_is_singleshot;
+ unsigned int ps_is_started;
+ unsigned int ps_data; /* to store PS data */
+
+ /* Range Data */
+ VL53L0_RangingMeasurementData_t rangeData;
+ int offset;
+ int xtalk;
+
+ /* delay time in miniseconds*/
+ unsigned int delay_ms;
+
+ struct mutex work_mutex;
+ /* Debug */
+ unsigned int enableDebug;
+ uint8_t interrupt_received;
+ int d_mode;
+ uint8_t w_mode;
+ /*for SAR mode indicate low range interrupt*/
+ uint8_t lowint;
+ uint8_t bus_type;
+ uint32_t lowv;
+ uint32_t highv;
+ wait_queue_head_t range_data_wait;
+ uint8_t d_ready;
+ uint8_t cut_v;
+ unsigned int xtalkCalDistance;
+ unsigned int offsetCalDistance;
+ unsigned int xtalkcalval;
+ VL53L0_GpioFunctionality gpio_function;
+ uint8_t c_suspend;
+ uint8_t c_stopped;
+ uint32_t refSpadCount;
+ uint8_t isApertureSpads;
+ uint8_t VhvSettings;
+ uint8_t PhaseCal;
+ uint8_t pll_p;
+ uint8_t pll_f;
+};
+
+/*
+ * funtion pointer structs
+ */
+struct stmvl53l0_module_fn_t {
+ int (*init)(void);
+ void (*deinit)(void *);
+ int (*power_up)(void *, unsigned int *);
+ int (*power_down)(void *);
+};
+
+struct stmvl53l0_data *stmvl53l0_getobject(void);
+int stmvl53l0_setup(struct stmvl53l0_data *data, uint8_t type);
+int stmvl53l0_checkmoduleid(struct stmvl53l0_data *data,
+ void *client, uint8_t type);
+int stmvl53l0_livechecking(struct stmvl53l0_data *data);
+void i2c_setclient(void *client, uint8_t type);
+
+#endif /* STMVL53L0_H */
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/ali_defconfig
pkgname=linux-motorola-ali
pkgver=3.18.140
pkgrel=0
pkgdesc="Motorola Moto G6 kernel fork"
arch="armv7"
_carch="arm"
_flavor="motorola-ali"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev dtbtool gcc6"
# Compiler: GCC 6 (doesn't boot when compiled with newer versions)
if [ "${CC:0:5}" != "gcc6-" ]; then
CC="gcc6-$CC"
HOSTCC="gcc6-gcc"
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
fi
# Source
_repository="kernel-msm"
_commit="974646412f6e865f6847a7c6b72528f3a14bdb56"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/Uclydde/$_repository/archive/$_commit.tar.gz
$_config
01_prima_gcc6.patch
04_fix_stmvl53l0_headers.patch
fix_focaltech_recursive_dependency.patch
fix_mdp_ctrl_off.patch
fix_fb.patch