From nobody Thu Nov 28 06:44:54 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2047.outbound.protection.outlook.com [40.107.20.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90177170853; Thu, 3 Oct 2024 12:23:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.47 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727958193; cv=fail; b=OpINruh1Ic29HUQcxlNb7ayqr9Xk9S4LTerkD6HbZ1pQLd+rn7zuRi9C7TiLHbPKOfy0GfxnUUfbvtIOEIWBvcpVEYrYxsH3ZW8iPscfKGPDfV+3yLyXRPPG60V6ojMR0VpmQklMHy9XAxOf2N8h07G4Flk8hmzlPGuOySjeD7Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727958193; c=relaxed/simple; bh=9irxaHnFv2UpgpDc00MJVKNvSgpTu1IyNGZAHUTreDc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=kWcVsS5bSelLRzw/PJPQlH9scQPFBC89htJf0CLl1KSjQ5M7eqT9WroFgnGOWEj9C/jN7rlW+led+9V38VTWwFPjS5jT4KmjKp2iGWSnRNkn6sFCr1kX6B9Qjjkh0tpELQ0ZRix8L22V+28A9fn75YBlk5eNirN3sZSy1I5y8Hg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=axis.com; spf=pass smtp.mailfrom=axis.com; dkim=pass (1024-bit key) header.d=axis.com header.i=@axis.com header.b=rpsVljCS; arc=fail smtp.client-ip=40.107.20.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=axis.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=axis.com header.i=@axis.com header.b="rpsVljCS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tNexTiR+W02WBx5bMaY06Ft1Eea7QwnnICch4q2NX37eBbqzBH88vHULz+d878T8nCooO5PR/5mpzCVLvtGIJeMku0UfFQ+Pfe/HAK3GeWsmmJlQ3BxOx9xoHWgTghZ7k21Ud1bnXBYFRqyR+he1HLKRnFP19bJTuehd0Pdp0hWLkStWUz6VBzRuvQLGHM/U74KnvWI64crXU1+N9AZKr/RDMTi7NLoXz7cmt77vkLT4EDGyewPWbMtzY23Z8JrTnwLFPnboi3CA+8JnN5uAAQMMBEwMMuDhhe4HfARlOCiXHlkbz/oFAwgG5lXLI9knRYimpto+QXe9ox29OnaOUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gwU8dVVzfOYrhhZkIqBbni6UPpKR8xW8KS40/uNpvE4=; b=IqrEdVt8nDfhGI16+hywUV0FaKJl1bnoqzNKgyneMmYVGAIigtCvx6NQASZorJF3lHS7yFaEjNhMxxfwgk1U3GXGfgzWrST+vjEQfDL0fjDwQGAdcxwwQJqSydWoqa9V1issfucaJuluoAwa82ZZ1UUlLgOpw0OMcbnsTZz/fKt2but7SA1MJfimaseBl+f4EpXDu6T+MQmDTCWpfZ3lzraXqXNbvrcHB+o8/30N2v4XUDX7dtYuRRM5ZhY9g4NE2oMR0wLkB9N/aJauOLejYV1M2eInMP+ISvdVf4Odl3Vi3YaJc9kICnAqQ3fK7Ou616b7wRK5OdVA0FCSJvNvGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=kernel.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gwU8dVVzfOYrhhZkIqBbni6UPpKR8xW8KS40/uNpvE4=; b=rpsVljCSHWYb10rUZVKuM/RHWD9+xpdEzm7H+oV4ZmAZzlGs+9+01x8rP7PPSl2QsvgPU1BqGDfbS1uyL1TX33zMtE4EgluPFQVnjX9mELoccReKLvv8RRVq/yh7pTAl4OZ83TdBggGMJOJZmI7co0vsnTRE2ZGK5jHJARP2EsM= Received: from DUZPR01CA0225.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b4::22) by GV2PR02MB8673.eurprd02.prod.outlook.com (2603:10a6:150:78::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.18; Thu, 3 Oct 2024 12:23:04 +0000 Received: from DB3PEPF00008859.eurprd02.prod.outlook.com (2603:10a6:10:4b4:cafe::3d) by DUZPR01CA0225.outlook.office365.com (2603:10a6:10:4b4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.18 via Frontend Transport; Thu, 3 Oct 2024 12:23:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DB3PEPF00008859.mail.protection.outlook.com (10.167.242.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Thu, 3 Oct 2024 12:23:04 +0000 Received: from se-mail01w.axis.com (10.20.40.7) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 3 Oct 2024 14:23:03 +0200 Received: from se-intmail02x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 3 Oct 2024 14:23:03 +0200 Received: from pc55303-2334.se.axis.com (pc55303-2334.se.axis.com [10.94.180.8]) by se-intmail02x.se.axis.com (Postfix) with ESMTP id 5788D3E9; Thu, 3 Oct 2024 14:23:03 +0200 (CEST) Received: by pc55303-2334.se.axis.com (Postfix, from userid 18269) id 515892376CCA; Thu, 3 Oct 2024 14:23:03 +0200 (CEST) From: Emil Gedenryd Date: Thu, 3 Oct 2024 14:22:16 +0200 Subject: [PATCH v4 1/2] dt-bindings: iio: light: opt3001: add compatible for opt3002 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20241003-add_opt3002-v4-1-c550dc4591b4@axis.com> References: <20241003-add_opt3002-v4-0-c550dc4591b4@axis.com> In-Reply-To: <20241003-add_opt3002-v4-0-c550dc4591b4@axis.com> To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andreas Dannenberg CC: , , , Emil Gedenryd , , Conor Dooley X-Mailer: b4 0.14.1 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB3PEPF00008859:EE_|GV2PR02MB8673:EE_ X-MS-Office365-Filtering-Correlation-Id: 1aed882e-df96-4ffd-47db-08dce3a62183 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|7416014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?aitLNlVzaklXNzBsQWNVVUpkMHk1TFhZeWJIV2RMbFFHWUJranRjaHpLaHo3?= =?utf-8?B?U3pwdDM1NTFyYTErWW1OcnVIWjlUWWd5L29nSlh3aFRpeEJxL01XOFNWMXZi?= =?utf-8?B?eElVR1FJak1XTmtybk1aYS9JQVFRNGhDY3lpMjdGU3FTSGFaU0k4OCt6cWhh?= =?utf-8?B?MkI4VDZHV3NRazFPK0V2MjJJcHk5Y2xQN3p2LzdFQ2pWWVVvNkpSa3pLTG8v?= =?utf-8?B?QitKM0h2bDdhQUU2KzNIZ3NENTJYcW9HRUJJVGNzbzFDMEorZ2t6d1lKWUV2?= =?utf-8?B?ZjZPbUp3cU1SZ1FnVlBadllZR0dnTWFCRkF0eG45YktXMUkySnRCQmlLZkpy?= =?utf-8?B?WXhTSTNiVWtxemJ5dkJEOHNZVGR6aDk0bnJ5cEVoK0k5Y1Qyd0tJR0FTZGZy?= =?utf-8?B?eHhRUm1YdUtNOXpJY3dNVW8zc1MrUFhqcHJSeUNDSmR3ZUJNTFhrcTJHN2N1?= =?utf-8?B?Vy94VWxMcTF1cTVqSDBSMmdKR3RtM25JZGVJQTdicW1TSllEMDIwL0piOFNs?= =?utf-8?B?aDdWckJocFhWTjJrOEV5b2tPb0tORXkwVnJGZE9DbmptVmpkZ2FkSHR0SHQ1?= =?utf-8?B?dHJ0VDRUNHcvczhmbmlKWDY0clV6dFFnZHlDczZMT25TU05vRFhrR0N1d3VC?= =?utf-8?B?Yk8wUFEvclZoUUZHOGlLODQ1YjBhdFBxakhiVHpoM0RiVjFjOHZwVm1ZY3ZV?= =?utf-8?B?RmpJRW0vYkpmemNLUkYwSUh2UHVxRkF0YzZsbGxRSE5JS0tCS2FXSXFHQmJV?= =?utf-8?B?cnB1bjA1bEdkdlVGcW1hWUs2SGNr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BScFFBQnZOOHN5Z1c4bHdEWmwzZ2taSC9ha0dYUUdMQS91OEF1cUtM?= =?utf-8?B?dHEyODl3WUgzelkxekdGUXNuYSs4MnlpVWpBTnc3U1loMWhUY0JpL1F1QnJX?= =?utf-8?B?ai91SlE0UitxdE5QQk81SWZJT1JnK0c3SEV3NEFGOWQwcGt1b2dzWENkMyty?= =?utf-8?Q?46kNl3V1pBl9M?= X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(7416014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2024 12:23:04.5470 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1aed882e-df96-4ffd-47db-08dce3a62183 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DB3PEPF00008859.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR02MB8673 The opt3002 is a Light-to-Digital Sensor by TI with support for wide-range spectrum light. It shares most properties with their opt3001 model with the exception of having a wide spectral bandwidth, ranging from 300 nm to 1000 nm. Add the compatible string of opt3002. Acked-by: Conor Dooley Signed-off-by: Emil Gedenryd --- Documentation/devicetree/bindings/iio/light/ti,opt3001.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iio/light/ti,opt3001.yaml b/= Documentation/devicetree/bindings/iio/light/ti,opt3001.yaml index 441e9343fc97..67ca8d08256a 100644 --- a/Documentation/devicetree/bindings/iio/light/ti,opt3001.yaml +++ b/Documentation/devicetree/bindings/iio/light/ti,opt3001.yaml @@ -15,7 +15,9 @@ description: | =20 properties: compatible: - const: ti,opt3001 + enum: + - ti,opt3001 + - ti,opt3002 =20 reg: maxItems: 1 --=20 2.39.2 From nobody Thu Nov 28 06:44:54 2024 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2055.outbound.protection.outlook.com [40.107.21.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58B951547FB; Thu, 3 Oct 2024 12:23:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727958192; cv=fail; b=SfB8siwgyeNiYQXIT5sM5op1IeR2HKhjEWf/eLDVgZBGahhLBdvmKP6+jV3KsfN6xs+zcKzGO8cy2+nAwAUdxC+0rc23+lj+10UT6PRfvF24HA2aM0zbTHRkXJkKWlw0vgu57VCf0toB1eiJdjiFHCNoanN5OxfXJvLrJ9UkvMA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727958192; c=relaxed/simple; bh=+Np1i8xL2Rd3ouGdna1LexAQ9V0EVFUot5mb5P2wE30=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=IL54k9JxCIMzLbOlZRqTIgY7cMASUJ+dEewxJalco1An/4VCdgMPivpcLF/ELsOB7CucpGFg08o/H++mteNQkt8mf3GfFXuhLBPXb7X7i10BSdqYvmErEx2GRjca3QcLEC3Dq36egKtJ6KyDucmRX3QQY6WoloEMfb1rr7lDCkg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=axis.com; spf=pass smtp.mailfrom=axis.com; dkim=pass (1024-bit key) header.d=axis.com header.i=@axis.com header.b=AhqnYXNf; arc=fail smtp.client-ip=40.107.21.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=axis.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=axis.com header.i=@axis.com header.b="AhqnYXNf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AuvDeiwaZAwPSxMOzYJj+aDzWYYoAXT8MVTQ4XLWDPOwYs8dq5MMhJM4efl/OKwQFwV8r5CvtVHtV3Sv0MZ26nqVM8lOX4dt5hTJ3cetMWDyrhdSDgiceT2qhYYgn5SSaRpibWJkvVtINBq23flWbHPiwkGsF6g+00Hg5XDxlltd2vtWbUXIw1ubOFcR0ctRZsyriCEA/lyp7/ztxFipt7mvpuHrqGNFmXq1UGYaKOb8yc9cQv0dbPKBxRJy2RyKVVpwasWD8MRd1UqCVKk1bqX+UmqwCdBxO9Q2ESA9XhoMGGA08JgU6AdVebGcGTNy9mPhzKizOfKpZBd3nJs0Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9JzVgzd9D6gtlpyjhqF/pFgxQ5aTRbyWrBEbf49pT9A=; b=q7dtuE2FLyqP8tvzaR8gUMzCGdX0Jsi5G9YosBll4tGKh0EL1PcHRHfFUhvSDmLhd4xvK8Q0AecOIJeWs7L6T13+SPtvHxhr2zxKt8634UD9mghvlUNElWShPWVaPs/h7jGMNspJ65/pTWRX/dCFsGig298Sfy0jauWXM49qfCgf7iQcmMCUKxPQx+8fhoVW3x7mXbH3hwgNI1KnkatHPO7FDy+Y2d1KnlxwNx7jnih1wyIrVRCiQGLHw1hreuKjNziHN6fZKkagYsl5HvUwe8P4cdzF+WL/gPkDgUltN3/SFxq4iS4cDTpkcfIrGstNz+DNfbpeltUHZDMBmyMGAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=kernel.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9JzVgzd9D6gtlpyjhqF/pFgxQ5aTRbyWrBEbf49pT9A=; b=AhqnYXNf0wbWeLGbMUpVPQ4gfZgRwVqTur62et/uIDCJDS0VUlOj1EEvkkV4sVOKTIm+zxorPYEIiRFqbW8emru2Ooty8A6qerNpcpjtKf481h2K6ryHwOvV0/+b47OaTZRRnmq67k/BchvuJrX1oXC32ZYY7F0ZBHag1jrClbE= Received: from DU2PR04CA0018.eurprd04.prod.outlook.com (2603:10a6:10:3b::23) by DU2PR02MB10230.eurprd02.prod.outlook.com (2603:10a6:10:46e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.15; Thu, 3 Oct 2024 12:23:04 +0000 Received: from DU6PEPF0000A7E3.eurprd02.prod.outlook.com (2603:10a6:10:3b:cafe::85) by DU2PR04CA0018.outlook.office365.com (2603:10a6:10:3b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.17 via Frontend Transport; Thu, 3 Oct 2024 12:23:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DU6PEPF0000A7E3.mail.protection.outlook.com (10.167.8.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Thu, 3 Oct 2024 12:23:04 +0000 Received: from se-mail01w.axis.com (10.20.40.7) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 3 Oct 2024 14:23:03 +0200 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 3 Oct 2024 14:23:03 +0200 Received: from pc55303-2334.se.axis.com (pc55303-2334.se.axis.com [10.94.180.8]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 49F2212F; Thu, 3 Oct 2024 14:23:03 +0200 (CEST) Received: by pc55303-2334.se.axis.com (Postfix, from userid 18269) id 5264A2376CC3; Thu, 3 Oct 2024 14:23:03 +0200 (CEST) From: Emil Gedenryd Date: Thu, 3 Oct 2024 14:22:17 +0200 Subject: [PATCH v4 2/2] iio: light: opt3001: add support for TI's opt3002 light sensor Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20241003-add_opt3002-v4-2-c550dc4591b4@axis.com> References: <20241003-add_opt3002-v4-0-c550dc4591b4@axis.com> In-Reply-To: <20241003-add_opt3002-v4-0-c550dc4591b4@axis.com> To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andreas Dannenberg CC: , , , Emil Gedenryd , X-Mailer: b4 0.14.1 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000A7E3:EE_|DU2PR02MB10230:EE_ X-MS-Office365-Filtering-Correlation-Id: 08ad6d9f-dbdc-40c2-298c-08dce3a6217e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?OTBQT1lYRzRWZjBuT3dPbGl4WVo4TjVNOVozZFI0UU15dUQ5RGNyMkVqdDd4?= =?utf-8?B?VUtoZ3N4K1BmZFhyVVc3N1hhT1p0NnJzTTRWUnlDcGxsZVVLa2gzVms4cGl4?= =?utf-8?B?R2NLRmRWbmJ2RUJ3VVo3Q3RKd0hKajdTSmt1Slk5RDU1MUdaTUdWTnFoZnpS?= =?utf-8?B?bmhPWnRuSFBmSGZqRDBKclJ0QmRaWWdDbVJ0d2Q5czFVU1daNHV5eFhTdWtI?= =?utf-8?B?bW5LMkhVdmhjMFJKazIwcjRTazlUQUliOEd6WDFkQWs3aFBkNFFhalRKd2ZZ?= =?utf-8?B?aWY0SUJ6Sy9wTTl6Zlo5TmMreWxoVHhtMFFYNk1tVEJJRzBsbTFvMEdSb0V6?= =?utf-8?B?YzkycE83ZkN2MFZYSTBLNnBBZ01meHVNNkJkZTVoTXV2MTRhMFZyc1cwTS9T?= =?utf-8?B?WDVXNE1rQkNGK3YwdHBjdWFkY2xTS2xabFJXdXVCL0g0ODJpZ1FuMUFlcmhu?= =?utf-8?B?dWZTMVd6ZFJXeHg1ZUVjeFE4RkFSSW00dVVKOHBSa3RYWmdmbFRNTmhzS0ZK?= =?utf-8?B?LzJMeEZJQmFBMDNCdjBTOEo2R3IxSWFsWmdoTkRqdHByYi9XbDBNd1YvdU1M?= =?utf-8?B?SzR5MEhGN0phbEFrQjJRV0hObTZxeC9JMnhw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yeWw1YjE0T2x5UFdpVUN6YU15S3Rw?= =?utf-8?B?V21zdDFWVnZOenMxZzJGTHJkUXNxMzdXY0p1eXd6SGJKMWRyQzFoQjVrL2JQ?= =?utf-8?B?cXE1MnZKRjNTcEJBRk9ZMzhxQm1UZTd2ZkQvdEJXQWk3ZDJIeVBIeFZzNHZS?= =?utf-8?B?UGc2OXZESVBHMm0zNnpTOVRVK1l1R2NwS0FOUFozbzdQVjR3cjZvVzFZYlMw?= =?utf-8?B?aUxlRXZUd2JQTy9CdEdRN205cWpQelYvWnAzZTlSL0ppUjlLVGJTYzVEZTYz?= =?utf-8?B?S2d1UU55RFdZWFdKVkVieUErV2MwZnNUbi9lUEpscEZtVHFmS0dVYXIwWUFw?= =?utf-8?Q?xQhldq5DC8Mqf?= X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2024 12:23:04.5135 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 08ad6d9f-dbdc-40c2-298c-08dce3a6217e X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DU6PEPF0000A7E3.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR02MB10230 TI's opt3002 light sensor shares most properties with the opt3001 model, with the exception of supporting a wider spectrum range. Add support for TI's opt3002 by extending the TI opt3001 driver. Datasheet: https://www.ti.com/product/OPT3002 Signed-off-by: Emil Gedenryd --- drivers/iio/light/Kconfig | 2 +- drivers/iio/light/opt3001.c | 189 ++++++++++++++++++++++++++++++++++++----= ---- 2 files changed, 157 insertions(+), 34 deletions(-) diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig index b68dcc1fbaca..c35bf962dae6 100644 --- a/drivers/iio/light/Kconfig +++ b/drivers/iio/light/Kconfig @@ -461,7 +461,7 @@ config OPT3001 depends on I2C help If you say Y or M here, you get support for Texas Instruments - OPT3001 Ambient Light Sensor. + OPT3001 Ambient Light Sensor, OPT3002 Light-to-Digital Sensor. =20 If built as a dynamically linked module, it will be called opt3001. diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c index 176e54bb48c3..ff7fc0d4b08f 100644 --- a/drivers/iio/light/opt3001.c +++ b/drivers/iio/light/opt3001.c @@ -70,6 +70,35 @@ #define OPT3001_RESULT_READY_SHORT 150 #define OPT3001_RESULT_READY_LONG 1000 =20 +struct opt3001_scale { + int val; + int val2; +}; + +struct opt3001_chip_info { + const struct iio_chan_spec (*channels)[2]; + enum iio_chan_type chan_type; + int num_channels; + + const struct opt3001_scale (*scales)[12]; + /* + * Factor as specified by conversion equation in datasheet. + * eg. 0.01 (scaled to integer 10) for opt3001. + */ + int factor_whole; + /* + * Factor to compensate for potentially scaled factor_whole. + */ + int factor_integer; + /* + * Factor used to align decimal part of proccessed value to six decimal + * places. + */ + int factor_decimal; + + bool has_id; +}; + struct opt3001 { struct i2c_client *client; struct device *dev; @@ -79,6 +108,7 @@ struct opt3001 { bool result_ready; wait_queue_head_t result_ready_queue; u16 result; + const struct opt3001_chip_info *chip_info; =20 u32 int_time; u32 mode; @@ -92,11 +122,6 @@ struct opt3001 { bool use_irq; }; =20 -struct opt3001_scale { - int val; - int val2; -}; - static const struct opt3001_scale opt3001_scales[] =3D { { .val =3D 40, @@ -148,21 +173,68 @@ static const struct opt3001_scale opt3001_scales[] = =3D { }, }; =20 +static const struct opt3001_scale opt3002_scales[] =3D { + { + .val =3D 4914, + .val2 =3D 0, + }, + { + .val =3D 9828, + .val2 =3D 0, + }, + { + .val =3D 19656, + .val2 =3D 0, + }, + { + .val =3D 39312, + .val2 =3D 0, + }, + { + .val =3D 78624, + .val2 =3D 0, + }, + { + .val =3D 157248, + .val2 =3D 0, + }, + { + .val =3D 314496, + .val2 =3D 0, + }, + { + .val =3D 628992, + .val2 =3D 0, + }, + { + .val =3D 1257984, + .val2 =3D 0, + }, + { + .val =3D 2515968, + .val2 =3D 0, + }, + { + .val =3D 5031936, + .val2 =3D 0, + }, + { + .val =3D 10063872, + .val2 =3D 0, + }, +}; + static int opt3001_find_scale(const struct opt3001 *opt, int val, int val2, u8 *exponent) { int i; - - for (i =3D 0; i < ARRAY_SIZE(opt3001_scales); i++) { - const struct opt3001_scale *scale =3D &opt3001_scales[i]; - + for (i =3D 0; i < ARRAY_SIZE(*opt->chip_info->scales); i++) { + const struct opt3001_scale *scale =3D &(*opt->chip_info->scales)[i]; /* - * Combine the integer and micro parts for comparison - * purposes. Use milli lux precision to avoid 32-bit integer - * overflows. + * Compare the integer and micro parts to determine value scale. */ - if ((val * 1000 + val2 / 1000) <=3D - (scale->val * 1000 + scale->val2 / 1000)) { + if (val < scale->val || + (val =3D=3D scale->val && val2 <=3D scale->val2)) { *exponent =3D i; return 0; } @@ -174,11 +246,14 @@ static int opt3001_find_scale(const struct opt3001 *o= pt, int val, static void opt3001_to_iio_ret(struct opt3001 *opt, u8 exponent, u16 mantissa, int *val, int *val2) { - int lux; + int ret; + int whole =3D opt->chip_info->factor_whole; + int integer =3D opt->chip_info->factor_integer; + int decimal =3D opt->chip_info->factor_decimal; =20 - lux =3D 10 * (mantissa << exponent); - *val =3D lux / 1000; - *val2 =3D (lux - (*val * 1000)) * 1000; + ret =3D whole * (mantissa << exponent); + *val =3D ret / integer; + *val2 =3D (ret - (*val * integer)) * decimal; } =20 static void opt3001_set_mode(struct opt3001 *opt, u16 *reg, u16 mode) @@ -225,7 +300,18 @@ static const struct iio_chan_spec opt3001_channels[] = =3D { IIO_CHAN_SOFT_TIMESTAMP(1), }; =20 -static int opt3001_get_lux(struct opt3001 *opt, int *val, int *val2) +static const struct iio_chan_spec opt3002_channels[] =3D { + { + .type =3D IIO_INTENSITY, + .info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW) | + BIT(IIO_CHAN_INFO_INT_TIME), + .event_spec =3D opt3001_event_spec, + .num_event_specs =3D ARRAY_SIZE(opt3001_event_spec), + }, + IIO_CHAN_SOFT_TIMESTAMP(1), +}; + +static int opt3001_get_processed(struct opt3001 *opt, int *val, int *val2) { int ret; u16 mantissa; @@ -397,14 +483,15 @@ static int opt3001_read_raw(struct iio_dev *iio, if (opt->mode =3D=3D OPT3001_CONFIGURATION_M_CONTINUOUS) return -EBUSY; =20 - if (chan->type !=3D IIO_LIGHT) + if (chan->type !=3D opt->chip_info->chan_type) return -EINVAL; =20 mutex_lock(&opt->lock); =20 switch (mask) { + case IIO_CHAN_INFO_RAW: case IIO_CHAN_INFO_PROCESSED: - ret =3D opt3001_get_lux(opt, val, val2); + ret =3D opt3001_get_processed(opt, val, val2); break; case IIO_CHAN_INFO_INT_TIME: ret =3D opt3001_get_int_time(opt, val, val2); @@ -428,7 +515,7 @@ static int opt3001_write_raw(struct iio_dev *iio, if (opt->mode =3D=3D OPT3001_CONFIGURATION_M_CONTINUOUS) return -EBUSY; =20 - if (chan->type !=3D IIO_LIGHT) + if (chan->type !=3D opt->chip_info->chan_type) return -EINVAL; =20 if (mask !=3D IIO_CHAN_INFO_INT_TIME) @@ -479,6 +566,9 @@ static int opt3001_write_event_value(struct iio_dev *ii= o, { struct opt3001 *opt =3D iio_priv(iio); int ret; + int whole; + int integer; + int decimal; =20 u16 mantissa; u16 value; @@ -497,7 +587,12 @@ static int opt3001_write_event_value(struct iio_dev *i= io, goto err; } =20 - mantissa =3D (((val * 1000) + (val2 / 1000)) / 10) >> exponent; + whole =3D opt->chip_info->factor_whole; + integer =3D opt->chip_info->factor_integer; + decimal =3D opt->chip_info->factor_decimal; + + mantissa =3D (((val * integer) + (val2 / decimal)) / whole) >> exponent; + value =3D (exponent << 12) | mantissa; =20 switch (dir) { @@ -610,7 +705,7 @@ static int opt3001_read_id(struct opt3001 *opt) ret =3D i2c_smbus_read_word_swapped(opt->client, OPT3001_DEVICE_ID); if (ret < 0) { dev_err(opt->dev, "failed to read register %02x\n", - OPT3001_DEVICE_ID); + OPT3001_DEVICE_ID); return ret; } =20 @@ -692,6 +787,7 @@ static irqreturn_t opt3001_irq(int irq, void *_iio) struct opt3001 *opt =3D iio_priv(iio); int ret; bool wake_result_ready_queue =3D false; + enum iio_chan_type chan_type =3D opt->chip_info->chan_type; =20 if (!opt->ok_to_ignore_lock) mutex_lock(&opt->lock); @@ -707,13 +803,13 @@ static irqreturn_t opt3001_irq(int irq, void *_iio) OPT3001_CONFIGURATION_M_CONTINUOUS) { if (ret & OPT3001_CONFIGURATION_FH) iio_push_event(iio, - IIO_UNMOD_EVENT_CODE(IIO_LIGHT, 0, + IIO_UNMOD_EVENT_CODE(chan_type, 0, IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING), iio_get_time_ns(iio)); if (ret & OPT3001_CONFIGURATION_FL) iio_push_event(iio, - IIO_UNMOD_EVENT_CODE(IIO_LIGHT, 0, + IIO_UNMOD_EVENT_CODE(chan_type, 0, IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING), iio_get_time_ns(iio)); @@ -755,22 +851,25 @@ static int opt3001_probe(struct i2c_client *client) opt =3D iio_priv(iio); opt->client =3D client; opt->dev =3D dev; + opt->chip_info =3D i2c_get_match_data(client); =20 mutex_init(&opt->lock); init_waitqueue_head(&opt->result_ready_queue); i2c_set_clientdata(client, iio); =20 - ret =3D opt3001_read_id(opt); - if (ret) - return ret; + if (opt->chip_info->has_id) { + ret =3D opt3001_read_id(opt); + if (ret) + return ret; + } =20 ret =3D opt3001_configure(opt); if (ret) return ret; =20 iio->name =3D client->name; - iio->channels =3D opt3001_channels; - iio->num_channels =3D ARRAY_SIZE(opt3001_channels); + iio->channels =3D *opt->chip_info->channels; + iio->num_channels =3D opt->chip_info->num_channels; iio->modes =3D INDIO_DIRECT_MODE; iio->info =3D &opt3001_info; =20 @@ -825,14 +924,38 @@ static void opt3001_remove(struct i2c_client *client) } } =20 +static const struct opt3001_chip_info opt3001_chip_information =3D { + .channels =3D &opt3001_channels, + .chan_type =3D IIO_LIGHT, + .num_channels =3D ARRAY_SIZE(opt3001_channels), + .scales =3D &opt3001_scales, + .factor_whole =3D 10, + .factor_integer =3D 1000, + .factor_decimal =3D 1000, + .has_id =3D true, +}; + +static const struct opt3001_chip_info opt3002_chip_information =3D { + .channels =3D &opt3002_channels, + .chan_type =3D IIO_INTENSITY, + .num_channels =3D ARRAY_SIZE(opt3002_channels), + .scales =3D &opt3002_scales, + .factor_whole =3D 12, + .factor_integer =3D 10, + .factor_decimal =3D 100000, + .has_id =3D false, +}; + static const struct i2c_device_id opt3001_id[] =3D { - { "opt3001" }, + { "opt3001", (kernel_ulong_t)&opt3001_chip_information }, + { "opt3002", (kernel_ulong_t)&opt3002_chip_information }, { } /* Terminating Entry */ }; MODULE_DEVICE_TABLE(i2c, opt3001_id); =20 static const struct of_device_id opt3001_of_match[] =3D { - { .compatible =3D "ti,opt3001" }, + { .compatible =3D "ti,opt3001", .data =3D &opt3001_chip_information }, + { .compatible =3D "ti,opt3002", .data =3D &opt3002_chip_information }, { } }; MODULE_DEVICE_TABLE(of, opt3001_of_match); --=20 2.39.2