From nobody Thu Apr 2 12:26:25 2026 Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (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 4E754339719 for ; Tue, 17 Feb 2026 12:13:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771330421; cv=none; b=U7FvMS1PagxRH4Cm6diSKed6fOmYKQHo+C7DphlzUsaZD6B8qMW417Flr6oMzfCIGP2diyOIHS2r6v/vDIweumoWDpnL0v9MH1kURKfDfWWxQraEmDLTZSMeqokUpIN5dbYeY9vaOXwH9zRgP4i95t/TNLRW8KHi5X9lQvqptBg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771330421; c=relaxed/simple; bh=YJwAdc9YN+Ork+lkKKTLcj/O0ofn3u7uG2j/EDfwnM4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MuDJrM4osyE+kqXQArRp6ev7eU+1Eb5+23WOMbHU7y+PbSPb9Mief2pmtV+mt/hbBK50HUPQ2qGOFtY4xagpYuTUQcIzDBANA1mvFoQXjDuoTh5wH/jYBtVqJoDanT6zlsSqwnLrjTg/zkXWR6UKPCEQdi1VibosTup4Xp+gW5c= 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=YBjhCn7m; arc=none smtp.client-ip=209.85.128.180 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="YBjhCn7m" Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-79088484065so33341337b3.1 for ; Tue, 17 Feb 2026 04:13:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771330419; x=1771935219; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=JnctnXD+vW2hwHaBIXjEArJKKlKzrQnCanQjG6cUX0E=; b=YBjhCn7mcDBt3F835kH3Nt9ts9UiHcI90dYZIGPVhgqQ8hC8LbV1vxdJi7IfR0ZZE9 5i9bNkGyJFvTstxhHH7MZywNe4+hpEtLIoOOlmKwZPicyIRqFhtCULCJ5I3KfNSrA/+t dUavoZgOZFi0tUb2Dx+9386t/XhKJ8IiIKlXAGc1WAuU/Pm3B/A9hG2Plfh/OH4ot9un 9r8FB+jislQH918hiVXReIh+T730BI0+FHqJnqjZoI7rNJtsEc2EM2MiSKCN5iPT6+Fl +R2w2p0GXVYFSlLgK4BM3+Aqnw08Pz1dNO87h7HhYJRF10CGipam7VpehyLVVHYDMY3A nt/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771330419; x=1771935219; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=JnctnXD+vW2hwHaBIXjEArJKKlKzrQnCanQjG6cUX0E=; b=DiX9vtgbBJpw3I9Jo+rNF/HVH1UoD87XXkH9OP3lPwNElNmGqiEKQbO1W7h8PPEoqp tp3adeSP2YsNrMJM+/k1VsBmX0oCbYWQ/Id3Wf6Cqon5cvgxXncD0JGPl5q06uXjIpJU q7WjnI1ZD2FsdqzLt91Q7nvvRgQDloOy7h/LVAdoQTKlAQG75pWExogJYw2yyU1Lll0N tCrB8ZfmdKNs1oCOy0HsB3ZhAxc2jPs39J8cEswNFh26mhc1NZo76U8VgrIVZHQvM5gA VDoTdfVYYR2wc69dj5dizcdGrufAUpSuwHksKptaALCUVGLHlwmoQdE3toFF097rswSX V/Lw== X-Forwarded-Encrypted: i=1; AJvYcCUgPdQ+KeJ3Q82UcrAPkyQdW4eGIWmL6tjM0sZJR9NTwIri27qoqykpdcR5VMiZq64XaAOBwmix7PaaXh0=@vger.kernel.org X-Gm-Message-State: AOJu0YyRPrUu1Furlf6AuVpJrEpsnL+41PnNWdX1uPMrEg/Ape+U0yul gNEdN0TPBmHydQFQ65kduFK7vv52G9WHEHb2nXCD6bKW5sQqWOZzWnc1 X-Gm-Gg: AZuq6aJysbNMmU8UtlDxBeHD8i8L7v1jH+dMKmIChguZim2GnktCTnvNQd/vINH+P2e eGIV3uWFSc6XosOMzZWuRKtnQmpOGXJR3dQw8dtbiiKvk1Dfxt/3XHePsRTjpInaapYI02mHev7 FDHR+q49zsClbCApKd1r7vDirhS1l0Tnl9UoCkP9oUROuNBUuy1gwsr4dpU5DVPxgcfGPxiPkG8 V70N4KXgo3vX3iHxJndEwzdEvNgbqea4tmBf9TE4i+Oj3w3SOvR27EfUnruLkHvwv6+edjPizZw 6wVbwolElgyotSC9CFNSy2ZcUCTxALhT3oYItP1A5bPsj1H+An3WK2EviXqkHgXFjZk2rfeNRu1 pC5rNjoVYSBWtklrVAEI2p7kvgfEa8uZ8pfwxGVytUZMob82wTgoPavIatxzDGERvVln1cS1M16 5y4TisG9rUab9RNGGUMugT2GmL8w== X-Received: by 2002:a05:690c:318:b0:797:ef49:a48c with SMTP id 00721157ae682-797ef49a9bdmr5077777b3.36.1771330419207; Tue, 17 Feb 2026 04:13:39 -0800 (PST) Received: from [192.168.0.40] ([79.133.247.80]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7966c16eb07sm115610727b3.7.2026.02.17.04.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Feb 2026 04:13:38 -0800 (PST) From: Erikas Bitovtas Date: Tue, 17 Feb 2026 14:13:16 +0200 Subject: [PATCH v5 2/2] iio: light: vcnl4000: add support for Capella CM36686 and CM36672P 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: <20260217-cm36686-v5-2-63c2de9709d8@gmail.com> References: <20260217-cm36686-v5-0-63c2de9709d8@gmail.com> In-Reply-To: <20260217-cm36686-v5-0-63c2de9709d8@gmail.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Peter Meerwald Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Erikas Bitovtas , Andy Shevchenko X-Mailer: b4 0.14.3 Add support for Capella's CM36686 and CM36672P sensors. Capella CM36686 is an ambient light and proximity sensor that is fully compatible with VCNL4040 and can be used as is. CM36672P is partially compatible with VCNL4040 - it uses the same register fields for proximity sensing, but the ambient light registers are reserved. For CM36672P, we reuse vcnl4040_channels, but remove the IIO_LIGHT channel and ambient light integration time. Reviewed-by: Andy Shevchenko Signed-off-by: Erikas Bitovtas --- drivers/iio/light/vcnl4000.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index a36c23813679..5e03c3d8874b 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -185,6 +185,7 @@ static const int vcnl4040_ps_oversampling_ratio[] =3D {= 1, 2, 4, 8}; #define VCNL4000_SLEEP_DELAY_MS 2000 /* before we enter pm_runtime_suspend= */ =20 enum vcnl4000_device_ids { + CM36672P, VCNL4000, VCNL4010, VCNL4040, @@ -235,6 +236,8 @@ struct vcnl4000_chip_spec { }; =20 static const struct i2c_device_id vcnl4000_id[] =3D { + { "cm36672p", CM36672P }, + { "cm36686", VCNL4040 }, { "vcnl4000", VCNL4000 }, { "vcnl4010", VCNL4010 }, { "vcnl4020", VCNL4010 }, @@ -1842,6 +1845,22 @@ static const struct iio_chan_spec vcnl4040_channels[= ] =3D { } }; =20 +static const struct iio_chan_spec cm36672p_channels[] =3D { + { + .type =3D IIO_PROXIMITY, + .info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW) | + BIT(IIO_CHAN_INFO_INT_TIME) | + BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO) | + BIT(IIO_CHAN_INFO_CALIBBIAS), + .info_mask_separate_available =3D BIT(IIO_CHAN_INFO_INT_TIME) | + BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO) | + BIT(IIO_CHAN_INFO_CALIBBIAS), + .ext_info =3D vcnl4000_ext_info, + .event_spec =3D vcnl4040_event_spec, + .num_event_specs =3D ARRAY_SIZE(vcnl4040_event_spec), + }, +}; + static const struct iio_info vcnl4000_info =3D { .read_raw =3D vcnl4000_read_raw, }; @@ -1867,6 +1886,19 @@ static const struct iio_info vcnl4040_info =3D { }; =20 static const struct vcnl4000_chip_spec vcnl4000_chip_spec_cfg[] =3D { + [CM36672P] =3D { + .prod =3D "CM36672P", + .init =3D vcnl4200_init, + .measure_proximity =3D vcnl4200_measure_proximity, + .set_power_state =3D vcnl4200_set_power_state, + .channels =3D cm36672p_channels, + .num_channels =3D ARRAY_SIZE(cm36672p_channels), + .info =3D &vcnl4040_info, + .irq_thread =3D vcnl4040_irq_thread, + .int_reg =3D VCNL4040_INT_FLAGS, + .ps_it_times =3D &vcnl4040_ps_it_times, + .num_ps_it_times =3D ARRAY_SIZE(vcnl4040_ps_it_times), + }, [VCNL4000] =3D { .prod =3D "VCNL4000", .init =3D vcnl4000_init, @@ -2033,6 +2065,15 @@ static int vcnl4000_probe(struct i2c_client *client) } =20 static const struct of_device_id vcnl_4000_of_match[] =3D { + { + .compatible =3D "capella,cm36672p", + .data =3D (void *)CM36672P, + }, + /* Capella CM36686 is fully compatible with Vishay VCNL4040 */ + { + .compatible =3D "capella,cm36686", + .data =3D (void *)VCNL4040, + }, { .compatible =3D "vishay,vcnl4000", .data =3D (void *)VCNL4000, --=20 2.53.0