@@ -29,7 +29,7 @@ static int ms5607_spi_raw_cmd(const struct ms5607_config *config, uint8_t cmd)
29
29
.count = 1 ,
30
30
};
31
31
32
- return spi_write ( config -> bus , & config -> bus_cfg .spi_cfg , & buf_set );
32
+ return spi_write_dt ( & config -> bus_cfg .spi_bus , & buf_set );
33
33
}
34
34
35
35
static int ms5607_spi_reset (const struct ms5607_config * config )
@@ -79,8 +79,7 @@ static int ms5607_spi_read_prom(const struct ms5607_config *config, uint8_t cmd,
79
79
.count = 1 ,
80
80
};
81
81
82
- err = spi_transceive (config -> bus ,
83
- & config -> bus_cfg .spi_cfg ,
82
+ err = spi_transceive_dt (& config -> bus_cfg .spi_bus ,
84
83
& tx_buf_set ,
85
84
& rx_buf_set );
86
85
if (err < 0 ) {
@@ -130,8 +129,7 @@ static int ms5607_spi_read_adc(const struct ms5607_config *config, uint32_t *val
130
129
.count = 1 ,
131
130
};
132
131
133
- err = spi_transceive (config -> bus ,
134
- & config -> bus_cfg .spi_cfg ,
132
+ err = spi_transceive_dt (& config -> bus_cfg .spi_bus ,
135
133
& tx_buf_set ,
136
134
& rx_buf_set );
137
135
if (err < 0 ) {
@@ -145,21 +143,11 @@ static int ms5607_spi_read_adc(const struct ms5607_config *config, uint32_t *val
145
143
146
144
static int ms5607_spi_check (const struct ms5607_config * config )
147
145
{
148
- const struct spi_cs_control * cs = config -> bus_cfg .spi_cfg .cs ;
149
-
150
- if (!device_is_ready (config -> bus )) {
146
+ if (!spi_is_ready (& config -> bus_cfg .spi_bus )) {
151
147
LOG_DBG ("SPI bus %s not ready" , config -> bus -> name );
152
148
return - ENODEV ;
153
149
}
154
150
155
- if (cs ) {
156
- if (!device_is_ready (cs -> gpio_dev )) {
157
- LOG_DBG ("SPI CS GPIO controller %s not ready" , cs -> gpio_dev -> name );
158
- return - ENODEV ;
159
- }
160
- LOG_DBG ("SPI GPIO CS configured on %s:%u" , cs -> gpio_dev -> name , cs -> gpio_pin );
161
- }
162
-
163
151
return 0 ;
164
152
}
165
153
0 commit comments