Make this driver multi-instance and use the new API. Notes for sensorhub mode: In case of multiples devices it is possible that some of them has i2c slaves attached to it (sensorhub mode) but not the others. Since the driver is configured in the same way for all the instances (CONFIG_SENSORHUB=y), the routine that initialize the sensorhub part does not fail anymore in case no slaves are found for a particular instance. Instead, those non-sensorhub driver instances will set the shub_inited flag to false and will totally ignore the feature. Notes for triggers: In case of multiples devices the device pin the interrupt wire is attached to can be different (INT1 or INT2 pin). So, this information has been moved in DTS and then stored in the specific instance config structure. Currently the driver is able to handle a sngle interrupt line at a time attached to either INT1 or INT2. MOreover, the interrupt initialization for a driver instance proceed only if the drdy has been configured in its DT, else it returns ok. Signed-off-by: Armando Visconti <armando.visconti@st.com>
30 lines
840 B
YAML
30 lines
840 B
YAML
# Copyright (c) 2020 STMicroelectronics
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
description: |
|
|
STMicroelectronics IIS2ICLX 2-axis accelerometer sensor
|
|
accessed through I2C bus
|
|
|
|
compatible: "st,iis2iclx"
|
|
|
|
include: i2c-device.yaml
|
|
|
|
properties:
|
|
drdy-gpios:
|
|
type: phandle-array
|
|
required: false
|
|
description: DRDY pin
|
|
|
|
This pin defaults to active high when produced by the sensor.
|
|
The property value should ensure the flags properly describe
|
|
the signal that is presented to the driver.
|
|
|
|
int-pin:
|
|
type: int
|
|
required: false
|
|
default: 1
|
|
description: Device INT pin number (1 or 2)
|
|
|
|
This number represents which of the two interrupt pins
|
|
(INT1 or INT2) the line is attached to. This property is not
|
|
mandatory and if not present it defaults to 1.
|