diff options
| -rw-r--r-- | Documentation/devicetree/bindings/power/supply/qcom/qpnp-fg-gen3.txt (renamed from Documentation/devicetree/bindings/power/qcom-charger/qpnp-fg-gen3.txt) | 1 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/power/supply/qcom/qpnp-fg.txt (renamed from Documentation/devicetree/bindings/power/qcom-charger/qpnp-fg.txt) | 0 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/power/supply/qcom/qpnp-qnovo.txt (renamed from Documentation/devicetree/bindings/power/qcom-charger/qpnp-qnovo.txt) | 0 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/power/supply/qcom/qpnp-smb2.txt (renamed from Documentation/devicetree/bindings/power/qcom-charger/qpnp-smb2.txt) | 0 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/power/supply/qcom/qpnp-smbcharger.txt (renamed from Documentation/devicetree/bindings/power/qcom-charger/qpnp-smbcharger.txt) | 0 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/power/supply/qcom/smb1351-charger.txt (renamed from Documentation/devicetree/bindings/power/qcom-charger/smb1351-charger.txt) | 0 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/power/supply/qcom/smb135x-charger.txt (renamed from Documentation/devicetree/bindings/power/qcom-charger/smb135x-charger.txt) | 0 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/power/supply/qcom/smb138x-charger.txt (renamed from Documentation/devicetree/bindings/power/qcom-charger/smb138x-charger.txt) | 0 | ||||
| -rw-r--r-- | arch/arm/boot/dts/qcom/msm8998.dtsi | 24 | ||||
| -rw-r--r-- | arch/arm/configs/msmcortex_defconfig | 11 | ||||
| -rw-r--r-- | arch/arm/configs/sdm660-perf_defconfig | 7 | ||||
| -rw-r--r-- | arch/arm/configs/sdm660_defconfig | 7 | ||||
| -rw-r--r-- | arch/arm64/Kconfig | 3 | ||||
| -rw-r--r-- | arch/arm64/configs/msm-perf_defconfig | 6 | ||||
| -rw-r--r-- | arch/arm64/configs/msm_defconfig | 6 | ||||
| -rw-r--r-- | arch/arm64/configs/msmcortex-perf_defconfig | 6 | ||||
| -rw-r--r-- | arch/arm64/configs/msmcortex_defconfig | 6 | ||||
| -rw-r--r-- | arch/arm64/configs/sdm660-perf_defconfig | 8 | ||||
| -rw-r--r-- | arch/arm64/configs/sdm660_defconfig | 8 | ||||
| -rw-r--r-- | drivers/char/diag/diagfwd_socket.c | 6 | ||||
| -rw-r--r-- | drivers/clk/qcom/clk-alpha-pll.c | 17 | ||||
| -rw-r--r-- | drivers/clk/qcom/clk-alpha-pll.h | 13 | ||||
| -rw-r--r-- | drivers/clk/qcom/common.c | 9 | ||||
| -rw-r--r-- | drivers/clk/qcom/gcc-sdm660.c | 67 | ||||
| -rw-r--r-- | drivers/platform/msm/ipa/ipa_v2/ipa.c | 13 | ||||
| -rw-r--r-- | drivers/platform/msm/ipa/ipa_v2/ipa_hdr.c | 79 | ||||
| -rw-r--r-- | drivers/platform/msm/ipa/ipa_v2/ipa_i.h | 11 | ||||
| -rw-r--r-- | drivers/platform/msm/ipa/ipa_v3/ipa.c | 13 | ||||
| -rw-r--r-- | drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c | 79 | ||||
| -rw-r--r-- | drivers/platform/msm/ipa/ipa_v3/ipa_i.h | 13 | ||||
| -rw-r--r-- | drivers/power/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/power/Makefile | 2 | ||||
| -rw-r--r-- | drivers/power/power_supply_sysfs.c | 1 | ||||
| -rw-r--r-- | drivers/power/supply/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/power/supply/Makefile | 1 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/Kconfig (renamed from drivers/power/qcom-charger/Kconfig) | 19 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/Makefile (renamed from drivers/power/qcom-charger/Makefile) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/battery_current_limit.c (renamed from drivers/power/qcom-charger/battery_current_limit.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/batterydata-lib.c (renamed from drivers/power/qcom-charger/batterydata-lib.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/bcl_peripheral.c (renamed from drivers/power/qcom-charger/bcl_peripheral.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/fg-core.h (renamed from drivers/power/qcom-charger/fg-core.h) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/fg-memif.c (renamed from drivers/power/qcom-charger/fg-memif.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/fg-reg.h (renamed from drivers/power/qcom-charger/fg-reg.h) | 3 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/fg-util.c (renamed from drivers/power/qcom-charger/fg-util.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/msm_bcl.c (renamed from drivers/power/qcom-charger/msm_bcl.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/pmic-voter.c (renamed from drivers/power/qcom-charger/pmic-voter.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/pmic-voter.h (renamed from drivers/power/qcom-charger/pmic-voter.h) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/qpnp-fg-gen3.c (renamed from drivers/power/qcom-charger/qpnp-fg-gen3.c) | 7 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/qpnp-fg.c (renamed from drivers/power/qcom-charger/qpnp-fg.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/qpnp-qnovo.c (renamed from drivers/power/qcom-charger/qpnp-qnovo.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/qpnp-smb2.c (renamed from drivers/power/qcom-charger/qpnp-smb2.c) | 3 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/qpnp-smbcharger.c (renamed from drivers/power/qcom-charger/qpnp-smbcharger.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/smb-lib.c (renamed from drivers/power/qcom-charger/smb-lib.c) | 26 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/smb-lib.h (renamed from drivers/power/qcom-charger/smb-lib.h) | 2 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/smb-reg.h (renamed from drivers/power/qcom-charger/smb-reg.h) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/smb1351-charger.c (renamed from drivers/power/qcom-charger/smb1351-charger.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/smb135x-charger.c (renamed from drivers/power/qcom-charger/smb135x-charger.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/smb138x-charger.c (renamed from drivers/power/qcom-charger/smb138x-charger.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/storm-watch.c (renamed from drivers/power/qcom-charger/storm-watch.c) | 0 | ||||
| -rw-r--r-- | drivers/power/supply/qcom/storm-watch.h (renamed from drivers/power/qcom-charger/storm-watch.h) | 0 | ||||
| -rw-r--r-- | drivers/usb/gadget/function/f_mbim.c | 3 | ||||
| -rw-r--r-- | include/dt-bindings/clock/qcom,gcc-sdm660.h | 6 | ||||
| -rw-r--r-- | include/linux/power_supply.h | 1 |
63 files changed, 326 insertions, 164 deletions
diff --git a/Documentation/devicetree/bindings/power/qcom-charger/qpnp-fg-gen3.txt b/Documentation/devicetree/bindings/power/supply/qcom/qpnp-fg-gen3.txt index 35d8d0d7d50b..221657780178 100644 --- a/Documentation/devicetree/bindings/power/qcom-charger/qpnp-fg-gen3.txt +++ b/Documentation/devicetree/bindings/power/supply/qcom/qpnp-fg-gen3.txt @@ -118,7 +118,6 @@ First Level Node - FG Gen3 device Definition: Specifies the source of sense resistor. Allowed values are: 0 - Rsense is from Battery FET - 1 - Rsense is external 2 - Rsense is Battery FET and SMB Option 2 can be used only when a parallel charger is present. If this property is not specified, then the diff --git a/Documentation/devicetree/bindings/power/qcom-charger/qpnp-fg.txt b/Documentation/devicetree/bindings/power/supply/qcom/qpnp-fg.txt index f6a7a1ba3005..f6a7a1ba3005 100644 --- a/Documentation/devicetree/bindings/power/qcom-charger/qpnp-fg.txt +++ b/Documentation/devicetree/bindings/power/supply/qcom/qpnp-fg.txt diff --git a/Documentation/devicetree/bindings/power/qcom-charger/qpnp-qnovo.txt b/Documentation/devicetree/bindings/power/supply/qcom/qpnp-qnovo.txt index 96b7dd517231..96b7dd517231 100644 --- a/Documentation/devicetree/bindings/power/qcom-charger/qpnp-qnovo.txt +++ b/Documentation/devicetree/bindings/power/supply/qcom/qpnp-qnovo.txt diff --git a/Documentation/devicetree/bindings/power/qcom-charger/qpnp-smb2.txt b/Documentation/devicetree/bindings/power/supply/qcom/qpnp-smb2.txt index eabdc6a75fbe..eabdc6a75fbe 100644 --- a/Documentation/devicetree/bindings/power/qcom-charger/qpnp-smb2.txt +++ b/Documentation/devicetree/bindings/power/supply/qcom/qpnp-smb2.txt diff --git a/Documentation/devicetree/bindings/power/qcom-charger/qpnp-smbcharger.txt b/Documentation/devicetree/bindings/power/supply/qcom/qpnp-smbcharger.txt index efd64cd90878..efd64cd90878 100644 --- a/Documentation/devicetree/bindings/power/qcom-charger/qpnp-smbcharger.txt +++ b/Documentation/devicetree/bindings/power/supply/qcom/qpnp-smbcharger.txt diff --git a/Documentation/devicetree/bindings/power/qcom-charger/smb1351-charger.txt b/Documentation/devicetree/bindings/power/supply/qcom/smb1351-charger.txt index ab0ac32e444e..ab0ac32e444e 100644 --- a/Documentation/devicetree/bindings/power/qcom-charger/smb1351-charger.txt +++ b/Documentation/devicetree/bindings/power/supply/qcom/smb1351-charger.txt diff --git a/Documentation/devicetree/bindings/power/qcom-charger/smb135x-charger.txt b/Documentation/devicetree/bindings/power/supply/qcom/smb135x-charger.txt index 3eff91a1d112..3eff91a1d112 100644 --- a/Documentation/devicetree/bindings/power/qcom-charger/smb135x-charger.txt +++ b/Documentation/devicetree/bindings/power/supply/qcom/smb135x-charger.txt diff --git a/Documentation/devicetree/bindings/power/qcom-charger/smb138x-charger.txt b/Documentation/devicetree/bindings/power/supply/qcom/smb138x-charger.txt index 0244f910017a..0244f910017a 100644 --- a/Documentation/devicetree/bindings/power/qcom-charger/smb138x-charger.txt +++ b/Documentation/devicetree/bindings/power/supply/qcom/smb138x-charger.txt diff --git a/arch/arm/boot/dts/qcom/msm8998.dtsi b/arch/arm/boot/dts/qcom/msm8998.dtsi index cb3d1fee1f48..cfdbf98af76e 100644 --- a/arch/arm/boot/dts/qcom/msm8998.dtsi +++ b/arch/arm/boot/dts/qcom/msm8998.dtsi @@ -286,34 +286,40 @@ reg = <0 0x85800000 0 0x3700000>; }; - pil_slpi_mem: pil_slpi_region@93800000 { + pil_ipa_gpu_mem: pil_ipa_gpu_region@95000000 { compatible = "removed-dma-pool"; no-map; - reg = <0 0x93800000 0 0xf00000>; + reg = <0 0x95000000 0 0x100000>; }; - pil_video_mem: pil_video_region@93300000 { + pil_slpi_mem: pil_slpi_region@94100000 { compatible = "removed-dma-pool"; no-map; - reg = <0 0x93300000 0 0x500000>; + reg = <0 0x94100000 0 0xf00000>; }; - pil_adsp_mem: pil_adsp_region@91900000 { + pil_video_mem: pil_video_region@93c00000 { compatible = "removed-dma-pool"; no-map; - reg = <0 0x91900000 0 0x1a00000>; + reg = <0 0x93c00000 0 0x500000>; }; - modem_mem: modem_region@8ac00000 { + modem_mem: modem_region@8cc00000 { compatible = "removed-dma-pool"; no-map; - reg = <0 0x8ac00000 0 0x6d00000>; + reg = <0 0x8cc00000 0 0x7000000>; + }; + + pil_adsp_mem: pil_adsp_region@0x8b200000 { + compatible = "removed-dma-pool"; + no-map; + reg = <0 0x8b200000 0 0x1a00000>; }; spss_mem: spss_region@8ab00000 { /* for SPSS-PIL */ compatible = "removed-dma-pool"; no-map; - reg = <0 0x8ab00000 0 0x100000>; + reg = <0 0x8ab00000 0 0x700000>; }; adsp_mem: adsp_region { diff --git a/arch/arm/configs/msmcortex_defconfig b/arch/arm/configs/msmcortex_defconfig index 1831f2c63ca5..fec429d7bd0c 100644 --- a/arch/arm/configs/msmcortex_defconfig +++ b/arch/arm/configs/msmcortex_defconfig @@ -292,15 +292,15 @@ CONFIG_PINCTRL_MSM8998=y CONFIG_PINCTRL_SDM660=y CONFIG_GPIO_SYSFS=y CONFIG_GPIO_QPNP_PIN=y -CONFIG_APSS_CORE_EA=y -CONFIG_MSM_APM=y -CONFIG_QPNP_SMBCHARGER=y -CONFIG_SMB135X_CHARGER=y -CONFIG_SMB1351_USB_CHARGER=y +CONFIG_POWER_SUPPLY=y +CONFIG_QPNP_FG_GEN3=y CONFIG_MSM_BCL_CTL=y CONFIG_MSM_BCL_PERIPHERAL_CTL=y CONFIG_QPNP_SMB2=y CONFIG_SMB138X_CHARGER=y +CONFIG_QPNP_QNOVO=y +CONFIG_APSS_CORE_EA=y +CONFIG_MSM_APM=y CONFIG_SENSORS_QPNP_ADC_VOLTAGE=y CONFIG_THERMAL=y CONFIG_MFD_SPMI_PMIC=y @@ -477,6 +477,7 @@ CONFIG_QCOM_DEVFREQ_DEVBW=y CONFIG_EXTCON=y CONFIG_IIO=y CONFIG_QCOM_RRADC=y +CONFIG_QCOM_TADC=y CONFIG_PWM=y CONFIG_PWM_QPNP=y CONFIG_ARM_GIC_V3_ACL=y diff --git a/arch/arm/configs/sdm660-perf_defconfig b/arch/arm/configs/sdm660-perf_defconfig index d555a1b179d8..cd09f085e6af 100644 --- a/arch/arm/configs/sdm660-perf_defconfig +++ b/arch/arm/configs/sdm660-perf_defconfig @@ -318,20 +318,19 @@ CONFIG_SPMI=y CONFIG_PINCTRL_SDM660=y CONFIG_GPIO_SYSFS=y CONFIG_GPIO_QPNP_PIN=y +CONFIG_POWER_SUPPLY=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_QCOM=y CONFIG_QCOM_DLOAD_MODE=y CONFIG_POWER_RESET_SYSCON=y -CONFIG_APSS_CORE_EA=y -CONFIG_MSM_APM=y -CONFIG_QPNP_SMBCHARGER=y -CONFIG_SMB135X_CHARGER=y CONFIG_SMB1351_USB_CHARGER=y CONFIG_MSM_BCL_CTL=y CONFIG_MSM_BCL_PERIPHERAL_CTL=y CONFIG_BATTERY_BCL=y CONFIG_QPNP_SMB2=y CONFIG_SMB138X_CHARGER=y +CONFIG_APSS_CORE_EA=y +CONFIG_MSM_APM=y CONFIG_SENSORS_QPNP_ADC_VOLTAGE=y CONFIG_THERMAL=y CONFIG_CPU_THERMAL=y diff --git a/arch/arm/configs/sdm660_defconfig b/arch/arm/configs/sdm660_defconfig index 2c94274b0637..8055774d9cdb 100644 --- a/arch/arm/configs/sdm660_defconfig +++ b/arch/arm/configs/sdm660_defconfig @@ -316,20 +316,19 @@ CONFIG_SPMI=y CONFIG_PINCTRL_SDM660=y CONFIG_GPIO_SYSFS=y CONFIG_GPIO_QPNP_PIN=y +CONFIG_POWER_SUPPLY=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_QCOM=y CONFIG_QCOM_DLOAD_MODE=y CONFIG_POWER_RESET_SYSCON=y -CONFIG_APSS_CORE_EA=y -CONFIG_MSM_APM=y -CONFIG_QPNP_SMBCHARGER=y -CONFIG_SMB135X_CHARGER=y CONFIG_SMB1351_USB_CHARGER=y CONFIG_MSM_BCL_CTL=y CONFIG_MSM_BCL_PERIPHERAL_CTL=y CONFIG_BATTERY_BCL=y CONFIG_QPNP_SMB2=y CONFIG_SMB138X_CHARGER=y +CONFIG_APSS_CORE_EA=y +CONFIG_MSM_APM=y CONFIG_SENSORS_QPNP_ADC_VOLTAGE=y CONFIG_THERMAL=y CONFIG_CPU_THERMAL=y diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 0efb7c66e818..8ac5ba251136 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -806,7 +806,6 @@ menu "ARMv8.1 architectural features" config ARM64_HW_AFDBM bool "Support for hardware updates of the Access and Dirty page flags" - default y help The ARMv8.1 architecture extensions introduce support for hardware updates of the access and dirty information in page @@ -823,7 +822,6 @@ config ARM64_HW_AFDBM config ARM64_PAN bool "Enable support for Privileged Access Never (PAN)" - default y help Privileged Access Never (PAN; part of the ARMv8.1 Extensions) prevents the kernel or hypervisor from accessing user-space (EL0) @@ -851,7 +849,6 @@ endmenu config ARM64_UAO bool "Enable support for User Access Override (UAO)" - default y help User Access Override (UAO; part of the ARMv8.2 Extensions) causes the 'unprivileged' variant of the load/store instructions to diff --git a/arch/arm64/configs/msm-perf_defconfig b/arch/arm64/configs/msm-perf_defconfig index 07e413e31234..56bbe8054264 100644 --- a/arch/arm64/configs/msm-perf_defconfig +++ b/arch/arm64/configs/msm-perf_defconfig @@ -326,15 +326,15 @@ CONFIG_POWER_RESET_QCOM=y CONFIG_QCOM_DLOAD_MODE=y CONFIG_POWER_RESET_XGENE=y CONFIG_POWER_RESET_SYSCON=y -CONFIG_MSM_PM=y -CONFIG_APSS_CORE_EA=y -CONFIG_MSM_APM=y CONFIG_QPNP_SMBCHARGER=y CONFIG_QPNP_FG=y CONFIG_SMB135X_CHARGER=y CONFIG_SMB1351_USB_CHARGER=y CONFIG_MSM_BCL_CTL=y CONFIG_MSM_BCL_PERIPHERAL_CTL=y +CONFIG_MSM_PM=y +CONFIG_APSS_CORE_EA=y +CONFIG_MSM_APM=y CONFIG_SENSORS_EPM_ADC=y CONFIG_SENSORS_QPNP_ADC_VOLTAGE=y CONFIG_LIMITS_MONITOR=y diff --git a/arch/arm64/configs/msm_defconfig b/arch/arm64/configs/msm_defconfig index 76d949319dfa..c39a9311e056 100644 --- a/arch/arm64/configs/msm_defconfig +++ b/arch/arm64/configs/msm_defconfig @@ -313,15 +313,15 @@ CONFIG_POWER_RESET_QCOM=y CONFIG_QCOM_DLOAD_MODE=y CONFIG_POWER_RESET_XGENE=y CONFIG_POWER_RESET_SYSCON=y -CONFIG_MSM_PM=y -CONFIG_APSS_CORE_EA=y -CONFIG_MSM_APM=y CONFIG_QPNP_SMBCHARGER=y CONFIG_QPNP_FG=y CONFIG_SMB135X_CHARGER=y CONFIG_SMB1351_USB_CHARGER=y CONFIG_MSM_BCL_CTL=y CONFIG_MSM_BCL_PERIPHERAL_CTL=y +CONFIG_MSM_PM=y +CONFIG_APSS_CORE_EA=y +CONFIG_MSM_APM=y CONFIG_SENSORS_EPM_ADC=y CONFIG_SENSORS_QPNP_ADC_VOLTAGE=y CONFIG_LIMITS_MONITOR=y diff --git a/arch/arm64/configs/msmcortex-perf_defconfig b/arch/arm64/configs/msmcortex-perf_defconfig index 9700145bfdf6..d71cfed7614d 100644 --- a/arch/arm64/configs/msmcortex-perf_defconfig +++ b/arch/arm64/configs/msmcortex-perf_defconfig @@ -316,9 +316,6 @@ CONFIG_POWER_RESET_QCOM=y CONFIG_QCOM_DLOAD_MODE=y CONFIG_POWER_RESET_XGENE=y CONFIG_POWER_RESET_SYSCON=y -CONFIG_MSM_PM=y -CONFIG_APSS_CORE_EA=y -CONFIG_MSM_APM=y CONFIG_QPNP_FG_GEN3=y CONFIG_MSM_BCL_CTL=y CONFIG_MSM_BCL_PERIPHERAL_CTL=y @@ -326,6 +323,9 @@ CONFIG_BATTERY_BCL=y CONFIG_QPNP_SMB2=y CONFIG_SMB138X_CHARGER=y CONFIG_QPNP_QNOVO=y +CONFIG_MSM_PM=y +CONFIG_APSS_CORE_EA=y +CONFIG_MSM_APM=y CONFIG_SENSORS_QPNP_ADC_VOLTAGE=y CONFIG_CPU_THERMAL=y CONFIG_LIMITS_MONITOR=y diff --git a/arch/arm64/configs/msmcortex_defconfig b/arch/arm64/configs/msmcortex_defconfig index 7761c2360675..cbff6b3a5b74 100644 --- a/arch/arm64/configs/msmcortex_defconfig +++ b/arch/arm64/configs/msmcortex_defconfig @@ -318,9 +318,6 @@ CONFIG_POWER_RESET_QCOM=y CONFIG_QCOM_DLOAD_MODE=y CONFIG_POWER_RESET_XGENE=y CONFIG_POWER_RESET_SYSCON=y -CONFIG_MSM_PM=y -CONFIG_APSS_CORE_EA=y -CONFIG_MSM_APM=y CONFIG_QPNP_FG_GEN3=y CONFIG_MSM_BCL_CTL=y CONFIG_MSM_BCL_PERIPHERAL_CTL=y @@ -328,6 +325,9 @@ CONFIG_BATTERY_BCL=y CONFIG_QPNP_SMB2=y CONFIG_SMB138X_CHARGER=y CONFIG_QPNP_QNOVO=y +CONFIG_MSM_PM=y +CONFIG_APSS_CORE_EA=y +CONFIG_MSM_APM=y CONFIG_SENSORS_QPNP_ADC_VOLTAGE=y CONFIG_CPU_THERMAL=y CONFIG_LIMITS_MONITOR=y diff --git a/arch/arm64/configs/sdm660-perf_defconfig b/arch/arm64/configs/sdm660-perf_defconfig index 5866ab18229a..9172e73ce075 100644 --- a/arch/arm64/configs/sdm660-perf_defconfig +++ b/arch/arm64/configs/sdm660-perf_defconfig @@ -318,12 +318,7 @@ CONFIG_POWER_RESET_QCOM=y CONFIG_QCOM_DLOAD_MODE=y CONFIG_POWER_RESET_XGENE=y CONFIG_POWER_RESET_SYSCON=y -CONFIG_MSM_PM=y -CONFIG_APSS_CORE_EA=y -CONFIG_MSM_APM=y -CONFIG_QPNP_SMBCHARGER=y CONFIG_QPNP_FG_GEN3=y -CONFIG_SMB135X_CHARGER=y CONFIG_SMB1351_USB_CHARGER=y CONFIG_MSM_BCL_CTL=y CONFIG_MSM_BCL_PERIPHERAL_CTL=y @@ -331,6 +326,9 @@ CONFIG_BATTERY_BCL=y CONFIG_QPNP_SMB2=y CONFIG_SMB138X_CHARGER=y CONFIG_QPNP_QNOVO=y +CONFIG_MSM_PM=y +CONFIG_APSS_CORE_EA=y +CONFIG_MSM_APM=y CONFIG_SENSORS_QPNP_ADC_VOLTAGE=y CONFIG_CPU_THERMAL=y CONFIG_LIMITS_MONITOR=y diff --git a/arch/arm64/configs/sdm660_defconfig b/arch/arm64/configs/sdm660_defconfig index 3e26679e1bf9..17de7c1a247a 100644 --- a/arch/arm64/configs/sdm660_defconfig +++ b/arch/arm64/configs/sdm660_defconfig @@ -320,12 +320,7 @@ CONFIG_POWER_RESET_QCOM=y CONFIG_QCOM_DLOAD_MODE=y CONFIG_POWER_RESET_XGENE=y CONFIG_POWER_RESET_SYSCON=y -CONFIG_MSM_PM=y -CONFIG_APSS_CORE_EA=y -CONFIG_MSM_APM=y -CONFIG_QPNP_SMBCHARGER=y CONFIG_QPNP_FG_GEN3=y -CONFIG_SMB135X_CHARGER=y CONFIG_SMB1351_USB_CHARGER=y CONFIG_MSM_BCL_CTL=y CONFIG_MSM_BCL_PERIPHERAL_CTL=y @@ -333,6 +328,9 @@ CONFIG_BATTERY_BCL=y CONFIG_QPNP_SMB2=y CONFIG_SMB138X_CHARGER=y CONFIG_QPNP_QNOVO=y +CONFIG_MSM_PM=y +CONFIG_APSS_CORE_EA=y +CONFIG_MSM_APM=y CONFIG_SENSORS_QPNP_ADC_VOLTAGE=y CONFIG_CPU_THERMAL=y CONFIG_LIMITS_MONITOR=y diff --git a/drivers/char/diag/diagfwd_socket.c b/drivers/char/diag/diagfwd_socket.c index 1b19e014af63..888949816dfe 100644 --- a/drivers/char/diag/diagfwd_socket.c +++ b/drivers/char/diag/diagfwd_socket.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2017, 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 @@ -43,8 +43,8 @@ #define LPASS_INST_BASE 64 #define WCNSS_INST_BASE 128 #define SENSORS_INST_BASE 192 -#define WDSP_INST_BASE 256 -#define CDSP_INST_BASE 320 +#define CDSP_INST_BASE 256 +#define WDSP_INST_BASE 320 #define INST_ID_CNTL 0 #define INST_ID_CMD 1 diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index f685e7fe3a4d..375f1420f3bb 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2017, 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 @@ -301,7 +301,12 @@ static int clk_alpha_pll_enable(struct clk_hw *hw) ret = clk_enable_regmap(hw); if (ret) return ret; - return wait_for_pll_enable(pll, PLL_ACTIVE_FLAG); + ret = wait_for_pll_enable(pll, PLL_ACTIVE_FLAG); + if (ret == 0) { + if (pll->flags & SUPPORTS_FSM_VOTE) + *pll->soft_vote |= (pll->soft_vote_mask); + return ret; + } } /* Skip if already enabled */ @@ -351,7 +356,13 @@ static void clk_alpha_pll_disable(struct clk_hw *hw) /* If in FSM mode, just unvote it */ if (val & PLL_VOTE_FSM_ENA) { - clk_disable_regmap(hw); + if (pll->flags & SUPPORTS_FSM_VOTE) { + *pll->soft_vote &= ~(pll->soft_vote_mask); + if (!*pll->soft_vote) + clk_disable_regmap(hw); + } else + clk_disable_regmap(hw); + return; } diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h index dd92bc340f8a..9644ee46f097 100644 --- a/drivers/clk/qcom/clk-alpha-pll.h +++ b/drivers/clk/qcom/clk-alpha-pll.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2017, 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 @@ -32,6 +32,8 @@ struct pll_vco { /** * struct clk_alpha_pll - phase locked loop (PLL) * @offset: base address of registers + * @soft_vote: soft voting variable for multiple PLL software instances + * @soft_vote_mask: soft voting mask for multiple PLL software instances * @vco_table: array of VCO settings * @vco_data: array of VCO data settings like post div * @clkr: regmap clock handle @@ -40,6 +42,13 @@ struct clk_alpha_pll { u32 offset; struct pll_config *config; + u32 *soft_vote; + u32 soft_vote_mask; +/* Soft voting values */ +#define PLL_SOFT_VOTE_PRIMARY BIT(0) +#define PLL_SOFT_VOTE_CPU BIT(1) +#define PLL_SOFT_VOTE_AUX BIT(2) + const struct pll_vco *vco_table; size_t num_vco; @@ -54,6 +63,8 @@ struct clk_alpha_pll { */ #define SUPPORTS_DYNAMIC_UPDATE BIT(1) #define SUPPORTS_SLEW BIT(2) + /* associated with soft_vote for multiple PLL software instances */ +#define SUPPORTS_FSM_VOTE BIT(3) struct clk_regmap clkr; #define PLLOUT_MAIN BIT(0) diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c index c762a387068b..cba778b827ec 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, 2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2014, 2016-2017, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -339,10 +339,11 @@ static unsigned long clk_debug_mux_measure_rate(struct clk_hw *hw) struct clk_debug_mux *meas = to_clk_measure(hw); struct measure_clk_data *data = meas->priv; - spin_lock_irqsave(&clk_reg_lock, flags); clk_prepare_enable(data->cxo); + spin_lock_irqsave(&clk_reg_lock, flags); + /* Enable CXO/4 and RINGOSC branch. */ regmap_read(meas->regmap[GCC], data->xo_div4_cbcr, &gcc_xo4_reg); gcc_xo4_reg |= BIT(0); @@ -376,10 +377,10 @@ static unsigned long clk_debug_mux_measure_rate(struct clk_hw *hw) ret = (raw_count_full * multiplier); } - clk_disable_unprepare(data->cxo); - spin_unlock_irqrestore(&clk_reg_lock, flags); + clk_disable_unprepare(data->cxo); + return ret; } diff --git a/drivers/clk/qcom/gcc-sdm660.c b/drivers/clk/qcom/gcc-sdm660.c index 5b118f297238..719948c71508 100644 --- a/drivers/clk/qcom/gcc-sdm660.c +++ b/drivers/clk/qcom/gcc-sdm660.c @@ -76,6 +76,12 @@ static const char * const gcc_parent_names_1[] = { "core_bi_pll_test_se", }; +static const char * const gcc_parent_names_ao_1[] = { + "cxo_a", + "gpll0_ao_out_main", + "core_bi_pll_test_se", +}; + static const struct parent_map gcc_parent_map_2[] = { { P_XO, 0 }, { P_GPLL0_OUT_MAIN, 1 }, @@ -189,8 +195,13 @@ static struct clk_fixed_factor xo = { }, }; +static unsigned int soft_vote_gpll0; + static struct clk_alpha_pll gpll0_out_main = { .offset = 0x0, + .soft_vote = &soft_vote_gpll0, + .soft_vote_mask = PLL_SOFT_VOTE_PRIMARY, + .flags = SUPPORTS_FSM_VOTE, .clkr = { .enable_reg = 0x52000, .enable_mask = BIT(0), @@ -203,6 +214,23 @@ static struct clk_alpha_pll gpll0_out_main = { }, }; +static struct clk_alpha_pll gpll0_ao_out_main = { + .offset = 0x0, + .soft_vote = &soft_vote_gpll0, + .soft_vote_mask = PLL_SOFT_VOTE_CPU, + .flags = SUPPORTS_FSM_VOTE, + .clkr = { + .enable_reg = 0x52000, + .enable_mask = BIT(0), + .hw.init = &(struct clk_init_data){ + .name = "gpll0_ao_out_main", + .parent_names = (const char *[]){ "cxo_a" }, + .num_parents = 1, + .ops = &clk_alpha_pll_ops, + }, + }, +}; + static struct clk_fixed_factor gpll0_out_early_div = { .mult = 1, .div = 2, @@ -718,7 +746,7 @@ static struct clk_rcg2 hmss_ahb_clk_src = { .freq_tbl = ftbl_hmss_ahb_clk_src, .clkr.hw.init = &(struct clk_init_data){ .name = "hmss_ahb_clk_src", - .parent_names = gcc_parent_names_1, + .parent_names = gcc_parent_names_ao_1, .num_parents = 3, .ops = &clk_rcg2_ops, VDD_DIG_FMAX_MAP3_AO( @@ -741,7 +769,7 @@ static struct clk_rcg2 hmss_gpll0_clk_src = { .freq_tbl = ftbl_hmss_gpll0_clk_src, .clkr.hw.init = &(struct clk_init_data){ .name = "hmss_gpll0_clk_src", - .parent_names = gcc_parent_names_1, + .parent_names = gcc_parent_names_ao_1, .num_parents = 3, .ops = &clk_rcg2_ops, VDD_DIG_FMAX_MAP1_AO( @@ -787,7 +815,7 @@ static struct clk_rcg2 hmss_rbcpr_clk_src = { .freq_tbl = ftbl_hmss_rbcpr_clk_src, .clkr.hw.init = &(struct clk_init_data){ .name = "hmss_rbcpr_clk_src", - .parent_names = gcc_parent_names_1, + .parent_names = gcc_parent_names_ao_1, .num_parents = 3, .ops = &clk_rcg2_ops, VDD_DIG_FMAX_MAP2( @@ -1735,19 +1763,6 @@ static struct clk_branch gcc_gpu_bimc_gfx_clk = { }, }; -static struct clk_branch gcc_gpu_bimc_gfx_src_clk = { - .halt_reg = 0x7100c, - .halt_check = BRANCH_HALT, - .clkr = { - .enable_reg = 0x7100c, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_gpu_bimc_gfx_src_clk", - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_gpu_cfg_ahb_clk = { .halt_reg = 0x71004, .halt_check = BRANCH_VOTED, @@ -1807,19 +1822,6 @@ static struct clk_branch gcc_gpu_gpll0_div_clk = { }, }; -static struct clk_branch gcc_gpu_snoc_dvm_gfx_clk = { - .halt_reg = 0x71018, - .halt_check = BRANCH_HALT, - .clkr = { - .enable_reg = 0x71018, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_gpu_snoc_dvm_gfx_clk", - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_hmss_ahb_clk = { .halt_reg = 0x48000, .halt_check = BRANCH_HALT_VOTED, @@ -2647,11 +2649,9 @@ static struct clk_regmap *gcc_660_clocks[] = { [GCC_GP2_CLK] = &gcc_gp2_clk.clkr, [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, [GCC_GPU_BIMC_GFX_CLK] = &gcc_gpu_bimc_gfx_clk.clkr, - [GCC_GPU_BIMC_GFX_SRC_CLK] = &gcc_gpu_bimc_gfx_src_clk.clkr, [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr, [GCC_GPU_GPLL0_CLK] = &gcc_gpu_gpll0_clk.clkr, [GCC_GPU_GPLL0_DIV_CLK] = &gcc_gpu_gpll0_div_clk.clkr, - [GCC_GPU_SNOC_DVM_GFX_CLK] = &gcc_gpu_snoc_dvm_gfx_clk.clkr, [GCC_HMSS_AHB_CLK] = &gcc_hmss_ahb_clk.clkr, [GCC_HMSS_DVM_BUS_CLK] = &gcc_hmss_dvm_bus_clk.clkr, [GCC_HMSS_RBCPR_CLK] = &gcc_hmss_rbcpr_clk.clkr, @@ -2699,6 +2699,7 @@ static struct clk_regmap *gcc_660_clocks[] = { [GP2_CLK_SRC] = &gp2_clk_src.clkr, [GP3_CLK_SRC] = &gp3_clk_src.clkr, [GPLL0] = &gpll0_out_main.clkr, + [GPLL0_AO] = &gpll0_ao_out_main.clkr, [GPLL1] = &gpll1_out_main.clkr, [GPLL4] = &gpll4_out_main.clkr, [HLOS1_VOTE_LPASS_ADSP_SMMU_CLK] = &hlos1_vote_lpass_adsp_smmu_clk.clkr, @@ -2890,9 +2891,7 @@ static const char *const debug_mux_parent_names[] = { "gcc_gp2_clk", "gcc_gp3_clk", "gcc_gpu_bimc_gfx_clk", - "gcc_gpu_bimc_gfx_src_clk", "gcc_gpu_cfg_ahb_clk", - "gcc_gpu_snoc_dvm_gfx_clk", "gcc_hmss_ahb_clk", "gcc_hmss_dvm_bus_clk", "gcc_hmss_rbcpr_clk", @@ -3071,9 +3070,7 @@ static struct clk_debug_mux gcc_debug_mux = { { "gcc_gp2_clk", 0x0E0 }, { "gcc_gp3_clk", 0x0E1 }, { "gcc_gpu_bimc_gfx_clk", 0x13F }, - { "gcc_gpu_bimc_gfx_src_clk", 0x13E }, { "gcc_gpu_cfg_ahb_clk", 0x13B }, - { "gcc_gpu_snoc_dvm_gfx_clk", 0x141 }, { "gcc_hmss_ahb_clk", 0x0BA }, { "gcc_hmss_dvm_bus_clk", 0x0BF }, { "gcc_hmss_rbcpr_clk", 0x0BC }, diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa.c b/drivers/platform/msm/ipa/ipa_v2/ipa.c index d82651f7b492..09ec8458fcad 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2017, 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 @@ -733,7 +733,8 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } - if (ipa2_del_hdr((struct ipa_ioc_del_hdr *)param)) { + if (ipa2_del_hdr_by_user((struct ipa_ioc_del_hdr *)param, + true)) { retval = -EFAULT; break; } @@ -1417,8 +1418,8 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } - if (ipa2_del_hdr_proc_ctx( - (struct ipa_ioc_del_hdr_proc_ctx *)param)) { + if (ipa2_del_hdr_proc_ctx_by_user( + (struct ipa_ioc_del_hdr_proc_ctx *)param, true)) { retval = -EFAULT; break; } @@ -2715,7 +2716,7 @@ fail_schedule_delayed_work: if (ipa_ctx->dflt_v4_rt_rule_hdl) __ipa_del_rt_rule(ipa_ctx->dflt_v4_rt_rule_hdl); if (ipa_ctx->excp_hdr_hdl) - __ipa_del_hdr(ipa_ctx->excp_hdr_hdl); + __ipa_del_hdr(ipa_ctx->excp_hdr_hdl, false); ipa2_teardown_sys_pipe(ipa_ctx->clnt_hdl_cmd); fail_cmd: return result; @@ -2727,7 +2728,7 @@ static void ipa_teardown_apps_pipes(void) ipa2_teardown_sys_pipe(ipa_ctx->clnt_hdl_data_in); __ipa_del_rt_rule(ipa_ctx->dflt_v6_rt_rule_hdl); __ipa_del_rt_rule(ipa_ctx->dflt_v4_rt_rule_hdl); - __ipa_del_hdr(ipa_ctx->excp_hdr_hdl); + __ipa_del_hdr(ipa_ctx->excp_hdr_hdl, false); ipa2_teardown_sys_pipe(ipa_ctx->clnt_hdl_cmd); } diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_hdr.c b/drivers/platform/msm/ipa/ipa_v2/ipa_hdr.c index 40d42e1775a9..51f34f0d5101 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_hdr.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_hdr.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2017, 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 @@ -741,7 +741,8 @@ error: return -EPERM; } -static int __ipa_del_hdr_proc_ctx(u32 proc_ctx_hdl, bool release_hdr) +static int __ipa_del_hdr_proc_ctx(u32 proc_ctx_hdl, + bool release_hdr, bool by_user) { struct ipa_hdr_proc_ctx_entry *entry; struct ipa_hdr_proc_ctx_tbl *htbl = &ipa_ctx->hdr_proc_ctx_tbl; @@ -755,6 +756,14 @@ static int __ipa_del_hdr_proc_ctx(u32 proc_ctx_hdl, bool release_hdr) IPADBG("del ctx proc cnt=%d ofst=%d\n", htbl->proc_ctx_cnt, entry->offset_entry->offset); + if (by_user && entry->user_deleted) { + IPAERR("proc_ctx already deleted by user\n"); + return -EINVAL; + } + + if (by_user) + entry->user_deleted = true; + if (--entry->ref_cnt) { IPADBG("proc_ctx_hdl %x ref_cnt %d\n", proc_ctx_hdl, entry->ref_cnt); @@ -762,7 +771,7 @@ static int __ipa_del_hdr_proc_ctx(u32 proc_ctx_hdl, bool release_hdr) } if (release_hdr) - __ipa_del_hdr(entry->hdr->id); + __ipa_del_hdr(entry->hdr->id, false); /* move the offset entry to appropriate free list */ list_move(&entry->offset_entry->link, @@ -779,7 +788,7 @@ static int __ipa_del_hdr_proc_ctx(u32 proc_ctx_hdl, bool release_hdr) } -int __ipa_del_hdr(u32 hdr_hdl) +int __ipa_del_hdr(u32 hdr_hdl, bool by_user) { struct ipa_hdr_entry *entry; struct ipa_hdr_tbl *htbl = &ipa_ctx->hdr_tbl; @@ -790,7 +799,7 @@ int __ipa_del_hdr(u32 hdr_hdl) return -EINVAL; } - if (!entry || (entry->cookie != IPA_COOKIE)) { + if (entry->cookie != IPA_COOKIE) { IPAERR("bad parm\n"); return -EINVAL; } @@ -802,6 +811,14 @@ int __ipa_del_hdr(u32 hdr_hdl) IPADBG("del hdr of sz=%d hdr_cnt=%d ofst=%d\n", entry->hdr_len, htbl->hdr_cnt, entry->offset_entry->offset); + if (by_user && entry->user_deleted) { + IPAERR("hdr already deleted by user\n"); + return -EINVAL; + } + + if (by_user) + entry->user_deleted = true; + if (--entry->ref_cnt) { IPADBG("hdr_hdl %x ref_cnt %d\n", hdr_hdl, entry->ref_cnt); return 0; @@ -812,7 +829,7 @@ int __ipa_del_hdr(u32 hdr_hdl) entry->phys_base, entry->hdr_len, DMA_TO_DEVICE); - __ipa_del_hdr_proc_ctx(entry->proc_ctx->id, false); + __ipa_del_hdr_proc_ctx(entry->proc_ctx->id, false, false); } else { /* move the offset entry to appropriate free list */ list_move(&entry->offset_entry->link, @@ -879,15 +896,16 @@ bail: } /** - * ipa2_del_hdr() - Remove the specified headers from SW and optionally commit them - * to IPA HW + * ipa2_del_hdr_by_user() - Remove the specified headers + * from SW and optionally commit them to IPA HW * @hdls: [inout] set of headers to delete + * @by_user: Operation requested by user? * * Returns: 0 on success, negative on failure * * Note: Should not be called from atomic context */ -int ipa2_del_hdr(struct ipa_ioc_del_hdr *hdls) +int ipa2_del_hdr_by_user(struct ipa_ioc_del_hdr *hdls, bool by_user) { int i; int result = -EFAULT; @@ -904,7 +922,7 @@ int ipa2_del_hdr(struct ipa_ioc_del_hdr *hdls) mutex_lock(&ipa_ctx->lock); for (i = 0; i < hdls->num_hdls; i++) { - if (__ipa_del_hdr(hdls->hdl[i].hdl)) { + if (__ipa_del_hdr(hdls->hdl[i].hdl, by_user)) { IPAERR("failed to del hdr %i\n", i); hdls->hdl[i].status = -1; } else { @@ -925,6 +943,20 @@ bail: } /** + * ipa2_del_hdr() - Remove the specified headers from SW + * and optionally commit them to IPA HW + * @hdls: [inout] set of headers to delete + * + * Returns: 0 on success, negative on failure + * + * Note: Should not be called from atomic context + */ +int ipa2_del_hdr(struct ipa_ioc_del_hdr *hdls) +{ + return ipa2_del_hdr_by_user(hdls, false); +} + +/** * ipa2_add_hdr_proc_ctx() - add the specified headers to SW * and optionally commit them to IPA HW * @proc_ctxs: [inout] set of processing context headers to add @@ -976,16 +1008,18 @@ bail: } /** - * ipa2_del_hdr_proc_ctx() - + * ipa2_del_hdr_proc_ctx_by_user() - * Remove the specified processing context headers from SW and * optionally commit them to IPA HW. * @hdls: [inout] set of processing context headers to delete + * @by_user: Operation requested by user? * * Returns: 0 on success, negative on failure * * Note: Should not be called from atomic context */ -int ipa2_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls) +int ipa2_del_hdr_proc_ctx_by_user(struct ipa_ioc_del_hdr_proc_ctx *hdls, + bool by_user) { int i; int result; @@ -1004,7 +1038,7 @@ int ipa2_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls) mutex_lock(&ipa_ctx->lock); for (i = 0; i < hdls->num_hdls; i++) { - if (__ipa_del_hdr_proc_ctx(hdls->hdl[i].hdl, true)) { + if (__ipa_del_hdr_proc_ctx(hdls->hdl[i].hdl, true, by_user)) { IPAERR("failed to del hdr %i\n", i); hdls->hdl[i].status = -1; } else { @@ -1025,6 +1059,21 @@ bail: } /** + * ipa2_del_hdr_proc_ctx() - + * Remove the specified processing context headers from SW and + * optionally commit them to IPA HW. + * @hdls: [inout] set of processing context headers to delete + * + * Returns: 0 on success, negative on failure + * + * Note: Should not be called from atomic context + */ +int ipa2_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls) +{ + return ipa2_del_hdr_proc_ctx_by_user(hdls, false); +} + +/** * ipa2_commit_hdr() - commit to IPA HW the current header table in SW * * Returns: 0 on success, negative on failure @@ -1252,7 +1301,7 @@ int __ipa_release_hdr(u32 hdr_hdl) { int result = 0; - if (__ipa_del_hdr(hdr_hdl)) { + if (__ipa_del_hdr(hdr_hdl, false)) { IPADBG("fail to del hdr %x\n", hdr_hdl); result = -EFAULT; goto bail; @@ -1280,7 +1329,7 @@ int __ipa_release_hdr_proc_ctx(u32 proc_ctx_hdl) { int result = 0; - if (__ipa_del_hdr_proc_ctx(proc_ctx_hdl, true)) { + if (__ipa_del_hdr_proc_ctx(proc_ctx_hdl, true, false)) { IPADBG("fail to del hdr %x\n", proc_ctx_hdl); result = -EFAULT; goto bail; diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_i.h b/drivers/platform/msm/ipa/ipa_v2/ipa_i.h index 967036a25746..2c2a9c617b16 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_i.h +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_i.h @@ -281,6 +281,7 @@ struct ipa_rt_tbl { * @id: header entry id * @is_eth2_ofst_valid: is eth2_ofst field valid? * @eth2_ofst: offset to start of Ethernet-II/802.3 header + * @user_deleted: is the header deleted by the user? */ struct ipa_hdr_entry { struct list_head link; @@ -298,6 +299,7 @@ struct ipa_hdr_entry { int id; u8 is_eth2_ofst_valid; u16 eth2_ofst; + bool user_deleted; }; /** @@ -361,6 +363,7 @@ struct ipa_hdr_proc_ctx_add_hdr_cmd_seq { * @cookie: cookie used for validity check * @ref_cnt: reference counter of routing table * @id: processing context header entry id + * @user_deleted: is the hdr processing context deleted by the user? */ struct ipa_hdr_proc_ctx_entry { struct list_head link; @@ -370,6 +373,7 @@ struct ipa_hdr_proc_ctx_entry { u32 cookie; u32 ref_cnt; int id; + bool user_deleted; }; /** @@ -1400,6 +1404,8 @@ int ipa2_add_hdr(struct ipa_ioc_add_hdr *hdrs); int ipa2_del_hdr(struct ipa_ioc_del_hdr *hdls); +int ipa2_del_hdr_by_user(struct ipa_ioc_del_hdr *hdls, bool by_user); + int ipa2_commit_hdr(void); int ipa2_reset_hdr(void); @@ -1417,6 +1423,9 @@ int ipa2_add_hdr_proc_ctx(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs); int ipa2_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls); +int ipa2_del_hdr_proc_ctx_by_user(struct ipa_ioc_del_hdr_proc_ctx *hdls, + bool by_user); + /* * Routing */ @@ -1709,7 +1718,7 @@ int ipa2_active_clients_log_print_table(char *buf, int size); void ipa2_active_clients_log_clear(void); int ipa_interrupts_init(u32 ipa_irq, u32 ee, struct device *ipa_dev); int __ipa_del_rt_rule(u32 rule_hdl); -int __ipa_del_hdr(u32 hdr_hdl); +int __ipa_del_hdr(u32 hdr_hdl, bool by_user); int __ipa_release_hdr(u32 hdr_hdl); int __ipa_release_hdr_proc_ctx(u32 proc_ctx_hdl); int _ipa_read_gen_reg_v1_1(char *buff, int max_len); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c index 3d276b0f535d..2da3b0ddca8f 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2017, 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 @@ -784,7 +784,8 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } - if (ipa3_del_hdr((struct ipa_ioc_del_hdr *)param)) { + if (ipa3_del_hdr_by_user((struct ipa_ioc_del_hdr *)param, + true)) { retval = -EFAULT; break; } @@ -1553,8 +1554,8 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = -EFAULT; break; } - if (ipa3_del_hdr_proc_ctx( - (struct ipa_ioc_del_hdr_proc_ctx *)param)) { + if (ipa3_del_hdr_proc_ctx_by_user( + (struct ipa_ioc_del_hdr_proc_ctx *)param, true)) { retval = -EFAULT; break; } @@ -2921,7 +2922,7 @@ fail_schedule_delayed_work: if (ipa3_ctx->dflt_v4_rt_rule_hdl) __ipa3_del_rt_rule(ipa3_ctx->dflt_v4_rt_rule_hdl); if (ipa3_ctx->excp_hdr_hdl) - __ipa3_del_hdr(ipa3_ctx->excp_hdr_hdl); + __ipa3_del_hdr(ipa3_ctx->excp_hdr_hdl, false); ipa3_teardown_sys_pipe(ipa3_ctx->clnt_hdl_cmd); fail_cmd: return result; @@ -2933,7 +2934,7 @@ static void ipa3_teardown_apps_pipes(void) ipa3_teardown_sys_pipe(ipa3_ctx->clnt_hdl_data_in); __ipa3_del_rt_rule(ipa3_ctx->dflt_v6_rt_rule_hdl); __ipa3_del_rt_rule(ipa3_ctx->dflt_v4_rt_rule_hdl); - __ipa3_del_hdr(ipa3_ctx->excp_hdr_hdl); + __ipa3_del_hdr(ipa3_ctx->excp_hdr_hdl, false); ipa3_teardown_sys_pipe(ipa3_ctx->clnt_hdl_cmd); } diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c b/drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c index 93fa1492cfd5..69dca7666346 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2017, 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 @@ -576,7 +576,8 @@ error: return -EPERM; } -static int __ipa3_del_hdr_proc_ctx(u32 proc_ctx_hdl, bool release_hdr) +static int __ipa3_del_hdr_proc_ctx(u32 proc_ctx_hdl, + bool release_hdr, bool by_user) { struct ipa3_hdr_proc_ctx_entry *entry; struct ipa3_hdr_proc_ctx_tbl *htbl = &ipa3_ctx->hdr_proc_ctx_tbl; @@ -590,6 +591,14 @@ static int __ipa3_del_hdr_proc_ctx(u32 proc_ctx_hdl, bool release_hdr) IPADBG("del proc ctx cnt=%d ofst=%d\n", htbl->proc_ctx_cnt, entry->offset_entry->offset); + if (by_user && entry->user_deleted) { + IPAERR("proc_ctx already deleted by user\n"); + return -EINVAL; + } + + if (by_user) + entry->user_deleted = true; + if (--entry->ref_cnt) { IPADBG("proc_ctx_hdl %x ref_cnt %d\n", proc_ctx_hdl, entry->ref_cnt); @@ -597,7 +606,7 @@ static int __ipa3_del_hdr_proc_ctx(u32 proc_ctx_hdl, bool release_hdr) } if (release_hdr) - __ipa3_del_hdr(entry->hdr->id); + __ipa3_del_hdr(entry->hdr->id, false); /* move the offset entry to appropriate free list */ list_move(&entry->offset_entry->link, @@ -614,7 +623,7 @@ static int __ipa3_del_hdr_proc_ctx(u32 proc_ctx_hdl, bool release_hdr) } -int __ipa3_del_hdr(u32 hdr_hdl) +int __ipa3_del_hdr(u32 hdr_hdl, bool by_user) { struct ipa3_hdr_entry *entry; struct ipa3_hdr_tbl *htbl = &ipa3_ctx->hdr_tbl; @@ -625,7 +634,7 @@ int __ipa3_del_hdr(u32 hdr_hdl) return -EINVAL; } - if (!entry || (entry->cookie != IPA_COOKIE)) { + if (entry->cookie != IPA_COOKIE) { IPAERR("bad parm\n"); return -EINVAL; } @@ -638,6 +647,14 @@ int __ipa3_del_hdr(u32 hdr_hdl) entry->hdr_len, htbl->hdr_cnt, entry->offset_entry->offset); + if (by_user && entry->user_deleted) { + IPAERR("proc_ctx already deleted by user\n"); + return -EINVAL; + } + + if (by_user) + entry->user_deleted = true; + if (--entry->ref_cnt) { IPADBG("hdr_hdl %x ref_cnt %d\n", hdr_hdl, entry->ref_cnt); return 0; @@ -648,7 +665,7 @@ int __ipa3_del_hdr(u32 hdr_hdl) entry->phys_base, entry->hdr_len, DMA_TO_DEVICE); - __ipa3_del_hdr_proc_ctx(entry->proc_ctx->id, false); + __ipa3_del_hdr_proc_ctx(entry->proc_ctx->id, false, false); } else { /* move the offset entry to appropriate free list */ list_move(&entry->offset_entry->link, @@ -710,15 +727,16 @@ bail: } /** - * ipa3_del_hdr() - Remove the specified headers from SW and optionally commit them - * to IPA HW + * ipa3_del_hdr_by_user() - Remove the specified headers + * from SW and optionally commit them to IPA HW * @hdls: [inout] set of headers to delete + * @by_user: Operation requested by user? * * Returns: 0 on success, negative on failure * * Note: Should not be called from atomic context */ -int ipa3_del_hdr(struct ipa_ioc_del_hdr *hdls) +int ipa3_del_hdr_by_user(struct ipa_ioc_del_hdr *hdls, bool by_user) { int i; int result = -EFAULT; @@ -730,7 +748,7 @@ int ipa3_del_hdr(struct ipa_ioc_del_hdr *hdls) mutex_lock(&ipa3_ctx->lock); for (i = 0; i < hdls->num_hdls; i++) { - if (__ipa3_del_hdr(hdls->hdl[i].hdl)) { + if (__ipa3_del_hdr(hdls->hdl[i].hdl, by_user)) { IPAERR("failed to del hdr %i\n", i); hdls->hdl[i].status = -1; } else { @@ -751,6 +769,20 @@ bail: } /** + * ipa3_del_hdr() - Remove the specified headers from SW + * and optionally commit them to IPA HW + * @hdls: [inout] set of headers to delete + * + * Returns: 0 on success, negative on failure + * + * Note: Should not be called from atomic context + */ +int ipa3_del_hdr(struct ipa_ioc_del_hdr *hdls) +{ + return ipa3_del_hdr_by_user(hdls, false); +} + +/** * ipa3_add_hdr_proc_ctx() - add the specified headers to SW * and optionally commit them to IPA HW * @proc_ctxs: [inout] set of processing context headers to add @@ -795,16 +827,18 @@ bail: } /** - * ipa3_del_hdr_proc_ctx() - + * ipa3_del_hdr_proc_ctx_by_user() - * Remove the specified processing context headers from SW and * optionally commit them to IPA HW. * @hdls: [inout] set of processing context headers to delete + * @by_user: Operation requested by user? * * Returns: 0 on success, negative on failure * * Note: Should not be called from atomic context */ -int ipa3_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls) +int ipa3_del_hdr_proc_ctx_by_user(struct ipa_ioc_del_hdr_proc_ctx *hdls, + bool by_user) { int i; int result; @@ -816,7 +850,7 @@ int ipa3_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls) mutex_lock(&ipa3_ctx->lock); for (i = 0; i < hdls->num_hdls; i++) { - if (__ipa3_del_hdr_proc_ctx(hdls->hdl[i].hdl, true)) { + if (__ipa3_del_hdr_proc_ctx(hdls->hdl[i].hdl, true, by_user)) { IPAERR("failed to del hdr %i\n", i); hdls->hdl[i].status = -1; } else { @@ -837,6 +871,21 @@ bail: } /** + * ipa3_del_hdr_proc_ctx() - + * Remove the specified processing context headers from SW and + * optionally commit them to IPA HW. + * @hdls: [inout] set of processing context headers to delete + * + * Returns: 0 on success, negative on failure + * + * Note: Should not be called from atomic context + */ +int ipa3_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls) +{ + return ipa3_del_hdr_proc_ctx_by_user(hdls, false); +} + +/** * ipa3_commit_hdr() - commit to IPA HW the current header table in SW * * Returns: 0 on success, negative on failure @@ -1064,7 +1113,7 @@ int __ipa3_release_hdr(u32 hdr_hdl) { int result = 0; - if (__ipa3_del_hdr(hdr_hdl)) { + if (__ipa3_del_hdr(hdr_hdl, false)) { IPADBG("fail to del hdr %x\n", hdr_hdl); result = -EFAULT; goto bail; @@ -1092,7 +1141,7 @@ int __ipa3_release_hdr_proc_ctx(u32 proc_ctx_hdl) { int result = 0; - if (__ipa3_del_hdr_proc_ctx(proc_ctx_hdl, true)) { + if (__ipa3_del_hdr_proc_ctx(proc_ctx_hdl, true, false)) { IPADBG("fail to del hdr %x\n", proc_ctx_hdl); result = -EFAULT; goto bail; diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h index fe7c88a25374..b3ce52424fec 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2017, 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 @@ -279,6 +279,7 @@ struct ipa3_rt_tbl { * @id: header entry id * @is_eth2_ofst_valid: is eth2_ofst field valid? * @eth2_ofst: offset to start of Ethernet-II/802.3 header + * @user_deleted: is the header deleted by the user? */ struct ipa3_hdr_entry { struct list_head link; @@ -296,6 +297,7 @@ struct ipa3_hdr_entry { int id; u8 is_eth2_ofst_valid; u16 eth2_ofst; + bool user_deleted; }; /** @@ -335,6 +337,7 @@ struct ipa3_hdr_proc_ctx_offset_entry { * @cookie: cookie used for validity check * @ref_cnt: reference counter of routing table * @id: processing context header entry id + * @user_deleted: is the hdr processing context deleted by the user? */ struct ipa3_hdr_proc_ctx_entry { struct list_head link; @@ -344,6 +347,7 @@ struct ipa3_hdr_proc_ctx_entry { u32 cookie; u32 ref_cnt; int id; + bool user_deleted; }; /** @@ -1548,6 +1552,8 @@ int ipa3_add_hdr(struct ipa_ioc_add_hdr *hdrs); int ipa3_del_hdr(struct ipa_ioc_del_hdr *hdls); +int ipa3_del_hdr_by_user(struct ipa_ioc_del_hdr *hdls, bool by_user); + int ipa3_commit_hdr(void); int ipa3_reset_hdr(void); @@ -1565,6 +1571,9 @@ int ipa3_add_hdr_proc_ctx(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs); int ipa3_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls); +int ipa3_del_hdr_proc_ctx_by_user(struct ipa_ioc_del_hdr_proc_ctx *hdls, + bool by_user); + /* * Routing */ @@ -1869,7 +1878,7 @@ int ipa3_active_clients_log_print_table(char *buf, int size); void ipa3_active_clients_log_clear(void); int ipa3_interrupts_init(u32 ipa_irq, u32 ee, struct device *ipa_dev); int __ipa3_del_rt_rule(u32 rule_hdl); -int __ipa3_del_hdr(u32 hdr_hdl); +int __ipa3_del_hdr(u32 hdr_hdl, bool by_user); int __ipa3_release_hdr(u32 hdr_hdl); int __ipa3_release_hdr_proc_ctx(u32 proc_ctx_hdl); int _ipa_read_ep_reg_v3_0(char *buf, int max_len, int pipe); diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index 931230d55f90..91fdeaf67037 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig @@ -521,9 +521,9 @@ config AXP20X_POWER AXP20x PMIC. source "drivers/power/reset/Kconfig" +source "drivers/power/supply/Kconfig" endif # POWER_SUPPLY source "drivers/power/avs/Kconfig" source "drivers/power/qcom/Kconfig" -source "drivers/power/qcom-charger/Kconfig" diff --git a/drivers/power/Makefile b/drivers/power/Makefile index 21aceda44c9e..f7adecea0a70 100644 --- a/drivers/power/Makefile +++ b/drivers/power/Makefile @@ -73,4 +73,4 @@ obj-$(CONFIG_POWER_RESET) += reset/ obj-$(CONFIG_AXP288_FUEL_GAUGE) += axp288_fuel_gauge.o obj-$(CONFIG_AXP288_CHARGER) += axp288_charger.o obj-$(CONFIG_ARCH_QCOM) += qcom/ -obj-y += qcom-charger/ +obj-$(CONFIG_POWER_SUPPLY) += supply/ diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index 83b75fcd257e..e99bf1ee5ad2 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c @@ -279,6 +279,7 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(pe_start), POWER_SUPPLY_ATTR(set_ship_mode), POWER_SUPPLY_ATTR(soc_reporting_ready), + POWER_SUPPLY_ATTR(debug_battery), /* Local extensions of type int64_t */ POWER_SUPPLY_ATTR(charge_counter_ext), /* Properties of type `const char *' */ diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig new file mode 100644 index 000000000000..ec128bf6a93a --- /dev/null +++ b/drivers/power/supply/Kconfig @@ -0,0 +1 @@ +source "drivers/power/supply/qcom/Kconfig" diff --git a/drivers/power/supply/Makefile b/drivers/power/supply/Makefile new file mode 100644 index 000000000000..c8f025f309e7 --- /dev/null +++ b/drivers/power/supply/Makefile @@ -0,0 +1 @@ +obj-y += qcom/ diff --git a/drivers/power/qcom-charger/Kconfig b/drivers/power/supply/qcom/Kconfig index 7a0b1464ad86..b919c688e627 100644 --- a/drivers/power/qcom-charger/Kconfig +++ b/drivers/power/supply/qcom/Kconfig @@ -1,9 +1,8 @@ -menu "Qualcomm Technologies Inc Charger and FG Drivers" +menu "Qualcomm Technologies Inc Charger and Fuel Gauge support" config QPNP_SMBCHARGER tristate "QPNP SMB Charger driver" - depends on SPMI - select POWER_SUPPLY + depends on MFD_SPMI_PMIC help Say Y here to enable the dual path switch mode battery charger which supports USB detection and battery charging up to 3A. @@ -12,8 +11,7 @@ config QPNP_SMBCHARGER config QPNP_FG tristate "QPNP fuel gauge driver" - depends on SPMI - select POWER_SUPPLY + depends on MFD_SPMI_PMIC help Say Y here to enable the Fuel Gauge driver. This adds support for battery fuel gauging and state of charge of battery connected to the @@ -22,8 +20,7 @@ config QPNP_FG config QPNP_FG_GEN3 tristate "QPNP GEN3 fuel gauge driver" - depends on SPMI - select REGMAP_SPMI + depends on MFD_SPMI_PMIC help Say Y here to enable the GEN3 Fuel Gauge driver. This adds support for battery fuel gauging and state of charge of battery connected to @@ -33,7 +30,6 @@ config QPNP_FG_GEN3 config SMB135X_CHARGER tristate "SMB135X Battery Charger" depends on I2C - select POWER_SUPPLY help Say Y to include support for SMB135X Battery Charger. SMB135X is a dual path switching mode charger capable of charging @@ -45,7 +41,6 @@ config SMB135X_CHARGER config SMB1351_USB_CHARGER tristate "smb1351 usb charger (with VBUS detection)" depends on I2C - select POWER_SUPPLY help Say Y to enable support for the SMB1351 switching mode based charger. The driver supports charging control (enable/disable) and @@ -65,7 +60,6 @@ config MSM_BCL_PERIPHERAL_CTL bool "BCL driver to control the PMIC BCL peripheral" depends on SPMI depends on MSM_BCL_CTL - select POWER_SUPPLY help Say Y here to enable this BCL PMIC peripheral driver. This driver provides routines to configure and monitor the BCL @@ -83,14 +77,12 @@ config BATTERY_BCL config QPNP_SMB2 tristate "SMB2 Battery Charger" depends on MFD_SPMI_PMIC - select POWER_SUPPLY help Enables support for the SMB2 charging peripheral config SMB138X_CHARGER tristate "SMB138X Battery Charger" depends on MFD_I2C_PMIC - select POWER_SUPPLY help Say Y to include support for SMB138X Battery Charger. SMB1380 is a dual phase 6A battery charger, and SMB1381 is a single @@ -101,8 +93,7 @@ config SMB138X_CHARGER config QPNP_QNOVO bool "QPNP QNOVO driver" - depends on SPMI - select POWER_SUPPLY + depends on MFD_SPMI_PMIC help Say Y here to enable the Qnovo pulse charging engine. Qnovo driver accepts pulse parameters via sysfs entries and programs the hardware diff --git a/drivers/power/qcom-charger/Makefile b/drivers/power/supply/qcom/Makefile index 0126d2d0a18e..0126d2d0a18e 100644 --- a/drivers/power/qcom-charger/Makefile +++ b/drivers/power/supply/qcom/Makefile diff --git a/drivers/power/qcom-charger/battery_current_limit.c b/drivers/power/supply/qcom/battery_current_limit.c index d2c25bfbf66c..d2c25bfbf66c 100644 --- a/drivers/power/qcom-charger/battery_current_limit.c +++ b/drivers/power/supply/qcom/battery_current_limit.c diff --git a/drivers/power/qcom-charger/batterydata-lib.c b/drivers/power/supply/qcom/batterydata-lib.c index 226581468fda..226581468fda 100644 --- a/drivers/power/qcom-charger/batterydata-lib.c +++ b/drivers/power/supply/qcom/batterydata-lib.c diff --git a/drivers/power/qcom-charger/bcl_peripheral.c b/drivers/power/supply/qcom/bcl_peripheral.c index cae4967f1ef4..cae4967f1ef4 100644 --- a/drivers/power/qcom-charger/bcl_peripheral.c +++ b/drivers/power/supply/qcom/bcl_peripheral.c diff --git a/drivers/power/qcom-charger/fg-core.h b/drivers/power/supply/qcom/fg-core.h index 07bde30524ac..07bde30524ac 100644 --- a/drivers/power/qcom-charger/fg-core.h +++ b/drivers/power/supply/qcom/fg-core.h diff --git a/drivers/power/qcom-charger/fg-memif.c b/drivers/power/supply/qcom/fg-memif.c index a98ff7d765e3..a98ff7d765e3 100644 --- a/drivers/power/qcom-charger/fg-memif.c +++ b/drivers/power/supply/qcom/fg-memif.c diff --git a/drivers/power/qcom-charger/fg-reg.h b/drivers/power/supply/qcom/fg-reg.h index 7ad26215e469..bf2827fb550d 100644 --- a/drivers/power/qcom-charger/fg-reg.h +++ b/drivers/power/supply/qcom/fg-reg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2017, 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 @@ -211,7 +211,6 @@ #define ADC_BITSTREAM_INV_BIT BIT(4) #define SOURCE_SELECT_MASK GENMASK(1, 0) #define SRC_SEL_BATFET 0x0 -#define SRC_SEL_RSENSE 0x1 #define SRC_SEL_BATFET_SMB 0x2 #define SRC_SEL_RESERVED 0x3 diff --git a/drivers/power/qcom-charger/fg-util.c b/drivers/power/supply/qcom/fg-util.c index 41d2af0fbdc6..41d2af0fbdc6 100644 --- a/drivers/power/qcom-charger/fg-util.c +++ b/drivers/power/supply/qcom/fg-util.c diff --git a/drivers/power/qcom-charger/msm_bcl.c b/drivers/power/supply/qcom/msm_bcl.c index aea3f4645897..aea3f4645897 100644 --- a/drivers/power/qcom-charger/msm_bcl.c +++ b/drivers/power/supply/qcom/msm_bcl.c diff --git a/drivers/power/qcom-charger/pmic-voter.c b/drivers/power/supply/qcom/pmic-voter.c index e1a92fb23912..e1a92fb23912 100644 --- a/drivers/power/qcom-charger/pmic-voter.c +++ b/drivers/power/supply/qcom/pmic-voter.c diff --git a/drivers/power/qcom-charger/pmic-voter.h b/drivers/power/supply/qcom/pmic-voter.h index 031b9a010a42..031b9a010a42 100644 --- a/drivers/power/qcom-charger/pmic-voter.h +++ b/drivers/power/supply/qcom/pmic-voter.h diff --git a/drivers/power/qcom-charger/qpnp-fg-gen3.c b/drivers/power/supply/qcom/qpnp-fg-gen3.c index 8523efa1a4ab..a441ff310e9f 100644 --- a/drivers/power/qcom-charger/qpnp-fg-gen3.c +++ b/drivers/power/supply/qcom/qpnp-fg-gen3.c @@ -2543,6 +2543,9 @@ static int fg_psy_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_SOC_REPORTING_READY: pval->intval = chip->soc_reporting_ready; break; + case POWER_SUPPLY_PROP_DEBUG_BATTERY: + pval->intval = is_debug_batt_id(chip); + break; default: pr_err("unsupported property %d\n", psp); rc = -EINVAL; @@ -2641,6 +2644,7 @@ static enum power_supply_property fg_psy_props[] = { POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, POWER_SUPPLY_PROP_SOC_REPORTING_READY, + POWER_SUPPLY_PROP_DEBUG_BATTERY, }; static const struct power_supply_desc fg_psy_desc = { @@ -2977,6 +2981,9 @@ enable_bmd: if (rc < 0) pr_err("Error in enabling BMD, rc=%d\n", rc); + if (chip->fg_psy) + power_supply_changed(chip->fg_psy); + return IRQ_HANDLED; } diff --git a/drivers/power/qcom-charger/qpnp-fg.c b/drivers/power/supply/qcom/qpnp-fg.c index e4a8ade80d4f..e4a8ade80d4f 100644 --- a/drivers/power/qcom-charger/qpnp-fg.c +++ b/drivers/power/supply/qcom/qpnp-fg.c diff --git a/drivers/power/qcom-charger/qpnp-qnovo.c b/drivers/power/supply/qcom/qpnp-qnovo.c index 7bc90fbf2929..7bc90fbf2929 100644 --- a/drivers/power/qcom-charger/qpnp-qnovo.c +++ b/drivers/power/supply/qcom/qpnp-qnovo.c diff --git a/drivers/power/qcom-charger/qpnp-smb2.c b/drivers/power/supply/qcom/qpnp-smb2.c index 98a917273328..4a12af466c36 100644 --- a/drivers/power/qcom-charger/qpnp-smb2.c +++ b/drivers/power/supply/qcom/qpnp-smb2.c @@ -1468,7 +1468,10 @@ static int smb2_setup_wa_flags(struct smb2 *chip) static int smb2_determine_initial_status(struct smb2 *chip) { struct smb_irq_data irq_data = {chip, "determine-initial-status"}; + struct smb_charger *chg = &chip->chg; + if (chg->bms_psy) + smblib_suspend_on_debug_battery(chg); smblib_handle_usb_plugin(0, &irq_data); smblib_handle_usb_typec_change(0, &irq_data); smblib_handle_usb_source_change(0, &irq_data); diff --git a/drivers/power/qcom-charger/qpnp-smbcharger.c b/drivers/power/supply/qcom/qpnp-smbcharger.c index 6c1e58d046e8..6c1e58d046e8 100644 --- a/drivers/power/qcom-charger/qpnp-smbcharger.c +++ b/drivers/power/supply/qcom/qpnp-smbcharger.c diff --git a/drivers/power/qcom-charger/smb-lib.c b/drivers/power/supply/qcom/smb-lib.c index 9728490736ff..d3f7e43ea10e 100644 --- a/drivers/power/qcom-charger/smb-lib.c +++ b/drivers/power/supply/qcom/smb-lib.c @@ -532,7 +532,7 @@ static int smblib_notifier_call(struct notifier_block *nb, if (!strcmp(psy->desc->name, "bms")) { if (!chg->bms_psy) chg->bms_psy = psy; - if (ev == PSY_EVENT_PROP_CHANGED && chg->batt_psy) + if (ev == PSY_EVENT_PROP_CHANGED) schedule_work(&chg->bms_update_work); } @@ -642,6 +642,24 @@ static bool smblib_sysok_reason_usbin(struct smb_charger *chg) return stat & SYSOK_REASON_USBIN_BIT; } +void smblib_suspend_on_debug_battery(struct smb_charger *chg) +{ + int rc; + union power_supply_propval val; + + rc = power_supply_get_property(chg->bms_psy, + POWER_SUPPLY_PROP_DEBUG_BATTERY, &val); + if (rc < 0) { + smblib_err(chg, "Couldn't get debug battery prop rc=%d\n", rc); + return; + } + + vote(chg->usb_suspend_votable, DEBUG_BOARD_VOTER, val.intval, 0); + vote(chg->dc_suspend_votable, DEBUG_BOARD_VOTER, val.intval, 0); + if (val.intval) + pr_info("Input suspended: Fake battery\n"); +} + /********************* * VOTABLE CALLBACKS * *********************/ @@ -3299,7 +3317,11 @@ static void bms_update_work(struct work_struct *work) { struct smb_charger *chg = container_of(work, struct smb_charger, bms_update_work); - power_supply_changed(chg->batt_psy); + + smblib_suspend_on_debug_battery(chg); + + if (chg->batt_psy) + power_supply_changed(chg->batt_psy); } static void step_soc_req_work(struct work_struct *work) diff --git a/drivers/power/qcom-charger/smb-lib.h b/drivers/power/supply/qcom/smb-lib.h index efce7eb987ab..c5d014193fd6 100644 --- a/drivers/power/qcom-charger/smb-lib.h +++ b/drivers/power/supply/qcom/smb-lib.h @@ -51,6 +51,7 @@ enum print_reason { #define BOOST_BACK_VOTER "BOOST_BACK_VOTER" #define HVDCP_INDIRECT_VOTER "HVDCP_INDIRECT_VOTER" #define MICRO_USB_VOTER "MICRO_USB_VOTER" +#define DEBUG_BOARD_VOTER "DEBUG_BOARD_VOTER" #define VCONN_MAX_ATTEMPTS 3 #define OTG_MAX_ATTEMPTS 3 @@ -383,6 +384,7 @@ int smblib_get_prop_slave_current_now(struct smb_charger *chg, union power_supply_propval *val); int smblib_set_prop_ship_mode(struct smb_charger *chg, const union power_supply_propval *val); +void smblib_suspend_on_debug_battery(struct smb_charger *chg); int smblib_init(struct smb_charger *chg); int smblib_deinit(struct smb_charger *chg); diff --git a/drivers/power/qcom-charger/smb-reg.h b/drivers/power/supply/qcom/smb-reg.h index 5f74e27c7978..5f74e27c7978 100644 --- a/drivers/power/qcom-charger/smb-reg.h +++ b/drivers/power/supply/qcom/smb-reg.h diff --git a/drivers/power/qcom-charger/smb1351-charger.c b/drivers/power/supply/qcom/smb1351-charger.c index e9d8c0e08447..e9d8c0e08447 100644 --- a/drivers/power/qcom-charger/smb1351-charger.c +++ b/drivers/power/supply/qcom/smb1351-charger.c diff --git a/drivers/power/qcom-charger/smb135x-charger.c b/drivers/power/supply/qcom/smb135x-charger.c index 65d4ae56ff83..65d4ae56ff83 100644 --- a/drivers/power/qcom-charger/smb135x-charger.c +++ b/drivers/power/supply/qcom/smb135x-charger.c diff --git a/drivers/power/qcom-charger/smb138x-charger.c b/drivers/power/supply/qcom/smb138x-charger.c index 70d935e9d1df..70d935e9d1df 100644 --- a/drivers/power/qcom-charger/smb138x-charger.c +++ b/drivers/power/supply/qcom/smb138x-charger.c diff --git a/drivers/power/qcom-charger/storm-watch.c b/drivers/power/supply/qcom/storm-watch.c index 90fec12bd742..90fec12bd742 100644 --- a/drivers/power/qcom-charger/storm-watch.c +++ b/drivers/power/supply/qcom/storm-watch.c diff --git a/drivers/power/qcom-charger/storm-watch.h b/drivers/power/supply/qcom/storm-watch.h index 44b9d64d8a87..44b9d64d8a87 100644 --- a/drivers/power/qcom-charger/storm-watch.h +++ b/drivers/power/supply/qcom/storm-watch.h diff --git a/drivers/usb/gadget/function/f_mbim.c b/drivers/usb/gadget/function/f_mbim.c index cdbac89d8734..e7c3278f66d4 100644 --- a/drivers/usb/gadget/function/f_mbim.c +++ b/drivers/usb/gadget/function/f_mbim.c @@ -2027,7 +2027,7 @@ static long mbim_ioctl(struct file *fp, unsigned cmd, unsigned long arg) default: ret = -ENODEV; pr_err("unknown transport\n"); - break; + goto fail; } ret = copy_to_user((void __user *)arg, &info, @@ -2043,6 +2043,7 @@ static long mbim_ioctl(struct file *fp, unsigned cmd, unsigned long arg) ret = -EINVAL; } +fail: mbim_unlock(&mbim->ioctl_excl); return ret; diff --git a/include/dt-bindings/clock/qcom,gcc-sdm660.h b/include/dt-bindings/clock/qcom,gcc-sdm660.h index 4bf87f6c08bf..e66633c74c0c 100644 --- a/include/dt-bindings/clock/qcom,gcc-sdm660.h +++ b/include/dt-bindings/clock/qcom,gcc-sdm660.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, 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 @@ -77,11 +77,9 @@ #define GCC_GP2_CLK 62 #define GCC_GP3_CLK 63 #define GCC_GPU_BIMC_GFX_CLK 64 -#define GCC_GPU_BIMC_GFX_SRC_CLK 65 #define GCC_GPU_CFG_AHB_CLK 66 #define GCC_GPU_GPLL0_CLK 67 #define GCC_GPU_GPLL0_DIV_CLK 68 -#define GCC_GPU_SNOC_DVM_GFX_CLK 69 #define GCC_HMSS_AHB_CLK 70 #define GCC_HMSS_DVM_BUS_CLK 71 #define GCC_HMSS_RBCPR_CLK 72 @@ -134,7 +132,7 @@ #define GPLL0_OUT_AUX2 119 #define GPLL0_OUT_EARLY 120 #define GPLL0_OUT_MAIN 121 -#define GPLL0_OUT_TEST 122 +#define GPLL0_AO 122 #define GPLL1 123 #define GPLL1_OUT_AUX 124 #define GPLL1_OUT_AUX2 125 diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 20280ff20e52..de35fe9441fe 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -228,6 +228,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_PE_START, POWER_SUPPLY_PROP_SET_SHIP_MODE, POWER_SUPPLY_PROP_SOC_REPORTING_READY, + POWER_SUPPLY_PROP_DEBUG_BATTERY, /* Local extensions of type int64_t */ POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT, /* Properties of type `const char *' */ |
