Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1805004rdh; Sat, 25 Nov 2023 03:57:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhJCEM53Q90BNrjtGdk4xf8yBxP+gQWi5QZegrnUmHMnOD1sJStWjSXzPc6vzdJdlt5h6p X-Received: by 2002:a05:6a00:21c8:b0:690:f877:aa1e with SMTP id t8-20020a056a0021c800b00690f877aa1emr7613968pfj.12.1700913460348; Sat, 25 Nov 2023 03:57:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700913460; cv=none; d=google.com; s=arc-20160816; b=Xzksm4AGhPSQgweRnwFHk9oEmQh4hvr4qbAA68g996LX4uaOBGvNEupX+dfh/LoMzO t1tN3IN4xdL/oD8iZyWiV8UC4Vua25KswiyIM/K1l5bStmUUQoa4C3OkmPXkCwtYqTJ9 YqwgrmNKnDcF06qN32cIqrVzwlTybjAWGQJ2R5hOVbFuNmPsNv1E6SRmEu6TOUbUrbrQ 55mu7ka2w5Tr7caf501UnjjCXdgpXGID8OzopkiXXIZMWen2sl3GJaceH7oa3B/mG4+G peBTR6kleK4VwOyJBURUX3choBceOiSkKR3KfYu484TLrEV0679x3CP9eMgR2oPTvrqa jI3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=PyJvKifjCksa9ZtBNafx8NGbx/DvHUPSdg3ul1e3Sf4=; fh=jcGSzGD5OROf8fZ/j4QKJ+wL1JghxO2NoWzmibggfGc=; b=x4hnMdb+QPbkCig0EhgwISQQWe1cC3xrLCvGqOtW7S1u9+uvKGY250rUg26o8g1J+U +bXwLPdEdVHHn4VX5c6iOFM76DmhFpjEYcK1CDHeAgY7HjForw3qtQ7M7KR29zMwsAut fWSAYSApuD6wPkRshpbAEvSKFfBvIrCrG9xRzVJtKVYi4GM4089QICllv/W0w0r0DIow lSfb3aPqHQEESO/K40FkxRiodbI8lt/xMIuWXJj1EoxoQm3sfOSdxKKbvGiopwCSpgCx JhtnqLD2HTU+mlOzJSASLC8HPH+nV9ykN7BZ/J7eKvcylndPnFVrd5w+71+zt0fgg1xv 7uYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nhEyZBFS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id x15-20020a056a00188f00b006c3463c7299si5593235pfh.197.2023.11.25.03.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 03:57:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nhEyZBFS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id D9C44809647D; Sat, 25 Nov 2023 03:57:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231967AbjKYL47 (ORCPT + 99 others); Sat, 25 Nov 2023 06:56:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbjKYL4z (ORCPT ); Sat, 25 Nov 2023 06:56:55 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8065010EB; Sat, 25 Nov 2023 03:57:01 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a02cc476581so366731466b.2; Sat, 25 Nov 2023 03:57:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700913419; x=1701518219; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=PyJvKifjCksa9ZtBNafx8NGbx/DvHUPSdg3ul1e3Sf4=; b=nhEyZBFS75LTwG5A1CA0WyQ9lpZN69d56raOV4FA9Tajf1+/tBcUEatJiipkJw8pKO +jMvFlBUjiAplXUZEkUEEh4ASBWjxHC4L/w0B52eGNQIRXb/ItbDLRV0R7Me42svmo/M 6E8eY3yQfSg45NH+SVruZF9O5AZXgELsR1h7jboElijVtt6tDTtLsy7eALDqDeYGCal+ CQlPIH8+stGbBKLXpgd4RkRfgbcW9XObOBpWCTQgPZiZkrph697vfbqljAEcCL+Lt+4A qcUj/LCIUz6+7OKmJQ7syigkDiYc/+VWEAxgg/keCVNuuUyHdebctELnjMEfQgJ/bP6J b7sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700913419; x=1701518219; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PyJvKifjCksa9ZtBNafx8NGbx/DvHUPSdg3ul1e3Sf4=; b=K574I+c9eq8Ij6CPmQWIRoeKXM1LbS9KVIEU+kqM/It1p3CwC8QU38h8lf6twlOwF9 wI9Y9avzaI313y6/ePO0Dg5wmGZ9t2PfE2Cv0kgAMV3UNfZv4+ur5tfmUja106KrAl6b eCdUKGZ0eBp1Ie0t8Wq7++c49wBgVuu1vyIT5QbK7AF+YKgy7IOUy4yXhF9uhtcCF0fM UFxG0oC1fEFBYfvlHcmWDbhgmc+b0fF4QVyJGEDMRZmGLhScDJng6YIv0yA4yLKvDbcb Yy4nTyTuu/Cg3Z31MeKbwo4q9HdMbuDqOc0N4EGArMMFEvvy7l6Dnyre01ES5UkZHH/+ ZCrw== X-Gm-Message-State: AOJu0Ywey7Fsr5L/6Zl8LL3gEisyd68vTl6PRRaxbErokoFMj6oBp/A1 /nOqh/szptWDspOZz6UevaLIIeOHcenFhA== X-Received: by 2002:a17:906:6711:b0:a01:77ef:e887 with SMTP id a17-20020a170906671100b00a0177efe887mr4026945ejp.64.1700913419355; Sat, 25 Nov 2023 03:56:59 -0800 (PST) Received: from [127.0.1.1] (2a02-8389-41cf-e200-3176-084d-819d-12bf.cable.dynamic.v6.surfer.at. [2a02:8389:41cf:e200:3176:84d:819d:12bf]) by smtp.gmail.com with ESMTPSA id r17-20020a170906a21100b009ae57888718sm3344349ejy.207.2023.11.25.03.56.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 03:56:59 -0800 (PST) From: Javier Carrasco Date: Sat, 25 Nov 2023 12:56:55 +0100 Subject: [PATCH v2 1/3] iio: add modifiers for A and B ultraviolet light MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231110-veml6075-v2-1-d04efbc8bf51@gmail.com> References: <20231110-veml6075-v2-0-d04efbc8bf51@gmail.com> In-Reply-To: <20231110-veml6075-v2-0-d04efbc8bf51@gmail.com> To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Javier Carrasco X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1700913416; l=3539; i=javier.carrasco.cruz@gmail.com; s=20230509; h=from:subject:message-id; bh=nymkBqy1zy5W1DkFZRCIlPpGK++jMxfNLk6XrJLr6Js=; b=qTOSDOAdV6ujrNBtJLLo1oxm+L27V6lBQRWNroF8w4wBc/fqjphx/ReyrlCEsOmzQVvnI5c84 7KJI/7mSyODApjQZpWYoM8uVjF85UkNqfvWXu3+D9nUQVz9BbxYWn5A X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=tIGJV7M+tCizagNijF0eGMBGcOsPD+0cWGfKjl4h6K8= X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 25 Nov 2023 03:57:29 -0800 (PST) Currently there are only two modifiers for ultraviolet light: a generic one for any ultraviolet light (IIO_MOD_LIGHT_UV) and one for deep ultraviolet (IIO_MOD_LIGHT_DUV), which is also referred as ultraviolet C (UV-C) band and covers short-wave ultraviolet. There are still no modifiers for the long-wave and medium-wave ultraviolet bands. These two bands are the main components used to obtain the UV index on the Earth's surface. Add modifiers for the ultraviolet A (UV-A) and ultraviolet B (UV-B) bands. Signed-off-by: Javier Carrasco --- Documentation/ABI/testing/sysfs-bus-iio | 7 +++++-- drivers/iio/industrialio-core.c | 2 ++ include/uapi/linux/iio/types.h | 2 ++ tools/iio/iio_event_monitor.c | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 19cde14f3869..e2a9937be99c 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -1574,6 +1574,8 @@ What: /sys/.../iio:deviceX/in_intensityY_raw What: /sys/.../iio:deviceX/in_intensityY_ir_raw What: /sys/.../iio:deviceX/in_intensityY_both_raw What: /sys/.../iio:deviceX/in_intensityY_uv_raw +What: /sys/.../iio:deviceX/in_intensityY_uva_raw +What: /sys/.../iio:deviceX/in_intensityY_uvb_raw What: /sys/.../iio:deviceX/in_intensityY_duv_raw KernelVersion: 3.4 Contact: linux-iio@vger.kernel.org @@ -1582,8 +1584,9 @@ Description: that measurements contain visible and infrared light components or just infrared light, respectively. Modifier uv indicates that measurements contain ultraviolet light - components. Modifier duv indicates that measurements - contain deep ultraviolet light components. + components. Modifiers uva, uvb and duv indicate that + measurements contain A, B or deep (C) ultraviolet light + components respectively. What: /sys/.../iio:deviceX/in_uvindex_input KernelVersion: 4.6 diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index c77745b594bd..65f567e4ff2a 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -117,6 +117,8 @@ static const char * const iio_modifier_names[] = { [IIO_MOD_LIGHT_GREEN] = "green", [IIO_MOD_LIGHT_BLUE] = "blue", [IIO_MOD_LIGHT_UV] = "uv", + [IIO_MOD_LIGHT_UVA] = "uva", + [IIO_MOD_LIGHT_UVB] = "uvb", [IIO_MOD_LIGHT_DUV] = "duv", [IIO_MOD_QUATERNION] = "quaternion", [IIO_MOD_TEMP_AMBIENT] = "ambient", diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h index 9c2ffdcd6623..5060963707b1 100644 --- a/include/uapi/linux/iio/types.h +++ b/include/uapi/linux/iio/types.h @@ -91,6 +91,8 @@ enum iio_modifier { IIO_MOD_CO2, IIO_MOD_VOC, IIO_MOD_LIGHT_UV, + IIO_MOD_LIGHT_UVA, + IIO_MOD_LIGHT_UVB, IIO_MOD_LIGHT_DUV, IIO_MOD_PM1, IIO_MOD_PM2P5, diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c index 2eaaa7123b04..8073c9e4fe46 100644 --- a/tools/iio/iio_event_monitor.c +++ b/tools/iio/iio_event_monitor.c @@ -105,6 +105,8 @@ static const char * const iio_modifier_names[] = { [IIO_MOD_LIGHT_GREEN] = "green", [IIO_MOD_LIGHT_BLUE] = "blue", [IIO_MOD_LIGHT_UV] = "uv", + [IIO_MOD_LIGHT_UVA] = "uva", + [IIO_MOD_LIGHT_UVB] = "uvb", [IIO_MOD_LIGHT_DUV] = "duv", [IIO_MOD_QUATERNION] = "quaternion", [IIO_MOD_TEMP_AMBIENT] = "ambient", -- 2.39.2