From patchwork Wed May 29 00:14:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Silva X-Patchwork-Id: 13677613 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B46D819; Wed, 29 May 2024 00:15:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716941712; cv=none; b=Tnyi56FhNTGhLgDa8p70q3Vm8V/p+06m45X7qtUemfEyIAE7o34VJI4Butx1wtQQwJeMgSi6EP0JyDO00vnOVL7hOe4wIQwOwhRM+znQ/dnvdYxgyvWYwmAWPONSg45j0FKc8NLPmotyUl9CkbcU8OwDZfgKksigGJqP/Ge+XLY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716941712; c=relaxed/simple; bh=nWS79Xdi9Z1eTNqxIh6QMb/lMAP5MFLOTH72fyKQ4Ss=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UatExrVzi/JnY2RUYZ8M++i8n+WRBWjRxiukbPK3DoGyF1JMhJEgcPAAn8icsTxNjoDFsvdAz7nq7m1PCD919HyT0T5aCTFUOcKNq5EmZyzQ9oBwxvoOO1xw08hdaRHbF6LprBboeye9lA7hDzDksf5qPcIByro7gswcgjdc0jA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZHYIK/nu; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZHYIK/nu" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6f8ecafd28cso1128248b3a.3; Tue, 28 May 2024 17:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716941711; x=1717546511; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=XvqQ51v9IugDWKdPnnnfXWHKI+dXs1qLkkNZeI+c6Xc=; b=ZHYIK/nuVfILf6u9s3DxRI7eHx/Jv1uiy6icF35mGJhjOgrlgygv+Hi/+5+XaTMZV1 W+/8VPmNSUQepClfP4SBlPk6P2c5P46OVossEMtlF2Kf5K3v4MKhM4NDBB/DSFIQkKCg V/InzQEc9wMSV3h1KpdbH349LQbqZWIvwOZtgIXAZXhnzQkiu1Psxeh9S9/r0rU0e+Ot m7lUNvbwDYV277hqsJGFOPuS5Z6QTw2UhRbx3c9oqiBi6YAIoNbic9KIV26t3yN1IxCB hlEnMVppJ5dE2C6onVzljrlMQaN+gb6RvLmz7Yk/KsBtTq3RrmMIB16pk9sD2pZbb9nG i5lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716941711; x=1717546511; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XvqQ51v9IugDWKdPnnnfXWHKI+dXs1qLkkNZeI+c6Xc=; b=tsLNDNiDlPy8LeiP8sVywhokiWb8Xo5seAIblFjux6U9IBDu6BVokW9q08osUDaJJh iVIoCkZLaSmmxlnnD9ijgwuZX4gHDh5aNa/bH9SOu/xpAtDLyWgq/YHHAA5qm9ZOj/PQ E0BSooXcAv+s6DhudV3XxTIKqg3PDpbTO+h80QdQ4m3oqaasrL+RsG+0JLl8Lwl/a9ts lkPUrUj/RQsK/htLG/XwHueKxa5ADaTORMxzAyXBvMYVFS7x4wnEZO0hbCHJddGmPPSN y9FzFSXszfqfy51ZjJRM6HBlHbI0KnLjRY6pcT8obvy0byytOKKTn9mKv38vvkvBmzzg gN5w== X-Forwarded-Encrypted: i=1; AJvYcCWfbe2hG4kWDvCwnGeTXR6Gs2dY/WMzKL3ru/d40NI7kWQBofRIVPiwwVZ2WldgTF+kJVYqQFE3pzuWXD0kOVH2k8GwXCTKaOetiIMk6C2dGLeA0I4iiLnsaDEh8B2gv1RHSRu/fRlHOW5f8K3nQdLKrHb2nRp1+sfhTOghCRhk8p38Dg== X-Gm-Message-State: AOJu0YwCT7ooErYtst5cde7GmS7O4OUrcuooV+2v9AxLtEDfS0xw3Auu PRQPcV5hpunAT33sQU2Lh/tpJoaZBcR1zkdm5HM8Djc2xOAVWg1YHBln8jHc++0= X-Google-Smtp-Source: AGHT+IFgjgDEue0qXVYGTI+3vE+43mbKQc5n7UgW/exEodSgv/tn4i+QHgus3C66Y+22YfyjnE0ODg== X-Received: by 2002:aa7:9302:0:b0:6f3:edac:d9e4 with SMTP id d2e1a72fcca58-6f8f3700476mr13476014b3a.20.1716941710695; Tue, 28 May 2024 17:15:10 -0700 (PDT) Received: from localhost.localdomain ([189.101.162.253]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3dea2sm6941433b3a.24.2024.05.28.17.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 17:15:10 -0700 (PDT) From: Gustavo Silva To: jic23@kernel.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, lars@metafoo.de, christophe.jaillet@wanadoo.fr, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/6] dt-bindings: vendor-prefixes: add ScioSense Date: Tue, 28 May 2024 21:14:18 -0300 Message-ID: <20240529001504.33648-1-gustavograzs@gmail.com> X-Mailer: git-send-email 2.45.1 Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add vendor prefix for ScioSense B.V. https://www.sciosense.com/ Signed-off-by: Gustavo Silva Acked-by: Conor Dooley --- no changes in v2 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) base-commit: 084eeee1d8da6b4712719264b01cb27b41307f54 diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index b97d298b3..298f13a0d 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1246,6 +1246,8 @@ patternProperties: description: Smart Battery System "^schindler,.*": description: Schindler + "^sciosense,.*": + description: ScioSense B.V. "^seagate,.*": description: Seagate Technology PLC "^seeed,.*": From patchwork Wed May 29 00:14:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Silva X-Patchwork-Id: 13677614 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45B006AB8; Wed, 29 May 2024 00:15:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716941716; cv=none; b=Y7OQlv771s2D4PvlYnTzwTcjb0DGqxRUanVOdoAMsMgpT6swc79p71Kbf/IXPanCLm21lZWgfAslOYFbI2aiXsqHxi323zJgcJj0483Cerrm9etmwofc8TpeqW4IQ57/DGDAz18ZqiaEytqUAAAxA0blb7CuOZjd+6qrVEDCxf0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716941716; c=relaxed/simple; bh=3ySH+jTc/L/dIVbHZ2ZTqDI9+5pLodfs8NbC1P/s2RM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ey7f7ZkLv6BCursISwde/4ipzBYKkq59hWgIU8+DSYg+r7ZNg0r7RrXy/N9RmPZwIb5JNHr4LfSP66QHuilQfXYsDEOtbDpibeMDukLXueoown+TgGvj0YGFJjIlks3sKPn9Cq1shnRM351I0K4xAm2/Y4LQloLeIwzsFlzsByE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=G9++CxHU; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="G9++CxHU" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-701ae8698d8so1170823b3a.0; Tue, 28 May 2024 17:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716941714; x=1717546514; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EHVXxNkKLM+Rbftg2VQtQvNGsn2A2WBaaezXU5OsSwU=; b=G9++CxHU13uL35WY+W2/16iHTn+gI2agZg/+mpowcl6P5NilBx69ibdhbWZfV9k13g 4I1n2JWj4TCJJVqfZQC4lkf8T5zZrCy5QyLPykP6yfTMpRvE643rA06qN4z+U+99JkD4 +SHtUly0bv8tYaQF1BKoARCgrW0kXcj97WlCpjaENktD2VMeHb5AWYmpkjvrGIWhotWS S3HV3zgqTT69BbwXq4momXT/fc25Q/CUQS/WGHeKCf8iV7S/qFnVwLda58VTIfmsavjS CQWyTqpYAL01m7LwOgUEaJmS0PWJSHCJUeWEnL/ni6fw02xS+jBQXei/5KMsiH0xYVkr NguQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716941714; x=1717546514; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EHVXxNkKLM+Rbftg2VQtQvNGsn2A2WBaaezXU5OsSwU=; b=dh3xIhty0WNED4XPhQswLmAj7e3g2xiD4J4vgV25es7tEV6V0KqoA7fId1GFqvaKyl ylhr4xdCnySJ6oRM3ZLLMoJ4Z9QlE/IkTOi5iHVRAtaUd/hm6GpPt6k8KQaRLGZMXnh6 WdheGTI9k0w3EE9phBUgWld55NFmMqTJOrgSJkraOtVsTCrIUGeiYknSRk0Vfr/H0I0R K89VphZBgeWAkCRdISjV0qH01483gDFYV51iBkuH+cmRv4w/hj5cz0DzEH/LMotvER6r FdTvEbdwVnNd6XFRUbDK8EGKzsljA6m26EI5p7b7MsDLnLFFC4+KV5uooxd9x0N91VuI MIAg== X-Forwarded-Encrypted: i=1; AJvYcCW222ywRW7krxIgMkzhwQq+cNG5phFV9AsCNvlPNQ/UZzufQ4ywXs7PgyjmG3j2vxp7uEYbY3OUdmg6DWv27XmVkvyxr7Mal71B8xnAQzmgIbKmKtQs9i5Ff9MuOnCFIJDk27Md45dHBZRzfFRs1ftDjwV1kDgViIkx++f8IozMpPOn6A== X-Gm-Message-State: AOJu0YwEzV0KKgWsUSk6v/aUVrxz+VhqkO5ms/kYYmjpbAlf/Rbe3Pb+ mB1MIehS0kqB3aApgbmBEQpQN3zlG6rEwyW7IQoFpmzElaqLRRFZ X-Google-Smtp-Source: AGHT+IGVZKoXeMCEWHgjDLJxQP7Y5wgw0WebOyx6d7ie/w4EWJMeBL9NNqFw/AZXSMoatxFeFcOsYw== X-Received: by 2002:a05:6a20:5a89:b0:1b0:2472:da14 with SMTP id adf61e73a8af0-1b212d3905cmr13182334637.2.1716941714392; Tue, 28 May 2024 17:15:14 -0700 (PDT) Received: from localhost.localdomain ([189.101.162.253]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3dea2sm6941433b3a.24.2024.05.28.17.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 17:15:13 -0700 (PDT) From: Gustavo Silva To: jic23@kernel.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, lars@metafoo.de, christophe.jaillet@wanadoo.fr, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/6] dt-bindings: iio: chemical: add ENS160 sensor Date: Tue, 28 May 2024 21:14:19 -0300 Message-ID: <20240529001504.33648-2-gustavograzs@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240529001504.33648-1-gustavograzs@gmail.com> References: <20240529001504.33648-1-gustavograzs@gmail.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add bindings for ScioSense ENS160 multi-gas sensor. Datasheet: https://www.sciosense.com/wp-content/uploads/2023/12/ENS160-Datasheet.pdf Signed-off-by: Gustavo Silva Reviewed-by: Conor Dooley --- changes in v2: - Add devicetree binding file specifically for this sensor instead of adding it to trivial-devices.yaml. This is needed in order to document that this chip supports Vdd and Vddio supplies. .../iio/chemical/sciosense,ens160.yaml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/chemical/sciosense,ens160.yaml diff --git a/Documentation/devicetree/bindings/iio/chemical/sciosense,ens160.yaml b/Documentation/devicetree/bindings/iio/chemical/sciosense,ens160.yaml new file mode 100644 index 000000000..7dd442f94 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/chemical/sciosense,ens160.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/chemical/sciosense,ens160.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ScioSense ENS160 multi-gas sensor + +maintainers: + - Gustavo Silva + +description: | + Digital Multi-Gas Sensor for Monitoring Indoor Air Quality. + + Datasheet: + https://www.sciosense.com/wp-content/uploads/2023/12/ENS160-Datasheet.pdf + +properties: + compatible: + enum: + - sciosense,ens160 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vdd-supply: true + vddio-supply: true + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + gas-sensor@52 { + compatible = "sciosense,ens160"; + reg = <0x52>; + interrupt-parent = <&gpio0>; + interrupts = <19 IRQ_TYPE_EDGE_FALLING>; + }; + }; + - | + #include + + spi { + #address-cells = <1>; + #size-cells = <0>; + + gas-sensor@0 { + compatible = "sciosense,ens160"; + reg = <0>; + spi-max-frequency = <10000000>; + interrupt-parent = <&gpio>; + interrupts = <19 IRQ_TYPE_EDGE_FALLING>; + }; + }; + +... From patchwork Wed May 29 00:14:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Silva X-Patchwork-Id: 13677615 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 800E6D2F0; Wed, 29 May 2024 00:15:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716941721; cv=none; b=iR/5AmmQUcmiBWi5p3x8ihpo7N12TrbgIWjki/u2uNv8t/OpItBsA2WiSRWh4z3wC4TnXbcDPk8SeL2JvuHUVg/4OL9UM6O8vVZeWeqdsZQ214TxJkwAfoQ0i2Qygr8X68N5g6sTtNZYXXlF4IBfVFwoKl7a/wUb7KGkHMhLNs0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716941721; c=relaxed/simple; bh=aKoJCOs1Woeh8RdLIYash1hOrt6afgr9uJF1cIhvJ8M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tOlXIdmM8c7sCilcimvGscagP1MWXwqecaYltpuSvfRRSOjiqOfi8Mvfx52SF1GLknIqCHB0CD/27KUBZAR9CpCrQgizbG3+rVL3T0DfkRiGKcup9VCuPEU/+R8mAGAkyO5Yjf39OjTA9wCrx7JzwxBywukFpSRJhjdyi+HIEXU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=c0ciBV4j; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c0ciBV4j" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6f8eba8f25eso1227986b3a.3; Tue, 28 May 2024 17:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716941719; x=1717546519; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LxhkVsRfSLouyfn4DzHsYv8zXpT26ihwNdIUpDqu4NA=; b=c0ciBV4jjazwiLX7kk4u4LxUdgEwIpf2PCGvuWjiPzaYykD+WORATh8dmzq0DI95a6 1foSWrmJ2ojU89HF0fB4ny25j9qX/rCxWrKxMbo6EDu+2mHe97KTv0/DG61XjO3izvkJ VY8Gj+gzJbSTb8Luy25KfRJTRFRbLsdlDBPrELWMl4xVeuneTAk8B5PuGiH0Tw2sqily cg92mc0BrNuFL9RJBpam8fpfYiDAB+J3DKFyYChE0zFPiddcH2Fr3VNY++qKK78TJH83 TDOZHKyzSeADvpw2ZL2J8vDVlJiYN0v3tHjQfv80hAidDqLgnsNWCpQuxX4EQHEcob2Z dyqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716941719; x=1717546519; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LxhkVsRfSLouyfn4DzHsYv8zXpT26ihwNdIUpDqu4NA=; b=CjTHXqGeq+5Zh3OO7gAg79/mdiZJoxdyB8rRBcgmEZmiw7S95qJ6bhYxeJ7IK4dmUw YHOkBs8lx91JMSpjnIbyW0w5vHrUZT+6VeyDNoOBQhMfHlj1PHEJIjOZv7e34SFCCgdA m5DKAIl4OQnd0AJ6Sh1k9/wAFuKFT5VXY4KtDfBeeEXIKZEykjkZ4DLEiBn3hOfk7TFJ dOUUKirjI8wBjn2PvlNXI9JqnanFKYPW4M5vqOR2IpkwMLJZ1EiOkyclAudcnS5OtSU/ q/mnuCruEwWNiGQnq/mHPfKr17rFlmA99HzZIRkzbEXDI+v5UU9fgLpaQUTnkClL2Wq8 GbyA== X-Forwarded-Encrypted: i=1; AJvYcCUB7+nACOuh1+DubIgW/D41Xh87qjlzUiwRHUmzmHai7g+3i1f9e1NrMk8PJxW0jNfSwJVCkku7QkbRSHJwWrcqOexbsFInt73P+HTZutOEGxQoYL1N3VQ24vDKDYSa+NV8y+N66uod8nBgseiQ34hiUZk3bi3c6XeKjyAtl84gbspE6g== X-Gm-Message-State: AOJu0Yzh+gPwx/b1gxhkXTzoWmeDoc5rsX4SyY51uZ4p7AuylgK6QZHM 8QKpuNmzk8341JtJVtdAHVpJ2z9lC4gqkXlRtuGZwH2J5VOen61CAOCrdRKSgt0= X-Google-Smtp-Source: AGHT+IHwoA+vIC3CqE092AsVG0c7CgoY1CT21mrANgivfs3ZXexulXkJUIP9ccnQ2Ryuzt7UKNWU6g== X-Received: by 2002:a05:6a00:418a:b0:6ea:bb00:dbb6 with SMTP id d2e1a72fcca58-6f8f2d730abmr15813967b3a.8.1716941718585; Tue, 28 May 2024 17:15:18 -0700 (PDT) Received: from localhost.localdomain ([189.101.162.253]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3dea2sm6941433b3a.24.2024.05.28.17.15.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 17:15:18 -0700 (PDT) From: Gustavo Silva To: jic23@kernel.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, lars@metafoo.de, christophe.jaillet@wanadoo.fr, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/6] iio: chemical: add driver for ENS160 sensor Date: Tue, 28 May 2024 21:14:20 -0300 Message-ID: <20240529001504.33648-3-gustavograzs@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240529001504.33648-1-gustavograzs@gmail.com> References: <20240529001504.33648-1-gustavograzs@gmail.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 ScioSense ENS160 is a digital metal oxide multi-gas sensor, designed for indoor air quality monitoring. The driver supports readings of CO2 and VOC, and can be accessed via both SPI and I2C. Datasheet: https://www.sciosense.com/wp-content/uploads/2023/12/ENS160-Datasheet.pdf Signed-off-by: Gustavo Silva --- changes in v2: - Make regmap bulk reads DMA safe by adding buffers to the end of iio_priv() struct and marking it __aligned(IIO_DMA_MINALIGN) - Remove unnecessary time delays - Use devm_add_action_or_reset() to register custom cleanup and delete the remove() function - Add missing register definition ENS160_REG_DATA_AQI - Use dev_err_probe() where applicable - Hardcode device name - Remove unnecessary dev_set_drvdata() call - Do not set driver_data to 0 in {spi,i2c}_device_id structs drivers/iio/chemical/Kconfig | 22 +++ drivers/iio/chemical/Makefile | 3 + drivers/iio/chemical/ens160.h | 7 + drivers/iio/chemical/ens160_core.c | 221 +++++++++++++++++++++++++++++ drivers/iio/chemical/ens160_i2c.c | 60 ++++++++ drivers/iio/chemical/ens160_spi.c | 60 ++++++++ 6 files changed, 373 insertions(+) create mode 100644 drivers/iio/chemical/ens160.h create mode 100644 drivers/iio/chemical/ens160_core.c create mode 100644 drivers/iio/chemical/ens160_i2c.c create mode 100644 drivers/iio/chemical/ens160_spi.c diff --git a/drivers/iio/chemical/Kconfig b/drivers/iio/chemical/Kconfig index 02649ab81..e407afab8 100644 --- a/drivers/iio/chemical/Kconfig +++ b/drivers/iio/chemical/Kconfig @@ -76,6 +76,28 @@ config CCS811 Say Y here to build I2C interface support for the AMS CCS811 VOC (Volatile Organic Compounds) sensor +config ENS160 + tristate "ScioSense ENS160 sensor driver" + depends on (I2C || SPI) + select REGMAP + select ENS160_I2C if I2C + select ENS160_SPI if SPI + help + Say yes here to build support for ScioSense ENS160 multi-gas sensor. + + This driver can also be built as a module. If so, the module for I2C + would be called ens160_i2c and ens160_spi for SPI support. + +config ENS160_I2C + tristate + depends on I2C && ENS160 + select REGMAP_I2C + +config ENS160_SPI + tristate + depends on SPI && ENS160 + select REGMAP_SPI + config IAQCORE tristate "AMS iAQ-Core VOC sensors" depends on I2C diff --git a/drivers/iio/chemical/Makefile b/drivers/iio/chemical/Makefile index 2f3dee8bb..4866db06b 100644 --- a/drivers/iio/chemical/Makefile +++ b/drivers/iio/chemical/Makefile @@ -11,6 +11,9 @@ obj-$(CONFIG_BME680) += bme680_core.o obj-$(CONFIG_BME680_I2C) += bme680_i2c.o obj-$(CONFIG_BME680_SPI) += bme680_spi.o obj-$(CONFIG_CCS811) += ccs811.o +obj-$(CONFIG_ENS160) += ens160_core.o +obj-$(CONFIG_ENS160_I2C) += ens160_i2c.o +obj-$(CONFIG_ENS160_SPI) += ens160_spi.o obj-$(CONFIG_IAQCORE) += ams-iaq-core.o obj-$(CONFIG_PMS7003) += pms7003.o obj-$(CONFIG_SCD30_CORE) += scd30_core.o diff --git a/drivers/iio/chemical/ens160.h b/drivers/iio/chemical/ens160.h new file mode 100644 index 000000000..d0df15f08 --- /dev/null +++ b/drivers/iio/chemical/ens160.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef ENS160_H_ +#define ENS160_H_ + +int devm_ens160_core_probe(struct device *dev, struct regmap *regmap, + const char *name); +#endif diff --git a/drivers/iio/chemical/ens160_core.c b/drivers/iio/chemical/ens160_core.c new file mode 100644 index 000000000..a535f62c4 --- /dev/null +++ b/drivers/iio/chemical/ens160_core.c @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ScioSense ENS160 multi-gas sensor driver + * + * Copyright (c) 2024 Gustavo Silva + * + * Datasheet: + * https://www.sciosense.com/wp-content/uploads/2023/12/ENS160-Datasheet.pdf + */ + +#include +#include +#include +#include + +#include "ens160.h" + +#define ENS160_PART_ID 0x160 + +#define ENS160_BOOTING_TIME_MS 10U + +#define ENS160_REG_PART_ID 0x00 + +#define ENS160_REG_OPMODE 0x10 + +#define ENS160_REG_MODE_DEEP_SLEEP 0x00 +#define ENS160_REG_MODE_IDLE 0x01 +#define ENS160_REG_MODE_STANDARD 0x02 +#define ENS160_REG_MODE_RESET 0xF0 + +#define ENS160_REG_COMMAND 0x12 +#define ENS160_REG_COMMAND_GET_APPVER 0x0E +#define ENS160_REG_COMMAND_CLRGPR 0xCC + +#define ENS160_REG_TEMP_IN 0x13 +#define ENS160_REG_RH_IN 0x15 +#define ENS160_REG_DEVICE_STATUS 0x20 +#define ENS160_REG_DATA_AQI 0x21 +#define ENS160_REG_DATA_TVOC 0x22 +#define ENS160_REG_DATA_ECO2 0x24 +#define ENS160_REG_DATA_T 0x30 +#define ENS160_REG_DATA_RH 0x32 +#define ENS160_REG_GPR_READ4 0x4C + +#define ENS160_STATUS_VALIDITY_FLAG GENMASK(3, 2) + +#define ENS160_STATUS_NORMAL 0x00 + +struct ens160_data { + struct regmap *regmap; + u8 fw_version[3] __aligned(IIO_DMA_MINALIGN); + __le16 buf; +}; + +static const struct iio_chan_spec ens160_channels[] = { + { + .type = IIO_CONCENTRATION, + .channel2 = IIO_MOD_VOC, + .modified = 1, + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | + BIT(IIO_CHAN_INFO_SCALE), + .address = ENS160_REG_DATA_TVOC, + }, + { + .type = IIO_CONCENTRATION, + .channel2 = IIO_MOD_CO2, + .modified = 1, + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | + BIT(IIO_CHAN_INFO_SCALE), + .address = ENS160_REG_DATA_ECO2, + }, +}; + +static int ens160_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int *val, int *val2, long mask) +{ + struct ens160_data *data = iio_priv(indio_dev); + int ret; + + switch (mask) { + case IIO_CHAN_INFO_RAW: + ret = regmap_bulk_read(data->regmap, chan->address, + &data->buf, sizeof(data->buf)); + if (ret) + return ret; + *val = le16_to_cpu(data->buf); + return IIO_VAL_INT; + + case IIO_CHAN_INFO_SCALE: + switch (chan->channel2) { + case IIO_MOD_CO2: + /* The sensor reads CO2 data as ppm */ + *val = 0; + *val2 = 100; + return IIO_VAL_INT_PLUS_MICRO; + case IIO_MOD_VOC: + /* The sensor reads VOC data as ppb */ + *val = 0; + *val2 = 100; + return IIO_VAL_INT_PLUS_NANO; + default: + return -EINVAL; + } + default: + return -EINVAL; + } +} + +static int ens160_set_mode(struct ens160_data *data, u8 mode) +{ + int ret; + + ret = regmap_write(data->regmap, ENS160_REG_OPMODE, mode); + if (ret) + return ret; + + msleep(ENS160_BOOTING_TIME_MS); + + return 0; +} + +static void ens160_set_idle(void *data) +{ + ens160_set_mode(data, ENS160_REG_MODE_IDLE); +} + +static int ens160_chip_init(struct ens160_data *data) +{ + struct device *dev = regmap_get_device(data->regmap); + unsigned int status; + int ret; + + ret = ens160_set_mode(data, ENS160_REG_MODE_RESET); + if (ret) + return ret; + + ret = regmap_bulk_read(data->regmap, ENS160_REG_PART_ID, &data->buf, + sizeof(data->buf)); + if (ret) + return ret; + + if (le16_to_cpu(data->buf) != ENS160_PART_ID) + return -ENODEV; + + ret = ens160_set_mode(data, ENS160_REG_MODE_IDLE); + if (ret) + return ret; + + ret = regmap_write(data->regmap, ENS160_REG_COMMAND, + ENS160_REG_COMMAND_CLRGPR); + if (ret) + return ret; + + ret = regmap_write(data->regmap, ENS160_REG_COMMAND, + ENS160_REG_COMMAND_GET_APPVER); + if (ret) + return ret; + + ret = regmap_bulk_read(data->regmap, ENS160_REG_GPR_READ4, + data->fw_version, sizeof(data->fw_version)); + if (ret) + return ret; + + dev_info(dev, "firmware version: %u.%u.%u\n", data->fw_version[2], + data->fw_version[1], data->fw_version[0]); + + ret = ens160_set_mode(data, ENS160_REG_MODE_STANDARD); + if (ret) + return ret; + + ret = regmap_read(data->regmap, ENS160_REG_DEVICE_STATUS, &status); + if (ret) + return ret; + + if (FIELD_GET(ENS160_STATUS_VALIDITY_FLAG, status) + != ENS160_STATUS_NORMAL) + return -EINVAL; + + return 0; +} + +static const struct iio_info ens160_info = { + .read_raw = ens160_read_raw, +}; + +int devm_ens160_core_probe(struct device *dev, struct regmap *regmap, + const char *name) +{ + struct ens160_data *data; + struct iio_dev *indio_dev; + int ret; + + indio_dev = devm_iio_device_alloc(dev, sizeof(*data)); + if (!indio_dev) + return -ENOMEM; + + data = iio_priv(indio_dev); + data->regmap = regmap; + + indio_dev->name = name; + indio_dev->info = &ens160_info; + indio_dev->modes = INDIO_DIRECT_MODE; + indio_dev->channels = ens160_channels; + indio_dev->num_channels = ARRAY_SIZE(ens160_channels); + + ret = devm_add_action_or_reset(dev, ens160_set_idle, data); + if (ret) + return ret; + + ret = ens160_chip_init(data); + if (ret) + return dev_err_probe(dev, ret, "chip initialization failed\n"); + + return devm_iio_device_register(dev, indio_dev); +} +EXPORT_SYMBOL_NS(devm_ens160_core_probe, IIO_ENS160); + +MODULE_AUTHOR("Gustavo Silva "); +MODULE_DESCRIPTION("ScioSense ENS160 driver"); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/iio/chemical/ens160_i2c.c b/drivers/iio/chemical/ens160_i2c.c new file mode 100644 index 000000000..2f0b08e52 --- /dev/null +++ b/drivers/iio/chemical/ens160_i2c.c @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ScioSense ENS160 multi-gas sensor I2C driver + * + * Copyright (c) 2024 Gustavo Silva + * + * 7-Bit I2C slave address is: + * - 0x52 if ADDR pin LOW + * - 0x53 if ADDR pin HIGH + */ + +#include +#include +#include + +#include "ens160.h" + +static const struct regmap_config ens160_regmap_i2c_conf = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int ens160_i2c_probe(struct i2c_client *client) +{ + struct regmap *regmap; + + regmap = devm_regmap_init_i2c(client, &ens160_regmap_i2c_conf); + if (IS_ERR(regmap)) + return dev_err_probe(&client->dev, PTR_ERR(regmap), + "Failed to register i2c regmap\n"); + + return devm_ens160_core_probe(&client->dev, regmap, "ens160_i2c"); +} + +static const struct i2c_device_id ens160_i2c_id[] = { + { "ens160" }, + { } +}; +MODULE_DEVICE_TABLE(i2c, ens160_i2c_id); + +static const struct of_device_id ens160_of_i2c_match[] = { + { .compatible = "sciosense,ens160" }, + { } +}; +MODULE_DEVICE_TABLE(of, ens160_of_i2c_match); + +static struct i2c_driver ens160_i2c_driver = { + .driver = { + .name = "ens160_i2c", + .of_match_table = ens160_of_i2c_match, + }, + .probe = ens160_i2c_probe, + .id_table = ens160_i2c_id, +}; +module_i2c_driver(ens160_i2c_driver); + +MODULE_AUTHOR("Gustavo Silva "); +MODULE_DESCRIPTION("ScioSense ENS160 I2C driver"); +MODULE_LICENSE("GPL v2"); +MODULE_IMPORT_NS(IIO_ENS160); diff --git a/drivers/iio/chemical/ens160_spi.c b/drivers/iio/chemical/ens160_spi.c new file mode 100644 index 000000000..9a6c9c7e3 --- /dev/null +++ b/drivers/iio/chemical/ens160_spi.c @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ScioSense ENS160 multi-gas sensor SPI driver + * + * Copyright (c) 2024 Gustavo Silva + */ + +#include +#include +#include + +#include "ens160.h" + +#define ENS160_SPI_READ BIT(0) + +static const struct regmap_config ens160_regmap_spi_conf = { + .reg_bits = 8, + .val_bits = 8, + .reg_shift = -1, + .read_flag_mask = ENS160_SPI_READ, +}; + +static int ens160_spi_probe(struct spi_device *spi) +{ + struct regmap *regmap; + + regmap = devm_regmap_init_spi(spi, &ens160_regmap_spi_conf); + if (IS_ERR(regmap)) + return dev_err_probe(&spi->dev, PTR_ERR(regmap), + "Failed to register spi regmap\n"); + + return devm_ens160_core_probe(&spi->dev, regmap, "ens160_spi"); +} + +static const struct of_device_id ens160_spi_of_match[] = { + { .compatible = "sciosense,ens160" }, + { } +}; +MODULE_DEVICE_TABLE(of, ens160_spi_of_match); + +static const struct spi_device_id ens160_spi_id[] = { + { "ens160" }, + { } +}; +MODULE_DEVICE_TABLE(spi, ens160_spi_id); + +static struct spi_driver ens160_spi_driver = { + .driver = { + .name = "ens160_spi", + .of_match_table = ens160_spi_of_match, + }, + .probe = ens160_spi_probe, + .id_table = ens160_spi_id, +}; +module_spi_driver(ens160_spi_driver); + +MODULE_AUTHOR("Gustavo Silva "); +MODULE_DESCRIPTION("ScioSense ENS160 SPI driver"); +MODULE_LICENSE("GPL v2"); +MODULE_IMPORT_NS(IIO_ENS160); From patchwork Wed May 29 00:14:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Silva X-Patchwork-Id: 13677616 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3926DDDAB; Wed, 29 May 2024 00:15:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716941724; cv=none; b=StDozf5rkbBwvrjTWcQUTOZe7FHGqR90SBOYJKA8Ja/mxOku5T3ShEAt4m0tZg2++1dTD9w1ASyXTDHHofrjoVDZiDz2fpNb8UmKh6TLTwrLJOdcBymhe4QHlHqoXnk0AQZq3Flb/Ny1pj5Kqk8+Itc1JoxAkjKbLIE2DLSb3sU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716941724; c=relaxed/simple; bh=pM5JtpMIhFsrfOUykyidhfQIhYMu2P8fjbRkZeC7Qvc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VqeeDueAUfiTmHy0Nl9C45YKBaiKkCB17CbrA3hsmsyMsdiTi7VmlFclDcHVXmuK21Lew1Rc9hc6493Bz63VCjthEJed71AY1THRCMCnD+kTI/EIOLRRTfds9ayOiJSFFRvAqAfCk8guc8kxk7u6iOoDeZFv33PfughlD0Spz3c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XWuY/xk4; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XWuY/xk4" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6f8eba8dcfcso1170139b3a.3; Tue, 28 May 2024 17:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716941722; x=1717546522; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=11h33bFGPY8PKHn8okMQNZ5Dqfl8yEakMmTNyggCBv8=; b=XWuY/xk4HlVJDAwhAId5JXZKKM2WHoWLirHihpA1mrPWO9b/Nu6vrZTzK/WhfL7Nqt w+nYlDg1lC1oXdksXCQyr/Vn6Fnc8SHHmhujA1jBeU2R4oJRYUh9Vw0ampBc7r6zU2ru /LxWoTbA7/6xawPirnyXhJQ/Oyb+JRBH3l4Ly+vtqsuETGs7S0oPHnhryIgpfHAkndTX 8JG9rExyNVUIVCnx3VmfIfZRywV6QRHGH4SBXzcRqH7/WgUvZqxHgeabZu5HJ9INpm0l Yn7ha8uycGSFcQLeztyjPIO2BSuwRMHdbhAxo0fi2iNJS6wA7gDVk1XYVZ87AFRFjt/d kgHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716941722; x=1717546522; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=11h33bFGPY8PKHn8okMQNZ5Dqfl8yEakMmTNyggCBv8=; b=jQcXqS0ylZFFtBe44gyjzrlGRioc5YGJ9TaRjaC3snBtUeqJZ/aeuF9vihFs0vYLkJ twoj1lkpQ9LGIJp3qTIu9y6YOHUFI03xKEIr3FOv5oX+IBCXz7dqzbou+wdaC23PtYPd SuNQxzSGgGC5fW3gYyFeEydIMCD7GerGV2J7hnz1k2xYTD07ldvxaprI4NtMuPJmIs3w cBDwlOtDBup9ccVF9pQ9J66gYoLlMMYM3R3pHgvndmIorMUfca+VTljPZU/9WIfhu4H0 Wuzvo71afMqY9EOj6/TuEA/HS1qa8/FAMoowHa2zlVLNffTHnhePEicRmBLouD1Yu74T wCcQ== X-Forwarded-Encrypted: i=1; AJvYcCU2Vtt4n0xkKivb1o080mBs7JpRgKjD+qFrYjxrWoWvQxiDhTTGKA9gfZkrz+U4VX5bYMKMgVqTW7wvYY1hk4Ia+zSChU+031V/9aFkk5WgMLYPioQwX9xTxj+oS66rdspN+QvyBCaCHqOnWaKJbhtSkkDe7HPiQvDEpeCTP8W2AoC7Yg== X-Gm-Message-State: AOJu0YzzxT80dt58LfUFgkZlPnQSn9Jk+g/X4l8M3DGfXOCuf1yv6k41 Xy0I5sJugeDKZvquJRgwJ9EBjdZB28bwloGL9GI70/ikm4GLw8ENMP+0MVCPqvk= X-Google-Smtp-Source: AGHT+IFnNhaNVtTqwUzY+M93uep+B7Jd3zXvDIfM0Qxd50NKyyAit1+2feE4nYWCKBLCEeNJDaIkbQ== X-Received: by 2002:a05:6a20:9684:b0:1a9:5b3f:f139 with SMTP id adf61e73a8af0-1b212d33064mr13774547637.25.1716941722452; Tue, 28 May 2024 17:15:22 -0700 (PDT) Received: from localhost.localdomain ([189.101.162.253]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3dea2sm6941433b3a.24.2024.05.28.17.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 17:15:22 -0700 (PDT) From: Gustavo Silva To: jic23@kernel.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, lars@metafoo.de, christophe.jaillet@wanadoo.fr, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/6] iio: chemical: ens160: add triggered buffer support Date: Tue, 28 May 2024 21:14:21 -0300 Message-ID: <20240529001504.33648-4-gustavograzs@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240529001504.33648-1-gustavograzs@gmail.com> References: <20240529001504.33648-1-gustavograzs@gmail.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 ENS160 supports a data ready interrupt. Use it in combination with triggered buffer for continuous data readings. Signed-off-by: Gustavo Silva --- changes in v2: - Remove copy of irq variable in device private data. Pass the variable directly to the required functions - Remove IRQ direction from irqflags in devm_request_threaded_irq() call - Use iio_trigger_generic_data_rdy_poll instead of custom irq handler - In the trigger handler, bulk read all the channels drivers/iio/chemical/ens160.h | 2 +- drivers/iio/chemical/ens160_core.c | 144 ++++++++++++++++++++++++++--- drivers/iio/chemical/ens160_i2c.c | 3 +- drivers/iio/chemical/ens160_spi.c | 3 +- 4 files changed, 138 insertions(+), 14 deletions(-) diff --git a/drivers/iio/chemical/ens160.h b/drivers/iio/chemical/ens160.h index d0df15f08..e6cc0987a 100644 --- a/drivers/iio/chemical/ens160.h +++ b/drivers/iio/chemical/ens160.h @@ -2,6 +2,6 @@ #ifndef ENS160_H_ #define ENS160_H_ -int devm_ens160_core_probe(struct device *dev, struct regmap *regmap, +int devm_ens160_core_probe(struct device *dev, struct regmap *regmap, int irq, const char *name); #endif diff --git a/drivers/iio/chemical/ens160_core.c b/drivers/iio/chemical/ens160_core.c index a535f62c4..74ef7f150 100644 --- a/drivers/iio/chemical/ens160_core.c +++ b/drivers/iio/chemical/ens160_core.c @@ -10,6 +10,9 @@ #include #include +#include +#include +#include #include #include @@ -19,9 +22,14 @@ #define ENS160_BOOTING_TIME_MS 10U -#define ENS160_REG_PART_ID 0x00 +#define ENS160_REG_PART_ID 0x00 -#define ENS160_REG_OPMODE 0x10 +#define ENS160_REG_OPMODE 0x10 + +#define ENS160_REG_CONFIG 0x11 +#define ENS160_REG_CONFIG_INTEN BIT(0) +#define ENS160_REG_CONFIG_INTDAT BIT(1) +#define ENS160_REG_CONFIG_INT_CFG BIT(5) #define ENS160_REG_MODE_DEEP_SLEEP 0x00 #define ENS160_REG_MODE_IDLE 0x01 @@ -48,7 +56,12 @@ struct ens160_data { struct regmap *regmap; - u8 fw_version[3] __aligned(IIO_DMA_MINALIGN); + struct mutex mutex; + struct { + __le16 chans[2]; + s64 timestamp __aligned(8); + } scan __aligned(IIO_DMA_MINALIGN); + u8 fw_version[3]; __le16 buf; }; @@ -60,6 +73,13 @@ static const struct iio_chan_spec ens160_channels[] = { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .address = ENS160_REG_DATA_TVOC, + .scan_index = 0, + .scan_type = { + .sign = 'u', + .realbits = 16, + .storagebits = 16, + .endianness = IIO_LE, + }, }, { .type = IIO_CONCENTRATION, @@ -68,7 +88,15 @@ static const struct iio_chan_spec ens160_channels[] = { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .address = ENS160_REG_DATA_ECO2, + .scan_index = 1, + .scan_type = { + .sign = 'u', + .realbits = 16, + .storagebits = 16, + .endianness = IIO_LE, + }, }, + IIO_CHAN_SOFT_TIMESTAMP(2), }; static int ens160_read_raw(struct iio_dev *indio_dev, @@ -80,13 +108,16 @@ static int ens160_read_raw(struct iio_dev *indio_dev, switch (mask) { case IIO_CHAN_INFO_RAW: - ret = regmap_bulk_read(data->regmap, chan->address, - &data->buf, sizeof(data->buf)); - if (ret) - return ret; - *val = le16_to_cpu(data->buf); - return IIO_VAL_INT; - + iio_device_claim_direct_scoped(return -EBUSY, indio_dev) { + guard(mutex)(&data->mutex); + ret = regmap_bulk_read(data->regmap, chan->address, + &data->buf, sizeof(data->buf)); + if (ret) + return ret; + *val = le16_to_cpu(data->buf); + return IIO_VAL_INT; + } + unreachable(); case IIO_CHAN_INFO_SCALE: switch (chan->channel2) { case IIO_MOD_CO2: @@ -184,7 +215,83 @@ static const struct iio_info ens160_info = { .read_raw = ens160_read_raw, }; -int devm_ens160_core_probe(struct device *dev, struct regmap *regmap, +static irqreturn_t ens160_trigger_handler(int irq, void *p) +{ + struct iio_poll_func *pf = p; + struct iio_dev *indio_dev = pf->indio_dev; + struct ens160_data *data = iio_priv(indio_dev); + int ret; + + guard(mutex)(&data->mutex); + + ret = regmap_bulk_read(data->regmap, ENS160_REG_DATA_TVOC, + data->scan.chans, sizeof(data->scan.chans)); + if (ret) + goto err; + + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, + pf->timestamp); +err: + iio_trigger_notify_done(indio_dev->trig); + + return IRQ_HANDLED; +} + +static int ens160_set_trigger_state(struct iio_trigger *trig, bool state) +{ + struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); + struct ens160_data *data = iio_priv(indio_dev); + unsigned int int_bits = ENS160_REG_CONFIG_INTEN | + ENS160_REG_CONFIG_INTDAT | + ENS160_REG_CONFIG_INT_CFG; + + if (state) + return regmap_set_bits(data->regmap, ENS160_REG_CONFIG, + int_bits); + else + return regmap_clear_bits(data->regmap, ENS160_REG_CONFIG, + int_bits); +} + +static const struct iio_trigger_ops ens160_trigger_ops = { + .set_trigger_state = ens160_set_trigger_state, + .validate_device = iio_trigger_validate_own_device, +}; + +static int ens160_setup_trigger(struct iio_dev *indio_dev, int irq) +{ + struct device *dev = indio_dev->dev.parent; + struct iio_trigger *trig; + int ret; + + trig = devm_iio_trigger_alloc(dev, "%s-dev%d", indio_dev->name, + iio_device_id(indio_dev)); + if (!trig) + return dev_err_probe(dev, -ENOMEM, + "failed to allocate trigger\n"); + + trig->ops = &ens160_trigger_ops; + iio_trigger_set_drvdata(trig, indio_dev); + + ret = devm_iio_trigger_register(dev, trig); + if (ret) + return ret; + + indio_dev->trig = iio_trigger_get(trig); + + ret = devm_request_threaded_irq(dev, irq, + iio_trigger_generic_data_rdy_poll, + NULL, + IRQF_ONESHOT, + indio_dev->name, + indio_dev->trig); + if (ret) + return dev_err_probe(dev, ret, "failed to request irq\n"); + + return 0; +} + +int devm_ens160_core_probe(struct device *dev, struct regmap *regmap, int irq, const char *name) { struct ens160_data *data; @@ -204,6 +311,13 @@ int devm_ens160_core_probe(struct device *dev, struct regmap *regmap, indio_dev->channels = ens160_channels; indio_dev->num_channels = ARRAY_SIZE(ens160_channels); + if (irq > 0) { + ret = ens160_setup_trigger(indio_dev, irq); + if (ret) + return dev_err_probe(dev, ret, + "failed to setup trigger\n"); + } + ret = devm_add_action_or_reset(dev, ens160_set_idle, data); if (ret) return ret; @@ -212,6 +326,14 @@ int devm_ens160_core_probe(struct device *dev, struct regmap *regmap, if (ret) return dev_err_probe(dev, ret, "chip initialization failed\n"); + mutex_init(&data->mutex); + + ret = devm_iio_triggered_buffer_setup(dev, indio_dev, + iio_pollfunc_store_time, + ens160_trigger_handler, NULL); + if (ret) + return ret; + return devm_iio_device_register(dev, indio_dev); } EXPORT_SYMBOL_NS(devm_ens160_core_probe, IIO_ENS160); diff --git a/drivers/iio/chemical/ens160_i2c.c b/drivers/iio/chemical/ens160_i2c.c index 2f0b08e52..4bf3c455c 100644 --- a/drivers/iio/chemical/ens160_i2c.c +++ b/drivers/iio/chemical/ens160_i2c.c @@ -29,7 +29,8 @@ static int ens160_i2c_probe(struct i2c_client *client) return dev_err_probe(&client->dev, PTR_ERR(regmap), "Failed to register i2c regmap\n"); - return devm_ens160_core_probe(&client->dev, regmap, "ens160_i2c"); + return devm_ens160_core_probe(&client->dev, regmap, client->irq, + "ens160_i2c"); } static const struct i2c_device_id ens160_i2c_id[] = { diff --git a/drivers/iio/chemical/ens160_spi.c b/drivers/iio/chemical/ens160_spi.c index 9a6c9c7e3..91528c5e3 100644 --- a/drivers/iio/chemical/ens160_spi.c +++ b/drivers/iio/chemical/ens160_spi.c @@ -29,7 +29,8 @@ static int ens160_spi_probe(struct spi_device *spi) return dev_err_probe(&spi->dev, PTR_ERR(regmap), "Failed to register spi regmap\n"); - return devm_ens160_core_probe(&spi->dev, regmap, "ens160_spi"); + return devm_ens160_core_probe(&spi->dev, regmap, spi->irq, + "ens160_spi"); } static const struct of_device_id ens160_spi_of_match[] = { From patchwork Wed May 29 00:14:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Silva X-Patchwork-Id: 13677617 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2730F107A9; Wed, 29 May 2024 00:15:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716941728; cv=none; b=MYVvgGFbDoa3xEL1SgdcKpPrAH2UP34kC65dTk70OiU3RQX1BUotHoG69zJhvl8fj236b76tImsOzZv1nfNe9NmWE+/gjVqyV10IF1GGwQRpw0XA+BW91ULE2+SIus1O++EKqIiJxrebuCKJrOvJf/cfHy1kkFdQF59OR8v+cHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716941728; c=relaxed/simple; bh=TQ2tuFb8KTSWOOE4KcN5SHfR+HSgWv6/oT3CclRh0rs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LBCMbwnXzxYehwk0HyoYFkDw0eXaEz8mlvb1kiJHLIpDhA/+61Dx0ocxnCY2F/NUjon2AYzuRbW7vvl6Dgl5TauSZQcbxjt575ie82/h6WLMmNnSNk8mph2n4P9Pn9VPrS/E31b8PChrk3TfDAfDYjcZK0tW0NRKwXGLtoaB9Gw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hjT06ONM; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hjT06ONM" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6f6911d16b4so1230760b3a.3; Tue, 28 May 2024 17:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716941726; x=1717546526; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hq3NtQJgJ+mKuwS8MgsQdc8jpUO2tdGTkXq47bqF/Fs=; b=hjT06ONMPJKp5Fu2FrIFsUk9kVOGvM1Up3Qj2xlGuc+2Cw9+yEa2zqQpFPrhiDKbqM jnEFFRhJhNBe8yRHra0YX3kr/f/FhW22910vJwTL8+q7pws3oBlEVOifV82gGmDtlXqH UYP0cyyJLStNAZbtRw0tSvHDbCcdz3tYytvYX2XWikVLmjhCeCAPwQUPbRkSGoqlN9Nq wj5st0g9AT6igUaeYMkTJrzbkFzcIbQsHP4aDie38d1hchcCTgIgOAJl+ctSh/0ciNOA 3txecv4H6igSBca4NKjfl6btjSII4dIw2CcsF9DSDtWaji1CQLe+UJ1S3PD7OoHcN6Vo XKMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716941726; x=1717546526; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hq3NtQJgJ+mKuwS8MgsQdc8jpUO2tdGTkXq47bqF/Fs=; b=moLZ3pQPLDmAXRHJ7D7kMPvmL8mUZnAALUd5a4n+HguooDHgDuJu7oJ7xYCgAVKLXX LCEBs5F4LqFLnMRj0XLB/0SlZz3tMrzr6kjaoZjLIdiz6VRKLRjM9tUuVLbGODXL5thL RNhKhKKPmzPLtg/uT/y/7H2c+9CmkByIy+I8/KMDfT6na2pHvc9bVvj9pJNarnh4TDzF U4ndaoGMoJiZ80VjDyl6TYJtQlV8TaShk24Gw/fTMNwu2TIK/X5M5MBPyhLaj8nNzdpE 5q1QBC1HoIW2fkB2DprUEzegPJVX51yJneLuxa+DamIm0+lYHepqGY4ImMItuZgg9/+5 ZwMg== X-Forwarded-Encrypted: i=1; AJvYcCXsAGzatVlP5pALmz1lNvu/dr2FOIaPLOerDjBFkD1Q5YjvlgcdOvplUfU/y/dP3jJ3EYGLqiRgxu+pt1mVzPdabrskW0znZ/a8G8rhhQuezHu7iXyKom/kAmS48RBP30eLmlNL1rYZe5aNXcRqgejNDrnCbd2yPX2nu97ZWb0twhTRNQ== X-Gm-Message-State: AOJu0Yw9SqlmXupnASucRPHABd4zJYnMPlAvvS//ulJ2GWijZjjCf6Lr 5iS41evdPuxRmhw1rQuDMn5FlRAQW9w5Wb4EFlkL23ZK1PCteMnP X-Google-Smtp-Source: AGHT+IFkLpirTq+1BRKb+hkAOJtU99YMtsYJQHPLuur9VJq9pQJm6JGWF2nR4zZNv8iJHUgubDtlhQ== X-Received: by 2002:a05:6a00:27a7:b0:6f6:94dc:6c4 with SMTP id d2e1a72fcca58-6f8f3928a67mr12815452b3a.20.1716941726415; Tue, 28 May 2024 17:15:26 -0700 (PDT) Received: from localhost.localdomain ([189.101.162.253]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3dea2sm6941433b3a.24.2024.05.28.17.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 17:15:26 -0700 (PDT) From: Gustavo Silva To: jic23@kernel.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, lars@metafoo.de, christophe.jaillet@wanadoo.fr, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/6] iio: chemical: ens160: add power management support Date: Tue, 28 May 2024 21:14:22 -0300 Message-ID: <20240529001504.33648-5-gustavograzs@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240529001504.33648-1-gustavograzs@gmail.com> References: <20240529001504.33648-1-gustavograzs@gmail.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 ENS160 supports a deep sleep mode for minimal power consumption. Use it to add PM sleep capability to the driver. Signed-off-by: Gustavo Silva --- no changes in v2 drivers/iio/chemical/ens160.h | 3 +++ drivers/iio/chemical/ens160_core.c | 23 +++++++++++++++++++++++ drivers/iio/chemical/ens160_i2c.c | 1 + drivers/iio/chemical/ens160_spi.c | 1 + 4 files changed, 28 insertions(+) diff --git a/drivers/iio/chemical/ens160.h b/drivers/iio/chemical/ens160.h index e6cc0987a..f9f0575ce 100644 --- a/drivers/iio/chemical/ens160.h +++ b/drivers/iio/chemical/ens160.h @@ -4,4 +4,7 @@ int devm_ens160_core_probe(struct device *dev, struct regmap *regmap, int irq, const char *name); + +extern const struct dev_pm_ops ens160_pm_ops; + #endif diff --git a/drivers/iio/chemical/ens160_core.c b/drivers/iio/chemical/ens160_core.c index 74ef7f150..dd501e655 100644 --- a/drivers/iio/chemical/ens160_core.c +++ b/drivers/iio/chemical/ens160_core.c @@ -215,6 +215,29 @@ static const struct iio_info ens160_info = { .read_raw = ens160_read_raw, }; +static int ens160_suspend(struct device *dev) +{ + struct iio_dev *indio_dev = dev_get_drvdata(dev); + struct ens160_data *data = iio_priv(indio_dev); + + return ens160_set_mode(data, ENS160_REG_MODE_DEEP_SLEEP); +} + +static int ens160_resume(struct device *dev) +{ + struct iio_dev *indio_dev = dev_get_drvdata(dev); + struct ens160_data *data = iio_priv(indio_dev); + int ret; + + ret = ens160_set_mode(data, ENS160_REG_MODE_IDLE); + if (ret) + return ret; + + return ens160_set_mode(data, ENS160_REG_MODE_STANDARD); +} +EXPORT_NS_SIMPLE_DEV_PM_OPS(ens160_pm_ops, ens160_suspend, ens160_resume, + IIO_ENS160); + static irqreturn_t ens160_trigger_handler(int irq, void *p) { struct iio_poll_func *pf = p; diff --git a/drivers/iio/chemical/ens160_i2c.c b/drivers/iio/chemical/ens160_i2c.c index 4bf3c455c..06d2967a9 100644 --- a/drivers/iio/chemical/ens160_i2c.c +++ b/drivers/iio/chemical/ens160_i2c.c @@ -49,6 +49,7 @@ static struct i2c_driver ens160_i2c_driver = { .driver = { .name = "ens160_i2c", .of_match_table = ens160_of_i2c_match, + .pm = pm_sleep_ptr(&ens160_pm_ops), }, .probe = ens160_i2c_probe, .id_table = ens160_i2c_id, diff --git a/drivers/iio/chemical/ens160_spi.c b/drivers/iio/chemical/ens160_spi.c index 91528c5e3..f9603f51d 100644 --- a/drivers/iio/chemical/ens160_spi.c +++ b/drivers/iio/chemical/ens160_spi.c @@ -49,6 +49,7 @@ static struct spi_driver ens160_spi_driver = { .driver = { .name = "ens160_spi", .of_match_table = ens160_spi_of_match, + .pm = pm_sleep_ptr(&ens160_pm_ops), }, .probe = ens160_spi_probe, .id_table = ens160_spi_id, From patchwork Wed May 29 00:14:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Silva X-Patchwork-Id: 13677618 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FDC9171A4; Wed, 29 May 2024 00:15:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716941733; cv=none; b=glSZFEyHHarOIMqWJJnBlJIOxQOx9BJzDjHlVK0oon/DrUOj35/ZeZVLyMNCR6brqbt9jamPKWHZ+GL7BaO75yDwsE4J+HbyuBpfiT2cfu5wswvnhWzB70qHpfIjA2xmPmIY+Ov2+IHFLEH832wYajPxcP7w2MCLmQl+cq1GH3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716941733; c=relaxed/simple; bh=Wg/8vm+DezXU+c6hssPffipfbzeswNnGmDjQwfNjP+c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H79g2k+g1RR7Xi/Txy/ar8Ar0Qzsx6mlg3Hffy8FyHUFELkVoCkNCA42aDrFEEkykT/MUGV/Rjcb0W0z7iYIb/aBA6QNhClex82NLhR0A4ujSrqjZ99di5aELu6jLfm6BhpZsiR1LWhO9B2yB479hULMaLqAl1VvOmw8RbKgdhI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=D8ZBOx/4; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D8ZBOx/4" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6f8edff35a0so1241716b3a.2; Tue, 28 May 2024 17:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716941730; x=1717546530; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GqWVoMsey0TuP/KwPDZYkNElI8gsVjWsVSRftA51+ZA=; b=D8ZBOx/4mXoEoHMrndyH0tGzVJwOV3BHFtpeur0qtEkIprrYUWmN1UNGDsmT50M0T5 /8FrsdLpiV/xtRliL6axg8DmH4DB9TwYeIah3TOQ42IkT8FRKeWSvU50qS0M85M5V2eN f8i/5KZP6E/7rT2x3tPUJ+p2rXer9gsuBabghE92eJXzhYy3LiHCke7YgPCAwRn+43e1 fiZDJq+awQQuWPgs4VN6E5rJaK5yZYG4k4U3PEECgLv8UMgKE6C3ZDt4dOXT6OAAbYSi 79JFVi5PF4jZxiTxlj9nzaBosNTMLA7/5W144rYlEIey3uVbP4v1IRhTFZNLTj+RQeBS CQKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716941730; x=1717546530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GqWVoMsey0TuP/KwPDZYkNElI8gsVjWsVSRftA51+ZA=; b=DuwEWNkYHSikBVfmGR7apXEyBiN0tb+FDxGvzfUJ4U9fZVU84TQjUR2cEywL1eMFjo kT4SaZtQoEs3MGd+HJjrNUixUmnw8QI4v8N2Cz+ZHkqdcgvv2/Rj7GatRi+KuRRDUNHD D022CFvNJWVrNhRWFzGXIwEiBRHtOlExWLQna4pyBsaSRY+f4f0QvBbeefnzvEO5jU9d tiz7RK2e4MnzhYYXnBuRf0Iu1KPajv9HbfkVQBz/sfnwziIib0PjRjjeemdXRyztpTCG 2FUAknkhzPmltIiA54MhljnTYQnQ/NqVYcT6MOV0fISznIYx+PXr27ap63Mk9AqF7cXW 2jpw== X-Forwarded-Encrypted: i=1; AJvYcCVZxuDB+muiZR6TXbYPs+8C0aZfW16S/L/0dWMPqgp1qpt4kZNo+8f2t/eMy93SvXyHZNCLPoXXjBUG0cOF4Ix51B43jWZZnHb1X5GXuxa9gQy+wAlXNOZOEa2OxJPA+Bu7yDHs9sxiWmbNJJPvFQtSFOZcRTE6khaJ0dFiTqxaPS4wVw== X-Gm-Message-State: AOJu0YxrCmPQi3wQ/yRJCMGKof2t4pydBR/VBLTBq6sonm9RGvG8hc/u //monV4vQx2yBiMPtETbcrh2cr1OXVqp1kJZ8NAmpJEwrq8zZCoE X-Google-Smtp-Source: AGHT+IH08riTKPmXba88vedO7GUJKrcOgqPIfQWtADHwfH4tjSQ30gTwLSx/QgaDgnNSwWy0nSnW8A== X-Received: by 2002:a05:6a20:3ca2:b0:1b0:19d5:f400 with SMTP id adf61e73a8af0-1b212dd4446mr15556115637.23.1716941730285; Tue, 28 May 2024 17:15:30 -0700 (PDT) Received: from localhost.localdomain ([189.101.162.253]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fbd3dea2sm6941433b3a.24.2024.05.28.17.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 17:15:30 -0700 (PDT) From: Gustavo Silva To: jic23@kernel.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, lars@metafoo.de, christophe.jaillet@wanadoo.fr, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/6] MAINTAINERS: Add ScioSense ENS160 Date: Tue, 28 May 2024 21:14:23 -0300 Message-ID: <20240529001504.33648-6-gustavograzs@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240529001504.33648-1-gustavograzs@gmail.com> References: <20240529001504.33648-1-gustavograzs@gmail.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add myself as maintainer for ScioSense ENS160 multi-gas sensor driver. Signed-off-by: Gustavo Silva --- no changes in v2 MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 304429f9b..92a130c8c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19660,6 +19660,14 @@ F: include/linux/wait.h F: include/uapi/linux/sched.h F: kernel/sched/ +SCIOSENSE ENS160 MULTI-GAS SENSOR DRIVER +M: Gustavo Silva +S: Maintained +F: drivers/iio/chemical/ens160_core.c +F: drivers/iio/chemical/ens160_i2c.c +F: drivers/iio/chemical/ens160_spi.c +F: drivers/iio/chemical/ens160.h + SCSI LIBSAS SUBSYSTEM R: John Garry R: Jason Yan