From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796038470; b=cRP30wh3GzzqTz7n6xSd/7hYeX+TdMBn6QCbfyMr9aRDFbdOrgI+Ln1OG+ANXRIc8pVf s2jmUGmCON/N2cCMNWufLcQvDC7kC7l1iALtnOcq+87zZyVh0R1zdDLj+76j8iR3zCjf6 OeqTzehBSZaAc/L/5/nShpLlMJ0ByHj4IM+EfEHooZR2ih/ue1qiHESBuuOuiN3oHFp68 1Oh/7kv3oX1JBHvZsVVtOGxfXToRLuh5zzO27UaAIQ/mKc3Ohps92zJyAoyeraBkN37jv po0HPs+qtRyjV5Mtbal3M6Kme3VvFltt3VjgZ0QUVQDkKzgn1FCk+ZopnBbjqrMkbgQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796038470; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:Cc: References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=2Q+/vBDJC3WDs7VdfJxfxycOCrgnRCad6eOAS+VsOLw=; b=5GGvsLEDzJHtKrqO45525InJ0aQ0YK/X+Ih0PtJF2HUNU9VkcUpTxZjE+ReHrEHKD5aV zQY4y3MeBVkQHWxlLdFTYTr/cFp3r8rBLPmRfjizSQzus+j67TRoRGsa3eMazVppYmB9K Vd4USFeDeFWN3yuMMd0aKiDqEDxmkCKCdn/liWghgXMHsmkUGwQvS9RcNrKGODlv9Jx31 j+VV5Zc2sCxPn69dRWB7xPm6FE6tu5P1M25wEqceYGOUCGFgo3jTGta33WveKWg5yW2Lc EA/IPqhG2d1Qiylw6/CPEDdBSsY5Q8p7KkQCiRxxMIxKrA5zodrxd42BKagrKerVbmA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bt1nYirk; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23FB9606A31C for ; Mon, 30 Nov 2026 11:34:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bt1nYirk Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4365E1F00897; Mon, 30 Nov 2026 11:34:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796038469; bh=2Q+/vBDJC3WDs7VdfJxfxycOCrgnRCad6eOAS+VsOLw=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=bt1nYirk5C7lCAXuq/I+Ql1ALs3iUQWD5TQXSswQTB7HZq/nWxQcpWeRmCzoSR4k5 a5HflcIxyF1P9VJZHYji0hpFhnnczcLpk9UK8KQuWJvRVikXrUBMGZIoZj9k86NeE9 71kL1FcSWqnkq2RXre0vSjhpt3HLPnHeg16FQ/Igy7l30WMbvGGg7p2ySXtQBUa7py Yt4xchltlyz8cuzf3pVQgLVyj6Zhq5G23y/zNoHo9mNvoDnKtwc4fOcSkavyYq+m4T /3H+wCdItMzFWwC+BpquztLKJHGUYYpW8nm9+JbGcBL+AVwvNt1KXgik9LdPktOPSV 2F1OZNvN9+1mw== Message-ID: <3f846bd6-0fa6-48d4-8a58-31b85f25e2c7@kernel.org> Date: Mon, 30 Nov 2026 12:34:24 +0100 X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Subject: Re: [PATCH v2 00/18] iio: accel: add mount matrix support to 18 accelerometer drivers To: hexin@hexin.host, linux-iio@vger.kernel.org, Michael Hennerich , Puranjay Mohan , Marcelo Schmitt , Antoniu Miclaus , Ramona Gradinariu , Petre Rodan Cc: Jonathan Cameron , David Lechner , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , linux@analog.com References: <20261130-work-v2-0-9eccecc71702@hexin.host> Content-Language: en-US From: Joshua Crofts In-Reply-To: <20261130-work-v2-0-9eccecc71702@hexin.host> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 30-Nov-26 7:29, He Xin via B4 Relay wrote: > These drivers ignore the "mount-matrix" property that other accelerometer > drivers already honour, so userspace gets raw sensor axes on any board > whose sensor is not mounted axis-aligned with the display. A udev/hwdb > override does not cover it either: it keys off the sensor modalias and > DMI, which do not tell such boards apart. > > Each patch is mechanical and independent: store the matrix in the driver's > private data, add an IIO_MOUNT_MATRIX() ext_info entry to the accelerometer > channels, and read the property once in probe. > > One behaviour change: a board whose firmware describes a matrix with the > wrong number of entries now fails to probe with -EINVAL instead of being > ignored, which is what the drivers that already support the property do. > > Not converted here, because the change would not have the same shape: > adis16201, adis16209 and sca3000 list their channels as array literals, > adxl313_core and fxls8962af-core keep the probe in the bus wrappers, and > mma9551/mma9553 differ in both. hid-sensor-accel-3d, ssp_accel_sensor and > cros_ec_accel_legacy take the orientation from the HID/SSP/EC side rather > than from a firmware property. > > Changes in v2: > - move stk8ba50 to patch 1 > - place the mount matrix before the __aligned(IIO_DMA_MINALIGN) members in > adxl345, adxl355, adxl367, adxl380, bma220, bmi088 and sca3300, so the > DMA buffers keep their own cacheline > - add the missing blank line after the mount matrix read in probe > - add the @orientation kernel-doc entry for msa311 and sca3300 > - shorten the stk8ba50 test note to the behaviour observed on the device > - v1 lost its threading because the sending MTA rewrote Message-IDs while > leaving References untouched; v2 is posted as a new series > > Build tested with allmodconfig: drivers/iio/accel, 71 objects, no warnings; > checkpatch.pl is silent in default and in --strict mode. Only stk8ba50 was > tested on hardware; the other 17 are compile tested. > > Link: https://lore.kernel.org/linux-iio/5F08289E852625FC+20261127030810.3150676-1-hexin@hexin.host/ > Signed-off-by: He Xin > --- I haven't checked the placements in the data structs with pahole, but otherwise this LGTM. For the series, Reviewed-by: Joshua Crofts -- Kind regards, Joshua Crofts