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: 147419 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp473344lji; Tue, 25 Sep 2018 02:05:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV60l5Jxv+mRR0TPRENNP9lf7vfCnnJlQPldn5JweBskSFB1/3fSiOyuqPqQNutsi1FE585K8 X-Received: by 2002:a17:902:a985:: with SMTP id bh5-v6mr67849plb.193.1537866305041; Tue, 25 Sep 2018 02:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537866305; cv=none; d=google.com; s=arc-20160816; b=oQCs3vmOq1097rGKCHrqS6rLRdRmP0KKIALn7h9N/KMelBeXjjI+PQ2ZBFm9N4KzGB sg5fruTcddozPItE6lks9ne2nra9vJGPEremzcBjMmeyBMncpmmUL/3BNN67SqnO5dWe d7sRko7NkG3KfEo9EEWWtRhttOMO5l6REo08t6IRuwVLtgxIm05plX1JUwG1ETkKCbiZ P3uyL9fAEnSu0TJCpftl7F2RoJq0a1vy9z6YSaZpgyGWKhUuEX6MDM3oMdlg6sN0Y+Gn 1HenbP1vqeD0En1GNA/zn8MoRysjnaAVKs7oIPgJEZm8z1DZEMB81Jw+rX4PIZtPkXf0 McQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=2c10kVYZmaRE2YAvTe8xN2YzBOeCiX1ots/Bs3skCvA=; b=lhhsTyJefVFUBMKJE6XDKJ+kbb5jf+JzJQ1XV9t9XsWr5dGCpvimLYKpOpSZ5+mVbd 0wt+zr9imAoJoV+MxRqHrdbCJ9i1KKhbcDKfI4ogjGUxAiDTDXrNzd1aT3HnQptGINYE 286HuMEwKE5NzKN7f2G8KtgjVXt81kYS4tVQe4gDSh19hn0JL9p4yhcqWBGsyqBr0P+K jAwpVmHCbpf8lE61aZd1a5EsafXvJPWCKnghFY8utw7G436yoEM2cVVmokwI+Qz9rd9U 4ez7X04QRFB7n2dQVYjJ+Fh5z3RA7gKJ9VbG83s7UTLM+ibIRbSTyorx5FbuejPaWsLh gE2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dI792yem; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10-v6si1586774pgv.374.2018.09.25.02.05.04; Tue, 25 Sep 2018 02:05:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dI792yem; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728953AbeIYPLf (ORCPT + 10 others); 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-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 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(-) -- 2.7.4 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; }