]> asedeno.scripts.mit.edu Git - linux.git/commit
iio: imu: adis16480: Add support for external clock
authorStefan Popa <stefan.popa@analog.com>
Mon, 11 Mar 2019 09:45:29 +0000 (11:45 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 4 Apr 2019 19:19:57 +0000 (20:19 +0100)
commit326e2357553d39769aacf737fd19650f2d81671a
treec7f0f6225cb511f2fabb0f14d5d03c9b94ef5918
parent20d9248e704a3a852cfc35a4003732349cb7cf3d
iio: imu: adis16480: Add support for external clock

Inertial sensor data collection and processing can be controlled by
configuring one of the DIOx lines as an external clock input. This
option is available for all devices supported by this driver. However,
only adis1649x devices support different modes for the external clock.

Sync mode is supported by all devices. In this mode, the output data
rate is equal with the clock frequency divided by DEC_RATE + 1. This
mode of calculation is similar with the case when the internal clock is
used.

Pulse Per Second (PPS) Mode, is only supported by adis1649x devices. In
this mode, the output data rate is equal to the product of the external
clock frequency and the scale factor in the SYNC_SCALE register.

This patch uses the "clock-names" property to enable the external clock
in one of the two supported modes: "sync" or "pps". This property is
optional. If it is not specified, the internal clock is used.

This patch also offers the option to select the DIOx line to be used as
an external clock input via the custom "adi,ext-clk-pin" property. If this
field is left empty, DIO2 is assigned as default external clock input pin.
Each DIOx pin supports only one function at a time (data ready line
selection or external clock input).

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/adis16480.c