From patchwork Wed Aug 30 08:47:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 111280 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp594923qge; Wed, 30 Aug 2017 01:48:47 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5IWBQ2LckJT2RUkFQe3lFpHDAaVbDHcYiUhEpckCgFZRov/1bSZrXwWo2XwR6dKe8MdlFT X-Received: by 10.99.5.80 with SMTP id 77mr808243pgf.123.1504082927025; Wed, 30 Aug 2017 01:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504082927; cv=none; d=google.com; s=arc-20160816; b=IN0PrS4UBHrtequeTnYnfuc5exscoAZTCzhPBDc9kbRBZZ+qX5iVj1279P3JMBpnlz gyLeUU8sCmuqGcpXOtYbd/3SzJZ8kjyySDP1spkavQOs5dcJLRrIALdTGwYgqs6Q9Ike 4a32QZzjHOU0KqevxC0EtZkzFn4XBL67mrWr3EYSgw7K70w3EPKSnOLgKF8wnmt2xczw geyDXVCeeeC9x67L/MKtWeKpdv5ZznfFmZaF6Ail3mD9IW0cG/dOTLj7aj32dz+qK8N8 TsuEt47c1wjmsCJkEoSmdoSI7k0eqtwV6h1OE1g6qKIkwO8pQxPq3NKJ0YKdyaahY7cK eB7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=YiiH7NYEAO/UOamWR9f2Rz1Vgy7Bb3LIy2EJe955KuU=; b=Gmrg3LOtTppzrRBSL9iDP5VHj504A+DSDfvyL2oUn0//iNMO4uGqL06xyXV7u1pU83 cIazmOGFL7TU0ERoByl2X53xWMwz2PvoWeHeTzzUAOrNe2RfgnbQgvI1kERYfNnzVbNQ BNBZ0M2R7/DnFqhvMrdirknCqwQunZ0vP+GP+YjAT15Q90932jl+7U3tx23NdJwXn3NJ XiTS8PWDRIxRddU849PYqrXtZusOh3T+0+EStvX4lx8IzWYlVlEz8DXjF1OgctlVTo1Z cYMLSxJXcPS2AXaqXaNq/60uE3rG5DPmBPTyS6l8UnvCpdd89cLmTPho7rrmLRj17nRU JdgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LezZq4O0; 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 v12si4013779pfl.553.2017.08.30.01.48.46; Wed, 30 Aug 2017 01:48:47 -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=LezZq4O0; 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 S1751318AbdH3Isp (ORCPT + 12 others); Wed, 30 Aug 2017 04:48:45 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:37651 "EHLO mail-wr0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751271AbdH3Isp (ORCPT ); Wed, 30 Aug 2017 04:48:45 -0400 Received: by mail-wr0-f173.google.com with SMTP id k9so4227329wre.4 for ; Wed, 30 Aug 2017 01:48:44 -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; bh=YiiH7NYEAO/UOamWR9f2Rz1Vgy7Bb3LIy2EJe955KuU=; b=LezZq4O0rQOpKmS9W9kIjIj5yqwbownn13J4kPz5fuAdsdR2D74r7Csv4MvxhoGYzk Gon/8JHtXkWFCOEmif2QJFm6x2ba+YNzD+QDE5uRHEMFeMyyhyifn9IxfBrid6kIruZQ pCfU7V5ZSUrL5aGd+R6winHCwCO2ho63Nk/O4= 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; bh=YiiH7NYEAO/UOamWR9f2Rz1Vgy7Bb3LIy2EJe955KuU=; b=ZMvxI9KCY9TzW05JwtnnLKUi4QB5DJLWOYO1QkJjUKqJPBQ2ILnbvDUBLYMEHsvB5b AnAQMjDahDw3m6PnZnlfDoZc93TiX+xuMZJ9his7qTz/UxH1y2p20r8YJOsbFkLXzI6r M5uKD2W4MXm9CnFS090n7+ddoztn8iYAwh3xwchI1P5vpvrPEgSzM2K94Zjy3zhGwE4I 1xm8nM4SkY26NT7NAzPKmb/hf5I6oir/Eo2c9KCHOUZGLfEnTfOHupJnwj78cPZFFPBN 9nYh4c6tr5G8wwrlqedpj+ztMTpB7XMsQvyCvEfMZyfthtjMweWHmze025bnkYhDQpms 3o9w== X-Gm-Message-State: AHYfb5hhBHFkm3iJrppVuQPP7+XS6ctkQuCWFAdLdqTMgtUbEGICaolK YWaRgcYdcAkdSnlLbhFPrQ== X-Received: by 10.223.133.245 with SMTP id 50mr598022wru.22.1504082923943; Wed, 30 Aug 2017 01:48:43 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:b0b0:ba2b:b9fd:8a33]) by smtp.gmail.com with ESMTPSA id q24sm4032811wrc.26.2017.08.30.01.48.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Aug 2017 01:48:43 -0700 (PDT) From: Daniel Lezcano To: rui.zhang@intel.com, edubezval@gmail.com Cc: daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, kevin.wangtao@linaro.org, leo.yan@linaro.org, linux-kernel@vger.kernel.org (open list) Subject: [PATCH 01/13] thermal/drivers/hisi: Fix missing interrupt enablement Date: Wed, 30 Aug 2017 10:47:25 +0200 Message-Id: <1504082857-21702-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The interrupt for the temperature threshold is not enabled at the end of the probe function, enable it after the setup is complete. On the other side, the irq_enabled is not correctly set as we are checking if the interrupt is masked where 'yes' means irq_enabled=false. irq_get_irqchip_state(data->irq, IRQCHIP_STATE_MASKED, &data->irq_enabled); As we are always enabling the interrupt, it is pointless to check if the interrupt is masked or not, just set irq_enabled to 'true'. Signed-off-by: Daniel Lezcano --- drivers/thermal/hisi_thermal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.7.4 Reviewed-by: Leo Yan Tested-by: Leo Yan Reviewed-by: Leo Yan Reviewed-by: Leo Yan Reviewed-by: Leo Yan Tested-by: Leo Yan Reviewed-by: Leo Yan Tested-by: Leo Yan diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index bd3572c..8381696 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -345,8 +345,7 @@ static int hisi_thermal_probe(struct platform_device *pdev) } hisi_thermal_enable_bind_irq_sensor(data); - irq_get_irqchip_state(data->irq, IRQCHIP_STATE_MASKED, - &data->irq_enabled); + data->irq_enabled = true; for (i = 0; i < HISI_MAX_SENSORS; ++i) { ret = hisi_thermal_register_sensor(pdev, data, @@ -358,6 +357,8 @@ static int hisi_thermal_probe(struct platform_device *pdev) hisi_thermal_toggle_sensor(&data->sensors[i], true); } + enable_irq(data->irq); + return 0; } From patchwork Wed Aug 30 08:47:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 111290 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp596683qge; Wed, 30 Aug 2017 01:50:31 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7llmslduV9qeEpTFr6RJSOJ3MSf42y3EyfruJ+7Xcatbx7B27FLe9lw3ghZcHlgEbAynv6 X-Received: by 10.99.126.91 with SMTP id o27mr810330pgn.303.1504083030986; Wed, 30 Aug 2017 01:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504083030; cv=none; d=google.com; s=arc-20160816; b=D8zpneGHZXiEDY/jdDm+pFPFEaK6HpgIZwPZ6oD+ydHSpTBqvIMxKKn9X7jhRmbGEx mUqOq4hel09HBgb9UmMuJrmFR6iDGo2o2B8vPS3CT+lyBYSe9FKrQaVEwyiv69jdpJJ6 Bn5znw70MJ/noQMKaz4Fn1IOoftSb5H8TCYClIRFal8d5qgSPjImZGhUl/L2ZJ4hxYcm FrcAvVmJ09aAX9cTqL5jciUP5Kp5p0vCSeh9YaYdL0ezZu1ozOF4NOKHwRp8bgFedJND aRv9aDVzAO00Ty0uTtoJfx0pCi4gmgUyodaf2EvU00KaZZ17oiKy9lfWtf3WHtHKWDN+ S4dg== 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:arc-authentication-results; bh=sWYO6EitAyPiMvIpQ1GOQhd07ArsKV2hWYnc8iKouvc=; b=BthdE2YC7+WTDBPxCngGLp7ALfVCd6XLLjXQX0Z0I6bv+5lBKlgsm713bsHcH2Jop6 8CokWsqFXjVMECxWFXf6rO15DZd4y/Gpg8aFkD3PkCe3QbYKkzmq4dql8DQGeWKDjMBx Yy3Dx3IIh58ggxMMN4nc2FTUEy8SLVd7RvEIZdCXb/3UgUg6IpcnjtGGw1fVQ8riad2u oQTuD9z0tSeAt6k0OylR+xyjN1WD49CmkqzkTqOz/Qv0JPbaa5y9QUWRFCEIqRBanb/d AX081H23iklPqguuhLeDdPTOCZS2X3CKKRQdesLv/WpnKhPMSMWeFKU8RjvPQSjZOrcg IIaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HZAVuY9I; 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 t6si3973304pgt.643.2017.08.30.01.50.30; Wed, 30 Aug 2017 01:50:30 -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=HZAVuY9I; 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 S1751843AbdH3Iu3 (ORCPT + 12 others); Wed, 30 Aug 2017 04:50:29 -0400 Received: from mail-wr0-f169.google.com ([209.85.128.169]:38384 "EHLO mail-wr0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751550AbdH3Is5 (ORCPT ); Wed, 30 Aug 2017 04:48:57 -0400 Received: by mail-wr0-f169.google.com with SMTP id 40so15984604wrv.5 for ; Wed, 30 Aug 2017 01:48:56 -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=sWYO6EitAyPiMvIpQ1GOQhd07ArsKV2hWYnc8iKouvc=; b=HZAVuY9Iop6dNhjNOl/ln7F4c5MXaZOLyCI1LWZPmVvdtc8ngB3cXt2o8fm6vDQkxN qNXGq86eNogPj2PifBD1EX0qFq2QYwVp3u6vyKBx9SHxvy85sRf5TZXXzsXNQhkagKOm 74RGAadUNMYGowaiF/l649rY/T+U1gLAwWhUU= 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=sWYO6EitAyPiMvIpQ1GOQhd07ArsKV2hWYnc8iKouvc=; b=gMNHlTsgDP10LBHGmPLg+rrYVykeQ/mgEiL2rUXZnvDGVeXMvPfoyIw7/5KvySd66w m733I8Xpw5PruSjO1ZyztaaX9YO7liuCUtQWWHRcpZB951E/g66xb9SHnK7Sjotkny8I OuHSrYPG7xemcmR2GkvYOsMCZ/y32s6HEPpzXIESJigYuYNbUawR0cTYoHz2Q3yW6uGZ WVD74b7HVfrhWHhlR2iqhmUx+fuw2RGeiVm7sX5IxlDzXzkaGRNefaGmaaEkgXD1hKlY sz+lCBkzH/cmcalGedBg6Hae1/RekNKcluoyoFXCSK2iPYKkXVcpGsEyBjKecCVIEvB+ uirw== X-Gm-Message-State: AHYfb5gk53FRBWbzRai8AgeZQcapy6NMoOonnpuCghEYDm3QqD3jnF39 zReyKqiNieq7LhQn X-Received: by 10.223.132.132 with SMTP id 4mr527270wrg.253.1504082935637; Wed, 30 Aug 2017 01:48:55 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:b0b0:ba2b:b9fd:8a33]) by smtp.gmail.com with ESMTPSA id q24sm4032811wrc.26.2017.08.30.01.48.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Aug 2017 01:48:55 -0700 (PDT) From: Daniel Lezcano To: rui.zhang@intel.com, edubezval@gmail.com Cc: daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, kevin.wangtao@linaro.org, leo.yan@linaro.org, linux-kernel@vger.kernel.org (open list) Subject: [PATCH 08/13] thermal/drivers/hisi: Fix configuration register setting Date: Wed, 30 Aug 2017 10:47:32 +0200 Message-Id: <1504082857-21702-8-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504082857-21702-1-git-send-email-daniel.lezcano@linaro.org> References: <1504082857-21702-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 TEMP0_CFG configuration register contains different field to set up the temperature controller. However in the code, nothing prevents a setup to overwrite the previous one: eg. writing the hdak value overwrites the sensor selection, the sensor selection overwrites the hdak value. In order to prevent such thing, use a regmap-like mechanism by reading the value before, set the corresponding bits and write the result. Signed-off-by: Daniel Lezcano --- drivers/thermal/hisi_thermal.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index d77a938..3e03908 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -132,19 +132,39 @@ static inline void hisi_thermal_enable(void __iomem *addr, int value) writel(value, addr + TEMP0_EN); } -static inline void hisi_thermal_sensor_select(void __iomem *addr, int sensor) +static inline int hisi_thermal_get_temperature(void __iomem *addr) { - writel((sensor << 12), addr + TEMP0_CFG); + return hisi_thermal_step_to_temp(readl(addr + TEMP0_VALUE)); } -static inline int hisi_thermal_get_temperature(void __iomem *addr) +/* + * Temperature configuration register - Sensor selection + * + * Bits [19:12] + * + * 0x0: local sensor (default) + * 0x1: remote sensor 1 (ACPU cluster 1) + * 0x2: remote sensor 2 (ACPU cluster 0) + * 0x3: remote sensor 3 (G3D) + */ +static inline void hisi_thermal_sensor_select(void __iomem *addr, int sensor) { - return hisi_thermal_step_to_temp(readl(addr + TEMP0_VALUE)); + writel(readl(addr + TEMP0_CFG) | (sensor << 12), addr + TEMP0_CFG); } +/* + * Temperature configuration register - Hdak conversion polling interval + * + * Bits [5:4] + * + * 0x0 : 0.768 ms + * 0x1 : 6.144 ms + * 0x2 : 49.152 ms + * 0x3 : 393.216 ms + */ static inline void hisi_thermal_hdak_set(void __iomem *addr, int value) { - writel(value, addr + TEMP0_CFG); + writel(readl(addr + TEMP0_CFG) | (value << 4), addr + TEMP0_CFG); } static long hisi_thermal_get_sensor_temp(struct hisi_thermal_data *data, From patchwork Wed Aug 30 08:47:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 111285 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp595273qge; Wed, 30 Aug 2017 01:49:07 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5+Gj78PMt/jtt/4s5IF9lUX8abzVgKzZMyJkHVfZmmzr2HTrmVBk43jWWYOHqgWTBpnuMn X-Received: by 10.84.224.72 with SMTP id a8mr1051743plt.92.1504082947697; Wed, 30 Aug 2017 01:49:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504082947; cv=none; d=google.com; s=arc-20160816; b=IgIJZ04h10c8FKZ6lb6JYzn22mA2YFMwHgXpGVl52qKMCZcltHCTV/i/Dk1Uvzf8C0 4IkSUI3nAygnSgKn+nL6RK6qh8FLIwNfxqhC5qF9l7OiZiUEXOHEc767btwYxfvuIpBk oFaZfNvkRTZP8HeJGWlbvYywYz2wzJ9vjfnaTdda97ittLbrU9ZmOUMbs4xn05l+XZ9j mS1IlFiLyR+u9UGaVvi6uzQqz/gtvFCwG1XBRG1Ry/9DzeO2I4HLuv5WUiHURfblEYyz qUND/4LlmCfeZ2d2kzcK4U2NyCCzZc/e1s6eYuevWlqpkH5oQW1AcS8DDhcmTgzAJLSD K8uw== 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:arc-authentication-results; bh=L59o5KhOAnbWNvbrzjq5OFkzNtbbH5svlrsIshlHsPU=; b=gnOclNuDFcXsuz8WX8Q+KQ/fOz9ZFL4C/Bte5cL9Dn+OzjPDUN9hIgJJoUu9uGRb3k OJk+iXu9uBHhusIidCtG+BSzt7GOKHtCNOSvFfqxTqkQrs63bfHRSe6N1+qgTlyP3AGl t8Z9pLTj+Brs4zzaSbXZbE0tsxI+nMQimOwJJQDoWCvsyiUFpo7pwkchWp/2R5/ramMX 1EBqiJOuEujXmMBXYL22xyuSN48krQRwo6BFkah948D+LOqwqXXbNJhRW7hMF3gwnRgT fcC+FPcTtWUOnegdIbnkBzGWHB2fxzdXbGasWxRiDp7g7KLBpjYeRYtWlM5+WPqGLAli FI0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BN02T81J; 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 h185si3913779pfb.398.2017.08.30.01.49.07; Wed, 30 Aug 2017 01:49:07 -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=BN02T81J; 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 S1751693AbdH3ItD (ORCPT + 12 others); Wed, 30 Aug 2017 04:49:03 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:35095 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751622AbdH3ItA (ORCPT ); Wed, 30 Aug 2017 04:49:00 -0400 Received: by mail-wm0-f54.google.com with SMTP id a80so5554232wma.0 for ; Wed, 30 Aug 2017 01:48:59 -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=L59o5KhOAnbWNvbrzjq5OFkzNtbbH5svlrsIshlHsPU=; b=BN02T81JriQTOnrgmFQMmK6q2ut1iHyZtRPEDKV2d4iLP6TgYXbUl83FOqFEFePSIY 1prjllez6yAtklzDNYSFqYy6NeozqY68swZL7DrejjlbmkiUDIjZqqJkJw7ttuMArATj iwZH72Ns7k30/gyWbL3vdxYeq2n2gIgS9WlbQ= 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=L59o5KhOAnbWNvbrzjq5OFkzNtbbH5svlrsIshlHsPU=; b=IbxeO68K/dYpcLzHt7+r0/k7EqbezpRnITWdc8GV2MzQlCNXTuhURbxiLnrXDjHuek wbxfRysFokGD9la60rL8jD1pOmRjpVNcvMGbvnGpHQ/jEpja2vwx/64uwN8Q99O9mE30 pLbymzO/OawzRNt0gakNg+5WR7gkJSoyeUwWCtqHRv5D2eSJWrAKP7viUWWOtAPoAVdd FkzNNhjCazwXKA29ic2Ce9Vb5CJzjLqbNxqMgRESnSkppP/+RXHoXTxYrOh+upaRBEus 39hzqt4klT2HGEYbetVbvgfkVKjT6v3nsxIugLEGCeSBwnd/VoJo6cCQMzVovqv0jTnR kPYg== X-Gm-Message-State: AHYfb5hROr+KyMu/SDFqYd5glAfTWRYKtDCvrF5I1YLqztM5hnRlrfR4 ezNi/FgvYMmfKpbk X-Received: by 10.28.143.5 with SMTP id r5mr721424wmd.77.1504082938922; Wed, 30 Aug 2017 01:48:58 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:b0b0:ba2b:b9fd:8a33]) by smtp.gmail.com with ESMTPSA id q24sm4032811wrc.26.2017.08.30.01.48.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Aug 2017 01:48:58 -0700 (PDT) From: Daniel Lezcano To: rui.zhang@intel.com, edubezval@gmail.com Cc: daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, kevin.wangtao@linaro.org, leo.yan@linaro.org, linux-kernel@vger.kernel.org (open list) Subject: [PATCH 10/13] thermal/drivers/hisi: Rename and remove unused field Date: Wed, 30 Aug 2017 10:47:34 +0200 Message-Id: <1504082857-21702-10-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504082857-21702-1-git-send-email-daniel.lezcano@linaro.org> References: <1504082857-21702-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 Rename the 'sensors' field to 'sensor' as we describe only one sensor. Remove the 'sensor_temp' as it is no longer used. Signed-off-by: Daniel Lezcano --- drivers/thermal/hisi_thermal.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) -- 2.7.4 Reviewed-by: Leo Yan Tested-by: Leo Yan diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index b038d8a..68b625c 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -47,8 +47,6 @@ struct hisi_thermal_sensor { struct hisi_thermal_data *thermal; struct thermal_zone_device *tzd; - - long sensor_temp; uint32_t id; uint32_t thres_temp; }; @@ -57,9 +55,9 @@ struct hisi_thermal_data { struct mutex thermal_lock; /* protects register data */ struct platform_device *pdev; struct clk *clk; - struct hisi_thermal_sensor sensors; - int irq; + struct hisi_thermal_sensor sensor; void __iomem *regs; + int irq; }; /* @@ -229,7 +227,7 @@ static const struct thermal_zone_of_device_ops hisi_of_thermal_ops = { static irqreturn_t hisi_thermal_alarm_irq_thread(int irq, void *dev) { struct hisi_thermal_data *data = dev; - struct hisi_thermal_sensor *sensor = &data->sensors; + struct hisi_thermal_sensor *sensor = &data->sensor; int temp; hisi_thermal_alarm_clear(data->regs, 1); @@ -240,7 +238,7 @@ static irqreturn_t hisi_thermal_alarm_irq_thread(int irq, void *dev) dev_crit(&data->pdev->dev, "THERMAL ALARM: %d > %d\n", temp, sensor->thres_temp); - thermal_zone_device_update(data->sensors.tzd, + thermal_zone_device_update(data->sensor.tzd, THERMAL_EVENT_UNSPECIFIED); } else if (temp < sensor->thres_temp) { @@ -303,7 +301,7 @@ static int hisi_thermal_setup(struct hisi_thermal_data *data) { struct hisi_thermal_sensor *sensor; - sensor = &data->sensors; + sensor = &data->sensor; /* disable module firstly */ hisi_thermal_reset_enable(data->regs, 0); @@ -376,7 +374,7 @@ static int hisi_thermal_probe(struct platform_device *pdev) } ret = hisi_thermal_register_sensor(pdev, data, - &data->sensors, + &data->sensor, HISI_DEFAULT_SENSOR); if (ret) { dev_err(&pdev->dev, "failed to register thermal sensor: %d\n", @@ -398,7 +396,7 @@ static int hisi_thermal_probe(struct platform_device *pdev) return ret; } - hisi_thermal_toggle_sensor(&data->sensors, true); + hisi_thermal_toggle_sensor(&data->sensor, true); return 0; } @@ -406,7 +404,7 @@ static int hisi_thermal_probe(struct platform_device *pdev) static int hisi_thermal_remove(struct platform_device *pdev) { struct hisi_thermal_data *data = platform_get_drvdata(pdev); - struct hisi_thermal_sensor *sensor = &data->sensors; + struct hisi_thermal_sensor *sensor = &data->sensor; hisi_thermal_toggle_sensor(sensor, false); hisi_thermal_disable_sensor(data);