Received: by 2002:a6b:7707:0:0:0:0:0 with SMTP id n7csp6951930iom; Wed, 25 May 2022 18:29:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvE1Qxwam9wuR556wUJXhXnuAJpxhoyZtFBUqW+FwhrOK2JHKWilRHYL4GHjYozqatbssy X-Received: by 2002:aa7:dbc9:0:b0:42a:ecf2:4740 with SMTP id v9-20020aa7dbc9000000b0042aecf24740mr37251246edt.149.1653528556778; Wed, 25 May 2022 18:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653528556; cv=none; d=google.com; s=arc-20160816; b=FCLpYrH8xVxZF4v45Sgex4i6e/nMU9ocj7+riTc/iR6vxYlP8ijpTf4pS9i+vGzRD6 5kUPVGCG8Hh8SNM0vsLIWQuq5BTsksJgqIxvGbjOUTRJRBCtwAqmcw/oXws5gIw7fSr5 U4TDsdBSGZQyMWsfsNYWpjQtXfOvEMsinmEopMeS5V/aGCJtMJPQZErElkgbYAawwK3T +yPRyjyiCIcLKB6tMaL4TIn36j3mWefe5wqeg2ol+pv2XRWowye0qHbDkHpFdhqo+hv+ 3xHBWj/GIddI5x6XqljzZ9Q44pzYNqNbEk2/yT21ozZak252NbYWNb7IiYCrdmn+6vZD NC/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=d1b5nILyGqqpNbh83B6jQJVoKjYjPJ5yWnONtHERzTk=; b=0WM62+5HmArz7rwbxQDbq+1+ZiW/OQPADJp3TthqI0Ftdnhs+VWYcBL0xp1iNpcdax lfep1AW1GYWDLEeSaIuj8Az25qI/cLQVoV0lJCOCbtJEE4DupqmRJjZlqmToayYLTwsP 0hjdCuMSsErbzouJDBvkx8qaN1js2KuVgDof0RBW00OyFZVElXkdiZnSgHUo311isSQH FaLFeRZCZJkQo38+RTsfMlfSNdfynjqKS3ttfu9rSpo5Zs4pjsJjQB2ek2QwMs1gQo91 a7DGKjazFUGTBfD7AyPOk7CO7aM60yXGylPfjgQPANTS1oBN8d6rrDARzMYVNdn/Gly2 kHgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WebDmmFh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t21-20020aa7db15000000b0042aca1d821csi154966eds.419.2022.05.25.18.28.49; Wed, 25 May 2022 18:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WebDmmFh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244529AbiEYN6I (ORCPT + 99 others); Wed, 25 May 2022 09:58:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236984AbiEYN6F (ORCPT ); Wed, 25 May 2022 09:58:05 -0400 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BF1B91575; Wed, 25 May 2022 06:58:04 -0700 (PDT) Received: by mail-oi1-x233.google.com with SMTP id t144so21862513oie.7; Wed, 25 May 2022 06:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d1b5nILyGqqpNbh83B6jQJVoKjYjPJ5yWnONtHERzTk=; b=WebDmmFh5GpeE3XP8N35Cr+1d3W/PKwx4R3sVlXX5fkUfew7SZ02lEBxMv4YkP/G+b QocVfWlUuO27rC8CSGSk0QP+mHMoG/X64sbNb+kuoNX3oxBH6xXZvv/1UOHuK/fTy0oZ VwMZtCkBuyDiz+HntCDrNSG6/6BzZLt5HPJCjKlYr8fgdTnNS/mLdJ96jDBoovFceVI0 kHU0P5rfhcf4IlNp9iYfkbN8E1Evng+sA72DjO+3/lRl/81T2UnKF/Dz7C5JdojM9Dzc zu67D468fCaiAjYBkj/LYsQx/rKYdOL5bNrpdP5JzdZLUzy43GEiRT4JpgZGsMnGPYbq ZIrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=d1b5nILyGqqpNbh83B6jQJVoKjYjPJ5yWnONtHERzTk=; b=gVfvubWEea/6eOxApJtFiqN/O2Dy1Sd+E2NNPoy/1RQ/zZNayfi1tbRIEl3Avwd769 FBJ8iAc0wBW+9KXWEBknochpWI+iyFjbHlbaLMptmtUSzaBv38o+GrbirtXY/FhhWTTL pZuiJDbY/PLnyppoIjwzIA10Xz2KjuiMzDWmR7vwL55boRtY2Iz9JJdgR41n0cbdXQpo 5KFi3WawDyiXIlCwlZyLIrA5jlqO25iAo3acFs1E7/pdhw+/loekdXB+XAcKep+DVje7 +ver3O3wUnLraAKUZAk84RJEB4vl018Z3cGICfOis2s6KIhYW98qE1iuxUo8lEw0CdWK R6Uw== X-Gm-Message-State: AOAM530xjCPM8ifhDJtfMlqEKQJa5zZq5z8D13MWqXbBVqA5YmA/hm+y ESJ2Nq4ywMkaN6hf5rUowMMDxF4t1BmYKA== X-Received: by 2002:aca:f306:0:b0:32b:4753:db60 with SMTP id r6-20020acaf306000000b0032b4753db60mr5208399oih.157.1653487083486; Wed, 25 May 2022 06:58:03 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id w187-20020acadfc4000000b0032b7b588f3asm2137256oig.46.2022.05.25.06.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 06:58:02 -0700 (PDT) Sender: Guenter Roeck From: Guenter Roeck To: linux-hwmon@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jean Delvare , Slawomir Stepien , Guenter Roeck Subject: [PATCH 01/40] hwmon: (lm90) Generate sysfs and udev events for all alarms Date: Wed, 25 May 2022 06:57:19 -0700 Message-Id: <20220525135758.2944744-2-linux@roeck-us.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220525135758.2944744-1-linux@roeck-us.net> References: <20220525135758.2944744-1-linux@roeck-us.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org So far the driver only generated sysfs and udev events for minimum and maximum alarms. Also generate events for critical and emergency alarms. Signed-off-by: Guenter Roeck --- drivers/hwmon/lm90.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 3820f0e61510..83d027c134be 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -1829,6 +1829,26 @@ static bool lm90_is_tripped(struct i2c_client *client, u16 *status) hwmon_notify_event(data->hwmon_dev, hwmon_temp, hwmon_temp_max_alarm, 2); + if (st & LM90_STATUS_LTHRM) + hwmon_notify_event(hwmon_dev, hwmon_temp, + hwmon_temp_crit_alarm, 0); + if (st & LM90_STATUS_RTHRM) + hwmon_notify_event(hwmon_dev, hwmon_temp, + hwmon_temp_crit_alarm, 1); + if (st2 & MAX6696_STATUS2_R2THRM) + hwmon_notify_event(hwmon_dev, hwmon_temp, + hwmon_temp_crit_alarm, 2); + + if (st2 & MAX6696_STATUS2_LOT2) + hwmon_notify_event(hwmon_dev, hwmon_temp, + hwmon_temp_emergency_alarm, 0); + if (st2 & MAX6696_STATUS2_ROT2) + hwmon_notify_event(hwmon_dev, hwmon_temp, + hwmon_temp_emergency_alarm, 1); + if (st2 & MAX6696_STATUS2_R2OT2) + hwmon_notify_event(hwmon_dev, hwmon_temp, + hwmon_temp_emergency_alarm, 2); + return true; } -- 2.35.1