]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - drivers/thermal/samsung/exynos_tmu.c
Merge branches 'armada-375-380-soc-support', 'eduardo-thermal-soc-fixes', 'intel...
[mirror_ubuntu-jammy-kernel.git] / drivers / thermal / samsung / exynos_tmu.c
index 2412090f5982f468bfb8e9652ce827f2e98be985..d7ca9f49c9cb2201d41f55c4fe98f0fb04595173 100644 (file)
@@ -233,6 +233,8 @@ skip_calib_data:
                        trigger_levs++;
        }
 
+       rising_threshold = readl(data->base + reg->threshold_th0);
+
        if (data->soc == SOC_ARCH_EXYNOS4210) {
                /* Write temperature code for threshold */
                threshold_code = temp_to_code(data, pdata->threshold);
@@ -257,6 +259,7 @@ skip_calib_data:
                                ret = threshold_code;
                                goto out;
                        }
+                       rising_threshold &= ~(0xff << 8 * i);
                        rising_threshold |= threshold_code << 8 * i;
                        if (pdata->threshold_falling) {
                                threshold_code = temp_to_code(data,
@@ -289,6 +292,7 @@ skip_calib_data:
                        }
                        if (i == EXYNOS_MAX_TRIGGER_PER_REG - 1) {
                                /* 1-4 level to be assigned in th0 reg */
+                               rising_threshold &= ~(0xff << 8 * i);
                                rising_threshold |= threshold_code << 8 * i;
                                writel(rising_threshold,
                                        data->base + reg->threshold_th0);
@@ -633,10 +637,8 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 
        data = devm_kzalloc(&pdev->dev, sizeof(struct exynos_tmu_data),
                                        GFP_KERNEL);
-       if (!data) {
-               dev_err(&pdev->dev, "Failed to allocate driver structure\n");
+       if (!data)
                return -ENOMEM;
-       }
 
        platform_set_drvdata(pdev, data);
        mutex_init(&data->lock);
@@ -700,7 +702,6 @@ static int exynos_tmu_probe(struct platform_device *pdev)
        sensor_conf = devm_kzalloc(&pdev->dev,
                                sizeof(struct thermal_sensor_conf), GFP_KERNEL);
        if (!sensor_conf) {
-               dev_err(&pdev->dev, "Failed to allocate registration struct\n");
                ret = -ENOMEM;
                goto err_clk;
        }