Commit 96da921c authored by Alessandro Rubini's avatar Alessandro Rubini

kernel/spi: write DAC at init an not-wr time

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent bd23b5e8
......@@ -170,6 +170,9 @@ static int fd_wr_mode(struct fd_dev *fd, int on)
} else {
fd_writel(fd, 0, FD_REG_TCR);
clear_bit(FD_FLAG_WR_MODE, &fd->flags);
/* not white-rabbit: write default to DAC for VCXO */
fd_spi_xfer(fd, FD_CS_DAC, 24,
fd->calib.vcxo_default_tune & 0xffff, NULL);
}
spin_unlock_irqrestore(&fd->lock, flags);
return 0;
......
......@@ -277,9 +277,10 @@ enum fd_acam_modes {
#define ACAM_MASK ((1<<29) - 1) /* 28 bits */
/* SPI Bus chip selects */
#define FD_CS_NONE 0 /* Nothing */
#define FD_CS_DAC 0 /* DAC for VCXO */
#define FD_CS_PLL 1 /* AD9516 PLL */
#define FD_CS_GPIO 2 /* MCP23S17 GPIO */
#define FD_CS_NONE 3 /* Unconnected, used as a delay */
/* MCP23S17 register addresses (only ones which are used by the lib) */
#define FD_MCP_IODIR 0x00
......
......@@ -46,7 +46,9 @@ int fd_spi_xfer(struct fd_dev *fd, int ss, int num_bits,
int fd_spi_init(struct fd_dev *fd)
{
/* nothing to do */
/* write default to DAC for VCXO */
fd_spi_xfer(fd, FD_CS_DAC, 24, fd->calib.vcxo_default_tune & 0xffff,
NULL);
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment