Commit 8c273216 authored by Federico Vaga's avatar Federico Vaga

drv: pattern data is 14bit, not 12bit

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent f4c1848b
......@@ -312,7 +312,7 @@ int fa_adc_data_pattern_get(struct fa_dev *fa, uint16_t *pattern,
if (err)
return err;
*enable = !!(rx & 0x80);
*pattern = ((rx & 0xF) << 8);
*pattern = ((rx & 0x3F) << 8);
tx = 0x8000 | (4 << 8);
err = fa_spi_xfer(fa, FA_SPI_SS_ADC, 16, tx, &rx);
......
......@@ -203,7 +203,7 @@ static int fa_data_pattern_adc_write(struct fa_dev *fa, const char __user *buf,
err = kstrtou16(buf_l + 2, 0, &pattern);
if (err)
return err;
err = fa_adc_data_pattern_set(fa, pattern & 0xFFF, 1);
err = fa_adc_data_pattern_set(fa, pattern & 0x3FFF, 1);
fa_calib_exit(fa);
return err;
} else {
......
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