From patchwork Tue Sep 25 09:03:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 10613731 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3CF3315E8 for ; Tue, 25 Sep 2018 09:05:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F9692836F for ; Tue, 25 Sep 2018 09:05:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2336429307; Tue, 25 Sep 2018 09:05:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C60992836F for ; Tue, 25 Sep 2018 09:05:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728953AbeIYPLf (ORCPT ); Tue, 25 Sep 2018 11:11:35 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43707 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728915AbeIYPLe (ORCPT ); Tue, 25 Sep 2018 11:11:34 -0400 Received: by mail-wr1-f68.google.com with SMTP id z14-v6so4966917wrs.10 for ; Tue, 25 Sep 2018 02:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2c10kVYZmaRE2YAvTe8xN2YzBOeCiX1ots/Bs3skCvA=; b=dI792yemZWGQzfz6P+lbysSZCE+Qgm0Rv/p1vw0/yIWguhd24AI/9xNBXL9QAOe8qi WmZ2mtf3GKG2j1FO+o/ZogAfHEpMC4FUXdtEOO9K5a54yUzDUgIdJ5g6rJuz2bxVn08M y9PhFzkYxxDDrDOe9lyWawRU33so4h6KCxHzs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2c10kVYZmaRE2YAvTe8xN2YzBOeCiX1ots/Bs3skCvA=; b=NSdq3h+7DLjMcjRqBeDVjsqY47xWYxj+0Lr3X7v7LqB+IS2xrmHWpIJHkKGKblR/BN usUrGXrdl69EpsWxK1TPVVdsF2Nza9+GZK1otb6GlhQgShE2EkakO3Rp8uvT2MJgYBEo qVATInpOyB/Bd3JTvwtZSLJKH+h+kCvU0EgsrVHeyv5nhTS10Bii30HY8miA6p8fDkkg Z3vUN6vJ32U2lUeqhQj2hn8oVBKr06tLF/hVFwAwMp5J3t2jw8ncXe8ZDyxxG0C3GgoH y/FDW5dN5lW0oqF7IOeHTLRoFXYa/ARY38gmQukI3sxl9tYQ6ZR9iOVW5qigeK0Jq5Fe udUA== X-Gm-Message-State: ABuFfojBkzoszhA8YjBJvc1MbzVfZkhOa5HITmCcyCwnPOCT4Ff5WFBS s8clC9HuNrH1D4PLukRkb9PRZw== X-Google-Smtp-Source: ACcGV60+/ljwuO8yKwpnFa1rZygDRXkqLMIjt5uOCwQfhX0TEWu0l/iLM3Fv9x6PKzml8z6VIhaLMA== X-Received: by 2002:a5d:5391:: with SMTP id d17-v6mr14805wrv.191.1537866300122; Tue, 25 Sep 2018 02:05:00 -0700 (PDT) Received: from localhost.localdomain (251.150.136.77.rev.sfr.net. [77.136.150.251]) by smtp.gmail.com with ESMTPSA id y206-v6sm1523828wmg.14.2018.09.25.02.04.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Sep 2018 02:04:59 -0700 (PDT) From: Daniel Lezcano To: edubezval@gmail.com Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, daniel.lezcano@linaro.org, leo.yan@linaro.org, Zhang Rui Subject: [PATCH 14/14] thermal/drivers/hisi: Add the dual clusters sensors for hi3660 Date: Tue, 25 Sep 2018 11:03:12 +0200 Message-Id: <1537866192-12320-15-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537866192-12320-1-git-send-email-daniel.lezcano@linaro.org> References: <1537866192-12320-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The code is ready to support multiple sensors on the hi3660. The DT defines a thermal zone per cluster. Add the little cluster sensor and let it bind with the thermal zone. Signed-off-by: Daniel Lezcano --- drivers/thermal/hisi_thermal.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index ba89cb9..c4111a9 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -424,14 +424,20 @@ static int hi3660_thermal_probe(struct hisi_thermal_data *data) struct platform_device *pdev = data->pdev; struct device *dev = &pdev->dev; - data->sensor = devm_kzalloc(dev, sizeof(*data->sensor), GFP_KERNEL); + data->nr_sensors = 2; + + data->sensor = devm_kzalloc(dev, sizeof(*data->sensor) * + data->nr_sensors, GFP_KERNEL); if (!data->sensor) return -ENOMEM; data->sensor[0].id = HI3660_BIG_SENSOR; data->sensor[0].irq_name = "tsensor_a73"; data->sensor[0].data = data; - data->nr_sensors = 1; + + data->sensor[1].id = HI3660_LITTLE_SENSOR; + data->sensor[1].irq_name = "tsensor_a53"; + data->sensor[1].data = data; return 0; } @@ -443,8 +449,8 @@ static int hisi_thermal_get_temp(void *__data, int *temp) *temp = data->ops->get_temp(sensor); - dev_dbg(&data->pdev->dev, "id=%d, temp=%d, thres=%d\n", - sensor->id, *temp, sensor->thres_temp); + dev_dbg(&data->pdev->dev, "tzd=%p, id=%d, temp=%d, thres=%d\n", + sensor->tzd, sensor->id, *temp, sensor->thres_temp); return 0; }