@@ -29,7 +29,7 @@ static int ms5607_spi_raw_cmd(const struct ms5607_config *config, uint8_t cmd)
2929 .count = 1 ,
3030 };
3131
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 );
3333}
3434
3535static 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,
7979 .count = 1 ,
8080 };
8181
82- err = spi_transceive (config -> bus ,
83- & config -> bus_cfg .spi_cfg ,
82+ err = spi_transceive_dt (& config -> bus_cfg .spi_bus ,
8483 & tx_buf_set ,
8584 & rx_buf_set );
8685 if (err < 0 ) {
@@ -130,8 +129,7 @@ static int ms5607_spi_read_adc(const struct ms5607_config *config, uint32_t *val
130129 .count = 1 ,
131130 };
132131
133- err = spi_transceive (config -> bus ,
134- & config -> bus_cfg .spi_cfg ,
132+ err = spi_transceive_dt (& config -> bus_cfg .spi_bus ,
135133 & tx_buf_set ,
136134 & rx_buf_set );
137135 if (err < 0 ) {
@@ -145,21 +143,11 @@ static int ms5607_spi_read_adc(const struct ms5607_config *config, uint32_t *val
145143
146144static int ms5607_spi_check (const struct ms5607_config * config )
147145{
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 )) {
151147 LOG_DBG ("SPI bus %s not ready" , config -> bus -> name );
152148 return - ENODEV ;
153149 }
154150
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-
163151 return 0 ;
164152}
165153
0 commit comments