From nobody Fri Nov 29 18:30:06 2024 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011016.outbound.protection.outlook.com [52.101.65.16]) (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 295EE15A85E; Mon, 16 Sep 2024 14:57:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.16 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726498674; cv=fail; b=PsCBSEPmZ5KV92ScCDP/qDrdsDlpvWY7EE43FORwvMSLQ7RevPYkCeNza5djBxfHPHNT4078kCr9z0TeMj8/nGMycyB46CBfmvhPaxrZrGKV0beSwIjC7WDsXSc5sM3JT7eFrsxYAUYN+CXaXwKB/GIu2l/nuDUKAPE5dofojnw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726498674; c=relaxed/simple; bh=aqY/vAVBSMH8SLZlhZ2rUTWyaKlm3LSZXGMGn4Xs3YI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=QF3Ohn2pNoHK5puDedf98DlImV/o8gywL0yl9fVUMw9HC/rzWbrRfzddPFWN7hyVu/aQCnhfEd8zXGzfVmnlEx3HudEmrjFVmKjcDiOvZZgZWGSzJQzFmhryxdSAr3f2iu3+54e1NhwGDmXKoCqV3ipanx7p24Shvse5ksBSrGk= 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=XLFi99dM; arc=fail smtp.client-ip=52.101.65.16 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="XLFi99dM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=I5esutnq1WwaIT6CUTO8rWpCfMqND0Mb/txs/cTU4nDhBBWGEXJizO8nroJcnKH7G8CcJJPDnaQNaVgCvb+x2RDIQ2eQten3jINOd1s0jkZbHsl1DAfnOJw6aBUy/22QU9WCpx546q3y34kzXybJ6uCvrtsBz2rWKTjUzcyYPRvPf4tLR5193PZMeIehyHfPQuzvBnK58dD/mSEH1WVoWkt8/I0h6QStCJPI2mOn354TlZF3/46cjrhJWDc5fAkXvDqW9UoXdSNup0qvwDOKjQqhJbt3yMTndO7siUfI54+np/FSlbVg3ixJkBPm5npgz985DNT/DfRTGXpzTrNPfA== 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=LFPN0SBSr6PbHgcghlFBv+QWPvrLlELhnAj1xrXcBOo=; b=ntEjG6y4TghZCOTCJHnIe2HdeSum8zA4I5h/yW44VQcP8IF70DUltFaEoH02w6bvvSGouEfArLGU51Ddwv4r/TlkxedSZyA3/xQhYxi94dN6acSx4sr4SvAXe6+lTNtWbQaBE76Kfh/q/h/qIpf4TJ6DVOUpYMgJDFLzunLX+kUJBruyC3iHJdqYcw5jiuhpWq5bRGBqDeFuDs+pk6jar+CMLAuoHTBeSz0ZVrP41TNosIDKkOuYZTZXaMPRZJsZefO1DyUQti2KtStP/TrOQ0Z8LsVQE+eX0OXIN6COTD0ROx4YVeoFtczsmeicl6ggpPonh3yyKmS24IFtC+PnRg== 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=LFPN0SBSr6PbHgcghlFBv+QWPvrLlELhnAj1xrXcBOo=; b=XLFi99dM2NPxfzJ6hQVXRqZWb8nkpiUgmgGHX/nxwK03A7p+N4vLboMbmgY54I5rqY9lIsqQs/tHHXi/vz3ZXkKyDI292s2KCl7nMVU2ehsBTlbX42fWf/D+D3gkcSs0oZLozJDSg+dVr+WWoDGMxPySNvcRBH7tXq7lJdfICQI= Received: from AM0PR08CA0010.eurprd08.prod.outlook.com (2603:10a6:208:d2::23) by DBBPR02MB10481.eurprd02.prod.outlook.com (2603:10a6:10:538::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.24; Mon, 16 Sep 2024 14:57:38 +0000 Received: from AM3PEPF00009B9E.eurprd04.prod.outlook.com (2603:10a6:208:d2:cafe::d) by AM0PR08CA0010.outlook.office365.com (2603:10a6:208:d2::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Mon, 16 Sep 2024 14:57:38 +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 AM3PEPF00009B9E.mail.protection.outlook.com (10.167.16.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Mon, 16 Sep 2024 14:57:38 +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; Mon, 16 Sep 2024 16:57:37 +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; Mon, 16 Sep 2024 16:57:37 +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 4FB92264; Mon, 16 Sep 2024 16:57:37 +0200 (CEST) Received: by pc55303-2334.se.axis.com (Postfix, from userid 18269) id 4CA0E22FBD57; Mon, 16 Sep 2024 16:57:37 +0200 (CEST) From: Emil Gedenryd Date: Mon, 16 Sep 2024 16:56:37 +0200 Subject: [PATCH v3 1/3] iio: light: opt3001: add missing full-scale range value 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: <20240916-add_opt3002-v3-1-984b190cd68c@axis.com> References: <20240916-add_opt3002-v3-0-984b190cd68c@axis.com> In-Reply-To: <20240916-add_opt3002-v3-0-984b190cd68c@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: AM3PEPF00009B9E:EE_|DBBPR02MB10481:EE_ X-MS-Office365-Filtering-Correlation-Id: 1918d5b9-1416-4ddb-c9ad-08dcd65fe825 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Micro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eE5mcmJvQUpqSzlhV3A5dTRFM0pkenVr?= =?utf-8?B?OC9zVTZGb1pDR0hxZGNMYXVWUGl0aUVkTncvNnorQnV1Tm41ZDBpdXJ4Wldn?= =?utf-8?B?RGZ5ZTZYVWE3QTUrMm9DQWIvSEhxWUtSY2VWZk1IcSs1dzE0c1YvaWZMOENU?= =?utf-8?B?NjJ3RTlCdFpNQ3poYndFK1lsSEdERFAxQ1VJKzlqR2ZoLzlraTBxVksyNEI3?= =?utf-8?Q?rm072vMZffHABzchRg2GV/YR3osOALsZ?= 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)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2024 14:57:38.4326 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1918d5b9-1416-4ddb-c9ad-08dcd65fe825 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: AM3PEPF00009B9E.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR02MB10481 The opt3001 driver uses predetermined full-scale range values to determine what exponent to use for event trigger threshold values. The problem is that one of the values specified in the datasheet is missing from the implementation. This causes larger values to be scaled down to an incorrect exponent, effectively reducing the maximum settable threshold value by a factor of 2. Add missing full-scale range array value. Fixes: 94a9b7b1809f ("iio: light: add support for TI's opt3001 light sensor= ") Signed-off-by: Emil Gedenryd --- drivers/iio/light/opt3001.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c index 887c4b776a86..176e54bb48c3 100644 --- a/drivers/iio/light/opt3001.c +++ b/drivers/iio/light/opt3001.c @@ -138,6 +138,10 @@ static const struct opt3001_scale opt3001_scales[] =3D= { .val =3D 20966, .val2 =3D 400000, }, + { + .val =3D 41932, + .val2 =3D 800000, + }, { .val =3D 83865, .val2 =3D 600000, --=20 2.39.2 From nobody Fri Nov 29 18:30:06 2024 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013029.outbound.protection.outlook.com [52.101.67.29]) (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 54A1D15854A; Mon, 16 Sep 2024 14:57:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.29 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726498666; cv=fail; b=a9WuW6iebKMzb6fajtWcu10yCZtTZdCx8ZMFeYCc3qBv7G444FAjd2/VJwiek0JhvRqP7Xw8PVTB8nR4NiatIPGPVZpE7qFDwh8n/XOm59fLBLbVtcrLD/+FTETpBCifDXPSYpM0Nb7vgEKxo4keP2dcgjYuc+6thooLWU6kvb4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726498666; c=relaxed/simple; bh=kN7XJWOhir0lDzlnOM3MXSRCqy76IrHmZRMvMFxpIVY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=ra5nIHYH0Aq6c4nvR+qE4qxFsqkJOJa57S9DN/I3U3ddFP11uXi3k+A8bPn2Jcq1MTQ2hyfZCVcRPVzlHYe9VS9lk+2r9lXVqkVHF1LAOwwMAu49YTQ2eawqg58tjuUA6hP8z8LPH+qnkF/cXdIy141HDo3WrKjqo6d8VxK6sis= 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=qNlyetGk; arc=fail smtp.client-ip=52.101.67.29 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="qNlyetGk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=anzWpbEuC5y0TwXQuJuQuYv+NTs5oG0bBUiMHPj8GqE+Y3u8lZSIK3rH4BdnJ7ocAZMFtj78DLXv2Dc5912fhBQq9NWZ85/wkHa4l+Gz7OZYZoELvfEwx2Zjl3Y2//sr4pBvTHB3TWumcNKK6gOYMdcDR1BWuPLWBRy1KgmyuqERK5byaqGVBBV6tN2J3tjRr62C6HUtbem3hInIus95GQnTWUHUYEKlY3+PffQvgIzP7fSokaN6CJcfJd4tJK+uR+FqR/W60vqxZFOoFtetpHLRnX7HXL6SmBIxn0A2hFXreEPqVBdThA8WsRGtGjwQNVNkTjvSQU9v3mhNpx2ckw== 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=zKZb30QSeG1aXMqTv+y/06EvS+uTSAi4qt1ctZg/1zM=; b=T9W37eQWh24x2PDOi4lowhTp7UQUXb4iMNZtNKLYabQcBfhrld7M9XnBBxKNXkzroy4aGd16enjPKcqg3vuOvRTTtBlYKgo/NPY5KArUjzCCzVNZpVICyYZSQsi7WbDI2wXGmV0iGa/wDSRvwntp05fljNCvrknS3mkbh90ssadV2J1ieVK00J1vunDGNQD9l031gJQhU2BRG34T4XUzV6gtBSJ7M+NWSF7SNvADIOIwaMh5FTUwhtVt67Xfw45ORgl8bgFKhoX8KAw0kAGgyzN4fu+45RDT+BTOGTc8qjccklkYDRJmiXDFtDADf/iyipsj+RwekOlVIlb7Mm2Wlw== 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=zKZb30QSeG1aXMqTv+y/06EvS+uTSAi4qt1ctZg/1zM=; b=qNlyetGkOASX4kBkZUtYB7i2uywkfYrI502lLCeBRNw7LGkzchNX1qmwyUQRB3jhpGmyGOEM0BJ8U46BeONfND/edtNfzhRlCJU3HY/C4RjFS5hZAH+dqS+1MRcFm5sRSez/nqdCwd3Xf1h65JTKZXyWep2Jl+5SHSS07kMHJNw= Received: from AS9PR06CA0681.eurprd06.prod.outlook.com (2603:10a6:20b:49c::26) by VI1PR02MB6269.eurprd02.prod.outlook.com (2603:10a6:800:19f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.23; Mon, 16 Sep 2024 14:57:40 +0000 Received: from AM1PEPF000252DE.eurprd07.prod.outlook.com (2603:10a6:20b:49c:cafe::d2) by AS9PR06CA0681.outlook.office365.com (2603:10a6:20b:49c::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Mon, 16 Sep 2024 14:57:40 +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 AM1PEPF000252DE.mail.protection.outlook.com (10.167.16.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Mon, 16 Sep 2024 14:57:40 +0000 Received: from SE-MAIL21W.axis.com (10.20.40.16) 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; Mon, 16 Sep 2024 16:57:37 +0200 Received: from se-mail01w.axis.com (10.20.40.7) by SE-MAIL21W.axis.com (10.20.40.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 16 Sep 2024 16:57:37 +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; Mon, 16 Sep 2024 16:57:37 +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 5194F10B; Mon, 16 Sep 2024 16:57:37 +0200 (CEST) Received: by pc55303-2334.se.axis.com (Postfix, from userid 18269) id 4EC7522FBD56; Mon, 16 Sep 2024 16:57:37 +0200 (CEST) From: Emil Gedenryd Date: Mon, 16 Sep 2024 16:56:38 +0200 Subject: [PATCH v3 2/3] 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: <20240916-add_opt3002-v3-2-984b190cd68c@axis.com> References: <20240916-add_opt3002-v3-0-984b190cd68c@axis.com> In-Reply-To: <20240916-add_opt3002-v3-0-984b190cd68c@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: AM1PEPF000252DE:EE_|VI1PR02MB6269:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c7c0c58-6d20-4516-bd43-08dcd65fe950 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?LzFlNnlqd2hiekFJMHNrYlZaV0N2cnduOFZRdld4b0V4bERabEtHam5kVzhR?= =?utf-8?B?Q0ZrL1hHWkx1VTJMMm1QZUxIQ00xb0VMVldhcFU1eExWWG5CdDJFcGt1TDlp?= =?utf-8?B?L29Fdk96SGVxdUNhOGtkOE44anJLVEhTSjBHTVpjYzZQRW5ad2hvZHJ0WEtC?= =?utf-8?B?dEp2blRvaWF2WCtTYXlON3NPdmNTZmd3SVYveEVZWXltdmRHYTBmZnp4TVM1?= =?utf-8?B?NU1UR3oyK1duMFQ0SThMcmp5RVBiVUV2TUg1Z01SaUlrbHVMbHVvRXZ6eXVT?= =?utf-8?B?RHIxdGRBMnV1Q2RCN0JyYkhweFZ6N3NLL1ovOWVJbGdBbnVlTDd5SWM1RTRO?= =?utf-8?B?ZGFpUHdieVBsb1BaUFdWUEExMmhSdEVJK09yd2ZFczV0c2ZITFlLM0hDT2FF?= =?utf-8?B?anBnUUtZZm1YN3lBNWpHRlJDRVQwdjYxeVFLemFLTWczd2FzQjV5WEZ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3NKaUJwd3A4ZDRUQjg3UVd5UmtzK1ZucHJ1?= =?utf-8?B?aUJWOUh1UDlHeVk4TUJBL2JJVXUvdk9QeERBK045MUlueVY2KzQ2dUU3NGZ5?= =?utf-8?B?cHpjVlZTczN4YXN0RnM5SVVKaE80NE5kbHVGeUF1OWxwc21lUjlBWExMVEJL?= =?utf-8?B?aUE3REZqUHNsQk9CTnpLNGgvQ2RTb1JuekxoNHV0QjFndE9kWFBxQ1RScGZl?= =?utf-8?B?dWttcERuT0R1WGpsVEhvS25jV0FuVVYzV2kwRE9PSlpLayt5ajF6aEIzeUhR?= =?utf-8?B?Q0o5eGJ1em5rcG5oVXZ4UkZwOHhpN1orRU9kVksrVEVEYmpaWjJVbEVpOEFP?= =?utf-8?B?NUFoeWIvL1FsWmJudUlrSEFTbHZPaWVYemtGK3M2SHlxNzBIT3psMlFFUU1J?= =?utf-8?B?Q2g3USs5RDJVK3N6bk5KdU5GcFErbGhVamZXcWJpWUV2Z3JHdGs5TUl3NmM1?= =?utf-8?B?NW42dXhrZkFqR0ppa05tZmw1SC9pdnhPa2ZSQUpwZHB5akQ2T3FWWkFhWUlO?= =?utf-8?B?K3FFYkcvNTFtQS9XT1I3Uzg2cEdOcEUzK1VBRFp4Y2pCbWFUenhiSDZST2Fz?= =?utf-8?Q?Cx82AuF8NX/CI0XvxVCoJ0OPhVNh+s17?= 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)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2024 14:57:40.3762 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c7c0c58-6d20-4516-bd43-08dcd65fe950 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: AM1PEPF000252DE.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR02MB6269 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. Signed-off-by: Emil Gedenryd Acked-by: Conor Dooley --- 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 Fri Nov 29 18:30:06 2024 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013044.outbound.protection.outlook.com [52.101.67.44]) (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 251BB156C76; Mon, 16 Sep 2024 14:57:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726498667; cv=fail; b=gaDBbe+uc139itlz9fGPHJoPHEkBEfYgwpaBk7Yz7mMdKIhe4sfBKIgvxL0CxNL/9v7L1IrsXTN7TApKalFbXqZK5UEr2vdPr5V4HnCmjxlAS0uiXnCvxw5UgC3pPjJtWdW0ZxB2GyEnBQJJ4IYkzkQXeDXX4W+LSbDVOjelnsk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726498667; c=relaxed/simple; bh=2+85WUU5/qz0k/NgQACMjUDSgUWC+9xJNHfJ7d8EmDU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=gyGQ0OhZaLacEZA38FTUiH9Zw5K8nu5RLTnsT8DxA2l267asVw/5JSuqu3OvTqLZjF03RYLU8+xv8KrH5ZJ2YO/abNr8o2DMu/5t31N1jg9ZK8f/i/msrgbTk/WEnn4GodTIJrjEt1pzbcy0l/5zAU2PRW45JM2oBGsBeYbRjeE= 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=dzj6ArRv; arc=fail smtp.client-ip=52.101.67.44 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="dzj6ArRv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QI9SRcSo38Ska6utcxeIMoC8jiny6+LDmx+6AkLY2qvfudM5wXFMVZdQWDLDQDoBcH9SngFkQS+Jk2LhX5HQH1jvkNFI9GR47QgL4UkH86QN/wracJlPqkRpAv2p4xHm62UnCikI3gslEUzVzoEkcTSJSTVvO/bSfKJiEKeVVUz7GreIpbab+KdG3hn+Z2lPLjXq8+kbP15SbavA+ZpBYUJ00s5J6U2J7QzuOMgplYX1sgnFR7ScEuzViQOx7cu8n7Aon34WLt8U9ldZAnjOZcSuiMT0QucOdAKi77mQESuWRX7XyzhfDhUuQkdeqqt81uK0KRbf+eRizVPt/DMc6A== 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=8ip2KQPKJIaWsPmzE7ZZZlFuNxKp87NMVWRV0riojqU=; b=XemSclyRMFpIAPEtFlmlsvHu2yhXKSLzeoEqEiqceeYaj1oR2f/181W6fyEAXQtEzPgMWW0wojJMC01khx6q0vhVJUvxJv3Z3uX8XGB1pa7/NpsMtoGBNkfHGtqZ/H/tfefgjNZqqT+NRqGY6RmDrx3KQ1Z6c8EWXy4Qgwi7pws4cUV0JvwQiKw1YRZrlDj8FctSzhIsGhLztPntCEpkTbsbT0D6HI7idTt+cYYqaqnXKi/E98siUqqLMdzOymnGNhZauvHE0i7XnpdxxJOJefO1BuAcn2updbUv1wcH/i6k7Mx3ZRcnl6MPCWtaT07uaTYM+lF131Cajd9f1a6wbQ== 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=8ip2KQPKJIaWsPmzE7ZZZlFuNxKp87NMVWRV0riojqU=; b=dzj6ArRvDmypsCNm7oQvetYwahQzf1aumq4kpOq7mYFlTRzqKTlMBVji7lLzOMG9kjYeVhJy2RI9RVYSqwJhEjIlcMc66h919R1jy7BaLkx+N8QoXp8teKr4xxu+bhAvKIw0xGWntBB0iiL8BOO/WFtcs+XE+iFRoRcsbGLWC28= Received: from AS9PR06CA0672.eurprd06.prod.outlook.com (2603:10a6:20b:49c::18) by AS2PR02MB9979.eurprd02.prod.outlook.com (2603:10a6:20b:605::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.23; Mon, 16 Sep 2024 14:57:39 +0000 Received: from AM1PEPF000252DE.eurprd07.prod.outlook.com (2603:10a6:20b:49c:cafe::5a) by AS9PR06CA0672.outlook.office365.com (2603:10a6:20b:49c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Mon, 16 Sep 2024 14:57:39 +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 AM1PEPF000252DE.mail.protection.outlook.com (10.167.16.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Mon, 16 Sep 2024 14:57:39 +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; Mon, 16 Sep 2024 16:57:37 +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; Mon, 16 Sep 2024 16:57:37 +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 54C282C1; Mon, 16 Sep 2024 16:57:37 +0200 (CEST) Received: by pc55303-2334.se.axis.com (Postfix, from userid 18269) id 5084722FBD58; Mon, 16 Sep 2024 16:57:37 +0200 (CEST) From: Emil Gedenryd Date: Mon, 16 Sep 2024 16:56:39 +0200 Subject: [PATCH v3 3/3] 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: <20240916-add_opt3002-v3-3-984b190cd68c@axis.com> References: <20240916-add_opt3002-v3-0-984b190cd68c@axis.com> In-Reply-To: <20240916-add_opt3002-v3-0-984b190cd68c@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: AM1PEPF000252DE:EE_|AS2PR02MB9979:EE_ X-MS-Office365-Filtering-Correlation-Id: 9fd63465-677f-4018-60ba-08dcd65fe8d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YlhaWGc4ZWJEZUVGMmhPUjRyNS9rYURXa3JrNHRUK2YzcjFtVFMyMjdCWWhR?= =?utf-8?B?WGROR2FMTU5QOUc4WFBLbmxjRlQ0cHNFNnZzQ3pnazRHSC9ma1k1VEJBTVgx?= =?utf-8?B?NzBkSFJzRDI1MlE3emZ1Tkl1TFBlUloxRTIrdTZabGlWcXRrU294ZS9YbWhv?= =?utf-8?B?clg5dU10YWpMR1BUbExneXd5eklCUHZGNFNNUUQ0V3QrTVJOS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mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2024 14:57:39.5637 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9fd63465-677f-4018-60ba-08dcd65fe8d2 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: AM1PEPF000252DE.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR02MB9979 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 | 186 ++++++++++++++++++++++++++++++++++++----= ---- 2 files changed, 154 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..5e3fe42c5b59 100644 --- a/drivers/iio/light/opt3001.c +++ b/drivers/iio/light/opt3001.c @@ -70,6 +70,34 @@ #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; + 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 +107,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 +121,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 +172,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 +245,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 +299,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 +482,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 +514,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 +565,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 +586,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 +704,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 +786,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 +802,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 +850,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 device_get_match_data(&client->dev); =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 ARRAY_SIZE(*opt->chip_info->channels); iio->modes =3D INDIO_DIRECT_MODE; iio->info =3D &opt3001_info; =20 @@ -825,14 +923,36 @@ 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, + .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, + .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