Skip to content

Commit 204c7b3

Browse files
scuciureanmchehab
authored andcommitted
media: spi: gs1662: Use new structure for SPI transfer delays
In a recent change to the SPI subsystem [1], a new `delay` struct was added to replace the `delay_usecs`. This change replaces the current `delay_usecs` with `delay` for this driver. The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure that both `delay_usecs` & `delay` are used (in this order to preserve backwards compatibility). [1] commit bebcfd2 ("spi: introduce `delay` field for `spi_transfer` + spi_transfer_delay_exec()") Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent aead0ff commit 204c7b3

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

‎drivers/media/spi/gs1662.c‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,17 @@ static int gs_read_register(struct spi_device *spi, u16 addr, u16 *value)
147147
{
148148
.tx_buf = &buf_addr,
149149
.len = 2,
150-
.delay_usecs = 1,
150+
.delay = {
151+
.value = 1,
152+
.unit = SPI_DELAY_UNIT_USECS
153+
},
151154
}, {
152155
.rx_buf = &buf_value,
153156
.len = 2,
154-
.delay_usecs = 1,
157+
.delay = {
158+
.value = 1,
159+
.unit = SPI_DELAY_UNIT_USECS
160+
},
155161
},
156162
};
157163

@@ -175,11 +181,17 @@ static int gs_write_register(struct spi_device *spi, u16 addr, u16 value)
175181
{
176182
.tx_buf = &buf_addr,
177183
.len = 2,
178-
.delay_usecs = 1,
184+
.delay = {
185+
.value = 1,
186+
.unit = SPI_DELAY_UNIT_USECS
187+
},
179188
}, {
180189
.tx_buf = &buf_value,
181190
.len = 2,
182-
.delay_usecs = 1,
191+
.delay = {
192+
.value = 1,
193+
.unit = SPI_DELAY_UNIT_USECS
194+
},
183195
},
184196
};
185197

0 commit comments

Comments
 (0)