Lines Matching refs:spi

70 	void			(*set_cs)(struct s3c2410_spi_info *spi,
92 static void s3c24xx_spi_gpiocs(struct s3c2410_spi_info *spi, int cs, int pol) in s3c24xx_spi_gpiocs() argument
94 gpio_set_value(spi->pin_cs, pol); in s3c24xx_spi_gpiocs()
97 static void s3c24xx_spi_chipsel(struct spi_device *spi, int value) in s3c24xx_spi_chipsel() argument
99 struct s3c24xx_spi_devstate *cs = spi->controller_state; in s3c24xx_spi_chipsel()
100 struct s3c24xx_spi *hw = to_hw(spi); in s3c24xx_spi_chipsel()
101 unsigned int cspol = spi->mode & SPI_CS_HIGH ? 1 : 0; in s3c24xx_spi_chipsel()
107 hw->set_cs(hw->pdata, spi->chip_select, cspol^1); in s3c24xx_spi_chipsel()
114 hw->set_cs(hw->pdata, spi->chip_select, cspol); in s3c24xx_spi_chipsel()
119 static int s3c24xx_spi_update_state(struct spi_device *spi, in s3c24xx_spi_update_state() argument
122 struct s3c24xx_spi *hw = to_hw(spi); in s3c24xx_spi_update_state()
123 struct s3c24xx_spi_devstate *cs = spi->controller_state; in s3c24xx_spi_update_state()
128 hz = t ? t->speed_hz : spi->max_speed_hz; in s3c24xx_spi_update_state()
131 hz = spi->max_speed_hz; in s3c24xx_spi_update_state()
133 if (spi->mode != cs->mode) { in s3c24xx_spi_update_state()
136 if (spi->mode & SPI_CPHA) in s3c24xx_spi_update_state()
139 if (spi->mode & SPI_CPOL) in s3c24xx_spi_update_state()
142 cs->mode = spi->mode; in s3c24xx_spi_update_state()
153 dev_dbg(&spi->dev, "pre-scaler=%d (wanted %d, got %ld)\n", in s3c24xx_spi_update_state()
163 static int s3c24xx_spi_setupxfer(struct spi_device *spi, in s3c24xx_spi_setupxfer() argument
166 struct s3c24xx_spi_devstate *cs = spi->controller_state; in s3c24xx_spi_setupxfer()
167 struct s3c24xx_spi *hw = to_hw(spi); in s3c24xx_spi_setupxfer()
170 ret = s3c24xx_spi_update_state(spi, t); in s3c24xx_spi_setupxfer()
177 static int s3c24xx_spi_setup(struct spi_device *spi) in s3c24xx_spi_setup() argument
179 struct s3c24xx_spi_devstate *cs = spi->controller_state; in s3c24xx_spi_setup()
180 struct s3c24xx_spi *hw = to_hw(spi); in s3c24xx_spi_setup()
185 cs = devm_kzalloc(&spi->dev, in s3c24xx_spi_setup()
193 spi->controller_state = cs; in s3c24xx_spi_setup()
197 ret = s3c24xx_spi_update_state(spi, NULL); in s3c24xx_spi_setup()
203 hw->bitbang.chipselect(spi, BITBANG_CS_INACTIVE); in s3c24xx_spi_setup()
389 static inline bool s3c24xx_spi_usingfiq(struct s3c24xx_spi *spi) in s3c24xx_spi_usingfiq() argument
391 return spi->fiq_inuse; in s3c24xx_spi_usingfiq()
402 static int s3c24xx_spi_txrx(struct spi_device *spi, struct spi_transfer *t) in s3c24xx_spi_txrx() argument
404 struct s3c24xx_spi *hw = to_hw(spi); in s3c24xx_spi_txrx()