Example #1
0
static void ar71xx_spi_restore_regs(struct ar71xx_spi *sp)
{
	/* restore CTRL register */
	ar71xx_spi_wr(sp, SPI_REG_CTRL, sp->reg_ctrl);
	/* disable GPIO mode */
	ar71xx_spi_wr(sp, SPI_REG_FS, 0);
}
Example #2
0
static void ar71xx_spi_restore_regs(struct spi_device *spi)
{
	struct ar71xx_spi *sp = spidev_to_sp(spi);

	/* restore CTRL register */
	ar71xx_spi_wr(sp, SPI_REG_CTRL, sp->reg_ctrl);
	/* disable GPIO mode */
	ar71xx_spi_wr(sp, SPI_REG_FS, 0);
}
Example #3
0
static void ar71xx_spi_setup_regs(struct ar71xx_spi *sp)
{
	/* enable GPIO mode */
	ar71xx_spi_wr(sp, SPI_REG_FS, SPI_FS_GPIO);

	/* save CTRL register */
	sp->reg_ctrl = ar71xx_spi_rr(sp, SPI_REG_CTRL);

	/* TODO: setup speed? */
	ar71xx_spi_wr(sp, SPI_REG_CTRL, 0x43);
}