Commit 70ed4d5f authored by Federico Vaga's avatar Federico Vaga

adc: more debug messages

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent df92f628
...@@ -405,7 +405,8 @@ static int zfad_apply_user_offset(struct fa_dev *fa, struct zio_channel *chan, ...@@ -405,7 +405,8 @@ static int zfad_apply_user_offset(struct fa_dev *fa, struct zio_channel *chan,
/* Get calibration offset and gain for DAC */ /* Get calibration offset and gain for DAC */
offset = fa->dac_cal_data[range].offset[chan->index]; offset = fa->dac_cal_data[range].offset[chan->index];
gain = fa->dac_cal_data[range].gain[chan->index]; gain = fa->dac_cal_data[range].gain[chan->index];
dev_dbg(&chan->head.dev, "Appling offset (%d, 0x%x, 0x%x, 0x%x)\n",
chan->index, range, gain, offset);
/* Calculate calibrater value for DAC */ /* Calculate calibrater value for DAC */
cal_val = ((((usr_val - 0x8000 + offset) << 15) * gain) >> 30); cal_val = ((((usr_val - 0x8000 + offset) << 15) * gain) >> 30);
cal_val += 0x8000; cal_val += 0x8000;
...@@ -448,6 +449,8 @@ static int zfad_conf_set(struct device *dev, struct zio_attribute *zattr, ...@@ -448,6 +449,8 @@ static int zfad_conf_set(struct device *dev, struct zio_attribute *zattr,
struct fa_dev *fa = get_zfadc(dev); struct fa_dev *fa = get_zfadc(dev);
int i, err, reg_index; int i, err, reg_index;
dev_dbg(dev, "Writing %d in the sysfs attribute %s\n",
usr_val, zattr->attr.attr.name);
reg_index = zattr->id; reg_index = zattr->id;
i = fa->zdev->cset->n_chan -1 ; /* -1 because of interleaved channel */ i = fa->zdev->cset->n_chan -1 ; /* -1 because of interleaved channel */
switch (reg_index) { switch (reg_index) {
...@@ -560,7 +563,8 @@ static int zfad_info_get(struct device *dev, struct zio_attribute *zattr, ...@@ -560,7 +563,8 @@ static int zfad_info_get(struct device *dev, struct zio_attribute *zattr,
} }
zfa_common_info_get(fa, reg_index, usr_val); zfa_common_info_get(fa, reg_index, usr_val);
dev_dbg(dev, "Reading %d from the sysfs attribute %s (%d)\n",
*usr_val, zattr->attr.attr.name, reg_index);
return 0; return 0;
} }
static const struct zio_sysfs_operations zfad_s_op = { static const struct zio_sysfs_operations zfad_s_op = {
...@@ -832,6 +836,9 @@ static void zfat_irq_trg_fire(struct zio_cset *cset) ...@@ -832,6 +836,9 @@ static void zfat_irq_trg_fire(struct zio_cset *cset)
/* translate from sample count to memory offset */ /* translate from sample count to memory offset */
fixed_mem_ptr = (trg_pos - pre_samp) * cset->ssize; fixed_mem_ptr = (trg_pos - pre_samp) * cset->ssize;
fixed_mem_ptr *= cset->n_chan; fixed_mem_ptr *= cset->n_chan;
dev_dbg(fa->fmc->hwdev,
"Trigger position: %i samples %i bytes\n",
trg_pos, fixed_mem_ptr);
zfad_block[fa->n_fires].dev_mem_ptr = fixed_mem_ptr; zfad_block[fa->n_fires].dev_mem_ptr = fixed_mem_ptr;
} }
......
...@@ -90,6 +90,8 @@ static int zfat_conf_set(struct device *dev, struct zio_attribute *zattr, ...@@ -90,6 +90,8 @@ static int zfat_conf_set(struct device *dev, struct zio_attribute *zattr,
uint32_t tmp_val = usr_val; uint32_t tmp_val = usr_val;
int err = 0; int err = 0;
dev_dbg(dev, "Writing %d in the sysfs attribute %s\n",
usr_val, zattr->attr.attr.name);
switch (zattr->id) { switch (zattr->id) {
case ZFAT_SHOTS_NB: case ZFAT_SHOTS_NB:
if (!tmp_val) { if (!tmp_val) {
...@@ -136,6 +138,9 @@ static int zfat_info_get(struct device *dev, struct zio_attribute *zattr, ...@@ -136,6 +138,9 @@ static int zfat_info_get(struct device *dev, struct zio_attribute *zattr,
zfa_common_info_get(fa, zattr->id, usr_val); zfa_common_info_get(fa, zattr->id, usr_val);
dev_dbg(dev, "Reading %d from the sysfs attribute %s\n",
*usr_val, zattr->attr.attr.name);
return 0; return 0;
} }
static const struct zio_sysfs_operations zfat_s_op = { static const struct zio_sysfs_operations zfat_s_op = {
...@@ -221,7 +226,7 @@ static int zfat_data_done(struct zio_cset *cset) ...@@ -221,7 +226,7 @@ static int zfat_data_done(struct zio_cset *cset)
struct fa_dev *fa = cset->zdev->priv_d; struct fa_dev *fa = cset->zdev->priv_d;
unsigned int i; unsigned int i;
dev_dbg(fa->fmc->hwdev, "Data done\n"); dev_dbg(&cset->head.dev, "Data done\n");
/* Nothing to store */ /* Nothing to store */
if (!zfad_block) if (!zfad_block)
...@@ -230,11 +235,11 @@ static int zfat_data_done(struct zio_cset *cset) ...@@ -230,11 +235,11 @@ static int zfat_data_done(struct zio_cset *cset)
/* Store blocks */ /* Store blocks */
for(i = 0; i < fa->n_shots; ++i) for(i = 0; i < fa->n_shots; ++i)
if (likely(i < fa->n_fires)) {/* Store filled blocks */ if (likely(i < fa->n_fires)) {/* Store filled blocks */
dev_dbg(fa->fmc->hwdev, "Store Block %i/%i\n", dev_dbg(&cset->head.dev, "Store Block %i/%i\n",
i + 1, fa->n_shots); i + 1, fa->n_shots);
bi->b_op->store_block(bi, zfad_block[i].block); bi->b_op->store_block(bi, zfad_block[i].block);
} else { /* Free un-filled blocks */ } else { /* Free un-filled blocks */
dev_dbg(fa->fmc->hwdev, "Free un-acquired block %d/%d " dev_dbg(&cset->head.dev, "Free un-acquired block %d/%d "
"(received %d shots)\n", "(received %d shots)\n",
i + 1, fa->n_shots, fa->n_fires); i + 1, fa->n_shots, fa->n_fires);
bi->b_op->free_block(bi, zfad_block[i].block); bi->b_op->free_block(bi, zfad_block[i].block);
...@@ -297,6 +302,7 @@ static int zfat_arm_trigger(struct zio_ti *ti) ...@@ -297,6 +302,7 @@ static int zfat_arm_trigger(struct zio_ti *ti)
dev_mem_ptr = 0; dev_mem_ptr = 0;
/* Allocate ZIO blocks */ /* Allocate ZIO blocks */
for (i = 0; i < fa->n_shots; ++i) { for (i = 0; i < fa->n_shots; ++i) {
dev_dbg(&ti->cset->head.dev, "Allocating block %d ...\n", i);
block = zbuf->b_op->alloc_block(interleave->bi, size, block = zbuf->b_op->alloc_block(interleave->bi, size,
GFP_ATOMIC); GFP_ATOMIC);
if (!block) { if (!block) {
......
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