Lines Matching refs:slave
17 static int flash_cmd(struct spi_slave *slave, uchar cmd, uchar *buf, int len) in flash_cmd() argument
20 return spi_xfer(slave, 8 * len, buf, buf, SPI_XFER_BEGIN | SPI_XFER_END); in flash_cmd()
23 static int flash_status(struct spi_slave *slave) in flash_status() argument
26 if (flash_cmd(slave, CMD_STAT, buf, sizeof(buf))) in flash_status()
31 static int flash_set_pow2(struct spi_slave *slave) in flash_set_pow2() argument
40 ret = flash_cmd(slave, CMD_CFG, buf, sizeof(buf)); in flash_set_pow2()
47 ret = flash_status(slave); in flash_set_pow2()
54 static int flash_check(struct spi_slave *slave) in flash_check() argument
59 ret = flash_cmd(slave, CMD_ID, buf, sizeof(buf)); in flash_check()
132 struct spi_slave *slave; in atmel_df_pow2() local
163 slave = spi_setup_slave(bus, cs, 1000, SPI_MODE_3); in atmel_df_pow2()
164 if (!slave) { in atmel_df_pow2()
169 if (spi_claim_bus(slave)) { in atmel_df_pow2()
170 spi_free_slave(slave); in atmel_df_pow2()
174 if (flash_check(slave)) { in atmel_df_pow2()
179 status = flash_status(slave); in atmel_df_pow2()
196 if (flash_set_pow2(slave)) { in atmel_df_pow2()
207 spi_release_bus(slave); in atmel_df_pow2()
208 spi_free_slave(slave); in atmel_df_pow2()