Lines Matching full: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()
130 struct spi_slave *slave; in atmel_df_pow2() local
161 slave = spi_setup_slave(bus, cs, 1000, SPI_MODE_3); in atmel_df_pow2()
162 if (!slave) { in atmel_df_pow2()
163 puts("unable to setup slave\n"); in atmel_df_pow2()
167 if (spi_claim_bus(slave)) { in atmel_df_pow2()
168 spi_free_slave(slave); in atmel_df_pow2()
172 if (flash_check(slave)) { in atmel_df_pow2()
177 status = flash_status(slave); in atmel_df_pow2()
194 if (flash_set_pow2(slave)) { in atmel_df_pow2()
205 spi_release_bus(slave); in atmel_df_pow2()
206 spi_free_slave(slave); in atmel_df_pow2()