]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'thermal-soc/next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 00:57:00 +0000 (11:57 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 00:57:00 +0000 (11:57 +1100)
Documentation/devicetree/bindings/thermal/rockchip-thermal.txt
drivers/thermal/devfreq_cooling.c
drivers/thermal/rockchip_thermal.c
include/linux/devfreq_cooling.h

index ef802de4957a38b523686a603ac0e5b2f5756aaa..b38200d2583a5473ebe4c618aa09475128d31100 100644 (file)
@@ -12,6 +12,11 @@ Required properties:
 - resets : Must contain an entry for each entry in reset-names.
           See ../reset/reset.txt for details.
 - reset-names : Must include the name "tsadc-apb".
+- pinctrl-names : The pin control state names;
+- pinctrl-0 : The "init" pinctrl state, it will be set before device probe.
+- pinctrl-1 : The "default" pinctrl state, it will be set after reset the
+             TSADC controller.
+- pinctrl-2 : The "sleep" pinctrl state, it will be in for suspend.
 - #thermal-sensor-cells : Should be 1. See ./thermal.txt for a description.
 - rockchip,hw-tshut-temp : The hardware-controlled shutdown temperature value.
 - rockchip,hw-tshut-mode : The hardware-controlled shutdown mode 0:CRU 1:GPIO.
@@ -27,8 +32,10 @@ tsadc: tsadc@ff280000 {
        clock-names = "tsadc", "apb_pclk";
        resets = <&cru SRST_TSADC>;
        reset-names = "tsadc-apb";
-       pinctrl-names = "default";
-       pinctrl-0 = <&otp_out>;
+       pinctrl-names = "init", "default", "sleep";
+       pinctrl-0 = <&otp_gpio>;
+       pinctrl-1 = <&otp_out>;
+       pinctrl-2 = <&otp_gpio>;
        #thermal-sensor-cells = <1>;
        rockchip,hw-tshut-temp = <95000>;
        rockchip,hw-tshut-mode = <0>;
index a272068150661c4cfc0a09e9c8e84722d5be7dcd..d1b7c32e7406cf819f078313a6f4cfc175c11d37 100644 (file)
@@ -257,7 +257,7 @@ static unsigned long
 get_dynamic_power(struct devfreq_cooling_device *dfc, unsigned long freq,
                  unsigned long voltage)
 {
-       unsigned long power;
+       u64 power;
        u32 freq_mhz;
        struct devfreq_cooling_power *dfc_power = dfc->power_ops;
 
@@ -467,7 +467,7 @@ free_power_table:
  * devfreq should use the simple_ondemand governor, other governors
  * are not currently supported.
  */
-struct devfreq_cooling_device *
+struct thermal_cooling_device *
 of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
                                  struct devfreq_cooling_power *dfc_power)
 {
@@ -513,7 +513,7 @@ of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
 
        dfc->cdev = cdev;
 
-       return dfc;
+       return cdev;
 
 release_idr:
        release_idr(&devfreq_idr, dfc->id);
@@ -533,7 +533,7 @@ EXPORT_SYMBOL_GPL(of_devfreq_cooling_register_power);
  * @np: Pointer to OF device_node.
  * @df: Pointer to devfreq device.
  */
-struct devfreq_cooling_device *
+struct thermal_cooling_device *
 of_devfreq_cooling_register(struct device_node *np, struct devfreq *df)
 {
        return of_devfreq_cooling_register_power(np, df, NULL);
@@ -544,7 +544,7 @@ EXPORT_SYMBOL_GPL(of_devfreq_cooling_register);
  * devfreq_cooling_register() - Register devfreq cooling device.
  * @df: Pointer to devfreq device.
  */
-struct devfreq_cooling_device *devfreq_cooling_register(struct devfreq *df)
+struct thermal_cooling_device *devfreq_cooling_register(struct devfreq *df)
 {
        return of_devfreq_cooling_register(NULL, df);
 }
@@ -554,11 +554,15 @@ EXPORT_SYMBOL_GPL(devfreq_cooling_register);
  * devfreq_cooling_unregister() - Unregister devfreq cooling device.
  * @dfc: Pointer to devfreq cooling device to unregister.
  */
-void devfreq_cooling_unregister(struct devfreq_cooling_device *dfc)
+void devfreq_cooling_unregister(struct thermal_cooling_device *cdev)
 {
-       if (!dfc)
+       struct devfreq_cooling_device *dfc;
+
+       if (!cdev)
                return;
 
+       dfc = cdev->devdata;
+
        thermal_cooling_device_unregister(dfc->cdev);
        release_idr(&devfreq_idr, dfc->id);
        kfree(dfc->power_table);
index 4d5b7d4b68a78c97a836c2d55996fb13f6096ffb..2b58870c3e25f5fad61ca7deda5c6596bfbe7cc8 100644 (file)
@@ -638,6 +638,8 @@ static int __maybe_unused rockchip_thermal_suspend(struct device *dev)
        clk_disable(thermal->pclk);
        clk_disable(thermal->clk);
 
+       pinctrl_pm_select_sleep_state(dev);
+
        return 0;
 }
 
@@ -674,6 +676,8 @@ static int __maybe_unused rockchip_thermal_resume(struct device *dev)
        for (i = 0; i < ARRAY_SIZE(thermal->sensors); i++)
                rockchip_thermal_toggle_sensor(&thermal->sensors[i], true);
 
+       pinctrl_pm_select_default_state(dev);
+
        return 0;
 }
 
index ee5f0ec9290b297c36da879b4508fa8b23fa1433..7adf6cc4b305d93fc5510b433b025165df4adf62 100644 (file)
@@ -43,37 +43,37 @@ struct devfreq_cooling_power {
        unsigned long dyn_power_coeff;
 };
 
-struct devfreq_cooling_device *
+struct thermal_cooling_device *
 of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
                                  struct devfreq_cooling_power *dfc_power);
-struct devfreq_cooling_device *
+struct thermal_cooling_device *
 of_devfreq_cooling_register(struct device_node *np, struct devfreq *df);
-struct devfreq_cooling_device *devfreq_cooling_register(struct devfreq *df);
-void devfreq_cooling_unregister(struct devfreq_cooling_device *dfc);
+struct thermal_cooling_device *devfreq_cooling_register(struct devfreq *df);
+void devfreq_cooling_unregister(struct thermal_cooling_device *dfc);
 
 #else /* !CONFIG_DEVFREQ_THERMAL */
 
-struct devfreq_cooling_device *
+struct thermal_cooling_device *
 of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
                                  struct devfreq_cooling_power *dfc_power)
 {
        return ERR_PTR(-EINVAL);
 }
 
-static inline struct devfreq_cooling_device *
+static inline struct thermal_cooling_device *
 of_devfreq_cooling_register(struct device_node *np, struct devfreq *df)
 {
        return ERR_PTR(-EINVAL);
 }
 
-static inline struct devfreq_cooling_device *
+static inline struct thermal_cooling_device *
 devfreq_cooling_register(struct devfreq *df)
 {
        return ERR_PTR(-EINVAL);
 }
 
 static inline void
-devfreq_cooling_unregister(struct devfreq_cooling_device *dfc)
+devfreq_cooling_unregister(struct thermal_cooling_device *dfc)
 {
 }