Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1516993lqt; Sat, 8 Jun 2024 01:13:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5uU/JvrmOf2fdOVWqiuyKwIfAc23YjiV15sKjLaF+T1QNEd9gDgN9Eeb/vHEjsruy+DaiwqdMuT7s24559gg3vUqZCatOqSqOczPn4Q== X-Google-Smtp-Source: AGHT+IEMaLjR6ru2if3eMQezSgpXApWQgHL49eExTB7UZ/quTBwojN9Ftm+e9h+mWH0b39rPKM0V X-Received: by 2002:a50:f60b:0:b0:57c:5874:4f5c with SMTP id 4fb4d7f45d1cf-57c5874587emr3082518a12.32.1717834392064; Sat, 08 Jun 2024 01:13:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717834392; cv=pass; d=google.com; s=arc-20160816; b=HmDaDkAroHZpe8MDiLpYU81YmmvqlPlaJpV7fHMpRUWRgARzToDRr6Mmmp9YxdrXVf UNzEtIPPoREZkGA1AWzsn5YhpKWwyF68uhNGlq3NtAazOf5J525w3X2uRF1L9k2HSocg 8uGZOAyB2Ko5/resMwM8LgntYl7jQrqZhlAEuvMQDJnt/hverR0cG2AclVn9oyDbdAS1 h6plVua6nIoCSJRnDy21qycsk+1oC5xqgYyAC9a/gHoZF8cR34yXbpIqSeaVj3HB2Mt9 fJBXpxP7K7sVfeGrICd5qVXmQnIALUMmwGdu1fdj3EJVSCXD+ZXXwSshAWc3lDImmiYk +JsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=M6+8Sx8xUecUPQkIa+MW0BM9AKL5SBM4NVPULLNihnk=; fh=5AL+W+VRaKXi95ohmAitFf8Afj0BM5Bnt/5VviAo1h8=; b=I6yGu9drm6d0Y5oBNLvmMRA2NKSHI9HsW3NVA0UUwWZW1Tm6QG9O8NKgpxrRK42D2Z 9dScKgHKEhfIRiAcX0CNeQwer85vNniGS6IeoUF58spNceFyGIAhuugSOAN9R3LJSsXc ktKZeoweDAWrlPmiIY5X8GF8bCjrIYLTMYMWSNPnegpvj+/GWjPK2UKP7uQz9CAt4Zhk xpIxfPh/tQVKCKWsA5ZhoK8zz6U6Df0gwUTxgWpmDrl6wgm4KoB8b9zeAqOwOLKGL+sv RL5DHLndlCXRE00UBl5i9eUVAsMsJIT5cNxFFchJZvL3U4trQBb6WMwx4Y7UF80tudaV 3TpA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=gthcl2iv; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-206944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206944-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c619f8f86si958061a12.512.2024.06.08.01.13.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 01:13:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=gthcl2iv; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-206944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206944-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C57001F22391 for ; Sat, 8 Jun 2024 08:13:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 661A9177983; Sat, 8 Jun 2024 08:12:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="gthcl2iv" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72E42176ABC; Sat, 8 Jun 2024 08:12:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717834372; cv=none; b=WWZVBmwih0CM9Sc/oYR8/zfHrWWGL+hNQWMWf6TKCnOZvV+qQKC3V/Cc8MsepDOBmVkTftE6GsE0VOIzKhPPc28trnj0GcrxOzbCdmz4o9uOf5aPTcJjSdR8MyeIIwMjAPmWLDdVGLMG+C3FHjxK1sAua8omNXruN/W04eQnrc0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717834372; c=relaxed/simple; bh=uOqrwTrndkshyrpD+eXmWOKCmadDalmhjImwkQ3pihs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qXFjFPU4FMUBGrtBTnyLJc06Jn2lVJ74f/mXrE3TPdGsYFAVKisikCuTc8jd6/yyNgVluiEWR/b6+zBxa6/66LTIY8RA74aeBmq7mfOXq6nUlfJ930QKtFiZLGTNlc3gIYuw9rvhM6jCHlRUs0l57FLJK2lVfReKLn7RDUroz4w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=gthcl2iv; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1717834365; bh=uOqrwTrndkshyrpD+eXmWOKCmadDalmhjImwkQ3pihs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gthcl2ivvcxPygDOG+vr7Mvnq8Lzvgyf+wRW7rujHo4L4uJn71ZiGX2bt9nGwgNhR 2W2qBRQLMaL6E+a9UXuIMcc71Bz16V0+Y86/oAiJt2jlPgZGd85H7gJC/qKNMPk8Xi /uQj+i4wOFQsysxPd91Sx/eVc3BwiY5YhpxZpLfs= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 08 Jun 2024 10:12:46 +0200 Subject: [PATCH 4/5] hwmon: (cros_ec) Split temperature channel params Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240608-cros_ec-hwmon-pwm-v1-4-d29dfc26fbc3@weissschuh.net> References: <20240608-cros_ec-hwmon-pwm-v1-0-d29dfc26fbc3@weissschuh.net> In-Reply-To: <20240608-cros_ec-hwmon-pwm-v1-0-d29dfc26fbc3@weissschuh.net> To: Benson Leung , Tzung-Bi Shih , Guenter Roeck , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Jean Delvare , Guenter Roeck Cc: Dustin Howett , Mario Limonciello , Stephen Horvath , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717834365; l=3087; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=uOqrwTrndkshyrpD+eXmWOKCmadDalmhjImwkQ3pihs=; b=P+7vcuq9iT0rpTV+K/76Tt9+v2o4ROJUSLOOKUTiDuKyNcOJM4Ygo/GboDTHiDjbykWZzSM/H 4gdJPDR9fZtCZ16xtIg0H2ZkVSLbjMkQk6E7mMRYtXaVxW8wa+LGqgd X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= An upcoming change will add more channel parameters. This leads to a lot of churn and very long lines. Use a macro to encapsulate all of the shared values. Signed-off-by: Thomas Weißschuh --- drivers/hwmon/cros_ec_hwmon.c | 50 ++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/drivers/hwmon/cros_ec_hwmon.c b/drivers/hwmon/cros_ec_hwmon.c index 48b7073a4991..5cddf78cfe0e 100644 --- a/drivers/hwmon/cros_ec_hwmon.c +++ b/drivers/hwmon/cros_ec_hwmon.c @@ -277,31 +277,33 @@ static const struct hwmon_channel_info * const cros_ec_hwmon_info[] = { HWMON_PWM_INPUT | HWMON_PWM_ENABLE, HWMON_PWM_INPUT | HWMON_PWM_ENABLE, HWMON_PWM_INPUT | HWMON_PWM_ENABLE), + +#define CROS_EC_HWMON_TEMP_PARAMS (HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL) HWMON_CHANNEL_INFO(temp, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL), + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS, + CROS_EC_HWMON_TEMP_PARAMS), NULL }; -- 2.45.2