From patchwork Mon Sep 26 14:05:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 609559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E41E9C6FA98 for ; Mon, 26 Sep 2022 15:19:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235984AbiIZPTZ (ORCPT ); Mon, 26 Sep 2022 11:19:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236317AbiIZPTB (ORCPT ); Mon, 26 Sep 2022 11:19:01 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 595AD82750 for ; Mon, 26 Sep 2022 07:06:28 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id r7so10440287wrm.2 for ; Mon, 26 Sep 2022 07:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=aNmMz3cRMj5kxPfKCvTpL8Ywx++ZqyPMyM5lgZsCem0=; b=Q23c4HAkgnl6Z9MaLlFBlkJQVlfuiThqrS8mJukwVIImKsYum75U4XdgrkNKk/0lwy lJzQv8+rsPlnw3WHwSmLxe9y/2uppUm+i374ZBcbjH37fLsr40lP26hZuauGkID+qu/1 rkApvZIf8Uu9MEmrkKhZJr53pIANT6XnDdzR5+74zNMG7IulxvRiGCWOyqJHhtiPgm/W REvizDF2fQ/Wa8Jg+yFs01HqT+Kb1zrvk4flQq8vtWLbINHUIegDGwW8rbkwsVlD8Bkj 7txsRB08UgJlDH24uEb550keyWuhzfNb+XK4KY7FG9iGIVaHBjHGW2Wl7RU4Sgi+g4pO ZLow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=aNmMz3cRMj5kxPfKCvTpL8Ywx++ZqyPMyM5lgZsCem0=; b=f0/Gm0IARmeBVOP8kWFLmFxhvSrfTCA1YH3ZSCGruFjYDIXGQDKEhcJ9CtZGPFWnGN CUpDKZSNDGGiij2+nhM8sc8gUcgYbLbMiI+NXxFSI0JFVdC/TXHC1VacTPn6CF8asrXS vFaYdmgRosMG8O8OCacjPL7VoNTKr0np1386U1Mhf2EslsrRlrz7QmbSCeA3kX5+zG5L wBo3YZMO9+IF4ARJAFTT6jDS64RjSoGn1Y6wOY1w4dpWFRbbhRdTFZf3uJx3vjNzhpiW WUvMYS2MSltmTBr+FoO0cEkVv9deOO5gvuTfqhC5monEHXFB2iSDODxyGbJkgVT9bUxg OR+w== X-Gm-Message-State: ACrzQf3bNtq+UxnA2rVb2AHgxIxuhWr0316xxNd0If9m2+N+T9+HBkuo RD9LpeCN6DsUSr9y6Bf8IxhRkQ== X-Google-Smtp-Source: AMsMyM6rJqmC1nrOEeRLrZJBMGkup0bYQbcQRJMYdBAN9BZM81uzWYQNn0pJhWUuTj55jrrdI43ezw== X-Received: by 2002:a5d:6147:0:b0:22a:6035:a878 with SMTP id y7-20020a5d6147000000b0022a6035a878mr13188016wrt.528.1664201187409; Mon, 26 Sep 2022 07:06:27 -0700 (PDT) Received: from mai.. (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id v3-20020adfebc3000000b0022adf321d22sm14310731wrn.92.2022.09.26.07.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 07:06:26 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rui.zhang@intel.com, Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Amit Kucheria , Alim Akhtar , linux-samsung-soc@vger.kernel.org (open list:SAMSUNG THERMAL DRIVER), linux-arm-kernel@lists.infradead.org (moderated list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES) Subject: [PATCH v5 08/30] thermal/drivers/exynos: Use generic thermal_zone_get_trip() function Date: Mon, 26 Sep 2022 16:05:42 +0200 Message-Id: <20220926140604.4173723-9-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220926140604.4173723-1-daniel.lezcano@linaro.org> References: <20220926140604.4173723-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The thermal framework gives the possibility to register the trip points with the thermal zone. When that is done, no get_trip_* ops are needed and they can be removed. Convert ops content logic into generic trip points and register them with the thermal zone. Signed-off-by: Daniel Lezcano Acked-by: Krzysztof Kozlowski --- drivers/thermal/samsung/exynos_tmu.c | 41 +++++++++++----------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 51874d0a284c..0e33d32a9d2e 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -260,16 +260,8 @@ static int exynos_tmu_initialize(struct platform_device *pdev) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); struct thermal_zone_device *tzd = data->tzd; - const struct thermal_trip * const trips = - of_thermal_get_trip_points(tzd); unsigned int status; - int ret = 0, temp, hyst; - - if (!trips) { - dev_err(&pdev->dev, - "Cannot get trip points from device tree!\n"); - return -ENODEV; - } + int ret = 0, temp; if (data->soc != SOC_ARCH_EXYNOS5433) /* FIXME */ ret = tzd->ops->get_crit_temp(tzd, &temp); @@ -303,19 +295,16 @@ static int exynos_tmu_initialize(struct platform_device *pdev) /* Write temperature code for rising and falling threshold */ for (i = 0; i < ntrips; i++) { - /* Write temperature code for rising threshold */ - ret = tzd->ops->get_trip_temp(tzd, i, &temp); - if (ret) - goto err; - temp /= MCELSIUS; - data->tmu_set_trip_temp(data, i, temp); - /* Write temperature code for falling threshold */ - ret = tzd->ops->get_trip_hyst(tzd, i, &hyst); + struct thermal_trip trip; + + ret = thermal_zone_get_trip(tzd, i, &trip); if (ret) goto err; - hyst /= MCELSIUS; - data->tmu_set_trip_hyst(data, i, temp, hyst); + + data->tmu_set_trip_temp(data, i, trip.temperature / MCELSIUS); + data->tmu_set_trip_hyst(data, i, trip.temperature / MCELSIUS, + trip.hysteresis / MCELSIUS); } data->tmu_clear_irqs(data); @@ -360,21 +349,23 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on) } static void exynos4210_tmu_set_trip_temp(struct exynos_tmu_data *data, - int trip, u8 temp) + int trip_id, u8 temp) { - const struct thermal_trip * const trips = - of_thermal_get_trip_points(data->tzd); + struct thermal_trip trip; u8 ref, th_code; - ref = trips[0].temperature / MCELSIUS; + if (thermal_zone_get_trip(data->tzd, 0, &trip)) + return; - if (trip == 0) { + ref = trip.temperature / MCELSIUS; + + if (trip_id == 0) { th_code = temp_to_code(data, ref); writeb(th_code, data->base + EXYNOS4210_TMU_REG_THRESHOLD_TEMP); } temp -= ref; - writeb(temp, data->base + EXYNOS4210_TMU_REG_TRIG_LEVEL0 + trip * 4); + writeb(temp, data->base + EXYNOS4210_TMU_REG_TRIG_LEVEL0 + trip_id * 4); } /* failing thresholds are not supported on Exynos4210 */ From patchwork Mon Sep 26 14:05:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 609560 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02766C6FA93 for ; Mon, 26 Sep 2022 15:19:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235919AbiIZPTY (ORCPT ); Mon, 26 Sep 2022 11:19:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236338AbiIZPTE (ORCPT ); Mon, 26 Sep 2022 11:19:04 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E82EA82842 for ; Mon, 26 Sep 2022 07:06:30 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id n15so10422474wrq.5 for ; Mon, 26 Sep 2022 07:06:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=YzUTWEHUQYeukAyJEfTuM3PzyJlxwwnF0DoykmVbPWw=; b=YVY6NIlG8E5MYLRDa2EiAoJgns8PVyfYKnGRLgZZLm7fx8zerSdtoskRa91POGwnsc KzA+kBKLt/IvYFHVQX08ps11j0X9q90x5cEamJ13yQPAfMurnqQIWWd58GYbKcgYx0+W isVYYTBHM4veXgds5rVH3lxZEoJNNYAMQ1LgAVzVtByqGNZdWAYAirwC8HLF9zZuzLtP l2a0DdiUpyGB/gH1srv75MVg1Ih5UN4STdwOniy7xvHzMzXhAetI3FR9fKZZDXVztbCa WbFrO13ViwlC7GbUSx82BMsKYvoX7fLEnyK5ci9Hp6n+AINetViPxB6qnfsuann3yViD ov7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=YzUTWEHUQYeukAyJEfTuM3PzyJlxwwnF0DoykmVbPWw=; b=HxG4ZU+K3ZNOPE9M93LHEgC0vM3Ea9k1IPwV9Wa0IOJ1Up5vcuXUx7g4Wz8aGRPGhH C63s1q1A27A8A0L72RDl08eT1+x44VxA7FlMtmNaVukqXbyZkOmD6CWh2rB0dmGx3/Yb RoBAbvHYvkQWs2NLFRRg87B52vvodomCF5hZy90MwcioNBzU2jMpVKlhqbhZEDg47XVi Ludn0FGJR/Kvgh8N6j/4nOlOQiZE1yTAs4y1zAlMjyYOECc8tM86ZzJ0HRYnZyUhbAkQ awN/FUdERT6XoStkAobJQUVPqQcZlYWSvnpxcB2fDfXHpqtEALWjqvHQkzyMQ/WknAf6 LCDg== X-Gm-Message-State: ACrzQf1RNMiRugHMqlqlaT7c1KiUtQLByhMfRrO/VewlPtq5K5DS4+Ya MNmwQNyTbfJktSEZ5ImgWsk5IA== X-Google-Smtp-Source: AMsMyM5veGH4dyYihTWvuy0zbsnz2bzt49D2I3XuR+AiNTbAalnoODS/c84isgnulFd8jc1u1OMlCg== X-Received: by 2002:a05:6000:78e:b0:22a:7e99:da93 with SMTP id bu14-20020a056000078e00b0022a7e99da93mr13503449wrb.20.1664201188818; Mon, 26 Sep 2022 07:06:28 -0700 (PDT) Received: from mai.. (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id v3-20020adfebc3000000b0022adf321d22sm14310731wrn.92.2022.09.26.07.06.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 07:06:28 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rui.zhang@intel.com, Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Amit Kucheria , Alim Akhtar , linux-samsung-soc@vger.kernel.org (open list:SAMSUNG THERMAL DRIVER), linux-arm-kernel@lists.infradead.org (moderated list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES) Subject: [PATCH v5 09/30] thermal/drivers/exynos: of_thermal_get_ntrips() Date: Mon, 26 Sep 2022 16:05:43 +0200 Message-Id: <20220926140604.4173723-10-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220926140604.4173723-1-daniel.lezcano@linaro.org> References: <20220926140604.4173723-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The thermal core framework allows to get the number of thermal trips, use it instead of visiting the thermal core structure internals. Signed-off-by: Daniel Lezcano Reviewed-by: Krzysztof Kozlowski --- drivers/thermal/samsung/exynos_tmu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 0e33d32a9d2e..91e6860b5ec4 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -260,6 +260,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); struct thermal_zone_device *tzd = data->tzd; + int num_trips = thermal_zone_get_num_trips(tzd); unsigned int status; int ret = 0, temp; @@ -271,12 +272,12 @@ static int exynos_tmu_initialize(struct platform_device *pdev) goto out; } - if (of_thermal_get_ntrips(tzd) > data->ntrip) { + if (num_trips > data->ntrip) { dev_info(&pdev->dev, "More trip points than supported by this TMU.\n"); dev_info(&pdev->dev, "%d trip points should be configured in polling mode.\n", - (of_thermal_get_ntrips(tzd) - data->ntrip)); + num_trips - data->ntrip); } mutex_lock(&data->lock); @@ -289,7 +290,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) ret = -EBUSY; } else { int i, ntrips = - min_t(int, of_thermal_get_ntrips(tzd), data->ntrip); + min_t(int, num_trips, data->ntrip); data->tmu_initialize(pdev); From patchwork Mon Sep 26 14:05:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 609976 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1579C6FA99 for ; Mon, 26 Sep 2022 15:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236094AbiIZPTb (ORCPT ); Mon, 26 Sep 2022 11:19:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236368AbiIZPTH (ORCPT ); Mon, 26 Sep 2022 11:19:07 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C9EB8285B for ; Mon, 26 Sep 2022 07:06:31 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id c192-20020a1c35c9000000b003b51339d350so5162992wma.3 for ; Mon, 26 Sep 2022 07:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=7e6ctEATW9s/XP6ppX0yJV3WjnU6tGYDDticrBE+dlY=; b=yXgAz7fHswCIEtOIYeo9cgpLiiJBWfgvR4uHjBK+K3qUYbnA8Y++ovFczH2C2Z7gtU N9C2D/iFJgdiYBdSN8O/VHkxCnNTG45plxKso6KCjXls1Jyot4+M4i82ezxMXH6d7U24 TG2E+oksIjDAputjsIhcsdUgxOX8SKFQYt+8WdKoC13fpMeTX/VQDK/tFu/VJfWdG+ny snjNU2/Xgz7PLDUjyfNwSLF+WOOoiJXEJVo0Qyuky86Wm2qjhG1STdPTdjEUJPIAe/uB hHZqWe/jK0wKdeMATM2ltoobIgkwpjo5Uwra5cIi8i4cE1ARfJYc01OvLEFAW9NF2j5c R1FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=7e6ctEATW9s/XP6ppX0yJV3WjnU6tGYDDticrBE+dlY=; b=ONNlTYGPVo3tWjh2pysBY2aEm8OeBjuT1q3mKzd7NZlbbJ5pq/9ZOlArvWN5vGZIo1 QlUBntOAfD9ZqCo9GYnRFDfWwD7ne7szjZK7BF5hJamLZQ+8/2yvmJA78YT713VapI65 r0xCyhDevtV3Hsx6xJqrmENWuKBxecIureGd5BMSVKKgDllusrhWHtA3/CjoOn9P590V 3fnRuLG2EZOqopbRjoxtLevgcILQNMMx3aksZOk4b1GpzlKeXFB0OKNXf8jgN7g/+Zf/ 07KpmYcsPulu9mMvxen3SxD3jrNN2pCF6V1gzaZgrTDpsodt1WwlRCJJJzXijDAzcuhO 9x+Q== X-Gm-Message-State: ACrzQf1FmVSyBNr0vIa5WOPPXaeJ9akLCvy/XjJXokevRnJhDlKEpVuf LCYdYRv8s5Tdzxj++aGKfyr9Zw== X-Google-Smtp-Source: AMsMyM7TAKm/5G7gkn7KlWPaE8c2DactDCCCu5Mc+JzPmPF6T54v2Ql/KNI5i3Xl9udNqwWnFigHQQ== X-Received: by 2002:a7b:c050:0:b0:3b4:fae1:6bce with SMTP id u16-20020a7bc050000000b003b4fae16bcemr14732183wmc.131.1664201190192; Mon, 26 Sep 2022 07:06:30 -0700 (PDT) Received: from mai.. (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id v3-20020adfebc3000000b0022adf321d22sm14310731wrn.92.2022.09.26.07.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 07:06:29 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rui.zhang@intel.com, Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Amit Kucheria , Alim Akhtar , linux-samsung-soc@vger.kernel.org (open list:SAMSUNG THERMAL DRIVER), linux-arm-kernel@lists.infradead.org (moderated list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES) Subject: [PATCH v5 10/30] thermal/drivers/exynos: Replace of_thermal_is_trip_valid() by thermal_zone_get_trip() Date: Mon, 26 Sep 2022 16:05:44 +0200 Message-Id: <20220926140604.4173723-11-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220926140604.4173723-1-daniel.lezcano@linaro.org> References: <20220926140604.4173723-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The thermal_zone_get_trip() does the same check as of_thermal_is_trip_valid(). Replace the call to of_thermal_is_trip_valid() by thermal_zone_get_trip(). Signed-off-by: Daniel Lezcano --- drivers/thermal/samsung/exynos_tmu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 91e6860b5ec4..34b460092308 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -554,13 +554,14 @@ static void exynos4210_tmu_control(struct platform_device *pdev, bool on) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); struct thermal_zone_device *tz = data->tzd; + struct thermal_trip trip; unsigned int con, interrupt_en = 0, i; con = get_con_reg(data, readl(data->base + EXYNOS_TMU_REG_CONTROL)); if (on) { for (i = 0; i < data->ntrip; i++) { - if (!of_thermal_is_trip_valid(tz, i)) + if (thermal_zone_get_trip(tz, i, &trip)) continue; interrupt_en |= @@ -584,13 +585,14 @@ static void exynos5433_tmu_control(struct platform_device *pdev, bool on) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); struct thermal_zone_device *tz = data->tzd; + struct thermal_trip trip; unsigned int con, interrupt_en = 0, pd_det_en, i; con = get_con_reg(data, readl(data->base + EXYNOS_TMU_REG_CONTROL)); if (on) { for (i = 0; i < data->ntrip; i++) { - if (!of_thermal_is_trip_valid(tz, i)) + if (thermal_zone_get_trip(tz, i, &trip)) continue; interrupt_en |= @@ -615,13 +617,14 @@ static void exynos7_tmu_control(struct platform_device *pdev, bool on) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); struct thermal_zone_device *tz = data->tzd; + struct thermal_trip trip; unsigned int con, interrupt_en = 0, i; con = get_con_reg(data, readl(data->base + EXYNOS_TMU_REG_CONTROL)); if (on) { for (i = 0; i < data->ntrip; i++) { - if (!of_thermal_is_trip_valid(tz, i)) + if (thermal_zone_get_trip(tz, i, &trip)) continue; interrupt_en |=