From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) (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 353583D3017 for ; Tue, 3 Feb 2026 16:36:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770136614; cv=none; b=ImJ0Mt5f43ZSBVdSIDGVy8GmWBfdsEDF+TkWvIi+OvcJgveELdWwKCnHpLdFRBO3r1wZebWutY0XieDTsZPbkpsyM208KQ/5YvabCVU2kHk5D9E6cLN1hy+X4H4d8Nr1cbAlSkyMYNwB8ME/57Wcx5TdwnA0FUkanOeO+pIC2cs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770136614; c=relaxed/simple; bh=DmlvpbzDEq4IPSeR2r7sL20gZAslDIjjLsNOaO5v9XE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=C2l0uPbH2my93oAK9pDjMFIGUC6hQ+st9wO+PI8d7uhjSqJe4fx91om+Qn62t8zcZjq/dGVk+5Q4bpeZGpzW5zxxM1o9OFUia5grOyImEk0yFGVo9WE2UyEq1Q4lUMdDa8U/aA7vyTLGpAgH5CBJ6AyfL9w7vwVSF/OLlXV/VJ0= 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.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=qapDFiCL; arc=none smtp.client-ip=209.85.160.45 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.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="qapDFiCL" Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-40946982a78so1942404fac.2 for ; Tue, 03 Feb 2026 08:36:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1770136611; x=1770741411; 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=DhiJ2nzhxoH58/LPSL3akF68TqoZ8tdv8BmXMofsceo=; b=qapDFiCLn28srBWgtOrErna+DeSYdTC4UsTktUpYxxZLvjQ+fWqBzQc89fCDRzfJB1 vV6kHWf7ah+aEemr7ZII9Irfqez+0KwQH84vBIG/5wumYre6MirCFz5JSdQZKK4hkYO1 caC16hyALKnWchpkHnhzaXrYfLK0xD5hq2am+zL3jMvQEua5fhJejzmnLevLcp/VrDec iPu2Ui14cngqxgAAo9KWN7G9j78gRTXBrEloO8T5ge8hTjQvOkVpU2cbk/eVJMGXbWV4 iAmWd+JSZEDwXhqa+HIbcYSflr/c6S2654Ow1IzS2a+qD3tk+6GzkfRlLe7ltY48GOPT RMbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770136611; x=1770741411; 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=DhiJ2nzhxoH58/LPSL3akF68TqoZ8tdv8BmXMofsceo=; b=YQW/17KZ15nA3ufXDSBLry7hrn9ZR/SB7Z971rvavjqKRSwh0p0xYvAKZv4xnJlkd+ VsMMR/Memnzc9JxhE0RYs8cxOwBpCT4KBjOmTUchF9XR1s5fuVUBLeZeoYfV8G3e+XRT /oCP+S0z7vBXIbSVvYkRnRFH8WUgUkbjJnhpaw91JKwMvmsoW7fgBfMtzmWJ25LEyfDL BDXGWLThM8jUymwoeb8cnFQq5eNc6dyQhXSFomAUwle9y+pM3JOVyAyTFwtpu6B2HP3b 35WOnqhGBAjkRs3bEQRuZPLLrwZw9blG6hqRWsVhaCk+Koif2ihWakjI1FF9N4I6nbyR 0d9w== X-Forwarded-Encrypted: i=1; AJvYcCVBhRZXIEJKSzI6Y/ql30k5TibwdJUftbaBNmZ7wXlylhELhzJaAw+CDX+z4YRhWjdus7EdvWssx9E3Z8k=@vger.kernel.org X-Gm-Message-State: AOJu0Yzx+yNTppcAiXr7sn5iMyCgvM+JedCdlsAyDlNpTAuxqSTIFpTX vPlG2/vYjAQusQb0akgI4v8QgxEojsd1Xy39tFbb3+MbmQdnTgBVT4VNNPgBfGIqarw= X-Gm-Gg: AZuq6aJdM7/25jpx5SwrcuVLhkdq/nyCCWc3sb4G6F8YiClojGUDfdfk4DPqtqY4h1h N2/8KDr5DvE/V7/8HQGsPAyo2XLyiaWzmJEhcH6btCWQldnq6wgObBrjgVWIRky1JJO7QzJtW9y j3iEKfmWeD3Lh9hnFVr03ckGRt7uo0LbsztRhpYoh5GlC2YJYyo+R3VPIPvQVGkLinbUufz7Vm/ ycjNY3hEPf3DWlhjlLv/WyPKX7IhngJeRrCEeGYJE6nTGs/533uZICTGV3tpOmjI5fpW8pvzh5S rkgX+P7hd3E0QYAU2j2/ClFgyPHAbBksp3O5be9JHi4lSh/F5bybgwfVlTw8GDsP8EcI99JxKD2 rs28noPNX8UsyBMsOF2wrcSqqI437XeG6lbKWxvl8BJQAlibVFa3eUcw0d4ikaR2BTIc6P1qTYq uMoJf8r2H9mV28XGTa49GExxrxMmJAkcnz5InYpx/jm2NQ6mSbgYJF2OA= X-Received: by 2002:a05:6870:3512:b0:3ec:48d5:5a50 with SMTP id 586e51a60fabf-409a6adfcf5mr7572564fac.19.1770136611130; Tue, 03 Feb 2026 08:36:51 -0800 (PST) Received: from ?IPV6:2600:8803:e7e4:500:8e13:880:992:e796? ([2600:8803:e7e4:500:8e13:880:992:e796]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-409570f63b4sm14278713fac.3.2026.02.03.08.36.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Feb 2026 08:36:50 -0800 (PST) Message-ID: <0b001503-5882-446c-a0df-642a9f75e7e3@baylibre.com> Date: Tue, 3 Feb 2026 10:36:49 -0600 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 2/2] iio: light: Add support for Capella cm36686 and cm36672p sensors To: Erikas Bitovtas , 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> <372c9172-ea01-4a3a-b737-3f7f14519791@gmail.com> Content-Language: en-US From: David Lechner In-Reply-To: <372c9172-ea01-4a3a-b737-3f7f14519791@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/3/26 9:41 AM, Erikas Bitovtas wrote: >> 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? I assume you have the hardware and can do a test to confirm this. :-) > 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.