From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (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 F14E914E2F2 for ; Sat, 18 Apr 2026 22:18:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776550739; cv=none; b=rvUynwueE4ogptar3H2mX5Ke072rGdHK3K2jSwI7IBLalJPo2d7oHbLGpi1mSkyJx+KIwboQbS94wLODzJDy0m2O4B3XLaVSP+mTTfy6U28CkZ5P97jOamjvNS9U4aw+XxOLr2Ifu5q9l/zZDbcccrWJ8DuMIQ3TYSO6Joq30gs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776550739; c=relaxed/simple; bh=1+qBHzyq/RyZJbREu6jXeYPnrwObeNp0SVWFjo3/mGQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PADzQdFfuWZNlwNhpcvZPe+8wv7UvmtaOBBizZC29fGjK+JHG+9D6EMjHsxJPcIgsresIft81Qs4gtydNCQBvNLgfHOGamRIQcFRHhDgcqdxfs8YvWBOyNfWYeKo70x6049EBJ/th32c7aa7k+THCh7I3vB3P+ktx/MwEt638Zc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.b=IEMZ9JNc; arc=none smtp.client-ip=209.85.210.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.b="IEMZ9JNc" Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-7dbcb467f2bso1917377a34.3 for ; Sat, 18 Apr 2026 15:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1776550736; x=1777155536; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=7jUgfQx3lTPA8+l0sSnmwFwjO5apfcViqgnRKAaYZmE=; b=IEMZ9JNcgs0Ak5I8FQwmUlIRJtdvoa6yVVIV9F6oMBOiM1V991pGkew57G3GScZXZj d+OoHl/1cTtC2fjeRPgZKqgURtfWa+STRAJaPqGM+55IIkOUJ99tLuOnA7QE5NvL0Hfk YR2f2YfNhk2Kz/N4C7BXS5U5AvENK9aMgdgZnylTp9wOs8j0kz3jLTwoHCPQ/ChEO0zn 0VmxfszJc67nSb4Hhu7QYkrvfRn+MQe/2u11PBe+qCNav9m+D2TCVGVPnQI3VSJK7MpA xgH0SnLcgieElPO+CKK8hhjDfUiMXlG6Z+rj5LRuV+QfEjHcVdfVTepA2ek1eK+j+SD8 tRqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776550736; x=1777155536; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7jUgfQx3lTPA8+l0sSnmwFwjO5apfcViqgnRKAaYZmE=; b=EgGuzNKqkMCaGuRqkmFsZP1u/c4W7C3i3AEyIqAhcBWZkeiDEIZfkbT4Wc+Ngo6hVt 432hBsVelXXh6BlQIRKcP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a:b0:7d7:da43:387 with SMTP id 46e09a7af769-7dc9518bfffmr5451502a34.16.1776550735928; Sat, 18 Apr 2026 15:18:55 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:500:b1f8:aabe:74d7:21ba? ([2600:8803:e7e4:500:b1f8:aabe:74d7:21ba]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7dc975b19fesm4638922a34.22.2026.04.18.15.18.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Apr 2026 15:18:55 -0700 (PDT) Message-ID: Date: Sat, 18 Apr 2026 17:18:54 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 0/5] Update APDS990x ALS to support device trees To: Svyatoslav Ryhel Cc: Jonathan Cameron , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Arnd Bergmann , Greg Kroah-Hartman , Randy Dunlap , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260418144716.132936-1-clamor95@gmail.com> <36e3611d-642e-42de-9a56-cf81c3e06832@baylibre.com> Content-Language: en-US From: David Lechner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 4/18/26 2:48 PM, Svyatoslav Ryhel wrote: > сб, 18 квіт. 2026 р. о 19:24 David Lechner пише: >> >> On 4/18/26 9:47 AM, Svyatoslav Ryhel wrote: >>> Document Avago APDS9900/9901 ALS/Proximity sensor in schema and modernize >>> its driver to support OF bindings. >>> >>> Svyatoslav Ryhel (5): >>> dt-bindings: iio: light: Document Avago APDS9900/9901 ALS/Proximity >>> sensor >>> misc: apds990x: Use more device managed approach in the probe >>> misc: apds990x: Drop Vled supply >>> misc: apds990x: Convert to use OF bindings >>> misc: apds990x: Drop IRQF_TRIGGER_LOW trigger >>> >>> .../bindings/iio/light/avago,apds9900.yaml | 83 ++++++++ >>> drivers/misc/apds990x.c | 197 +++++++++--------- >> >> As mentioned in my reply to the dt-bindings patch, there is already an >> IIO driver that looks like it could be compatible. I'm guessing that >> this misc driver pre-dates the IIO subsystem. I would have a look at it >> instead (drivers/iio/light/tsl2772.c). >> > > tsl2772 driver fits, thanks for pointing out. Maybe you know how > apds9930 lux table was calculated? It is quite obscure to me. The tsl2772 driver says: /* * Different devices require different coefficents, and these numbers were * derived from the 'Lux Equation' section of the various device datasheets. * All of these coefficients assume a Glass Attenuation (GA) factor of 1. * The coefficients are multiplied by 1000 to avoid floating point operations. * The two rows in each table correspond to the Lux1 and Lux2 equations from * the datasheets. */ So probably just need to look up the A tsl datasheet and compare it to the apds datasheet. The apds has some equations with GA, so just need to figure out what Lux1 and Lux2 correspond to. > > Obviously this patchset is obsolete and different set of changes is required. > >>> include/linux/platform_data/apds990x.h | 65 ------ >>> 3 files changed, 187 insertions(+), 158 deletions(-) >>> create mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9900.yaml >>> delete mode 100644 include/linux/platform_data/apds990x.h >>> >>