From patchwork Thu Jul 8 12:01:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 12365023 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE304C07E96 for ; Thu, 8 Jul 2021 11:58:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F7106141D for ; Thu, 8 Jul 2021 11:58:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231776AbhGHMB2 (ORCPT ); Thu, 8 Jul 2021 08:01:28 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:7806 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231773AbhGHMB2 (ORCPT ); Thu, 8 Jul 2021 08:01:28 -0400 Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 168Btxc9008114; Thu, 8 Jul 2021 07:58:32 -0400 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com with ESMTP id 39nub31aw7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jul 2021 07:58:32 -0400 Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 168BwUsh042533 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Jul 2021 07:58:30 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.5; Thu, 8 Jul 2021 07:58:30 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.858.5 via Frontend Transport; Thu, 8 Jul 2021 07:58:30 -0400 Received: from nsa.ad.analog.com ([10.44.3.58]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 168BwPto020146; Thu, 8 Jul 2021 07:58:29 -0400 From: =?utf-8?q?Nuno_S=C3=A1?= To: , CC: Guenter Roeck , Rob Herring , Jean Delvare Subject: [RFC PATCH 1/6] hwmon: axi-fan-control: make sure the clock is enabled Date: Thu, 8 Jul 2021 14:01:06 +0200 Message-ID: <20210708120111.519444-2-nuno.sa@analog.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210708120111.519444-1-nuno.sa@analog.com> References: <20210708120111.519444-1-nuno.sa@analog.com> MIME-Version: 1.0 X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: GX0tjEgwNm9NRaMiHIghe33laSuLxzav X-Proofpoint-ORIG-GUID: GX0tjEgwNm9NRaMiHIghe33laSuLxzav X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-08_06:2021-07-08,2021-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107080067 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org The core will only work if it's clock is enabled. This patch is a minor enhancement to make sure that's the case. Signed-off-by: Nuno Sá --- drivers/hwmon/axi-fan-control.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/hwmon/axi-fan-control.c b/drivers/hwmon/axi-fan-control.c index e3f6b03e6764..901d1588234d 100644 --- a/drivers/hwmon/axi-fan-control.c +++ b/drivers/hwmon/axi-fan-control.c @@ -351,6 +351,11 @@ static int axi_fan_control_init(struct axi_fan_control_data *ctl, return ret; } +static void axi_fan_control_clk_disable(void *clk) +{ + clk_disable_unprepare(clk); +} + static const struct hwmon_channel_info *axi_fan_control_info[] = { HWMON_CHANNEL_INFO(pwm, HWMON_PWM_INPUT), HWMON_CHANNEL_INFO(fan, HWMON_F_INPUT | HWMON_F_FAULT | HWMON_F_LABEL), @@ -406,6 +411,14 @@ static int axi_fan_control_probe(struct platform_device *pdev) return PTR_ERR(clk); } + ret = clk_prepare_enable(clk); + if (ret) + return ret; + + ret = devm_add_action_or_reset(&pdev->dev, axi_fan_control_clk_disable, clk); + if (ret) + return ret; + ctl->clk_rate = clk_get_rate(clk); if (!ctl->clk_rate) return -EINVAL; From patchwork Thu Jul 8 12:01:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 12365025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5FADC07E9C for ; Thu, 8 Jul 2021 11:58:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3DA36141D for ; Thu, 8 Jul 2021 11:58:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231777AbhGHMB3 (ORCPT ); Thu, 8 Jul 2021 08:01:29 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:9422 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231773AbhGHMB3 (ORCPT ); Thu, 8 Jul 2021 08:01:29 -0400 Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 168BteFm005563; Thu, 8 Jul 2021 07:58:33 -0400 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com with ESMTP id 39mehm2qjk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jul 2021 07:58:33 -0400 Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 168BwW31042537 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Jul 2021 07:58:32 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.5; Thu, 8 Jul 2021 07:58:31 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.858.5 via Frontend Transport; Thu, 8 Jul 2021 07:58:31 -0400 Received: from nsa.ad.analog.com ([10.44.3.58]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 168BwPtp020146; Thu, 8 Jul 2021 07:58:30 -0400 From: =?utf-8?q?Nuno_S=C3=A1?= To: , CC: Guenter Roeck , Rob Herring , Jean Delvare Subject: [RFC PATCH 2/6] hwmon: axi-fan-control: add tacho devicetree properties Date: Thu, 8 Jul 2021 14:01:07 +0200 Message-ID: <20210708120111.519444-3-nuno.sa@analog.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210708120111.519444-1-nuno.sa@analog.com> References: <20210708120111.519444-1-nuno.sa@analog.com> MIME-Version: 1.0 X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: PFuYHh4RUs0bRZz2B4KFb2YwN0rTkcX5 X-Proofpoint-GUID: PFuYHh4RUs0bRZz2B4KFb2YwN0rTkcX5 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-08_06:2021-07-08,2021-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 phishscore=0 adultscore=0 clxscore=1015 spamscore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107080067 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org This core is capable to run without any user interaction and when it does, it uses some predefined values in order to evaluate the tacho signal from the FAN. These values depend on the attached FAN, so that the core now exposes registers to change them accordingly. The values are: * adi,tacho-25-us: Expected tacho signal when the PWM is 25%; * adi,tacho-50-us: Expected tacho signal when the PWM is 50%; * adi,tacho-75-us: Expected tacho signal when the PWM is 75%; * adi,tacho-100-us: Expected tacho signal when the PWM is 100%. Signed-off-by: Nuno Sá --- drivers/hwmon/axi-fan-control.c | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/hwmon/axi-fan-control.c b/drivers/hwmon/axi-fan-control.c index 901d1588234d..aa5a922f684d 100644 --- a/drivers/hwmon/axi-fan-control.c +++ b/drivers/hwmon/axi-fan-control.c @@ -23,6 +23,14 @@ #define ADI_REG_PWM_PERIOD 0x00c0 #define ADI_REG_TACH_MEASUR 0x00c4 #define ADI_REG_TEMPERATURE 0x00c8 +#define ADI_REG_TACH_25 0x0140 +#define ADI_REG_TACH_50 0x0144 +#define ADI_REG_TACH_75 0x0148 +#define ADI_REG_TACH_100 0x014c +#define ADI_REG_TACH_25_TOL 0x0150 +#define ADI_REG_TACH_50_TOL 0x0154 +#define ADI_REG_TACH_75_TOL 0x0158 +#define ADI_REG_TACH_100_TOL 0x015c #define ADI_REG_IRQ_MASK 0x0040 #define ADI_REG_IRQ_PENDING 0x0044 @@ -328,6 +336,7 @@ static int axi_fan_control_init(struct axi_fan_control_data *ctl, const struct device_node *np) { int ret; + u32 tacho_val; /* get fan pulses per revolution */ ret = of_property_read_u32(np, "pulses-per-revolution", &ctl->ppr); @@ -337,6 +346,31 @@ static int axi_fan_control_init(struct axi_fan_control_data *ctl, /* 1, 2 and 4 are the typical and accepted values */ if (ctl->ppr != 1 && ctl->ppr != 2 && ctl->ppr != 4) return -EINVAL; + + if (!of_property_read_u32(np, "adi,tacho-25-us", &tacho_val)) { + tacho_val = DIV_ROUND_CLOSEST_ULL((u64)tacho_val * ctl->clk_rate, 1000000); + axi_iowrite(tacho_val, ADI_REG_TACH_25, ctl); + axi_iowrite(DIV_ROUND_CLOSEST(tacho_val * 25, 100), ADI_REG_TACH_25_TOL, ctl); + } + + if (!of_property_read_u32(np, "adi,tacho-50-us", &tacho_val)) { + tacho_val = DIV_ROUND_CLOSEST_ULL((u64)tacho_val * ctl->clk_rate, 1000000); + axi_iowrite(tacho_val, ADI_REG_TACH_50, ctl); + axi_iowrite(DIV_ROUND_CLOSEST(tacho_val * 25, 100), ADI_REG_TACH_50_TOL, ctl); + } + + if (!of_property_read_u32(np, "adi,tacho-75-us", &tacho_val)) { + tacho_val = DIV_ROUND_CLOSEST_ULL((u64)tacho_val * ctl->clk_rate, 1000000); + axi_iowrite(tacho_val, ADI_REG_TACH_75, ctl); + axi_iowrite(DIV_ROUND_CLOSEST(tacho_val * 25, 100), ADI_REG_TACH_75_TOL, ctl); + } + + if (!of_property_read_u32(np, "adi,tacho-100-us", &tacho_val)) { + tacho_val = DIV_ROUND_CLOSEST_ULL((u64)tacho_val * ctl->clk_rate, 1000000); + axi_iowrite(tacho_val, ADI_REG_TACH_100, ctl); + axi_iowrite(DIV_ROUND_CLOSEST(tacho_val * 25, 100), ADI_REG_TACH_100_TOL, ctl); + } + /* * Enable all IRQs */ From patchwork Thu Jul 8 12:01:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 12365027 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B97D6C07E96 for ; Thu, 8 Jul 2021 11:58:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C14D61184 for ; Thu, 8 Jul 2021 11:58:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231727AbhGHMBa (ORCPT ); Thu, 8 Jul 2021 08:01:30 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:10406 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231773AbhGHMBa (ORCPT ); Thu, 8 Jul 2021 08:01:30 -0400 Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 168Bt1MC004631; Thu, 8 Jul 2021 07:58:34 -0400 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com with ESMTP id 39mehm2qjq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jul 2021 07:58:34 -0400 Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 168BwXHT042541 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Jul 2021 07:58:33 -0400 Received: from ASHBCASHYB5.ad.analog.com (10.64.17.133) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.5; Thu, 8 Jul 2021 07:58:32 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB5.ad.analog.com (10.64.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.5; Thu, 8 Jul 2021 07:58:32 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.858.5 via Frontend Transport; Thu, 8 Jul 2021 07:58:32 -0400 Received: from nsa.ad.analog.com ([10.44.3.58]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 168BwPtq020146; Thu, 8 Jul 2021 07:58:31 -0400 From: =?utf-8?q?Nuno_S=C3=A1?= To: , CC: Guenter Roeck , Rob Herring , "Jean Delvare" Subject: [RFC PATCH 3/6] dt-bindings: axi-fan-control: add tacho properties Date: Thu, 8 Jul 2021 14:01:08 +0200 Message-ID: <20210708120111.519444-4-nuno.sa@analog.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210708120111.519444-1-nuno.sa@analog.com> References: <20210708120111.519444-1-nuno.sa@analog.com> MIME-Version: 1.0 X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: S_mhcHxlVRcYbj-GjLgdEdIiurr222r- X-Proofpoint-GUID: S_mhcHxlVRcYbj-GjLgdEdIiurr222r- X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-08_06:2021-07-08,2021-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 phishscore=0 adultscore=0 clxscore=1015 spamscore=0 suspectscore=0 mlxlogscore=983 impostorscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107080067 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Add the bindings for the tacho signal evaluation parameters which depend on the FAN being used. Signed-off-by: Nuno Sá --- .../bindings/hwmon/adi,axi-fan-control.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml b/Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml index 6747b870f297..0481eb34d9f1 100644 --- a/Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml +++ b/Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml @@ -37,6 +37,18 @@ properties: $ref: /schemas/types.yaml#/definitions/uint32 enum: [1, 2, 4] + adi,tacho-25-us: + description: Expected tacho signal when the PWM is at 25%. + + adi,tacho-50-us: + description: Expected tacho signal when the PWM is at 50%. + + adi,tacho-75-us: + description: Expected tacho signal when the PWM is at 75%. + + adi,tacho-100-us: + description: Expected tacho signal when the PWM is at 100%. + required: - compatible - reg From patchwork Thu Jul 8 12:01:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 12365029 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD6B2C07E96 for ; Thu, 8 Jul 2021 11:59:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A08866141D for ; Thu, 8 Jul 2021 11:59:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231811AbhGHMB7 (ORCPT ); Thu, 8 Jul 2021 08:01:59 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:40542 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231802AbhGHMB5 (ORCPT ); Thu, 8 Jul 2021 08:01:57 -0400 Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 168BtxcA008114; Thu, 8 Jul 2021 07:58:35 -0400 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com with ESMTP id 39nub31awe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jul 2021 07:58:35 -0400 Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 168BwYHV042545 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Jul 2021 07:58:34 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.5; Thu, 8 Jul 2021 07:58:33 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.858.5 via Frontend Transport; Thu, 8 Jul 2021 07:58:33 -0400 Received: from nsa.ad.analog.com ([10.44.3.58]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 168BwPtr020146; Thu, 8 Jul 2021 07:58:32 -0400 From: =?utf-8?q?Nuno_S=C3=A1?= To: , CC: Guenter Roeck , Rob Herring , Jean Delvare Subject: [RFC PATCH 4/6] hwmon: axi-fan-control: handle irqs in natural order Date: Thu, 8 Jul 2021 14:01:09 +0200 Message-ID: <20210708120111.519444-5-nuno.sa@analog.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210708120111.519444-1-nuno.sa@analog.com> References: <20210708120111.519444-1-nuno.sa@analog.com> MIME-Version: 1.0 X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: nkpMBqpEh5EU8BYZKgn7NunHrr5zNG3w X-Proofpoint-ORIG-GUID: nkpMBqpEh5EU8BYZKgn7NunHrr5zNG3w X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-08_06:2021-07-08,2021-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 malwarescore=0 mlxlogscore=813 suspectscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107080067 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org The core will now start out of reset at boot as soon as clocking is available. Hence, by the time we unmask the interrupts we already might have some of them set. Thus, it's important to handle them in the natural order the core generates them. Otherwise, we could process 'ADI_IRQ_SRC_PWM_CHANGED' before 'ADI_IRQ_SRC_TEMP_INCREASE' and erroneously set 'update_tacho_params' to true. Signed-off-by: Nuno Sá --- drivers/hwmon/axi-fan-control.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/hwmon/axi-fan-control.c b/drivers/hwmon/axi-fan-control.c index aa5a922f684d..d4b62d54375b 100644 --- a/drivers/hwmon/axi-fan-control.c +++ b/drivers/hwmon/axi-fan-control.c @@ -291,18 +291,9 @@ static irqreturn_t axi_fan_control_irq_handler(int irq, void *data) u32 irq_pending = axi_ioread(ADI_REG_IRQ_PENDING, ctl); u32 clear_mask; - if (irq_pending & ADI_IRQ_SRC_NEW_MEASUR) { - if (ctl->update_tacho_params) { - u32 new_tach = axi_ioread(ADI_REG_TACH_MEASUR, ctl); - - /* get 25% tolerance */ - u32 tach_tol = DIV_ROUND_CLOSEST(new_tach * 25, 100); - /* set new tacho parameters */ - axi_iowrite(new_tach, ADI_REG_TACH_PERIOD, ctl); - axi_iowrite(tach_tol, ADI_REG_TACH_TOLERANCE, ctl); - ctl->update_tacho_params = false; - } - } + if (irq_pending & ADI_IRQ_SRC_TEMP_INCREASE) + /* hardware requested a new pwm */ + ctl->hw_pwm_req = true; if (irq_pending & ADI_IRQ_SRC_PWM_CHANGED) { /* @@ -318,9 +309,18 @@ static irqreturn_t axi_fan_control_irq_handler(int irq, void *data) } } - if (irq_pending & ADI_IRQ_SRC_TEMP_INCREASE) - /* hardware requested a new pwm */ - ctl->hw_pwm_req = true; + if (irq_pending & ADI_IRQ_SRC_NEW_MEASUR) { + if (ctl->update_tacho_params) { + u32 new_tach = axi_ioread(ADI_REG_TACH_MEASUR, ctl); + /* get 25% tolerance */ + u32 tach_tol = DIV_ROUND_CLOSEST(new_tach * 25, 100); + + /* set new tacho parameters */ + axi_iowrite(new_tach, ADI_REG_TACH_PERIOD, ctl); + axi_iowrite(tach_tol, ADI_REG_TACH_TOLERANCE, ctl); + ctl->update_tacho_params = false; + } + } if (irq_pending & ADI_IRQ_SRC_TACH_ERR) ctl->fan_fault = 1; From patchwork Thu Jul 8 12:01:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 12365063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BE0BC07E96 for ; Thu, 8 Jul 2021 12:08:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3300661493 for ; Thu, 8 Jul 2021 12:08:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231437AbhGHMKx (ORCPT ); Thu, 8 Jul 2021 08:10:53 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:50756 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231347AbhGHMKx (ORCPT ); Thu, 8 Jul 2021 08:10:53 -0400 Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 168Bt2di004728; Thu, 8 Jul 2021 07:58:36 -0400 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com with ESMTP id 39mehm2qjt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jul 2021 07:58:36 -0400 Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 168BwZkl042549 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Jul 2021 07:58:35 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.5; Thu, 8 Jul 2021 07:58:34 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.858.5 via Frontend Transport; Thu, 8 Jul 2021 07:58:34 -0400 Received: from nsa.ad.analog.com ([10.44.3.58]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 168BwPts020146; Thu, 8 Jul 2021 07:58:33 -0400 From: =?utf-8?q?Nuno_S=C3=A1?= To: , CC: Guenter Roeck , Rob Herring , Jean Delvare Subject: [RFC PATCH 5/6] hwmon: axi-fan-control: clear the fan fault irq at startup Date: Thu, 8 Jul 2021 14:01:10 +0200 Message-ID: <20210708120111.519444-6-nuno.sa@analog.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210708120111.519444-1-nuno.sa@analog.com> References: <20210708120111.519444-1-nuno.sa@analog.com> MIME-Version: 1.0 X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: Q8ykOz8sdWLmsg0O3Th9RWi2W7PeH1ci X-Proofpoint-GUID: Q8ykOz8sdWLmsg0O3Th9RWi2W7PeH1ci X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-08_06:2021-07-08,2021-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 phishscore=0 adultscore=0 clxscore=1015 spamscore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107080067 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org The core might pull itself out of reset automatically which means it can run with invalid tacho evaluation parameters for some time. Thus, it will trigger a FAN FAULT interrupt as soon as we unmask it. Some userland apps might be sensitive to this and act drastically. Hence, we will clear it here and if there's something really wrong with the FAN or the evaluation parameters, we'll get that interrupt again... Signed-off-by: Nuno Sá --- drivers/hwmon/axi-fan-control.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/hwmon/axi-fan-control.c b/drivers/hwmon/axi-fan-control.c index d4b62d54375b..59c9babb3850 100644 --- a/drivers/hwmon/axi-fan-control.c +++ b/drivers/hwmon/axi-fan-control.c @@ -379,6 +379,15 @@ static int axi_fan_control_init(struct axi_fan_control_data *ctl, ADI_IRQ_SRC_PWM_CHANGED | ADI_IRQ_SRC_TEMP_INCREASE), ADI_REG_IRQ_MASK, ctl); + /* + * The core might pull itself out of reset automatically which means it can run with + * invalid tacho evaluation parameters for some time. Thus, it will trigger a FAN + * FAULT interrupt as soon as we unmask it(and some userland apps might be sensitive to + * this). Hence, we will clear it here and if there's something really wrong with the + * FAN or the evaluation parameters, we'll get that interrupt again... + */ + axi_iowrite(ADI_IRQ_SRC_TACH_ERR, ADI_REG_IRQ_PENDING, ctl); + /* bring the device out of reset */ axi_iowrite(0x01, ADI_REG_RSTN, ctl); From patchwork Thu Jul 8 12:01:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 12365031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25DB6C07E9C for ; Thu, 8 Jul 2021 11:59:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07F6A61469 for ; Thu, 8 Jul 2021 11:59:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231933AbhGHMCY (ORCPT ); Thu, 8 Jul 2021 08:02:24 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:2354 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231397AbhGHMCX (ORCPT ); Thu, 8 Jul 2021 08:02:23 -0400 Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 168BteFn005563; Thu, 8 Jul 2021 07:58:37 -0400 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com with ESMTP id 39mehm2qju-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jul 2021 07:58:37 -0400 Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 168BwaMX042553 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Jul 2021 07:58:36 -0400 Received: from ASHBCASHYB5.ad.analog.com (10.64.17.133) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.5; Thu, 8 Jul 2021 07:58:35 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB5.ad.analog.com (10.64.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.5; Thu, 8 Jul 2021 07:58:35 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.858.5 via Frontend Transport; Thu, 8 Jul 2021 07:58:35 -0400 Received: from nsa.ad.analog.com ([10.44.3.58]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 168BwPtt020146; Thu, 8 Jul 2021 07:58:34 -0400 From: =?utf-8?q?Nuno_S=C3=A1?= To: , CC: Guenter Roeck , Rob Herring , "Jean Delvare" Subject: [RFC PATCH 6/6] hwmon: axi-fan-control: support temperature vs pwm points Date: Thu, 8 Jul 2021 14:01:11 +0200 Message-ID: <20210708120111.519444-7-nuno.sa@analog.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210708120111.519444-1-nuno.sa@analog.com> References: <20210708120111.519444-1-nuno.sa@analog.com> MIME-Version: 1.0 X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: 9IbDYt3Okw1I8wB2WXlxaUUBMsXkCydU X-Proofpoint-GUID: 9IbDYt3Okw1I8wB2WXlxaUUBMsXkCydU X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-08_06:2021-07-08,2021-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 phishscore=0 adultscore=0 clxscore=1015 spamscore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107080067 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org The HW has some predefined points where it will associate a PWM value. However some users might want to better set these points to their usecases. This patch exposes these points as pwm auto_points: * pwm1_auto_point1_temp: temperature threshold below which PWM should be 0%; * pwm1_auto_point2_temp: temperature threshold above which PWM should be 25%; * pwm1_auto_point3_temp: temperature threshold below which PWM should be 25%; * pwm1_auto_point4_temp: temperature threshold above which PWM should be 50%; * pwm1_auto_point5_temp: temperature threshold below which PWM should be 50%; * pwm1_auto_point6_temp: temperature threshold above which PWM should be 75%; * pwm1_auto_point7_temp: temperature threshold below which PWM should be 75%; * pwm1_auto_point8_temp: temperature threshold above which PWM should be 100%; Signed-off-by: Nuno Sá --- drivers/hwmon/axi-fan-control.c | 74 ++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/axi-fan-control.c b/drivers/hwmon/axi-fan-control.c index 59c9babb3850..80b216448f47 100644 --- a/drivers/hwmon/axi-fan-control.c +++ b/drivers/hwmon/axi-fan-control.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +32,14 @@ #define ADI_REG_TACH_50_TOL 0x0154 #define ADI_REG_TACH_75_TOL 0x0158 #define ADI_REG_TACH_100_TOL 0x015c +#define ADI_REG_TEMP_00_H 0x0100 +#define ADI_REG_TEMP_25_L 0x0104 +#define ADI_REG_TEMP_25_H 0x0108 +#define ADI_REG_TEMP_50_L 0x010c +#define ADI_REG_TEMP_50_H 0x0110 +#define ADI_REG_TEMP_75_L 0x0114 +#define ADI_REG_TEMP_75_H 0x0118 +#define ADI_REG_TEMP_100_L 0x011c #define ADI_REG_IRQ_MASK 0x0040 #define ADI_REG_IRQ_PENDING 0x0044 @@ -70,6 +79,39 @@ static inline u32 axi_ioread(const u32 reg, return ioread32(ctl->base + reg); } +/* + * The core calculates the temperature as: + * T = /raw * 509.3140064 / 65535) - 280.2308787 + */ +static ssize_t axi_fan_control_show(struct device *dev, struct device_attribute *da, char *buf) +{ + struct axi_fan_control_data *ctl = dev_get_drvdata(dev); + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u32 temp = axi_ioread(attr->index, ctl); + + temp = DIV_ROUND_CLOSEST_ULL(temp * 509314ULL, 65535) - 280230; + + return sprintf(buf, "%u\n", temp); +} + +static ssize_t axi_fan_control_store(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + struct axi_fan_control_data *ctl = dev_get_drvdata(dev); + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u32 temp; + int ret; + + ret = kstrtou32(buf, 10, &temp); + if (ret) + return ret; + + temp = DIV_ROUND_CLOSEST_ULL((temp + 280230) * 65535ULL, 509314); + axi_iowrite(temp, attr->index, ctl); + + return count; +} + static long axi_fan_control_get_pwm_duty(const struct axi_fan_control_data *ctl) { u32 pwm_width = axi_ioread(ADI_REG_PWM_WIDTH, ctl); @@ -418,6 +460,36 @@ static const struct hwmon_chip_info axi_chip_info = { .info = axi_fan_control_info, }; +/* temperature threshold below which PWM should be 0% */ +static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point1_temp, axi_fan_control, ADI_REG_TEMP_00_H); +/* temperature threshold above which PWM should be 25% */ +static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point2_temp, axi_fan_control, ADI_REG_TEMP_25_L); +/* temperature threshold below which PWM should be 25% */ +static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point3_temp, axi_fan_control, ADI_REG_TEMP_25_H); +/* temperature threshold above which PWM should be 50% */ +static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point4_temp, axi_fan_control, ADI_REG_TEMP_50_L); +/* temperature threshold below which PWM should be 50% */ +static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point5_temp, axi_fan_control, ADI_REG_TEMP_50_H); +/* temperature threshold above which PWM should be 75% */ +static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point6_temp, axi_fan_control, ADI_REG_TEMP_75_L); +/* temperature threshold below which PWM should be 75% */ +static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point7_temp, axi_fan_control, ADI_REG_TEMP_75_H); +/* temperature threshold above which PWM should be 100% */ +static SENSOR_DEVICE_ATTR_RW(pwm1_auto_point8_temp, axi_fan_control, ADI_REG_TEMP_100_L); + +static struct attribute *axi_fan_control_attrs[] = { + &sensor_dev_attr_pwm1_auto_point1_temp.dev_attr.attr, + &sensor_dev_attr_pwm1_auto_point2_temp.dev_attr.attr, + &sensor_dev_attr_pwm1_auto_point3_temp.dev_attr.attr, + &sensor_dev_attr_pwm1_auto_point4_temp.dev_attr.attr, + &sensor_dev_attr_pwm1_auto_point5_temp.dev_attr.attr, + &sensor_dev_attr_pwm1_auto_point6_temp.dev_attr.attr, + &sensor_dev_attr_pwm1_auto_point7_temp.dev_attr.attr, + &sensor_dev_attr_pwm1_auto_point8_temp.dev_attr.attr, + NULL, +}; +ATTRIBUTE_GROUPS(axi_fan_control); + static const u32 version_1_0_0 = ADI_AXI_PCORE_VER(1, 0, 'a'); static const struct of_device_id axi_fan_control_of_match[] = { @@ -502,7 +574,7 @@ static int axi_fan_control_probe(struct platform_device *pdev) name, ctl, &axi_chip_info, - NULL); + axi_fan_control_groups); return PTR_ERR_OR_ZERO(ctl->hdev); }