Commit 94dc30f4 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

dev/ad9910: implement ad9910_frequency_to_ftw()

parent 996c13fc
......@@ -82,6 +82,11 @@ int ad9910_probe( struct ad9910_device *dev, struct spi_bus *bus, void (*trigger
return (id == AD9910_DEFAULT_CFR1) ? 0 : -1;
}
uint64_t ad9910_frequency_to_ftw( struct ad9910_device *dev, uint64_t freq_hz )
{
return (1ULL << 32) * freq_hz / AD9910_REF_FREQ;
}
int ad9910_program( struct ad9910_device *dev, uint64_t ftw_n, int phase, int fs_current )
{
......@@ -92,6 +97,8 @@ int ad9910_program( struct ad9910_device *dev, uint64_t ftw_n, int phase, int fs
uint64_t ftw = ftw_n;
uint64_t prof0_cr = ftw | (0x8b5ULL << 48);
dev_dbg("ad9910 FTW = %d\n", (uint32_t) ftw);
// dev_dbg("ad9910_program [%08x%08x] asf %d!\n", (uint32_t)(prof0_cr >> 32), (uint32_t)prof0_cr, asf );
for(i = 0; ad9910_default_config[i].addr >= 0; i++)
......
......@@ -46,5 +46,6 @@ void ad9910_write(struct ad9910_device *dev, uint32_t reg, uint64_t value, int n
int ad9910_probe( struct ad9910_device *dev, struct spi_bus *bus, void (*trigger_io_update)(struct ad9910_device *dev) );
void ad9910_trigger_update(struct ad9910_device *dev);
void ad9910_configure_sync( struct ad9910_device *dev, int enable, int fine_delay_taps );
uint64_t ad9910_frequency_to_ftw( struct ad9910_device *dev, uint64_t freq_hz );
#endif
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