• Stefan Popa's avatar
    iio: imu: adis16480: Add support for external clock · 326e2357
    Stefan Popa authored
    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: default avatarStefan Popa <stefan.popa@analog.com>
    Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    326e2357
adis16480.c 37.3 KB