From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.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 B847541C301 for ; Tue, 28 Apr 2026 13:36:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777383369; cv=none; b=TeQBR1K4AgYs/hzAiHgCpYLxWICu5PPiy8Cdld4rqNOwDCLgcxZDlrwgHVwM3hQiEgkRILOQ9XRLrdBInQFbhdZAJRl5qwAUohYStADfiLjD7jZHwSscBPNzqwxmoN8757hLLZfaNKjicMrtDNfyf6QGPC8I44yvE1S0cP7FNeo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777383369; c=relaxed/simple; bh=YWQQoiHZ7IZSnDOFqtAI6/PWzAs1sY4d/dHrYDvu3yI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LBJmPqa4gJRogvmjGuG4ZzjYcgvu6eLWXARmep/ci1I/CeGv8OyhypLHYwhadGIpRaTkbI+qxJCGX1a1Jl7ihSptffmeFhFBjIT65tVi/04ovuHdkdU6C6il9KseTuFI2BEvPXsZxV3lLZdhQ/Y7bkq83WgdC+mRrp81ZMvNfio= 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=Wpc4ThK+; arc=none smtp.client-ip=209.85.128.45 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="Wpc4ThK+" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-488e1a8ac40so141057365e9.2 for ; Tue, 28 Apr 2026 06:36:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777383366; x=1777988166; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=KSUttvaTic5DYL1Jfs9PEfQhM88IfdUsheMHDUliQwc=; b=Wpc4ThK+VpbyOP1xtypoQkC6uN5NOTM7dbwW6oEuFLdflITLq0e+fFvtb/lLkeyKX4 mARKcC57O0mgcKXTfN+Da5b1S+QaRsqVY2ZjosGd5tvtEb10m1gWSdfRwg/SJ2WV1b+d wAo1UIqgbD55XmJIAGKf0Zv6laDsbNcl2me+3gH4m7F952L6RTdxDR+slyKShQrO5z8+ roldJUH7WpyBDjZ8eN4LVxznBQtJWQn+1tUU0Jd2fHd5Xlx/cBjMYaVqx1uSaLrJHtmk rykHalCQ0a4rkkzvPz1Nb+dg4gQwvtR2tX3cgNV8Uyr7l08JyeSd3/0aK4Dz1jxCcJTt oHLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777383366; x=1777988166; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KSUttvaTic5DYL1Jfs9PEfQhM88IfdUsheMHDUliQwc=; b=klUPBIcreBE3AxMKV0EKzNZjZNXpX8iitc3vLsLfBUq17yHKvnY4eW3W9x+Y4Z4sNB 05MvygC07NwaUj1slSZFJdvqaCE6oO878ML7E9kgyiT4EOq3nQEdZGRe1qMUOvOIg3jR W6umpT5GRPUg8tHqB+r/q6azUypLsjo0VW5G7JYGPghTTqdnM31UacV7td+p9Xhftnnh xmkVozRYSDmR1jM7wbci/ZEf8FvTaILhfoEEdaJ+GmHjccpbd6r8m4O4O4l0/LV0rQv2 aHXLQFa9FoGHGoGtOsJPb1rK/kkB+FGtXqUOxi9tU43w49O/AMyr9Ro46OBcN+xyBwJr N1JA== X-Forwarded-Encrypted: i=1; AFNElJ8piY0eddRaVlAMXGjWGo5jKdaUnYZWz5YZo960Lm/HecIU5xTltpzFdl72BmPkX31GDsCSOtneKe4tdK0=@vger.kernel.org X-Gm-Message-State: AOJu0Yx8xP4z6g+388qx1tdVlGvD8dbyS7vqa3Vi8atXK0OITWHgkVs8 Q1qOWPsJm9MDF8h13ETF2YEA05EWKJnbYCjwYnpqyRD4YeKGbAt18coW X-Gm-Gg: AeBDietPl5PMploz7+1da6L2V7bmY+jBPK/nXb0o6f5jM7y3aO17TLGw9QIqlCdUkbd FKsQCAUlNOqkSWgjsBv8B1xGUuVyijzKLJ8VSQaA0/SAPYEDQ1DWxjYxNsYU7qxiqLYrMGLcm3r Sr7ajyBZyb4ahePXjH/IY+Pd53hj8MtOc3Z60NMOuQb+2tp9VsI7Mspn8D1iIFdiBxZT2//uh6i c8Yeplh1ttkBXaKmKLy3TtUpwghvgLXO0YY6DLM/vycpqFIEFchDOPyvlct8I7k8fblWlBLz9yE 79lk5D3ooO5sPV2XuoYyQCv2uC6ggL8tQftFrUg7m6YSaHQmRPLSCnXpCMVArkp1+ymPFdXyM6P j17KvTq6Ogna5fnbUB1cZCcfMnVqEwjk+durx0arAXkVuIReKKHjtb1TvkG2ob2r61GYEbBbM52 joC+yWmfVmU2ZzAR7v02DQLbA= X-Received: by 2002:a05:600c:6209:b0:48a:563c:c8e2 with SMTP id 5b1f17b1804b1-48a7ada0423mr7752485e9.3.1777383365755; Tue, 28 Apr 2026 06:36:05 -0700 (PDT) Received: from pc ([165.51.114.229]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a773e70c2sm59774865e9.10.2026.04.28.06.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2026 06:36:04 -0700 (PDT) Date: Tue, 28 Apr 2026 14:36:00 +0100 From: Salah Triki To: Andy Shevchenko Cc: Marcelo Schmitt , Jonathan Cameron , David Lechner , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: temperature: max30208: fix wrong scale value Message-ID: References: <20260428085415.52858-1-salah.triki@gmail.com> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Apr 28, 2026 at 02:00:48PM +0300, Andy Shevchenko wrote: > On Tue, Apr 28, 2026 at 09:54:15AM +0100, Salah Triki wrote: > > The driver currently returns a scale of 5 for IIO_CHAN_INFO_SCALE, which > > leads to incorrect temperature readings. > > > > According to the MAX30208 datasheet, the temperature resolution is 0.005°C > > per LSB. Using IIO_VAL_FRACTIONAL with 5/1000 correctly represents this > > 16-bit resolution. > > > > Fix the scale value to ensure user space tools report the temperature > > correctly in Celsius. > > > Fixes: 9ee95ae4cffd ("iio: temperature: Add driver support for Maxim > > MAX30208") > > The tags should go with 1 tag per one (single) line. Do not wrap them. Sorry about that, I will fix the tag wrapping in v2. > > > Signed-off-by: Salah Triki > > ... > > > case IIO_CHAN_INFO_SCALE: > > *val = 5; > > - return IIO_VAL_INT; > > + *val2 = 1000; > > + return IIO_VAL_FRACTIONAL; > > Isn't it an ABI change? > Yes, it technically changes the value exposed to user space. However, the current scale (5) is objectively incorrect according to the datasheet (0.005°C per LSB). With the current scale, a raw reading of 5000 (25°C) is reported as 25000°C by user space tools. This makes the driver practically unusable for standard IIO consumers without custom workarounds. Since the driver is relatively recent, I believe fixing it now to match the hardware specification is preferable to keeping a broken ABI. What do you think? Best regards, -- Salah Triki