Thread (2 messages) flat view 2 messages, 2 authors, 2017-01-03

RE: [PATCH 1/2] iio: Add support for linear accel

From: Peter Meerwald-Stadler <hidden>
Date: 2017-01-03 08:04:19
Also in: linux-iio

Hi,
	 I checked and find that iio device name is usually named to be with underline if it has more than one word, so I assigned to be " linear_accel_3d".
 I think the device property node named to be "in_linear_accel_x_raw" is better than " in_linearaccel_x_raw" Just follow the former coding style.
"linearaccel" is only a name which specify IIO type [IIO_LINEAR_ACCEL]
I name [IIO_LINEAR_ACCEL] to be "linearaccel" just follow the history code style in " iio_chan_type_name_spec[]" which do not have any underline.
quoted
+What:		/sys/bus/iio/devices/iio:deviceX/in_linear_accel_x_raw
+What:		/sys/bus/iio/devices/iio:deviceX/in_linear_accel_y_raw
+What:		/sys/bus/iio/devices/iio:deviceX/in_linear_accel_z_raw
I think this would be in_linearaccel_x_raw, etc.?
quoted
@@ -82,6 +82,7 @@ struct bus_type iio_bus_type = {
 	[IIO_UVINDEX] = "uvindex",
 	[IIO_ELECTRICALCONDUCTIVITY] = "electricalconductivity",
 	[IIO_GRAVITY]  = "gravity",
+	[IIO_LINEAR_ACCEL] = "linearaccel",
 };

linearaccel vs. linear_accel is a matter of taste, I have no preference;
nevertheless, the documentation should match what IIO outputs

if you have "linearaccel" in iio_bus_type, I think the name of a 
LINEAR_ACCEL channel will end up as "in_linearaccel_x_raw" and must be 
documented like that -- i.e. there is a mismatch between 
documentation and actual code/output

probably your patches should be rebased, iio/testing branch has IIO_COUNT 
and IIO_INDEX channels

regards, p.


-- 

Peter Meerwald-Stadler
+43-664-2444418 (mobile)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help