mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-29 04:46:07 +00:00
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>
563 lines
11 KiB
Plaintext
563 lines
11 KiB
Plaintext
/*
|
|
* Copyright (c) 2020, Linaro Ltd.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
* Application overlay for spi devices
|
|
*/
|
|
|
|
test_spi_adxl362: adxl362@0 {
|
|
compatible = "adi,adxl362";
|
|
label = "ADXL362";
|
|
reg = <0x0>;
|
|
spi-max-frequency = <0>;
|
|
int1-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_adxl372: adxl372@1 {
|
|
compatible = "adi,adxl372";
|
|
label = "ADXL372";
|
|
reg = <0x1>;
|
|
spi-max-frequency = <0>;
|
|
int1-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_apa102: apa102@2 {
|
|
compatible = "apa,apa102";
|
|
label = "APA102";
|
|
reg = <0x2>;
|
|
spi-max-frequency = <0>;
|
|
};
|
|
|
|
test_spi_at25: at25@3 {
|
|
compatible = "atmel,at25";
|
|
label = "AT25";
|
|
reg = <0x3>;
|
|
spi-max-frequency = <0>;
|
|
size = <0>;
|
|
pagesize = <0>;
|
|
address-width = <0>;
|
|
timeout = <0>;
|
|
wp-gpios = <&test_gpio 0 0>;
|
|
/* read-only; */
|
|
};
|
|
|
|
test_spi_rf2xx: rf2xx@4 {
|
|
compatible = "atmel,rf2xx";
|
|
label = "RF2XX";
|
|
reg = <0x4>;
|
|
spi-max-frequency = <0>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
reset-gpios = <&test_gpio 0 0>;
|
|
slptr-gpios = <&test_gpio 0 0>;
|
|
dig2-gpios = <&test_gpio 0 0>;
|
|
clkm-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_winc1500: winc1500@5 {
|
|
compatible = "atmel,winc1500";
|
|
label = "WINC1500";
|
|
reg = <0x5>;
|
|
spi-max-frequency = <0>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
reset-gpios = <&test_gpio 0 0>;
|
|
enable-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_bme280: bme280@6 {
|
|
compatible = "bosch,bme280";
|
|
label = "BME280";
|
|
reg = <0x6>;
|
|
spi-max-frequency = <0>;
|
|
};
|
|
|
|
test_spi_bmi160: bmi160@7 {
|
|
compatible = "bosch,bmi160";
|
|
label = "BMI160";
|
|
reg = <0x7>;
|
|
spi-max-frequency = <0>;
|
|
int-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_lpd8803: lpd8803@8 {
|
|
compatible = "colorway,lpd8803";
|
|
label = "LPD8803";
|
|
reg = <0x8>;
|
|
spi-max-frequency = <0>;
|
|
};
|
|
|
|
test_spi_lpd8806: lpd8806@9 {
|
|
compatible = "colorway,lpd8806";
|
|
label = "LPD8806";
|
|
reg = <0x9>;
|
|
spi-max-frequency = <0>;
|
|
};
|
|
|
|
test_spi_gd7965: gd7965@a {
|
|
compatible = "gooddisplay,gd7965";
|
|
label = "GD7965";
|
|
reg = <0xa>;
|
|
spi-max-frequency = <0>;
|
|
height = <0>;
|
|
width = <0>;
|
|
reset-gpios = <&test_gpio 0 0>;
|
|
dc-gpios = <&test_gpio 0 0>;
|
|
busy-gpios = <&test_gpio 0 0>;
|
|
pwr = [];
|
|
softstart = [];
|
|
cdi = <0>;
|
|
tcon = <0>;
|
|
};
|
|
|
|
test_spi_ili9340: ili9340@b {
|
|
compatible = "ilitek,ili9340";
|
|
label = "ILI9340";
|
|
reg = <0xb>;
|
|
spi-max-frequency = <0>;
|
|
reset-gpios = <&test_gpio 0 0>;
|
|
cmd-data-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_eswifi: eswifi@c {
|
|
compatible = "inventek,eswifi";
|
|
label = "ESWIFI";
|
|
reg = <0xc>;
|
|
spi-max-frequency = <0>;
|
|
resetn-gpios = <&test_gpio 0 0>;
|
|
data-gpios = <&test_gpio 0 0>;
|
|
wakeup-gpios = <&test_gpio 0 0>;
|
|
boot0-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_spi_nor: spi-nor@d {
|
|
compatible = "jedec,spi-nor";
|
|
label = "SPI-NOR";
|
|
reg = <0xd>;
|
|
spi-max-frequency = <0>;
|
|
wp-gpios = <&test_gpio 0 0>;
|
|
hold-gpios = <&test_gpio 0 0>;
|
|
reset-gpios = <&test_gpio 0 0>;
|
|
jedec-id = [];
|
|
/* has-be32k; */
|
|
/* requires-ulbpr; */
|
|
/* has-dpd; */
|
|
size = <0>;
|
|
};
|
|
|
|
test_spi_ms5607: ms5607@e {
|
|
compatible = "meas,ms5607";
|
|
label = "MS5607";
|
|
reg = <0xe>;
|
|
spi-max-frequency = <0>;
|
|
};
|
|
|
|
test_spi_enc28j60: enc28j60@f {
|
|
compatible = "microchip,enc28j60";
|
|
label = "ENC28J60";
|
|
reg = <0xf>;
|
|
spi-max-frequency = <0>;
|
|
int-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_enc424j600: enc424j600@10 {
|
|
compatible = "microchip,enc424j600";
|
|
label = "ENC424J600";
|
|
reg = <0x10>;
|
|
spi-max-frequency = <0>;
|
|
int-gpios = <&test_gpio 0 0>;
|
|
};
|
|
test_spi_mcp23s17: mcp23s17@11 {
|
|
compatible = "microchip,mcp23s17";
|
|
label = "GPIO_E0";
|
|
spi-max-frequency = <0>;
|
|
reg = <0x11>;
|
|
gpio-controller;
|
|
#gpio-cells = <2>;
|
|
ngpios = <16>;
|
|
};
|
|
|
|
test_spi_mcp2515: mcp2515@12 {
|
|
compatible = "microchip,mcp2515";
|
|
label = "MCP2515";
|
|
reg = <0x12>;
|
|
spi-max-frequency = <0>;
|
|
osc-freq = <0>;
|
|
int-gpios = <&test_gpio 0 0>;
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
bus-speed = <0>;
|
|
sjw = <0>;
|
|
prop-seg = <0>;
|
|
phase-seg1 = <0>;
|
|
phase-seg2 = <0>;
|
|
};
|
|
|
|
test_spi_mcr20a: mcr20a@13 {
|
|
compatible = "nxp,mcr20a";
|
|
label = "MCR20A";
|
|
reg = <0x13>;
|
|
spi-max-frequency = <0>;
|
|
irqb-gpios = <&test_gpio 0 0>;
|
|
reset-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_sx1276: sx1276@14 {
|
|
compatible = "semtech,sx1276";
|
|
label = "SX1276";
|
|
reg = <0x14>;
|
|
spi-max-frequency = <0>;
|
|
reset-gpios = <&test_gpio 0 0>;
|
|
dio-gpios = <&test_gpio 0 0>;
|
|
power-amplifier-output = "rfo";
|
|
};
|
|
|
|
test_spi_st7789v: st7789v@15 {
|
|
compatible = "sitronix,st7789v";
|
|
label = "ST7789V";
|
|
reg = <0x15>;
|
|
spi-max-frequency = <0>;
|
|
reset-gpios = <&test_gpio 0 0>;
|
|
cmd-data-gpios = <&test_gpio 0 0>;
|
|
height = <0>;
|
|
width = <0>;
|
|
x-offset = <0>;
|
|
y-offset = <0>;
|
|
vcom = <0>;
|
|
gctrl = <0>;
|
|
mdac = <0>;
|
|
lcm = <0>;
|
|
colmod = <0>;
|
|
gamma = <0>;
|
|
porch-param = [];
|
|
cmd2en-param = [];
|
|
pwctrl1-param = [];
|
|
pvgam-param = [];
|
|
nvgam-param = [];
|
|
ram-param = [];
|
|
rgb-param = [];
|
|
};
|
|
|
|
test_spi_ssd16xxfb: ssd16xxfb@16 {
|
|
compatible = "solomon,ssd16xxfb";
|
|
label = "SSD16XXFB";
|
|
reg = <0x16>;
|
|
spi-max-frequency = <0>;
|
|
height = <0>;
|
|
width = <0>;
|
|
pp-height-bits = <0>;
|
|
pp-width-bits = <0>;
|
|
gdv = [];
|
|
sdv = [];
|
|
vcom = <0>;
|
|
border-waveform = <0>;
|
|
/* orientation-flipped; */
|
|
reset-gpios = <&test_gpio 0 0>;
|
|
dc-gpios = <&test_gpio 0 0>;
|
|
busy-gpios = <&test_gpio 0 0>;
|
|
lut-initial = [];
|
|
lut-default = [];
|
|
};
|
|
|
|
test_spi_iis2dlpc: iis2dlpc@17 {
|
|
compatible = "st,iis2dlpc";
|
|
label = "IIS2DLPC";
|
|
reg = <0x17>;
|
|
spi-max-frequency = <0>;
|
|
drdy-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_iis2mdc: iis2mdc@18 {
|
|
compatible = "st,iis2mdc";
|
|
label = "IIS2MDC";
|
|
reg = <0x18>;
|
|
spi-max-frequency = <0>;
|
|
drdy-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_iis3dhhc: iis3dhhc@19 {
|
|
compatible = "st,iis3dhhc";
|
|
label = "IIS3DHHC";
|
|
reg = <0x19>;
|
|
spi-max-frequency = <0>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_ism330dhcx: ism330dhcx@1a {
|
|
compatible = "st,ism330dhcx";
|
|
label = "ISM330DHCX";
|
|
reg = <0x1a>;
|
|
spi-max-frequency = <0>;
|
|
drdy-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_lis2dh: lis2dh@1b {
|
|
compatible = "st,lis2dh";
|
|
label = "LIS2DH";
|
|
reg = <0x1b>;
|
|
spi-max-frequency = <0>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
/* disconnect-sdo-sa0-pull-up; */
|
|
};
|
|
|
|
test_spi_lis2ds12: lis2ds12@1c {
|
|
compatible = "st,lis2ds12";
|
|
label = "LIS2DS12";
|
|
reg = <0x1c>;
|
|
spi-max-frequency = <0>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_lis2dw12: lis2dw12@1d {
|
|
compatible = "st,lis2dw12";
|
|
label = "LIS2DW12";
|
|
reg = <0x1d>;
|
|
spi-max-frequency = <0>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_lis2mdl: lis2mdl@1e {
|
|
compatible = "st,lis2mdl";
|
|
label = "LIS2MDL";
|
|
reg = <0x1e>;
|
|
spi-max-frequency = <0>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_lps22hh: lps22hh@1f {
|
|
compatible = "st,lps22hh";
|
|
label = "LPS22HH";
|
|
reg = <0x1f>;
|
|
spi-max-frequency = <0>;
|
|
drdy-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_lsm303agr_accel: lsm303agr-accel@20 {
|
|
compatible = "st,lsm303agr-accel";
|
|
label = "LSM303AGR-ACCEL";
|
|
reg = <0x20>;
|
|
spi-max-frequency = <0>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
/* disconnect-sdo-sa0-pull-up; */
|
|
};
|
|
|
|
test_spi_lsm6dsl: lsm6dsl@21 {
|
|
compatible = "st,lsm6dsl";
|
|
label = "LSM6DSL";
|
|
reg = <0x21>;
|
|
spi-max-frequency = <0>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_lsm6dso: lsm6dso@22 {
|
|
compatible = "st,lsm6dso";
|
|
label = "LSM6DSO";
|
|
reg = <0x22>;
|
|
spi-max-frequency = <0>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_cc1200: cc1200@23 {
|
|
compatible = "ti,cc1200";
|
|
label = "CC1200";
|
|
reg = <0x23>;
|
|
spi-max-frequency = <0>;
|
|
int-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_cc2520: cc2520@24 {
|
|
compatible = "ti,cc2520";
|
|
label = "CC2520";
|
|
reg = <0x24>;
|
|
spi-max-frequency = <0>;
|
|
vreg-en-gpios = <&test_gpio 0 0>;
|
|
reset-gpios = <&test_gpio 0 0>;
|
|
fifo-gpios = <&test_gpio 0 0>;
|
|
cca-gpios = <&test_gpio 0 0>;
|
|
sfd-gpios = <&test_gpio 0 0>;
|
|
fifop-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_lmp90077: lmp90077@25 {
|
|
compatible = "ti,lmp90077";
|
|
label = "LMP90077";
|
|
reg = <0x25>;
|
|
spi-max-frequency = <0>;
|
|
drdyb-gpios = <&test_gpio 0 0>;
|
|
#io-channel-cells = <2>;
|
|
};
|
|
|
|
test_spi_lmp90078: lmp90078@26 {
|
|
compatible = "ti,lmp90078";
|
|
label = "LMP90078";
|
|
reg = <0x26>;
|
|
spi-max-frequency = <0>;
|
|
drdyb-gpios = <&test_gpio 0 0>;
|
|
#io-channel-cells = <2>;
|
|
};
|
|
|
|
test_spi_lmp90079: lmp90079@27 {
|
|
compatible = "ti,lmp90079";
|
|
label = "LMP90079";
|
|
reg = <0x27>;
|
|
spi-max-frequency = <0>;
|
|
drdyb-gpios = <&test_gpio 0 0>;
|
|
#io-channel-cells = <2>;
|
|
};
|
|
|
|
test_spi_lmp90080: lmp90080@28 {
|
|
compatible = "ti,lmp90080";
|
|
label = "LMP90080";
|
|
reg = <0x28>;
|
|
spi-max-frequency = <0>;
|
|
drdyb-gpios = <&test_gpio 0 0>;
|
|
#io-channel-cells = <2>;
|
|
};
|
|
|
|
test_spi_lmp90097: lmp90097@29 {
|
|
compatible = "ti,lmp90097";
|
|
label = "LMP90097";
|
|
reg = <0x29>;
|
|
spi-max-frequency = <0>;
|
|
drdyb-gpios = <&test_gpio 0 0>;
|
|
#io-channel-cells = <2>;
|
|
};
|
|
|
|
test_spi_lmp90098: lmp90098@2a {
|
|
compatible = "ti,lmp90098";
|
|
label = "LMP90098";
|
|
reg = <0x2a>;
|
|
spi-max-frequency = <0>;
|
|
drdyb-gpios = <&test_gpio 0 0>;
|
|
#io-channel-cells = <2>;
|
|
};
|
|
|
|
test_spi_lmp90099: lmp90099@2b {
|
|
compatible = "ti,lmp90099";
|
|
label = "LMP90099";
|
|
reg = <0x2b>;
|
|
spi-max-frequency = <0>;
|
|
drdyb-gpios = <&test_gpio 0 0>;
|
|
#io-channel-cells = <2>;
|
|
};
|
|
|
|
test_spi_lmp90100: lmp90100@2c {
|
|
compatible = "ti,lmp90100";
|
|
label = "LMP90100";
|
|
reg = <0x2c>;
|
|
spi-max-frequency = <0>;
|
|
drdyb-gpios = <&test_gpio 0 0>;
|
|
#io-channel-cells = <2>;
|
|
};
|
|
|
|
test_spi_ws2812_spi: ws2812-spi@2e {
|
|
compatible = "worldsemi,ws2812-spi";
|
|
label = "WS2812-SPI";
|
|
reg = <0x2e>;
|
|
spi-max-frequency = <0>;
|
|
spi-one-frame = <0>;
|
|
spi-zero-frame = <0>;
|
|
chain-length = <0>;
|
|
/* has-white-channel; */
|
|
};
|
|
|
|
test_spi_bt_hci_spi: bt-hci-spi@2f {
|
|
compatible = "zephyr,bt-hci-spi";
|
|
label = "BT-HCI-SPI";
|
|
reg = <0x2f>;
|
|
spi-max-frequency = <0>;
|
|
irq-gpios = <&test_gpio 0 0>;
|
|
reset-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_mmc_spi_slot: mmc-spi-slot@30 {
|
|
compatible = "zephyr,mmc-spi-slot";
|
|
label = "MMC-SPI-SLOT";
|
|
reg = <0x30>;
|
|
spi-max-frequency = <0>;
|
|
};
|
|
|
|
test_spi_iis2dh: iis2dh@31 {
|
|
compatible = "st,iis2dh";
|
|
label = "IIS2DH";
|
|
reg = <0x31>;
|
|
spi-max-frequency = <0>;
|
|
drdy-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_mcp3204: mcp3204@32 {
|
|
compatible = "microchip,mcp3204";
|
|
reg = <0x32>;
|
|
spi-max-frequency = <0>;
|
|
label = "MCP3204";
|
|
#io-channel-cells = <1>;
|
|
};
|
|
|
|
test_spi_dac60508: dac60508@33 {
|
|
compatible = "ti,dac60508";
|
|
label = "DAC60508";
|
|
reg = <0x33>;
|
|
spi-max-frequency = <0>;
|
|
#io-channel-cells = <1>;
|
|
voltage-reference = <0>;
|
|
channel0-gain = <0>;
|
|
channel1-gain = <0>;
|
|
channel2-gain = <0>;
|
|
channel3-gain = <0>;
|
|
channel4-gain = <0>;
|
|
channel5-gain = <0>;
|
|
channel6-gain = <0>;
|
|
channel7-gain = <0>;
|
|
};
|
|
|
|
test_spi_dac70508: dac70508@34 {
|
|
compatible = "ti,dac70508";
|
|
label = "DAC70508";
|
|
reg = <0x34>;
|
|
spi-max-frequency = <0>;
|
|
#io-channel-cells = <1>;
|
|
voltage-reference = <0>;
|
|
channel0-gain = <0>;
|
|
channel1-gain = <0>;
|
|
channel2-gain = <0>;
|
|
channel3-gain = <0>;
|
|
channel4-gain = <0>;
|
|
channel5-gain = <0>;
|
|
channel6-gain = <0>;
|
|
channel7-gain = <0>;
|
|
};
|
|
|
|
test_spi_dac80508: dac80508@35 {
|
|
compatible = "ti,dac80508";
|
|
label = "DAC80508";
|
|
reg = <0x35>;
|
|
spi-max-frequency = <0>;
|
|
#io-channel-cells = <1>;
|
|
voltage-reference = <0>;
|
|
channel0-gain = <0>;
|
|
channel1-gain = <0>;
|
|
channel2-gain = <0>;
|
|
channel3-gain = <0>;
|
|
channel4-gain = <0>;
|
|
channel5-gain = <0>;
|
|
channel6-gain = <0>;
|
|
channel7-gain = <0>;
|
|
};
|
|
|
|
test_spi_w5500: w5500@36 {
|
|
compatible = "wiznet,w5500";
|
|
label = "w5500";
|
|
reg = <0x36>;
|
|
spi-max-frequency = <0>;
|
|
int-gpios = <&test_gpio 0 0>;
|
|
reset-gpios = <&test_gpio 0 0>;
|
|
};
|
|
|
|
test_spi_iis2iclx: iis2iclx@37 {
|
|
compatible = "st,iis2iclx";
|
|
label = "IIS2ICLX";
|
|
reg = <0x37>;
|
|
spi-max-frequency = <0>;
|
|
drdy-gpios = <&test_gpio 0 0>;
|
|
int-pin = <1>;
|
|
};
|