diff options
28 files changed, 345 insertions, 131 deletions
diff --git a/AndroidKernel.mk b/AndroidKernel.mk index 1e4726094308..1cce0204bfc9 100644 --- a/AndroidKernel.mk +++ b/AndroidKernel.mk @@ -187,9 +187,11 @@ $(KERNEL_HEADERS_INSTALL): $(KERNEL_OUT) echo $(KERNEL_CONFIG_OVERRIDE) >> $(KERNEL_OUT)/.config; \ $(MAKE) -C $(TARGET_KERNEL_SOURCE) O=$(BUILD_ROOT_LOC)$(KERNEL_OUT) $(KERNEL_MAKE_ENV) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) $(real_cc) oldconfig; fi +.PHONY: kerneltags kerneltags: $(KERNEL_OUT) $(KERNEL_CONFIG) $(MAKE) -C $(TARGET_KERNEL_SOURCE) O=$(BUILD_ROOT_LOC)$(KERNEL_OUT) $(KERNEL_MAKE_ENV) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) $(real_cc) tags +.PHONY: kernelconfig kernelconfig: $(KERNEL_OUT) $(KERNEL_CONFIG) env KCONFIG_NOTIMESTAMP=true \ $(MAKE) -C $(TARGET_KERNEL_SOURCE) O=$(BUILD_ROOT_LOC)$(KERNEL_OUT) $(KERNEL_MAKE_ENV) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) $(real_cc) menuconfig @@ -408,6 +408,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE) KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds +CLANG_FLAGS := # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) @@ -618,21 +619,23 @@ all: vmlinux ifeq ($(cc-name),clang) ifneq ($(CROSS_COMPILE),) CLANG_TRIPLE ?= $(CROSS_COMPILE) -CLANG_TARGET := --target=$(notdir $(CLANG_TRIPLE:%-=%)) -ifeq ($(shell $(srctree)/scripts/clang-android.sh $(CC) $(CLANG_TARGET)), y) +CLANG_FLAGS += --target=$(notdir $(CLANG_TRIPLE:%-=%)) +ifeq ($(shell $(srctree)/scripts/clang-android.sh $(CC) $(CLANG_FLAGS)), y) $(error "Clang with Android --target detected. Did you specify CLANG_TRIPLE?") endif GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit)) -CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR) +CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR) GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..) endif ifneq ($(GCC_TOOLCHAIN),) -CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN) -endif -KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) -KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) -KBUILD_CFLAGS += $(call cc-option, -no-integrated-as) -KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) +CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN) +endif +CLANG_FLAGS += -no-integrated-as +CLANG_FLAGS += -Werror=unknown-warning-option +CLANG_FLAGS += $(call cc-option, -Wno-misleading-indentation) +CLANG_FLAGS += $(call cc-option, -Wno-bool-operation) +KBUILD_CFLAGS += $(CLANG_FLAGS) +KBUILD_AFLAGS += $(CLANG_FLAGS) endif # The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default diff --git a/arch/arm64/configs/vendor/msm-perf_defconfig b/arch/arm64/configs/vendor/msm-perf_defconfig new file mode 120000 index 000000000000..8b124b7e4bbe --- /dev/null +++ b/arch/arm64/configs/vendor/msm-perf_defconfig @@ -0,0 +1 @@ +../msm-perf_defconfig
\ No newline at end of file diff --git a/arch/arm64/configs/vendor/msm_defconfig b/arch/arm64/configs/vendor/msm_defconfig new file mode 120000 index 000000000000..b3d2530373fa --- /dev/null +++ b/arch/arm64/configs/vendor/msm_defconfig @@ -0,0 +1 @@ +../msm_defconfig
\ No newline at end of file diff --git a/arch/arm64/configs/vendor/msmcortex-perf_defconfig b/arch/arm64/configs/vendor/msmcortex-perf_defconfig new file mode 120000 index 000000000000..4af6507b9e8e --- /dev/null +++ b/arch/arm64/configs/vendor/msmcortex-perf_defconfig @@ -0,0 +1 @@ +../msmcortex-perf_defconfig
\ No newline at end of file diff --git a/arch/arm64/configs/vendor/msmcortex_defconfig b/arch/arm64/configs/vendor/msmcortex_defconfig new file mode 120000 index 000000000000..da30fee62781 --- /dev/null +++ b/arch/arm64/configs/vendor/msmcortex_defconfig @@ -0,0 +1 @@ +../msmcortex_defconfig
\ No newline at end of file diff --git a/arch/arm64/configs/vendor/msmcortex_mediabox-perf_defconfig b/arch/arm64/configs/vendor/msmcortex_mediabox-perf_defconfig new file mode 120000 index 000000000000..87c3757d6db5 --- /dev/null +++ b/arch/arm64/configs/vendor/msmcortex_mediabox-perf_defconfig @@ -0,0 +1 @@ +../msmcortex_mediabox-perf_defconfig
\ No newline at end of file diff --git a/arch/arm64/configs/vendor/msmcortex_mediabox_defconfig b/arch/arm64/configs/vendor/msmcortex_mediabox_defconfig new file mode 120000 index 000000000000..9d87f6373ed9 --- /dev/null +++ b/arch/arm64/configs/vendor/msmcortex_mediabox_defconfig @@ -0,0 +1 @@ +../msmcortex_mediabox_defconfig
\ No newline at end of file diff --git a/arch/arm64/configs/vendor/sdm660-perf_defconfig b/arch/arm64/configs/vendor/sdm660-perf_defconfig new file mode 120000 index 000000000000..5a629cc6da53 --- /dev/null +++ b/arch/arm64/configs/vendor/sdm660-perf_defconfig @@ -0,0 +1 @@ +../sdm660-perf_defconfig
\ No newline at end of file diff --git a/arch/arm64/configs/vendor/sdm660_defconfig b/arch/arm64/configs/vendor/sdm660_defconfig new file mode 120000 index 000000000000..b1f9b548fbd6 --- /dev/null +++ b/arch/arm64/configs/vendor/sdm660_defconfig @@ -0,0 +1 @@ +../sdm660_defconfig
\ No newline at end of file diff --git a/drivers/misc/lkdtm.c b/drivers/misc/lkdtm.c index 849592f45889..58f2aef5d236 100644 --- a/drivers/misc/lkdtm.c +++ b/drivers/misc/lkdtm.c @@ -348,7 +348,7 @@ static noinline void corrupt_stack(void) /* Use default char array length that triggers stack protection. */ char data[8]; - memset((void *)data, 0, 64); + memset((void *)data, 0, sizeof(char)*8); } static void execute_location(void *dst) diff --git a/drivers/power/supply/qcom/qpnp-fg-gen3.c b/drivers/power/supply/qcom/qpnp-fg-gen3.c index a546621d0837..32fb0538cc8c 100644 --- a/drivers/power/supply/qcom/qpnp-fg-gen3.c +++ b/drivers/power/supply/qcom/qpnp-fg-gen3.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -2608,7 +2608,7 @@ static void clear_cycle_counter(struct fg_chip *chip) } rc = fg_sram_write(chip, CYCLE_COUNT_WORD, CYCLE_COUNT_OFFSET, (u8 *)&chip->cyc_ctr.count, - sizeof(chip->cyc_ctr.count) / sizeof(u8 *), + sizeof(chip->cyc_ctr.count) / (sizeof(u8 *)), FG_IMA_DEFAULT); if (rc < 0) pr_err("failed to clear cycle counter rc=%d\n", rc); diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c index b70937a8f5fe..747c245bf78e 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c +++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c @@ -509,8 +509,13 @@ void *hdmi_get_featuredata_from_sysfs_dev(struct device *device, { struct hdmi_tx_ctrl *hdmi_ctrl = NULL; - if (!device || feature_type >= HDMI_TX_FEAT_MAX) { - DEV_ERR("%s: invalid input\n", __func__); + if (!device) { + DEV_ERR("%s: invalid device data\n", __func__); + return NULL; + } + + if (feature_type >= HDMI_TX_FEAT_MAX) { + DEV_ERR("%s: feature_type exceeding max value\n", __func__); return NULL; } @@ -583,8 +588,13 @@ static ssize_t hdmi_tx_sysfs_wta_edid(struct device *dev, hdmi_ctrl = hdmi_tx_get_drvdata_from_sysfs_dev(dev); - if (!hdmi_ctrl || !hdmi_ctrl->edid_buf) { - DEV_ERR("%s: invalid data\n", __func__); + if (!hdmi_ctrl) { + DEV_ERR("%s: invalid hdmi_ctrl data\n", __func__); + return -EINVAL; + } + + if (!hdmi_ctrl->edid_buf) { + DEV_ERR("%s: invalid edid_buf data\n", __func__); return -EINVAL; } @@ -635,8 +645,13 @@ static ssize_t hdmi_tx_sysfs_rda_edid(struct device *dev, hdmi_ctrl = hdmi_tx_get_drvdata_from_sysfs_dev(dev); - if (!hdmi_ctrl || !hdmi_ctrl->edid_buf) { - DEV_ERR("%s: invalid data\n", __func__); + if (!hdmi_ctrl) { + DEV_ERR("%s: invalid hdmi_ctrl data\n", __func__); + return -EINVAL; + } + + if (!hdmi_ctrl->edid_buf) { + DEV_ERR("%s: invalid edid_buf data\n", __func__); return -EINVAL; } @@ -1495,8 +1510,13 @@ static int hdmi_tx_sysfs_create(struct hdmi_tx_ctrl *hdmi_ctrl, { int rc; - if (!hdmi_ctrl || !fbi) { - DEV_ERR("%s: invalid input\n", __func__); + if (!hdmi_ctrl) { + DEV_ERR("%s: invalid hdmi_ctrl data\n", __func__); + return -ENODEV; + } + + if (!fbi) { + DEV_ERR("%s: invalid fb_info data\n", __func__); return -ENODEV; } @@ -2163,8 +2183,14 @@ static int hdmi_tx_init_features(struct hdmi_tx_ctrl *hdmi_ctrl, int ret = 0; u32 deinit_features = 0; - if (!hdmi_ctrl || !fbi) { - DEV_ERR("%s: invalid input\n", __func__); + if (!hdmi_ctrl) { + DEV_ERR("%s: invalid hdmi_ctrl data\n", __func__); + ret = -EINVAL; + goto end; + } + + if (!fbi) { + DEV_ERR("%s: invalid fb_info data\n", __func__); ret = -EINVAL; goto end; } @@ -2761,8 +2787,14 @@ static int hdmi_tx_config_power(struct hdmi_tx_ctrl *hdmi_ctrl, struct dss_module_power *power_data = NULL; char name[MAX_CLIENT_NAME_LEN]; - if (!hdmi_ctrl || module >= HDMI_TX_MAX_PM) { - DEV_ERR("%s: Error: invalid input\n", __func__); + if (!hdmi_ctrl) { + DEV_ERR("%s: invalid hdmi_ctrl data\n", __func__); + rc = -EINVAL; + goto exit; + } + + if (module >= HDMI_TX_MAX_PM) { + DEV_ERR("%s: power_module exceeding max value\n", __func__); rc = -EINVAL; goto exit; } @@ -2829,8 +2861,14 @@ static int hdmi_tx_enable_power(struct hdmi_tx_ctrl *hdmi_ctrl, int rc = 0; struct dss_module_power *power_data = NULL; - if (!hdmi_ctrl || module >= HDMI_TX_MAX_PM) { - DEV_ERR("%s: Error: invalid input\n", __func__); + if (!hdmi_ctrl) { + DEV_ERR("%s: invalid hdmi_ctrl data\n", __func__); + rc = -EINVAL; + goto error; + } + + if (module >= HDMI_TX_MAX_PM) { + DEV_ERR("%s: power_module exceeding max value\n", __func__); rc = -EINVAL; goto error; } @@ -3170,8 +3208,13 @@ static int hdmi_tx_audio_info_setup(struct platform_device *pdev, struct hdmi_tx_ctrl *hdmi_ctrl = platform_get_drvdata(pdev); u32 is_mode_dvi; - if (!hdmi_ctrl || !params) { - DEV_ERR("%s: invalid input\n", __func__); + if (!hdmi_ctrl) { + DEV_ERR("%s: invalid hdmi_ctrl data\n", __func__); + return -ENODEV; + } + + if (!params) { + DEV_ERR("%s: invalid audio_setup params\n", __func__); return -ENODEV; } @@ -4637,8 +4680,14 @@ static int hdmi_tx_get_dt_clk_data(struct device *dev, struct dss_module_power *hpd_power_data = NULL; struct dss_module_power *core_power_data = NULL; - if (!dev || !pdata) { - pr_err("%s: invalid input\n", __func__); + if (!dev) { + pr_err("%s: invalid device data\n", __func__); + rc = -EINVAL; + goto exit; + } + + if (!pdata) { + pr_err("%s: invalid hdmi platform data\n", __func__); rc = -EINVAL; goto exit; } @@ -4711,8 +4760,13 @@ static int hdmi_tx_get_dt_vreg_data(struct device *dev, const char *mod_name = NULL; struct device_node *of_node = NULL; - if (!dev || !mp) { - DEV_ERR("%s: invalid input\n", __func__); + if (!dev) { + DEV_ERR("%s: invalid device data\n", __func__); + return -EINVAL; + } + + if (!mp) { + DEV_ERR("%s: invalid power_module data\n", __func__); return -EINVAL; } @@ -4901,15 +4955,20 @@ static int hdmi_tx_get_dt_gpio_data(struct device *dev, struct dss_gpio *gpio_list = NULL; struct device_node *of_node = NULL; - DEV_DBG("%s: module: '%s'\n", __func__, hdmi_tx_pm_name(module_type)); + if (!dev) { + DEV_ERR("%s: invalid device data\n", __func__); + return -EINVAL; + } - if (!dev || !mp) { - DEV_ERR("%s: invalid input\n", __func__); + if (!mp) { + DEV_ERR("%s: invalid power_module data\n", __func__); return -EINVAL; } of_node = dev->of_node; + DEV_DBG("%s: module: '%s'\n", __func__, hdmi_tx_pm_name(module_type)); + switch (module_type) { case HDMI_TX_HPD_PM: gpio_list_size = ARRAY_SIZE(hpd_gpio_config); @@ -4982,8 +5041,14 @@ static void hdmi_tx_put_dt_data(struct device *dev, struct hdmi_tx_platform_data *pdata) { int i; - if (!dev || !pdata) { - DEV_ERR("%s: invalid input\n", __func__); + + if (!dev) { + pr_err("%s: invalid device data\n", __func__); + return; + } + + if (!pdata) { + pr_err("%s: invalid hdmi platform data\n", __func__); return; } @@ -5005,8 +5070,13 @@ static int hdmi_tx_get_dt_data(struct platform_device *pdev, struct hdmi_tx_ctrl *hdmi_ctrl = platform_get_drvdata(pdev); const char *data; - if (!pdev || !pdata) { - DEV_ERR("%s: invalid input\n", __func__); + if (!pdev) { + pr_err("%s: invalid platform_device data\n", __func__); + return -EINVAL; + } + + if (!pdata) { + pr_err("%s: invalid hdmi platform data\n", __func__); return -EINVAL; } diff --git a/gen_headers_arm.bp b/gen_headers_arm.bp index 9ee49cdfad39..9b6721d24b38 100644 --- a/gen_headers_arm.bp +++ b/gen_headers_arm.bp @@ -488,6 +488,8 @@ gen_headers_out_arm = [ "linux/qbt1000.h", "linux/qcedev.h", "linux/qcota.h", + "linux/qg-profile.h", + "linux/qg.h", "linux/qnx4_fs.h", "linux/qnxtypes.h", "linux/qrng.h", diff --git a/gen_headers_arm64.bp b/gen_headers_arm64.bp index e38d6166cbd0..db09deada714 100644 --- a/gen_headers_arm64.bp +++ b/gen_headers_arm64.bp @@ -486,6 +486,8 @@ gen_headers_out_arm64 = [ "linux/qbt1000.h", "linux/qcedev.h", "linux/qcota.h", + "linux/qg-profile.h", + "linux/qg.h", "linux/qnx4_fs.h", "linux/qnxtypes.h", "linux/qrng.h", diff --git a/include/sound/q6asm-v2.h b/include/sound/q6asm-v2.h index d2d639ec462f..9a6c1c8eefd2 100644 --- a/include/sound/q6asm-v2.h +++ b/include/sound/q6asm-v2.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2018, 2020 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -100,7 +100,7 @@ #define SOFT_PAUSE_ENABLE 1 #define SOFT_PAUSE_DISABLE 0 -#define ASM_ACTIVE_STREAMS_ALLOWED 0x9 +#define ASM_ACTIVE_STREAMS_ALLOWED 0xF /* Control session is used for mapping calibration memory */ #define ASM_CONTROL_SESSION (ASM_ACTIVE_STREAMS_ALLOWED + 1) diff --git a/include/uapi/linux/msm_audio_calibration.h b/include/uapi/linux/msm_audio_calibration.h index f05f9aaddb70..3da0d0842213 100644 --- a/include/uapi/linux/msm_audio_calibration.h +++ b/include/uapi/linux/msm_audio_calibration.h @@ -99,12 +99,24 @@ enum { AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE, AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE, AFE_SIDETONE_IIR_CAL_TYPE, + AFE_LSM_TOPOLOGY_CAL_TYPE, + AFE_LSM_TX_CAL_TYPE, + ADM_LSM_TOPOLOGY_CAL_TYPE, + ADM_LSM_AUDPROC_CAL_TYPE, + ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE, + ADM_AUDPROC_PERSISTENT_CAL_TYPE, MAX_CAL_TYPES, }; #define AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE #define AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE +#define ADM_AUDPROC_PERSISTENT_CAL_TYPE ADM_AUDPROC_PERSISTENT_CAL_TYPE +#define ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE +#define ADM_LSM_AUDPROC_CAL_TYPE ADM_LSM_AUDPROC_CAL_TYPE +#define AFE_LSM_TOPOLOGY_CAL_TYPE AFE_LSM_TOPOLOGY_CAL_TYPE +#define AFE_LSM_TX_CAL_TYPE AFE_LSM_TX_CAL_TYPE +#define ADM_LSM_AUDPROC_CAL_TYPE ADM_LSM_AUDPROC_CAL_TYPE #define AFE_SIDETONE_IIR_CAL_TYPE AFE_SIDETONE_IIR_CAL_TYPE enum { diff --git a/include/uapi/linux/msm_ipa.h b/include/uapi/linux/msm_ipa.h index 296784dcca6d..ca9dd6adc708 100644 --- a/include/uapi/linux/msm_ipa.h +++ b/include/uapi/linux/msm_ipa.h @@ -535,6 +535,9 @@ enum ipa_rm_resource_name { * @IPA_HW_v3_5: IPA hardware version 3.5 * @IPA_HW_v3_5_1: IPA hardware version 3.5.1 * @IPA_HW_v4_0: IPA hardware version 4.0 + * @IPA_HW_v4_1: IPA hardware version 4.1 + * @IPA_HW_v4_2: IPA hardware version 4.2 + * @IPA_HW_v4_5: IPA hardware version 4.5 */ enum ipa_hw_type { IPA_HW_None = 0, @@ -550,10 +553,16 @@ enum ipa_hw_type { IPA_HW_v3_5 = 12, IPA_HW_v3_5_1 = 13, IPA_HW_v4_0 = 14, + IPA_HW_v4_1 = 15, + IPA_HW_v4_2 = 16, + IPA_HW_v4_5 = 17, }; -#define IPA_HW_MAX (IPA_HW_v4_0 + 1) +#define IPA_HW_MAX (IPA_HW_v4_5 + 1) #define IPA_HW_v4_0 IPA_HW_v4_0 +#define IPA_HW_v4_1 IPA_HW_v4_1 +#define IPA_HW_v4_2 IPA_HW_v4_2 +#define IPA_HW_v4_5 IPA_HW_v4_5 /** * struct ipa_rule_attrib - attributes of a routing/filtering diff --git a/include/uapi/linux/qg-profile.h b/include/uapi/linux/qg-profile.h new file mode 100644 index 000000000000..0230b3227f78 --- /dev/null +++ b/include/uapi/linux/qg-profile.h @@ -0,0 +1,68 @@ +#ifndef __QG_PROFILE_H__ +#define __QG_PROFILE_H__ + +#include <linux/ioctl.h> + +/** + * enum profile_table - Table index for battery profile data + */ +enum profile_table { + TABLE_SOC_OCV1, + TABLE_SOC_OCV2, + TABLE_FCC1, + TABLE_FCC2, + TABLE_Z1, + TABLE_Z2, + TABLE_Z3, + TABLE_Z4, + TABLE_Z5, + TABLE_Z6, + TABLE_Y1, + TABLE_Y2, + TABLE_Y3, + TABLE_Y4, + TABLE_Y5, + TABLE_Y6, + TABLE_MAX, +}; + +/** + * struct battery_params - Battery profile data to be exchanged + * @soc: SOC (state of charge) of the battery + * @ocv_uv: OCV (open circuit voltage) of the battery + * @batt_temp: Battery temperature in deci-degree + * @var: 'X' axis param for interpolation + * @table_index:Table index to be used for interpolation + */ +struct battery_params { + int soc; + int ocv_uv; + int fcc_mah; + int slope; + int var; + int batt_temp; + int table_index; +}; + +/* Profile MIN / MAX values */ +#define QG_MIN_SOC 0 +#define QG_MAX_SOC 10000 +#define QG_MIN_OCV_UV 3000000 +#define QG_MAX_OCV_UV 5000000 +#define QG_MIN_VAR 0 +#define QG_MAX_VAR 65535 +#define QG_MIN_FCC_MAH 100 +#define QG_MAX_FCC_MAH 16000 +#define QG_MIN_SLOPE 1 +#define QG_MAX_SLOPE 50000 +#define QG_ESR_SF_MIN 5000 +#define QG_ESR_SF_MAX 20000 + +/* IOCTLs to query battery profile data */ +#define BPIOCXSOC _IOWR('B', 0x01, struct battery_params) /* SOC */ +#define BPIOCXOCV _IOWR('B', 0x02, struct battery_params) /* OCV */ +#define BPIOCXFCC _IOWR('B', 0x03, struct battery_params) /* FCC */ +#define BPIOCXSLOPE _IOWR('B', 0x04, struct battery_params) /* Slope */ +#define BPIOCXVAR _IOWR('B', 0x05, struct battery_params) /* All-other */ + +#endif /* __QG_PROFILE_H__ */ diff --git a/include/uapi/linux/qg.h b/include/uapi/linux/qg.h new file mode 100644 index 000000000000..8bd220fbc6a8 --- /dev/null +++ b/include/uapi/linux/qg.h @@ -0,0 +1,63 @@ +#ifndef __QG_H__ +#define __QG_H__ + +#define MAX_FIFO_LENGTH 16 + +enum qg { + QG_SOC, + QG_OCV_UV, + QG_RBAT_MOHM, + QG_PON_OCV_UV, + QG_GOOD_OCV_UV, + QG_ESR, + QG_CHARGE_COUNTER, + QG_FIFO_TIME_DELTA, + QG_BATT_SOC, + QG_CC_SOC, + QG_ESR_CHARGE_DELTA, + QG_ESR_DISCHARGE_DELTA, + QG_ESR_CHARGE_SF, + QG_ESR_DISCHARGE_SF, + QG_FULL_SOC, + QG_CLEAR_LEARNT_DATA, + QG_SYS_SOC, + QG_VBMS_IBAT, + QG_MAX, +}; + +#define QG_BATT_SOC QG_BATT_SOC +#define QG_CC_SOC QG_CC_SOC +#define QG_ESR_CHARGE_DELTA QG_ESR_CHARGE_DELTA +#define QG_ESR_DISCHARGE_DELTA QG_ESR_DISCHARGE_DELTA +#define QG_ESR_CHARGE_SF QG_ESR_CHARGE_SF +#define QG_ESR_DISCHARGE_SF QG_ESR_DISCHARGE_SF +#define QG_FULL_SOC QG_FULL_SOC +#define QG_CLEAR_LEARNT_DATA QG_CLEAR_LEARNT_DATA +#define QG_SYS_SOC QG_SYS_SOC +#define QG_VBMS_IBAT QG_VBMS_IBAT + +struct fifo_data { + unsigned int v; + unsigned int i; + unsigned int count; + unsigned int interval; +}; + +struct qg_param { + unsigned int data; + bool valid; +}; + +struct qg_kernel_data { + unsigned int seq_no; + unsigned int fifo_time; + unsigned int fifo_length; + struct fifo_data fifo[MAX_FIFO_LENGTH]; + struct qg_param param[QG_MAX]; +}; + +struct qg_user_data { + struct qg_param param[QG_MAX]; +}; + +#endif diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 11a5ae596901..300ab8a51738 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -1606,6 +1606,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, NL80211_FEATURE_SUPPORTS_WMM_ADMISSION) CMD(add_tx_ts, ADD_TX_TS); CMD(update_connect_params, UPDATE_CONNECT_PARAMS); + CMD(update_ft_ies, UPDATE_FT_IES); } /* add into the if now */ #undef CMD diff --git a/scripts/build-all.py b/scripts/build-all.py index 4f02c33d4248..2e88b7cb3f59 100755 --- a/scripts/build-all.py +++ b/scripts/build-all.py @@ -1,6 +1,6 @@ #! /usr/bin/env python2 -# Copyright (c) 2009-2015, The Linux Foundation. All rights reserved. +# Copyright (c) 2009-2015, 2017, 2019, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -45,6 +45,7 @@ build_dir = '../all-kernels' make_command = ["vmlinux", "modules", "dtbs"] all_options = {} compile64 = os.environ.get('CROSS_COMPILE64') +clang_bin = os.environ.get('CLANG_BIN') def error(msg): sys.stderr.write("error: %s\n" % msg) @@ -230,7 +231,7 @@ class Builder(): self.name = name self.defconfig = defconfig - self.confname = self.defconfig.split('/')[-1] + self.confname = re.sub('arch/arm[64]*/configs/', '', self.defconfig) # Determine if this is a 64-bit target based on the location # of the defconfig. @@ -266,34 +267,30 @@ class Builder(): steps.append(ExecStep(['make', 'O=%s' % dest_dir, self.confname], env=self.make_env)) - if not all_options.updateconfigs: - # Build targets can be dependent upon the completion of - # previous build targets, so build them one at a time. + # Build targets can be dependent upon the completion of + # previous build targets, so build them one at a time. + if os.environ.get('ARCH') == "arm64": + cmd_line = ['make', + 'INSTALL_HDR_PATH=%s' % hdri_dir, + 'INSTALL_MOD_PATH=%s' % modi_dir, + 'O=%s' % dest_dir, + 'REAL_CC=%s' % clang_bin] + else: cmd_line = ['make', 'INSTALL_HDR_PATH=%s' % hdri_dir, 'INSTALL_MOD_PATH=%s' % modi_dir, 'O=%s' % dest_dir] - build_targets = [] - for c in make_command: - if re.match(r'^-{1,2}\w', c): - cmd_line.append(c) - else: - build_targets.append(c) - for t in build_targets: - steps.append(ExecStep(cmd_line + [t], env=self.make_env)) - - # Copy the defconfig back. - if all_options.configs or all_options.updateconfigs: - steps.append(ExecStep(['make', 'O=%s' % dest_dir, - 'savedefconfig'], env=self.make_env)) - steps.append(CopyfileStep(savedefconfig, defconfig)) - return steps + build_targets = [] + for c in make_command: + if re.match(r'^-{1,2}\w', c): + cmd_line.append(c) + else: + build_targets.append(c) + for t in build_targets: + steps.append(ExecStep(cmd_line + [t], env=self.make_env)) -def update_config(file, str): - print 'Updating %s with \'%s\'\n' % (file, str) - with open(file, 'a') as defconfig: - defconfig.write(str + '\n') + return steps def scan_configs(): """Get the full list of defconfigs appropriate for this tree.""" @@ -303,21 +300,19 @@ def scan_configs(): r'apq*_defconfig', r'qsd*_defconfig', r'mpq*_defconfig', - r'sdm[0-9]*_defconfig', - ) - arch64_pats = ( - r'msm*_defconfig', - r'sdm[0-9]*_defconfig', + r'sdm*_defconfig', ) for p in arch_pats: for n in glob.glob('arch/arm/configs/' + p): name = os.path.basename(n)[:-10] names.append(Builder(name, n)) - if 'CROSS_COMPILE64' in os.environ: - for p in arch64_pats: - for n in glob.glob('arch/arm64/configs/' + p): - name = os.path.basename(n)[:-10] + "-64" - names.append(Builder(name, n)) + for defconfig in glob.glob('arch/arm*/configs/vendor/*_defconfig'): + target = os.path.basename(defconfig)[:-10] + name = target + "-llvm" + if 'arch/arm64' in defconfig: + name = name + "-64" + names.append(Builder(name, defconfig)) + return names def build_many(targets): @@ -333,8 +328,6 @@ def build_many(targets): tracker = BuildTracker(parallel) for target in targets: - if all_options.updateconfigs: - update_config(target.defconfig, all_options.updateconfigs) steps = target.build() tracker.add_sequence(target.log_name, target.name, steps) tracker.run() @@ -350,25 +343,14 @@ def main(): usage = (""" %prog [options] all -- Build all targets %prog [options] target target ... -- List specific targets - %prog [options] perf -- Build all perf targets - %prog [options] noperf -- Build all non-perf targets""") + """) parser = OptionParser(usage=usage, version=version) - parser.add_option('--configs', action='store_true', - dest='configs', - help="Copy configs back into tree") parser.add_option('--list', action='store_true', dest='list', help='List available targets') parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='Output to stdout in addition to log file') - parser.add_option('--oldconfig', action='store_true', - dest='oldconfig', - help='Only process "make oldconfig"') - parser.add_option('--updateconfigs', - dest='updateconfigs', - help="Update defconfigs with provided option setting, " - "e.g. --updateconfigs=\'CONFIG_USE_THING=y\'") parser.add_option('-j', '--jobs', type='int', dest="jobs", help="Number of simultaneous jobs") parser.add_option('-l', '--load-average', type='int', @@ -391,25 +373,11 @@ def main(): print " %s" % target.name sys.exit(0) - if options.oldconfig: - make_command = ["oldconfig"] - elif options.make_target: + if options.make_target: make_command = options.make_target if args == ['all']: build_many(configs) - elif args == ['perf']: - targets = [] - for t in configs: - if "perf" in t.name: - targets.append(t) - build_many(targets) - elif args == ['noperf']: - targets = [] - for t in configs: - if "perf" not in t.name: - targets.append(t) - build_many(targets) elif len(args) > 0: all_configs = {} for t in configs: diff --git a/scripts/gcc-wrapper.py b/scripts/gcc-wrapper.py index 76fb91c57264..3d1d6fbcaa04 100755 --- a/scripts/gcc-wrapper.py +++ b/scripts/gcc-wrapper.py @@ -1,7 +1,7 @@ #! /usr/bin/env python2 # -*- coding: utf-8 -*- -# Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. +# Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -40,10 +40,6 @@ import subprocess # force LANG to be set to en_US.UTF-8 to get consistent warnings. allowed_warnings = set([ - "core.c:144", - "inet_connection_sock.c:430", - "inet_connection_sock.c:467", - "inet6_connection_sock.c:89", ]) # Capture the name of the object file, can find it. diff --git a/sound/soc/codecs/sdm660_cdc/msm-digital-cdc.c b/sound/soc/codecs/sdm660_cdc/msm-digital-cdc.c index dba4f8b48197..e5f079978398 100644 --- a/sound/soc/codecs/sdm660_cdc/msm-digital-cdc.c +++ b/sound/soc/codecs/sdm660_cdc/msm-digital-cdc.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -42,6 +42,7 @@ #define DEC_SVA 5 #define MSM_DIG_CDC_VERSION_ENTRY_SIZE 32 +#define ADSP_UP 1 static unsigned long rx_digital_gain_reg[] = { MSM89XX_CDC_CORE_RX1_VOL_CTL_B2_CTL, @@ -87,8 +88,13 @@ static int msm_digcdc_clock_control(bool flag) if (flag) { mutex_lock(&pdata->cdc_int_mclk0_mutex); if (atomic_read(&pdata->int_mclk0_enabled) == false) { - if (msm_dig_cdc->regmap->cache_only == true) - return ret; + if (msm_dig_cdc->regmap->cache_only == true) { + if (test_bit(ADSP_UP, + &msm_dig_cdc->status_mask)) + msm_dig_cdc->regmap->cache_only = false; + else + return ret; + } if (pdata->native_clk_set) pdata->digital_cdc_core_clk.clk_freq_in_hz = NATIVE_MCLK_RATE; @@ -1115,9 +1121,11 @@ static int msm_dig_cdc_event_notify(struct notifier_block *block, MSM89XX_CDC_CORE_RX2_B3_CTL, 0x80, 0x00); break; case DIG_CDC_EVENT_SSR_DOWN: + clear_bit(ADSP_UP, &msm_dig_cdc->status_mask); regcache_cache_only(msm_dig_cdc->regmap, true); break; case DIG_CDC_EVENT_SSR_UP: + set_bit(ADSP_UP, &msm_dig_cdc->status_mask); regcache_cache_only(msm_dig_cdc->regmap, false); regcache_mark_dirty(msm_dig_cdc->regmap); @@ -2145,6 +2153,7 @@ static int msm_dig_cdc_probe(struct platform_device *pdev) msm_codec_dais, ARRAY_SIZE(msm_codec_dais)); dev_dbg(&pdev->dev, "%s: registered DIG CODEC 0x%x\n", __func__, dig_cdc_addr); + set_bit(ADSP_UP, &msm_dig_cdc->status_mask); rtn: return ret; } diff --git a/sound/soc/codecs/sdm660_cdc/msm-digital-cdc.h b/sound/soc/codecs/sdm660_cdc/msm-digital-cdc.h index cbb8a8138db8..ab470de460ea 100644 --- a/sound/soc/codecs/sdm660_cdc/msm-digital-cdc.h +++ b/sound/soc/codecs/sdm660_cdc/msm-digital-cdc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2017, 2020 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -62,6 +62,7 @@ struct msm_dig_priv { struct notifier_block *nblock, bool enable); struct tx_mute_work tx_mute_dwork[NUM_DECIMATORS]; + unsigned long status_mask; }; struct dig_ctrl_platform_data { diff --git a/sound/soc/codecs/wcd_cpe_core.c b/sound/soc/codecs/wcd_cpe_core.c index 337c25f869d6..a4ef63bcd32e 100644 --- a/sound/soc/codecs/wcd_cpe_core.c +++ b/sound/soc/codecs/wcd_cpe_core.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2018,2020 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1987,8 +1987,8 @@ struct wcd_cpe_core *wcd_cpe_init(const char *img_fname, } card = codec->component.card->snd_card; - snprintf(proc_name, (sizeof("cpe") + sizeof("_state") + - sizeof(id) - 2), "%s%d%s", cpe_name, id, state_name); + snprintf(proc_name, sizeof(proc_name), "%s%d%s", cpe_name, id, + state_name); entry = snd_info_create_card_entry(card, proc_name, card->proc_root); if (entry) { diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c index 0c672fd89652..df2b5ff24054 100644 --- a/sound/soc/codecs/wsa881x.c +++ b/sound/soc/codecs/wsa881x.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2018,2020 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -362,8 +362,8 @@ static ssize_t wsa881x_swrslave_reg_show(char __user *ubuf, size_t count, continue; swr_read(dbgwsa881x->swr_slave, devnum, i, ®_val, 1); - len = snprintf(tmp_buf, 25, "0x%.3x: 0x%.2x\n", i, - (reg_val & 0xFF)); + len = snprintf(tmp_buf, sizeof(tmp_buf), "0x%.3x: 0x%.2x\n", + i, (reg_val & 0xFF)); if ((total + len) >= count - 1) break; if (copy_to_user((ubuf + total), tmp_buf, len)) { diff --git a/sound/soc/msm/qdsp6v2/q6adm.c b/sound/soc/msm/qdsp6v2/q6adm.c index dc7165263316..b40710cf3f45 100644 --- a/sound/soc/msm/qdsp6v2/q6adm.c +++ b/sound/soc/msm/qdsp6v2/q6adm.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -2423,8 +2423,8 @@ static int adm_arrange_mch_map_v8( } else if (channel_mode == 6) { ep_payload->dev_channel_mapping[0] = PCM_CHANNEL_FL; ep_payload->dev_channel_mapping[1] = PCM_CHANNEL_FR; - ep_payload->dev_channel_mapping[2] = PCM_CHANNEL_LFE; - ep_payload->dev_channel_mapping[3] = PCM_CHANNEL_FC; + ep_payload->dev_channel_mapping[2] = PCM_CHANNEL_FC; + ep_payload->dev_channel_mapping[3] = PCM_CHANNEL_LFE; ep_payload->dev_channel_mapping[4] = PCM_CHANNEL_LS; ep_payload->dev_channel_mapping[5] = PCM_CHANNEL_RS; } else if (channel_mode == 7) { @@ -2432,18 +2432,18 @@ static int adm_arrange_mch_map_v8( ep_payload->dev_channel_mapping[1] = PCM_CHANNEL_FR; ep_payload->dev_channel_mapping[2] = PCM_CHANNEL_FC; ep_payload->dev_channel_mapping[3] = PCM_CHANNEL_LFE; - ep_payload->dev_channel_mapping[4] = PCM_CHANNEL_LB; - ep_payload->dev_channel_mapping[5] = PCM_CHANNEL_RB; + ep_payload->dev_channel_mapping[4] = PCM_CHANNEL_LS; + ep_payload->dev_channel_mapping[5] = PCM_CHANNEL_RS; ep_payload->dev_channel_mapping[6] = PCM_CHANNEL_CS; } else if (channel_mode == 8) { ep_payload->dev_channel_mapping[0] = PCM_CHANNEL_FL; ep_payload->dev_channel_mapping[1] = PCM_CHANNEL_FR; - ep_payload->dev_channel_mapping[2] = PCM_CHANNEL_LFE; - ep_payload->dev_channel_mapping[3] = PCM_CHANNEL_FC; - ep_payload->dev_channel_mapping[4] = PCM_CHANNEL_LS; - ep_payload->dev_channel_mapping[5] = PCM_CHANNEL_RS; - ep_payload->dev_channel_mapping[6] = PCM_CHANNEL_LB; - ep_payload->dev_channel_mapping[7] = PCM_CHANNEL_RB; + ep_payload->dev_channel_mapping[2] = PCM_CHANNEL_FC; + ep_payload->dev_channel_mapping[3] = PCM_CHANNEL_LFE; + ep_payload->dev_channel_mapping[4] = PCM_CHANNEL_LB; + ep_payload->dev_channel_mapping[5] = PCM_CHANNEL_RB; + ep_payload->dev_channel_mapping[6] = PCM_CHANNEL_LS; + ep_payload->dev_channel_mapping[7] = PCM_CHANNEL_RS; } else if (channel_mode == 10) { ep_payload->dev_channel_mapping[0] = PCM_CHANNEL_FL; ep_payload->dev_channel_mapping[1] = PCM_CHANNEL_FR; |
