OSDN Git Service

Merge "ARM: dts: msm: Add cnss for WLAN in ivi vplatform"
authorLinux Build Service Account <lnxbuild@quicinc.com>
Sat, 27 Jan 2018 00:10:33 +0000 (16:10 -0800)
committerGerrit - the friendly Code Review server <code-review@localhost>
Sat, 27 Jan 2018 00:10:32 +0000 (16:10 -0800)
arch/arm/boot/dts/qcom/Makefile
arch/arm/boot/dts/qcom/sdm660-qrd.dtsi
arch/arm/boot/dts/qcom/vplatform-lfv-msm8996-baseline.dts [new file with mode: 0644]
arch/arm/boot/dts/qcom/vplatform-lfv-msm8996-usb.dtsi
arch/arm/boot/dts/qcom/vplatform-lfv-msm8996.dtsi
drivers/soc/qcom/qpnp-haptic.c

index 2112173..5c61dba 100644 (file)
@@ -118,6 +118,7 @@ dtb-$(CONFIG_ARCH_MSM8996) += msm8996-v2-pmi8994-cdp.dtb \
 
 dtb-$(CONFIG_MSM_GVM_QUIN) += vplatform-lfv-msm8996-telematics.dtb \
        vplatform-lfv-msm8996-ivi.dtb \
+       vplatform-lfv-msm8996-baseline.dtb \
        vplatform-lfv-msm8996-ivi-la.dtb
 
 ifeq ($(CONFIG_BUILD_ARM64_DT_OVERLAY),y)
index b1408cc..88aea6d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2018, 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
        qcom,battery-thermal-coefficients = [9d 50 ff];
 };
 
+&pm660_haptics {
+       qcom,wave-play-rate-us = <4255>;
+       qcom,vmax-mv = <1800>;
+};
+
 &i2c_2 {
        status = "ok";
        smb1351_charger: smb1351-charger@1d {
diff --git a/arch/arm/boot/dts/qcom/vplatform-lfv-msm8996-baseline.dts b/arch/arm/boot/dts/qcom/vplatform-lfv-msm8996-baseline.dts
new file mode 100644 (file)
index 0000000..2c45eb2
--- /dev/null
@@ -0,0 +1,53 @@
+/* Copyright (c) 2018, 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
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+/dts-v1/;
+
+#include "skeleton64.dtsi"
+
+/ {
+       model = "Qualcomm Technologies, Inc. MSM 8996";
+       compatible = "qcom,msm8996";
+       qcom,msm-id = <246 0x0>;
+
+       psci {
+               compatible = "arm,psci-1.0";
+               method = "smc";
+       };
+
+       soc: soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               virtual-interrupt-parent = "gic";
+               ranges = <0 0 0 0xffffffff>;
+               compatible = "simple-bus";
+
+               qcom,mpm2-sleep-counter@4a3000 {
+                       compatible = "qcom,mpm2-sleep-counter";
+                       reg = <0x004a3000 0x1000>;
+                       clock-frequency = <32768>;
+               };
+
+               qcom,msm-imem@66bf000 {
+                       compatible = "qcom,msm-imem";
+                       reg = <0x66bf000 0x1000>; /* Address and size of IMEM */
+                       ranges = <0x0 0x66bf000 0x1000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       boot_stats@6b0 {
+                               compatible = "qcom,msm-imem-boot_stats";
+                               reg = <0x6b0 32>;
+                       };
+               };
+       };
+};
index 5059961..e50447c 100644 (file)
@@ -86,7 +86,7 @@
 
                qcom,core-clk-rate = <120000000>;
 
-               resets = <&clock_gcc USB_30_BCR>;
+               resets = <&clock_virt USB_30_BCR>;
                reset-names = "core_reset";
 
                dwc3@6a00000 {
                                        <87 512 0 0>,
                                        <87 512 60000 960000>;
 
-               clocks = <&clock_gcc clk_gcc_usb20_master_clk>,
-                        <&clock_gcc clk_gcc_periph_noc_usb20_ahb_clk>,
-                        <&clock_gcc clk_gcc_usb20_mock_utmi_clk>,
-                        <&clock_gcc clk_gcc_usb20_sleep_clk>,
+               clocks = <&clock_virt clk_gcc_usb20_master_clk>,
+                        <&clock_virt clk_gcc_periph_noc_usb20_ahb_clk>,
+                        <&clock_virt clk_gcc_usb20_mock_utmi_clk>,
+                        <&clock_virt clk_gcc_usb20_sleep_clk>,
                         <&clock_gcc clk_cxo_dwc3_clk>,
-                        <&clock_gcc clk_gcc_usb_phy_cfg_ahb2phy_clk>;
+                        <&clock_virt clk_gcc_usb_phy_cfg_ahb2phy_clk>;
                clock-names = "core_clk", "iface_clk", "utmi_clk", "sleep_clk",
                                "xo", "cfg_ahb_clk";
                qcom,core-clk-rate = <60000000>;
-               resets = <&clock_gcc USB_20_BCR>;
+               resets = <&clock_virt USB_20_BCR>;
                reset-names = "core_reset";
                qcom,disable-host-mode-pm;
 
                         <&clock_gcc clk_ln_bb_clk>;
                clock-names = "cfg_ahb_clk", "ref_clk_src";
 
-               resets = <&clock_gcc QUSB2PHY_PRIM_BCR>;
+               resets = <&clock_virt QUSB2PHY_PRIM_BCR>;
                reset-names = "phy_reset";
        };
 
                qcom,major-rev = <1>;
                qcom,hold-reset;
 
-               clocks = <&clock_gcc clk_gcc_usb_phy_cfg_ahb2phy_clk>,
+               clocks = <&clock_virt clk_gcc_usb_phy_cfg_ahb2phy_clk>,
                        <&clock_gcc clk_ln_bb_clk>;
                clock-names = "cfg_ahb_clk", "ref_clk_src";
 
-               resets = <&clock_gcc QUSB2PHY_SEC_BCR>;
+               resets = <&clock_virt QUSB2PHY_SEC_BCR>;
                reset-names = "phy_reset";
        };
 
                clock-names = "aux_clk", "pipe_clk", "cfg_ahb_clk",
                                "ref_clk_src", "ref_clk";
 
-               resets = <&clock_gcc USB3_PHY_BCR>,
-                        <&clock_gcc USB3PHY_PHY_BCR>;
+               resets = <&clock_virt USB3_PHY_BCR>,
+                        <&clock_virt USB3PHY_PHY_BCR>;
                reset-names = "phy_reset", "phy_phy_reset";
                qcom,disable-autonomous-mode;
        };
index 24ac570..857db65 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, 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
        clock_virt: qcom,virtclk-frontend@0 {
                compatible = "qcom,virtclk-frontend-8996";
                #clock-cells = <1>;
+               #reset-cells = <1>;
        };
 
        clock_gcc: qcom,gcc@300000 {
index 38cc869..4ca0edf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015, 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2018, 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
@@ -2231,6 +2231,8 @@ static void qpnp_hap_td_enable(struct timed_output_dev *dev, int time_ms)
 {
        struct qpnp_hap *hap = container_of(dev, struct qpnp_hap,
                                         timed_dev);
+       bool state = !!time_ms;
+       ktime_t rem;
        int rc;
 
        if (time_ms < 0)
@@ -2238,38 +2240,49 @@ static void qpnp_hap_td_enable(struct timed_output_dev *dev, int time_ms)
 
        mutex_lock(&hap->lock);
 
-       if (time_ms == 0) {
-               /* disable haptics */
-               hrtimer_cancel(&hap->hap_timer);
-               hap->state = 0;
-               schedule_work(&hap->work);
+       if (hap->state == state) {
+               if (state) {
+                       rem = hrtimer_get_remaining(&hap->hap_timer);
+                       if (time_ms > ktime_to_ms(rem)) {
+                               time_ms = (time_ms > hap->timeout_ms ?
+                                                hap->timeout_ms : time_ms);
+                               hrtimer_cancel(&hap->hap_timer);
+                               hap->play_time_ms = time_ms;
+                               hrtimer_start(&hap->hap_timer,
+                                               ktime_set(time_ms / 1000,
+                                               (time_ms % 1000) * 1000000),
+                                               HRTIMER_MODE_REL);
+                       }
+               }
                mutex_unlock(&hap->lock);
                return;
        }
 
-       if (time_ms < 10)
-               time_ms = 10;
-
-       if (is_sw_lra_auto_resonance_control(hap))
-               hrtimer_cancel(&hap->auto_res_err_poll_timer);
-
-       hrtimer_cancel(&hap->hap_timer);
+       hap->state = state;
+       if (!hap->state) {
+               hrtimer_cancel(&hap->hap_timer);
+       } else {
+               if (time_ms < 10)
+                       time_ms = 10;
 
-       if (hap->auto_mode) {
-               rc = qpnp_hap_auto_mode_config(hap, time_ms);
-               if (rc < 0) {
-                       pr_err("Unable to do auto mode config\n");
-                       mutex_unlock(&hap->lock);
-                       return;
+               if (hap->auto_mode) {
+                       rc = qpnp_hap_auto_mode_config(hap, time_ms);
+                       if (rc < 0) {
+                               pr_err("Unable to do auto mode config\n");
+                               mutex_unlock(&hap->lock);
+                               return;
+                       }
                }
+
+               time_ms = (time_ms > hap->timeout_ms ?
+                                hap->timeout_ms : time_ms);
+               hap->play_time_ms = time_ms;
+               hrtimer_start(&hap->hap_timer,
+                               ktime_set(time_ms / 1000,
+                               (time_ms % 1000) * 1000000),
+                               HRTIMER_MODE_REL);
        }
 
-       time_ms = (time_ms > hap->timeout_ms ? hap->timeout_ms : time_ms);
-       hap->play_time_ms = time_ms;
-       hap->state = 1;
-       hrtimer_start(&hap->hap_timer,
-               ktime_set(time_ms / 1000, (time_ms % 1000) * 1000000),
-               HRTIMER_MODE_REL);
        mutex_unlock(&hap->lock);
        schedule_work(&hap->work);
 }