From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 CA37830EF86 for ; Wed, 4 Mar 2026 14:21:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772634072; cv=none; b=Q3JQk9hn4P19juhpETckSu6uEj2tX4J7QjVklEkC+hMaZxzRNcfFaqlbgP0MmBhlPEjI/U/v7NM3F74CIDu3gQL93K9o6TQZRGy9dXO1GOzmOMIrCPVf0jRlZCJGcPuQg2K5TSO59hQnZLJmfeP9FJLnmm1pcB900vf1SQwC/Jo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772634072; c=relaxed/simple; bh=PRWWUKqKHoWc2ct4wK4ZzhM2kMtkMtidr8+RVkms78M=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=B4RgwrUf11Pv1+KSLW6jUZpdW1zTeOo7sSnrutND7Gwz6ki2orNFL6XT3ebyDiaCbR9GIQ7Pu40BUU/HgYNWyWAwWvby6fIcGpFFYtPn/VPz8dar+YmjmxGe/UhknU6B9P1meJ6ukxJMHbNGCjYyfiudwV6B3KOs20tgxW1vtlE= 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=hDqTKda3; arc=none smtp.client-ip=209.85.128.49 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="hDqTKda3" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4806cc07ce7so78752645e9.1 for ; Wed, 04 Mar 2026 06:21:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1772634068; x=1773238868; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:organization :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to; bh=PRWWUKqKHoWc2ct4wK4ZzhM2kMtkMtidr8+RVkms78M=; b=hDqTKda3S2SQ8JHUL8Yt6VP+gUkRWcRrmxpDCPdG+C4DCpLssOAFgRCrtHl4Yj+vR/ eS8euz6reU2XQkdaeX3vuDibEMF5w9+a9pU4pkHSx7tfclan6O0NgXnx22FZ2Ljux3t/ q+iS60ddFgzIiY72jvgEA6KJCdHBdFMtcxxFANOzMZLVT3bIdAvo+Nn84bmlX6iwXsUs Ej5JhW26sAgidDGGRSdDjndkNZp0eamjqR7gLy8RjK44x3PhtFSdHsEewg75s2ynYjOv PhVd36pmoZWpgVA/WeCzdlmmhYh+pwe87Tw8nFIAAPV2VUaNz2NpGl40iNHzFqAsp63b ht6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772634068; x=1773238868; h=mime-version:user-agent:content-transfer-encoding:organization :references:in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PRWWUKqKHoWc2ct4wK4ZzhM2kMtkMtidr8+RVkms78M=; b=NFLsWzEfddRa4a5bQLBwAPIplouotdKLaMoLlvHxdFEybyNmNNyob5GH4tCOtORHEj sLSGS5yafVs0JRJVE9AxCp3o419CsT0iMvu6GGVWyAg9RA4X2NUHCA25gEqlUqKOmmVx 4+a0a/lHhjRjFgkvQ0DO8jjkyHb0P6F9vH0ubkTQUetgDilDbJI2TFkGFoDQZYUMjjic dbpf723n1houpUSo5yA4QbY1LZlu2VD/W87El/lKxtn1HKaQqdbN6fSFLZW6TVbz5n7b 6Fffg0OixcKnme26LfXzAJZRkrLtj1UUCTrf1Ts2SQ0sLhULygTiQ+H0A8bwYlLcBAhC SSlw== X-Forwarded-Encrypted: i=1; AJvYcCUjmDeseXxu7YSSJOMzunBbOlkkve/unzx8lQFteRZk+q/oL+FsODasknE762Q4wfSFm1pVjxg2tgdGaXs=@vger.kernel.org X-Gm-Message-State: AOJu0Yz6vlInZAHsNOqKc2nvEIVaKJ0SEy0+VFSL4scP0jUQC87p0bKx wmUqD7DGRLQClAyY+2urjnzbQHiJ/QWfXtRJo/GqokByL5AiHFSBo8caYLCPbZgKGyo= X-Gm-Gg: ATEYQzzN2SDy4OUPVdRnT3VQtP2RbM55q6X3af4fz7I7kWGTm/ONxszH+z/C73oYTHv f8cXl5pf4lrPiCcNNgOa03xh0yzcpSOm3w1bD6BI5/ljln6DD/gR+TvWS5iG3AsdOT8c/aM3F5J yJgv9EfadqDZ9v+t9ujT4jOflLcdwdOH4BzmQoW5iAysgWGbsJW5fiMZ0XqCjXuWPZmsDOTcw7o lGhgRBkZuvvtpWJcIfP5z2MWk0remGyLxZ8r+zea/dcVSAJ75CeaSypT4KLZN9xdUQV+TIr4kVX KY7vRHrIwy0RATPKQpDgfi0FeJSR9JCpWIwVIT4c1+s0jjRnMOBrmup8wV4U/DeL3BGYApBTyZv c/1yVWaLebrQlGHyx0OYUPi+Q9RfdstBVFLW61k25JAvcYvItTAXkDFY3ao7OikjEnEtvjg/N42 FSaZHheLw= X-Received: by 2002:a05:600c:6812:b0:483:9139:4c29 with SMTP id 5b1f17b1804b1-485198480b2mr39528925e9.2.1772634067858; Wed, 04 Mar 2026 06:21:07 -0800 (PST) Received: from [10.203.83.178] ([151.57.249.149]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4851881a844sm50608135e9.15.2026.03.04.06.21.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2026 06:21:07 -0800 (PST) Message-ID: Subject: Re: [PATCH v7 5/6] iio: ABI: Add partial quaternion modifier From: Francesco Lavra To: Andy Shevchenko Cc: Jonathan Cameron , David Lechner , Nuno =?ISO-8859-1?Q?S=E1?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 04 Mar 2026 15:21:05 +0100 In-Reply-To: References: <20260304080519.2844101-1-flavra@baylibre.com> <20260304080706.2844472-1-flavra@baylibre.com> Organization: BayLibre Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2026-03-04 at 13:51 +0200, Andy Shevchenko wrote: > On Wed, Mar 04, 2026 at 09:07:05AM +0100, Francesco Lavra wrote: > > This modifier applies to the IIO_ROT channel type, and indicates a data > > representation that specifies the {x, y, z} components of the > > normalized > > quaternion vector. >=20 > ... >=20 > > +What:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/sys/= bus/iio/devices/iio:deviceX/in_rot_partial_quatern > > ion_raw >=20 > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0Raw value of {x, y, z} components of the quaternion > > vector. These > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0components represent the axis about which a rotation > > occurs, and are > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0subject to the following costraints: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0- the quaternion vector is normalized, i.e. x^2 + y^2 = + > > z^2 + w^2 =3D 1 > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0- the rotation angle is within the [-180, 180] range, > > i.e. the w > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 component (which represents the amount of rotat= ion) > > is non-negative > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0These constraints allow the w value to be calculated > > from the other > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0components: w =3D sqrt(1 - (x^2 + y^2 + z^2)). >=20 > Just to double check if we really do not have a special mathematical term > for > that already. If we do, I prefer to have that over odd "partial > quaternion". A quaternion is often represented as w + xi + yj + zk, i.e. it's composed of a real coefficient (w) and 3 imaginary coefficients (x, y, z). With this notation, the (x, y, z) components are referred to as the imaginary part of the quaternion. Alternatively, a quaternion is represented as the combination of a scalar value w and a 3D vector value (x, y, z). With this notation, the (x, y, z) components are referred to as the vector part of the quaternion; this can be confusing, since the quaternion as a whole is often considered as a 4D vector.