From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yx1-f52.google.com (mail-yx1-f52.google.com [74.125.224.52]) (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 0F33A3B8D42 for ; Tue, 3 Feb 2026 15:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770133272; cv=none; b=ha8oNS9GAIG7wQHeF25m88dNUzCbVhiZdLvAZYPbewuLyDt9YNaYuzoqy0jZ6hmDoVjyg+DPDvpYvwQyCPYsUOVWsYi6EHau/SW9652/oNEIuOfEbLeERQvHiZGMnyJyc1QIUpMTSUl9D7XIZgm3gaR3BeVKjo98Y+zRlUIRBKk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770133272; c=relaxed/simple; bh=1LJxSgDfu2qHVQ0BcLX0FLZBAv55EAAcPTpRZxMhd0k=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=kVTStRDpSEfaU9637slroRIUCy37NZEULGrwgZGB54qx2WoYGZ/FwipTNentURT74bhLA0r1FEb9f+TubWHX+d9R7ol4ToxZH7Wto7blzfZyYXxgswN139YHGgIiT2ZmBZFMQ1inmOeQ0XRVwHGiBTDOoIj05uAKoGjqFT7aJiM= 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=JWYzJmqr; arc=none smtp.client-ip=74.125.224.52 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="JWYzJmqr" Received: by mail-yx1-f52.google.com with SMTP id 956f58d0204a3-64455a2a096so4655359d50.3 for ; Tue, 03 Feb 2026 07:41:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770133270; x=1770738070; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=Y+dHBcJ0EB1oMWtqDa79JLU2lSQMRC9g+f/II9Wq8ic=; b=JWYzJmqrJZlDuWM1M5XSmQVkgjbQcC7n26n23tCf3PGLlAdKUMHG3fwNQyMmVm3ZkA K1V+/fe3vNvj9m2gpSXu7EXOOMCMLYTpAIMUoNTCUJW0ni7iz/z7Fm7rPcR6KDQq7xK4 ItBSQRcNiyDYGU9SwuC1FC/yFjrozk1SC56D913jf+Ua85WQ1j/kmZVsmYiHoygrctCU TeXJVuXmZBXolSbyCba4DGpse3lDmguwg/wiBjGHL2o17ltHCvkFuHQ+diVXfAL+GGqM 4HMLpjX2VLE66GvCE68ai7nPtr72lbMMIBjr/h+BZGUR/Dp9v7EFbqwryxuAvUhAlaiw eG1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770133270; x=1770738070; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Y+dHBcJ0EB1oMWtqDa79JLU2lSQMRC9g+f/II9Wq8ic=; b=me3vLi1RWXzh2jAZ/x2WNYGNgkI3A+ALD/hUIQEsb96+/u9uZ80vTsmu2pGri4Q+Fy kI4KZaGM9lahEZj69+Y3ZAuoSDV1xlmBz0oSZ0+lnzOluRgv80DGGKA7V9ve1Z3xqEzb 9L2emDgLWEoW9N+uw/Nvlc1NLKziLmQnbBtx101LV5AYg+wfu2Aclj7+Nwf79p70l5Hp YyCNoJgvoYoktDz/cKUXzLMOL3/xLpUMB3L+k/KZc/xXmKY2dDXOxRcRjof2Ro4PAgro IJ7FO4b7PhsaWPgXvdtfmpxYw0D5dYmsrYZIXBSD01NM0DlvXz9grvNHw4YS0xBDKR0m 9d6g== X-Forwarded-Encrypted: i=1; AJvYcCU3pVE/scdL7N+YMiSEq3I29V4JtpP3fblHqDFRRsWh+Sxctoe2dLY8n2p9pzZaIslHCEGm6Ll3j22iBHQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwfU/1Ju+h7VjZWU6EM/KrGj6l1Rd15XfHFba7pJu84cz4/wEEU ZyxHp0tKR+qErDtHPxN4ez3MDLgfGPKp/9mGqBp3XX5QgBr060mAJ2hL X-Gm-Gg: AZuq6aKJMfIxt67U6yZm28Twrs1TdKSAbqT7M25DUWGUvmz4m3WujpTs5yQ6WlpvAVz coMca6z5B7IUkdli9DYt5P9sVkmPF/AmV7TlDCAdxeawrAxJNl+1vEWWSWesZ+d22lf2vyfU7v5 kOaUC+HEcOhvnCoWqc1ag9dUUO49tIQLax/uxhRGEy7EjC0rkDyYKP3tlZe4LWDwpMnqHwo+hLS XTSFmbERTzycFUtQ7EEnh05GdzJt3qFHsmPywEVZWaVT+bw16yng4FnTrSYOKrN5iN/czmbIwCu TbTH7So6VL5gblq8csH5E4Uv6gfPoy2fHPu/wRPwa0qIMqZzk/8119uwYCHeDVc6jxT+xIyrP4j r4ujQbdONpNWWdU745aA2DuMxswRcDzbC3cmSFx1gxvqeHO6gZEQK84WxmTrH0GjqhXZZv2AiUw QvfYcU5yk9LkAlIQ== X-Received: by 2002:a05:690c:260b:b0:794:f3df:80f3 with SMTP id 00721157ae682-794f3dfa1a8mr32368167b3.69.1770133269769; Tue, 03 Feb 2026 07:41:09 -0800 (PST) Received: from [192.168.0.40] ([79.133.247.80]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-649b30b5825sm8121645d50.24.2026.02.03.07.41.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Feb 2026 07:41:09 -0800 (PST) Message-ID: <372c9172-ea01-4a3a-b737-3f7f14519791@gmail.com> Date: Tue, 3 Feb 2026 17:41:04 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Erikas Bitovtas Subject: Re: [PATCH 2/2] iio: light: Add support for Capella cm36686 and cm36672p sensors To: David Lechner , Jonathan Cameron , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kevin Tsai 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 References: <20260201-cm36686-v1-0-4949a2a9ba63@gmail.com> <20260201-cm36686-v1-2-4949a2a9ba63@gmail.com> <086d6b35-8c19-4e92-9cd1-557b98991d35@baylibre.com> Content-Language: en-US In-Reply-To: <086d6b35-8c19-4e92-9cd1-557b98991d35@baylibre.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > Pro tip: when you reply, trim out the not relevant parts like this. Noted. > We could start with hard-coding the als_trans_ratio in this driver for the > scale (and write comments explaining where it came from and what we know > and don't know). Then at least we would have a scale. And if anyone needs > something more accurate and reverse-engineers it we could fix it up later > with a DT property or something like that. > In arch/arm/boot/dts/qcom/libra/common-proximity.dtsi Xiaomi sets this property to 16, and they set integration time in their driver to 160ms. Maybe als_trans_ratio has something to do with integration time? In that case, we can calculate the scale from a formula, like this: scale = cm36686_als_it_times[index][1] / 10000 * 40000 val = scale / 1000000 val2 = scale % 1000000 This would allow us to preserve lux value when changing integration time.