From patchwork Tue Jun 4 22:57:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Silva X-Patchwork-Id: 13685965 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 290FD14D428; Tue, 4 Jun 2024 22:58:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717541883; cv=none; b=s+4jL4rXm2YLrx2vwti/EGCKO2FfbbRD6+/OOn2AqU8mWQqmZgmYdjLL0WQZU5Cfv0W9sldcEdV61TzdWVD9nn7iAlvqFwpKpvthvKz+vooQujNaU5612YpcGz7OTZo9tS2RrG20jPNX1+WFS9hBGw1JDJG3nzvjIaYZIHG2TZo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717541883; c=relaxed/simple; bh=4Upi/aO1n9wppPrsSNrwRbUEd5yfjpJhKlR5qtbnYoc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WGZaOudxlI4+OHMrcMmcXdl/HtTpzzmISis+YDB7j91WuT9IV6r16sf24xG4gD+QoKR3kGejV/7Qwc/3yvxfW3R7jd+fy2fmRL9HcFLO0SMviLwbu3aYM80Qq82mLbZOLsqclkmlX7G/3pUJqNy+Nr7yRSr3OsV1YAqL3VgqaKc= 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=DRNYI2kM; arc=none smtp.client-ip=209.85.210.171 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="DRNYI2kM" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-70244776719so1387357b3a.2; Tue, 04 Jun 2024 15:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717541881; x=1718146681; 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=YIreKlpdqaedCwYC1fHyxchxscrvu2yAn0VXiUW6ZrY=; b=DRNYI2kMsnFw0KghYCX3IvBhKqYwXrF2a5zxrWc4RJ7FKFPU2AEHFkdZe9Gge3JHHw RYeHLO2FgX9hu0/cur3r+fyw7xPSXYIUYfLESueDL0rq9CWssiXbNxhJ1sdqf54HtUBD nY87UCcIp6YUOlADfBxerC13ifCFo135cc+RcmYhV5jqUYEXIVXCd3Lhi7YSiP0E+jay 5z5FLYbWJPBSrMtoYCIgjIEboPIOXE2GmcKiJv0eUPbXie5RBaAq7roFjYFQP22KtXQ4 r0iJfi+rq06FKa3JPTDWNCYMFZxTZi1eekaMMVT3ganZJ0xWPbKQ8LOErIBxvDKdbwRl anWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717541881; x=1718146681; 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=YIreKlpdqaedCwYC1fHyxchxscrvu2yAn0VXiUW6ZrY=; b=NWrcb5AnVDzCuDtaRVQE3ZgQNYRVTq0H4ai6nf6BcVWqVIvAUPJTI0Sltru+NRfwRx EQT0K9DbRS1YPQKJa3HRMjLGskO2hGSHflsp2Dwyf+tiI8+1FcK14TlEfeMDVOvycw89 U1ixPbo8XJLCO1awWABJKF51TnXWbtRv3lvHlj5oxQdoHtXBzC+mVwgFIRBjyuITjFTa Jxu9uZjbcAxBbg3W3SZ5/IKVtKV6t9DBY/p0YoNC0DhiOECm4E6S8V0BXIQTUBcDi95N BGW2bDAFYdjvvbjyy/fPNEmRaVwFRpTCUwUgfjTrRZdMgcRogdtqM3Hva1wV5zabBlSO ejtg== X-Forwarded-Encrypted: i=1; AJvYcCWwddxm0Loz2IjEqsOhOnTCHQe1dmXrQ4f9D0Bkrcq5gibFWYKMy4gZKNOMChrjqi476FJ/jC7QiVmqcI+7qPy9Iy1TtUXDbmNLSHANfaLWUbAUnXgHpprHrF3TADVl/a+ZCZox4/QlcIPd+M4x3IhnbDInZlfLWurHJSUqam91ld2RfQ== X-Gm-Message-State: AOJu0Yxx2hifkA89DVRZdLZ6BX8vp7vjYfmL0aFwYgXAFUbIpHngl7LA JrUlsTIOxNzqQ1WJtXvix3/VQF7lcL80FzWyqFb6c2UHCRZvKxRr X-Google-Smtp-Source: AGHT+IHceD+KWLEKh9bzRbs6/sLhNMQ/mCZKeDL9jxUdK2SVW07CDG25eEfceLfeIrrnq7fxsmsm1Q== X-Received: by 2002:a05:6a00:2387:b0:702:2749:6090 with SMTP id d2e1a72fcca58-703e5920c74mr1028549b3a.5.1717541881329; Tue, 04 Jun 2024 15:58:01 -0700 (PDT) Received: from localhost.localdomain ([189.101.166.155]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7025a955dd1sm5312125b3a.64.2024.06.04.15.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 15:58:01 -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, Conor Dooley Subject: [PATCH v3 1/6] dt-bindings: vendor-prefixes: add ScioSense Date: Tue, 4 Jun 2024 19:57:25 -0300 Message-ID: <20240604225747.7212-2-gustavograzs@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604225747.7212-1-gustavograzs@gmail.com> References: <20240604225747.7212-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 vendor prefix for ScioSense B.V. https://www.sciosense.com/ Acked-by: Conor Dooley Signed-off-by: Gustavo Silva --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) 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 Tue Jun 4 22:57:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Silva X-Patchwork-Id: 13685966 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 C192D14D6F8; Tue, 4 Jun 2024 22:58:06 +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=1717541888; cv=none; b=TngjDsDys7Hpvjqdr4bB/No0x/O8xUa1K5yVnzwLhpTtjLFYEzW3dbKSjr6NT6AXuoG5ekoRObnehQGRSb4QNNgJPOrA4J2hyvW6QIJgUW9sSkTm5Vh2gwcv9YVJdwe3k14+sr+xG0y7j/MUTeopMQd8f9UnHqSEtXjOTCc83cs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717541888; c=relaxed/simple; bh=jaccSrfWNdimxniSQ+8sK760H3HeuR0fZn2ChXZuJQA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A/bkfP0VQpm7c/J0gpFGpuFcuyotWFiHo317VUnEB/ChK1AdhpHGKDIBcmWiZlfZ+whiZf1ikHl7t2BsXZ3iuBlqacO+48gJKTnwiig1V7N6jDpFayR3x5IoLf9CklUBBEq3hEP6XcS803aO/EvL/9m2B7gjbw/12ccxgNoC1E8= 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=FgH1nvRm; 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="FgH1nvRm" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6f6a045d476so4830570b3a.1; Tue, 04 Jun 2024 15:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717541886; x=1718146686; 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=9/3ZatKa4mrnJ7b8FLyAeDzEmtyVTBklWU1iYA6k6Co=; b=FgH1nvRmCQN1NdTUR631Sn/GRrv8qQrYnRa8sKO72IovghOvzSpJeUUvxQbDOye/Wv W/VYTeuLRvaeffCaKvdYvyu4oY2/AM0WQOgSZJFM4Cms91szIvIuyC6oFB4f2iiGTipe BlNEj4a5a8jWEwck/d1xsCHwttyPKw5bj2yUQ+PC3xAcYdOPPtOs1ikkcQotnN1RHwe9 HhGqQsmSZFCshfilsVQv/ts52yP8yC9lX2QqOlTdNh0JWcrQyb7u4LGdlkktG0TpVVSC r/In/LGMG7jXRY7wg6djUlNESnKwtzvvImqJJUOObxWWiT4ryvxEo5NjfXQQHzx5yhLX YsIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717541886; x=1718146686; 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=9/3ZatKa4mrnJ7b8FLyAeDzEmtyVTBklWU1iYA6k6Co=; b=cm2yeb7GEZK0sc0ou3eZ+CQ/jMMLM16gFdevDmi2rCp9PCIm8pos2fnlZDhvhz2TCn GJxeLUn14LtBOnn6qi1D2+gYcQVefLPNrXQoSFvVwD1OuQDhXtOzGvZ03KRiWqOKLQ+2 xSOfPiUhZbF07ksiXUM+LUSBAiOFPIj0fKv10Rc5CF1+7G/Tf6dw882Hl94VOwNhRby9 33RJKIl8aRdRRy7sk3b08U8L0j8mwqZIoDjOuJBky+5HJVxIXEEE6YY1lSeDE4jonyuT qJs+RpGKFbIZz2aDHTXNFZFJKtz2JfgvKrLjBB/yUYc6blMfOwYG3S3p8NvVxYjlnFOi yfzA== X-Forwarded-Encrypted: i=1; AJvYcCUwr90qTXVYC3Q9adxwjo68Xbc9t702+2thapigPJAuZtCE/mdaL2c5J383ZW0HBSH3qez66EzXobBscRPlNqUFqOtCsRb5O9ss0zsf4TcYSjK5cVDqPVf9QoFyGDL1RImCvqBFuxGNymfLURFw9EsY7kmPlt2PLIgB09CwljrYVZO0Ig== X-Gm-Message-State: AOJu0YxPYUdsDbqV7g3TdsbtWWA8K+BVZQrcPeWTqtkCbFAs8n0l88gF gpjs4MjsQGENCFgeXsV8Fl16Gh+DFIG5eoYB7Pkx5bPLef45rZqV X-Google-Smtp-Source: AGHT+IG6HtXG+L5NbNCxquI4zVSqkHk92ntjYPr2fohLAXLWrKy0s68y9y1ZsmsC4vM3o8jI2yaU/w== X-Received: by 2002:a05:6a00:2e1b:b0:6ea:bb00:dbb6 with SMTP id d2e1a72fcca58-703e594abf2mr907176b3a.8.1717541885904; Tue, 04 Jun 2024 15:58:05 -0700 (PDT) Received: from localhost.localdomain ([189.101.166.155]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7025a955dd1sm5312125b3a.64.2024.06.04.15.58.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 15:58:05 -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, Conor Dooley Subject: [PATCH v3 2/6] dt-bindings: iio: chemical: add ENS160 sensor Date: Tue, 4 Jun 2024 19:57:26 -0300 Message-ID: <20240604225747.7212-3-gustavograzs@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604225747.7212-1-gustavograzs@gmail.com> References: <20240604225747.7212-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 Reviewed-by: Conor Dooley Signed-off-by: Gustavo Silva --- .../iio/chemical/sciosense,ens160.yaml | 70 +++++++++++++++++++ 1 file changed, 70 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..267033a68 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/chemical/sciosense,ens160.yaml @@ -0,0 +1,70 @@ +# 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 + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +unevaluatedProperties: 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 Tue Jun 4 22:57:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Silva X-Patchwork-Id: 13685967 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 8496A14D71A; Tue, 4 Jun 2024 22:58:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717541893; cv=none; b=epiLqAIAhyS1V0u2l0UUxBHnQl5nslynPHlyVVpDBKShtK2OgUfj9jrMVhApNJq425JIHXLCZZ91rZjyJ/eAyFXVHwFOQJi3K7EQwD28AU80ou6KMGSjXNhMFzmXRx522qIGIGDLmH/Gac61vXV1/7xCr+6JxYl0I0LrdkpUZDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717541893; c=relaxed/simple; bh=p4bwZAWmp9vh/C/xRyTREFaRe34bl4hTR1TUB33SsEU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hRM2Mp4uRvwRZ3FFppE4hqVaAutN5l+faJJg7YC0y5NF1myK6vNSQQUYbvq7XK4/DAoUvwXU+Y+kgYUGYoUTCXQyG1vbqTcD+YrQCtw1B96eNltiDZDJCZ13fY6BWndYYaKs510o5gYEXHlL99gePFh1cD1BEAAND5nt8zJGOJY= 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=bh+W6Me3; arc=none smtp.client-ip=209.85.210.175 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="bh+W6Me3" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-7025b84c0daso2785411b3a.2; Tue, 04 Jun 2024 15:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717541891; x=1718146691; 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=APNhbypR6az9KgaNvqpVnJMl5ILr3nA1zO1si5c55fA=; b=bh+W6Me3PtjXzle47ZkJh/BkejgzPtQiYWdvhCLEm/4S7ZYwA+I8GF6oYCR4IcqHKF ZQmdYOuz2VdVmrrhTbsB3LcyMYicANR5J4Cy0sHBNlHNmwUhnjS+VznzJqO4kTd/gGXv DEo3UheBE08yURmZBaBuyKaNfUFGaz2PY3NuUoknpkXAIsAb+GWhc5w3y/+1ie15ka+q HG81wwdgdTc4mrP9P0BL0T3kbUlgR9S4zfST/iAFONSs4IKwHjycos/qUu65haDo/htV 8IIDG2v7M8lV6ldWmpez4iDHjVOcjQXhDnly3Q7IKouhon4rW7w45GoLk6eem2Fx+guF JMdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717541891; x=1718146691; 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=APNhbypR6az9KgaNvqpVnJMl5ILr3nA1zO1si5c55fA=; b=HQZnzH+/xx4m6+gU1b5XPrbvlWRq8McaIpxHCNt4xt+9krGCrjuVENchsyDpSQ3WnK rtgTAi7Mu0a4g9vtX0Ro0D2izpvF8inEJ4DTfM0YoD6+zvLLI5owAfrJuP5MxdegwOfK /t39k4MqqfVcmSs4Pi9enk+WiOSVT5jDbBFR4LPxQBwb7glzf5GRDZmJG5h8SFMXzror 7Sxgduv/qRUGog12UCVnqFwQzmVgP7pmcTeXlvW8d17B2DfS7tMTE20YYtQ8MxcNeSg3 HzR1ngXMr/RWELiAIrhOVz4Q+DCUXqLrHlfTWbixGECm6/ouNs6WI77pD7N/DLnUoyA8 lRow== X-Forwarded-Encrypted: i=1; AJvYcCUQc68Ia6vE8p99JQvXSChPDhhTvbBdtH/asqhCg1yF/04Qxpr1B+hPoOINltDXfx9JVhIIvzCr0OZGl+8pSVnm9Cn4SM0HiW8JTGABK2ynnnsRV12LxyPHQI5U69SG5JskeAwkGioJXXT1U+BXZRbQ0hLm0JAilFoHTyetrL8+6Ezhwg== X-Gm-Message-State: AOJu0Yw0SMuRlScarx5dBrJvDB6mB7VOE6+vu5ijWLnQQbAtj/ScAYZb lJ4gsa+YA2LJPeh5Y0t9m0ebIOqgg4yIvWPNl7ROkhgNG/2sfNhXGZmBxbEt X-Google-Smtp-Source: AGHT+IFAOunI1dFYUNOt2HGENcb38JOKZjkXVXFaNfnGEG6354rffjZjnMw5yMsSOebJNscG/HcikA== X-Received: by 2002:a05:6a00:4c0f:b0:6f3:e9bc:7ed3 with SMTP id d2e1a72fcca58-703e599fcdbmr1008693b3a.17.1717541890631; Tue, 04 Jun 2024 15:58:10 -0700 (PDT) Received: from localhost.localdomain ([189.101.166.155]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7025a955dd1sm5312125b3a.64.2024.06.04.15.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 15:58: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 v3 3/6] iio: chemical: add driver for ENS160 sensor Date: Tue, 4 Jun 2024 19:57:27 -0300 Message-ID: <20240604225747.7212-4-gustavograzs@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604225747.7212-1-gustavograzs@gmail.com> References: <20240604225747.7212-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 --- 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..ae99a95c6 --- /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 = devm_add_action_or_reset(dev, ens160_set_idle, data); + 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 = 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..f885903fe --- /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"); +} + +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", + .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..40c68c5c4 --- /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"); +} + +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", + .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 Tue Jun 4 22:57:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Silva X-Patchwork-Id: 13685968 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 B387414D2BF; Tue, 4 Jun 2024 22:58:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717541897; cv=none; b=Ux35umYoRDTPdUhwwiB5C7dwwKLBkiSM9MWvJqEXDvBhlkcrC7QoXoT1CFmQ5IMjF81wJSOEY8isHwEh0w3WrDjr62G59Rxcoc4fJH5c5Npnp4wTDTxkp2rO6mcdiVlF3OLVVzkHu6+4HX0kHzXJVlCiaR4mxrlMuTFOcVMBXhs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717541897; c=relaxed/simple; bh=hBFRhU9jLcFXzLrq8iR9NyRX1lGd8Edes/2I6DiNTKw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LGf9JxWw4DGVgoCjlZFs9wrccBtTwHRkJ5jt4L9fCzEZ+3VyGVrkGiPK0+G+bHKsQsl3tRXAdb8LxqGN9j7P6lA8ZfGEqjh/eV8Wj8U8f+KUul2lDybXIy7lL20N24hJHF3HJbTI4zsQYD/VdrVHp3xAr/CHUkPPG6dYUdwheM0= 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=PblS7wNn; arc=none smtp.client-ip=209.85.210.173 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="PblS7wNn" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-702621d8725so3493918b3a.0; Tue, 04 Jun 2024 15:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717541895; x=1718146695; 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=p5+ZBH+n5A7gbuFFgRz4H/jOIhRg+AiCgR/DWUt6Km0=; b=PblS7wNnXC6mPQtCs5ndTf8A3b85p1cREoeKGPQygYAUuqN1UK52bBbSv4zxFxHsg8 tsUfMgz03hOKIARdc1jUdpY/BNVTBpHU8udgfjTMnCX1TPGPtGYQ6XTyV/6OBEzAXwvx AHL7eG7lHjJE5YP/tn5y2jAt7cS24K237A4jfu3/jSCJA0d+oLz0eQZhm7jKK+Cs6RnA E+dIkFLbKwNMNbUOslwrm25TW4f3iEaDc47JhsjMHVq30F39A2YPb8iv7Hk86vLgMZYc yn0CAzK7pZ2rjI/C1EmenUpdCil31+q1S5hqHW9+zj5JYG8tkBl76AEmLVbnnhVpice3 c03g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717541895; x=1718146695; 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=p5+ZBH+n5A7gbuFFgRz4H/jOIhRg+AiCgR/DWUt6Km0=; b=cg4sY2dpxo1G+kOZI+vdNvaBbEhoVBvSFKqcu6l+Co30D4/6m/XL7FBcDAV/taGHy1 Wtt5W6ckCFvT8jDazClFSWbqbu287pFHNuYrGAGXUdZUdbk44knIyXKQPVGDyFm1Btxc hNyuC2/e+UsUqt/vavV02uv+PGkXxshC79P3jvPwolVgHxOUExRCV1+p228SkFnzDFrk EG/XkU4tmsTtfV7nc3GnMNTjRRErvSOW/cLIGZ+KALCK5vbikMnBuBBOpFP4Jku3BQ71 RtbSUn3e93XM9UT90Q+GfdvMTu5Ag2hDdqh4VQTu4vAYsZux7qAxvYS85braxfPJICkS VoAQ== X-Forwarded-Encrypted: i=1; AJvYcCVRq0FlGGBv/KOpJtqALAPlFYi4oFEqQ4Pe6X4sJ7VnFb1HF0zprx3fn7whgHDBe0qzVGkriTKAoFGzew7WA3DnbVUa9rAjt/kRwu+HS+9d46LISoRawrZjmg0JN88SSFPXVBPdZnf8Ae01q12o5bXv2AxeRQ7NNhdvCs0khvmT6OJ5mQ== X-Gm-Message-State: AOJu0YxzWe3RRYoWDVMSG7zfXqqpYQTInjR4jvQISlBdZxSuXjalUdMd r0sy5YiB38X+XFNtaG7hYqretDKvSl3ys6OCV3GyjTslxOqND/1j X-Google-Smtp-Source: AGHT+IHob8PqrCO2BuCFNMAtSUeLtAyaT6/H0QCdrriHfaaGmvF56ImsIM41kmirG4MYpUkq6AhB2Q== X-Received: by 2002:a05:6a20:3c90:b0:1b1:d2a5:c7b1 with SMTP id adf61e73a8af0-1b2b713c6d7mr1256111637.49.1717541894917; Tue, 04 Jun 2024 15:58:14 -0700 (PDT) Received: from localhost.localdomain ([189.101.166.155]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7025a955dd1sm5312125b3a.64.2024.06.04.15.58.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 15:58:14 -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 v3 4/6] iio: chemical: ens160: add triggered buffer support Date: Tue, 4 Jun 2024 19:57:28 -0300 Message-ID: <20240604225747.7212-5-gustavograzs@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604225747.7212-1-gustavograzs@gmail.com> References: <20240604225747.7212-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 --- drivers/iio/chemical/ens160.h | 2 +- drivers/iio/chemical/ens160_core.c | 141 +++++++++++++++++++++++++++-- drivers/iio/chemical/ens160_i2c.c | 3 +- drivers/iio/chemical/ens160_spi.c | 2 +- 4 files changed, 136 insertions(+), 12 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 ae99a95c6..3da3b1095 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 @@ -23,6 +26,11 @@ #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 #define ENS160_REG_MODE_STANDARD 0x02 @@ -48,7 +56,13 @@ struct ens160_data { struct regmap *regmap; - u8 fw_version[3] __aligned(IIO_DMA_MINALIGN); + /* Protect reads from the sensor */ + struct mutex mutex; + struct { + __le16 chans[2]; + s64 timestamp __aligned(8); + } scan __aligned(IIO_DMA_MINALIGN); + u8 fw_version[3]; __le16 buf; }; @@ -60,6 +74,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 +89,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 +109,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: @@ -188,7 +220,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; @@ -208,10 +316,25 @@ 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 = ens160_chip_init(data); 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 f885903fe..f3fb45b75 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"); + return devm_ens160_core_probe(&client->dev, regmap, client->irq, + "ens160"); } 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 40c68c5c4..90e1e8386 100644 --- a/drivers/iio/chemical/ens160_spi.c +++ b/drivers/iio/chemical/ens160_spi.c @@ -29,7 +29,7 @@ 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"); + return devm_ens160_core_probe(&spi->dev, regmap, spi->irq, "ens160"); } static const struct of_device_id ens160_spi_of_match[] = { From patchwork Tue Jun 4 22:57:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Silva X-Patchwork-Id: 13685969 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 4F74114EC49; Tue, 4 Jun 2024 22:58:20 +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=1717541901; cv=none; b=D2FSWp14CXEh1adQ1plVut7XBL/x/4OJbeYDC6+GHYOYHubMvJG6hViHz3Lg+rGbOZsg840T/1nNycK0wnvCoBYzWpfmdQtGou48sf+1OPoke6bwS6APB34yhp+PilaZeGK+d0yXHGlDDKx+woy+GLmfTEjrdgU9GTX7Mgk5MW0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717541901; c=relaxed/simple; bh=3PbBRRIGCGwbDPONnU11cfvO9liugEEisBeeZgXscYk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VOl7iUZ6Kxj0FOHjqdlEiHyhG7XEXg4ZVjxSaeR3xCm5H7CfjJ8KZSSph8wPxYvEnVYCD/zf7JJxRTNctWlczUpTZOenGDp7YoKk+YSqxX4GLpB/C1erTfr0khtrfOgs5OCzO7R8Loq0WMWAOkCUYkxI0YVIYkiDrJv26zu0b4g= 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=Q9kdfIDE; 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="Q9kdfIDE" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-7025b253f64so2648927b3a.3; Tue, 04 Jun 2024 15:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717541899; x=1718146699; 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=Hj1V63M+srwA2IM19IN3/t8Yj3UqyDWtuebSx4Tuw4w=; b=Q9kdfIDE2yEeYnjJU4SziCZIclEfwArQDvmZwopapQpkciWkYeUeV/Jz446w1Sw7vq lTjHLlQLrFQ6HZ/g2/rG6+bpQtrR+DJw/mnMjNBJ+63m7/KKOIf9pxmhX/Yn660+Dp3v LpD8bloYiu5pDV7HLqGsQcy4B8raDiDJpd8hUD0K7tBRKgLeTOPsUurcTQrp2QhAihIK z1oCjCLZAr4sSAelo5zGMOn/r+MUG9qNEgSG/iWPRIQ63NvfKfywKWpsfLPGFEMt4r22 af8IaYVaGSwuJrmsxZU7syX3NCkU9+FBSw4PENBHqOs/2WDl4cRmubIF9VOHNUExaddz CWkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717541899; x=1718146699; 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=Hj1V63M+srwA2IM19IN3/t8Yj3UqyDWtuebSx4Tuw4w=; b=iG7XB466/AUAju+U84x/bJPy0/3vxEtWhxTw/gJWK8i5A5Q8Gwsv6DTVA4IuvxV4ay kQeEg+Kyh6hBP8i5EoDAwTogJwZNb7vpvAE99ofhGfo2BEOcZmNw2G5C4bvnUp+7EJWI WcVGloPO6Puhpeqd+HOg/jC1Vabe4JBSTgoe5JrsgqMd+Q3aq+V4xP9opBpXKENtZNdI +JdF/z4TdOf6y/nnO4wk5W/iXvVYSIDEhhBnhogopw+oHZLy3XlM2fkvZ7jq38Z1bdTX HsjKucjHGbYoWl4LgB3y0oxetlXgVweZlWNHiW1jwtZPWGzMV+VpRoabgIBbYqwp0E2x 0I/w== X-Forwarded-Encrypted: i=1; AJvYcCWK4TRqi8rcYzzjVPeMP1f+WFMAhfcpmyDmLZfiHfmcXmndWf+2GyF1uSvUgVG0Tplf1ZEnvGhM8bGAtDczJOX+vVuQFFh2qFSZD9SKVyRckjxfSEYdJnsRpRSC4wu+jKDlerufxcZGfV3t/ec0ped9RY5rOZHk8pNlfQgv1+h1EFtwMA== X-Gm-Message-State: AOJu0YyyEx9gQCQILFr1FTJzAEaaW0mNtdaOzwRkS8oLI5wXmiDaSuZ8 J+gdbBH1H182Yqd7OMuWU9Bf1If8C+yjlzh+dBBmbtR/NBJz+rso X-Google-Smtp-Source: AGHT+IF0bDONOHmRx6dYgUqrIamqsqVPVgFk743oOc63+wUMbNu1a3ZdBkz90lTn3CjzDNjHY3rjyQ== X-Received: by 2002:a05:6a20:244d:b0:1b2:53c5:9e71 with SMTP id adf61e73a8af0-1b2b6fa3436mr1288430637.25.1717541899510; Tue, 04 Jun 2024 15:58:19 -0700 (PDT) Received: from localhost.localdomain ([189.101.166.155]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7025a955dd1sm5312125b3a.64.2024.06.04.15.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 15:58:19 -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 v3 5/6] iio: chemical: ens160: add power management support Date: Tue, 4 Jun 2024 19:57:29 -0300 Message-ID: <20240604225747.7212-6-gustavograzs@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604225747.7212-1-gustavograzs@gmail.com> References: <20240604225747.7212-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 --- 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 3da3b1095..c1aa3b498 100644 --- a/drivers/iio/chemical/ens160_core.c +++ b/drivers/iio/chemical/ens160_core.c @@ -220,6 +220,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 f3fb45b75..57a189a4c 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", .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 90e1e8386..10e4f5fd0 100644 --- a/drivers/iio/chemical/ens160_spi.c +++ b/drivers/iio/chemical/ens160_spi.c @@ -48,6 +48,7 @@ static struct spi_driver ens160_spi_driver = { .driver = { .name = "ens160", .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 Tue Jun 4 22:57:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Silva X-Patchwork-Id: 13685970 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 CBD2814EC69; Tue, 4 Jun 2024 22:58:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717541906; cv=none; b=peD7fwRZwJYJzxJiHbBHODoHJU+YO3DqwBCBiI/fptwfxOayrazI7OVmW0YE8dpaV/jzw5SdM2oi1cidmvIYi/+xPL+P8MTXWE/VGr7dz5L6mr0z7oqQ2ctwt94yfVd/lG+3ep2WRKKH/mpcvYjqxad+Gof6scZegyY5vvQKH3k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717541906; c=relaxed/simple; bh=1HPHsVbVreRIstqrbeKaTP8EFP0/aLLOcaUwnO+ibPc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X8GUrW5NkJVTq/FCo0fGkWRa3GL0ixTECaUIHRmO21JI/Lohn/AtDuYptA5ZdYaBzQfQFbl7yafYOUPltEPyKWp9K8kv4o93futl/Kxy4lw5pRwupz2YfeGVtwo9aCgCgJWqE7YvMxb3b6wRYtw+raPWoAWEsvPcaoThS9toEJ8= 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=ncADUrwD; arc=none smtp.client-ip=209.85.210.171 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="ncADUrwD" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-70260814b2dso293057b3a.1; Tue, 04 Jun 2024 15:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717541904; x=1718146704; 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=e+HE1jadcQymVFTGU3XZI2NR8MDGRn4CBzGuTw21Pfw=; b=ncADUrwDWcdSSFlfQLc2lZ5lZIUK9ZjcbBK1P3thDD4OHJDl2wfuG2gd2574WnePKG VD6IT+jOwJotOgejSykTV4nS16pIhvokb2An/Rm003dMfpXcKfYcNgQCLWhZ6o79a0gi 2YdNtSb31yLrxmbRuGZB4FRZQO2r3RB+HTslSlArTXgZwFEb/ZuMmIfSM7CMtFcrLKne JyMKWKLynRKxs+vhtVamzvu6qeV5+fwc0aRyqKzgEknMcfkva2/VIyQNxb3oaxg3QQte DTdzVnYjcVKIG9oniG90I76/PO75uvCv9MJqB6N1ivgbkWVrBx7i9WlJvkq6yZ18Z5zx s8Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717541904; x=1718146704; 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=e+HE1jadcQymVFTGU3XZI2NR8MDGRn4CBzGuTw21Pfw=; b=us0823Ety9wcEU6/SKtFkEnafXfz2rGMwWN27WpREil06Xhc40PfEpFv6hlzEA/eya xeZ6M1OYiiw4es4WVbEID4f/qNU+epv9In35tx2Lbu/c7wpZbHLGoJzrzl5XZPTDs/1U FGv5tOVnM1jD1ZtqrxYLK21eDPxVLJ49PzjIZ1PxZGisB7iEbti8q7ak+mkg5aH64P1E KQUMty6y6ycuyYSdl8lcZ6DZnzm/Br1cpnpc0E26yCDMSUOU0GQF3suwNmmlgpwLexpe P2qBsG8GpuskYYlZACM/F5/KuE/hfB8ZnoKLaJ3cMq9DOxJ9o8tz21bCY5m8yJBWmO5w VLuQ== X-Forwarded-Encrypted: i=1; AJvYcCVYK0+wyhwsXpam2Fz385laJUow6mmbLxNP5W4IltZrUzIeu6qfGZkASLrXk9gIZgbYUObb4Y8CZ9lCvJTVdemSIyBlfyEBgG8dg+SeslkqQvAKlFJ/gbbz6ki+bmSYgHV87XK7l/DpKxMzP5oA1jWRwnuzy57O0UjfXYYaLYYM9JiF0Q== X-Gm-Message-State: AOJu0YwUsPGUFY0ibl4WxGGS63Lu7L5QGEEzft/M1QqKqCiBB06pEhKl deDPAT1OxFg87aeg0mGW+9ZyTVmim4iRDbYJQIV50ONqvFaPTNDVqP46DdHU X-Google-Smtp-Source: AGHT+IHG95txt/EEN2XtLksxrB5BLETOojV6B2WT0UsHubIgaPBuvKC3rhB06KSUv+Z0T/4QVBd0XA== X-Received: by 2002:a05:6a00:928e:b0:703:ecde:fc00 with SMTP id d2e1a72fcca58-703ecdf1af9mr29567b3a.1.1717541904037; Tue, 04 Jun 2024 15:58:24 -0700 (PDT) Received: from localhost.localdomain ([189.101.166.155]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7025a955dd1sm5312125b3a.64.2024.06.04.15.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 15:58:23 -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 v3 6/6] MAINTAINERS: Add ScioSense ENS160 Date: Tue, 4 Jun 2024 19:57:30 -0300 Message-ID: <20240604225747.7212-7-gustavograzs@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240604225747.7212-1-gustavograzs@gmail.com> References: <20240604225747.7212-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 --- 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