Commit 32a2e85a authored by Federico Vaga's avatar Federico Vaga

kernel: uniform kernel messages

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 77d73d4d
...@@ -90,5 +90,5 @@ void fa_read_eeprom_calib(struct fa_dev *fa) ...@@ -90,5 +90,5 @@ void fa_read_eeprom_calib(struct fa_dev *fa)
memcpy(&fa->calib, fa->fmc->eeprom + FA_CAL_OFFSET, sizeof(fa->calib)); memcpy(&fa->calib, fa->fmc->eeprom + FA_CAL_OFFSET, sizeof(fa->calib));
fa_endian_calib(&fa->calib); fa_endian_calib(&fa->calib);
fa_verify_calib(&fa->fmc->dev, &fa->calib, &fa_identity_calib); fa_verify_calib(&fa->fmc->dev, &fa->calib, &fa_identity_calib);
dev_info(&fa->fmc->dev, "%s succeeds.\n", __func__); dev_info(fa->msgdev, "%s succeeds.\n", __func__);
} }
...@@ -169,7 +169,7 @@ int zfad_set_range(struct fa_dev *fa, struct zio_channel *chan, ...@@ -169,7 +169,7 @@ int zfad_set_range(struct fa_dev *fa, struct zio_channel *chan,
gain = FA_CAL_NO_GAIN; gain = FA_CAL_NO_GAIN;
} else { } else {
if (range < 0 || range > ARRAY_SIZE(fa->calib.adc)) { if (range < 0 || range > ARRAY_SIZE(fa->calib.adc)) {
dev_info(&fa->fmc->dev, "Invalid range %i or ch %i\n", dev_info(fa->msgdev, "Invalid range %i or ch %i\n",
range, chan->index); range, chan->index);
return -EINVAL; return -EINVAL;
} }
...@@ -199,13 +199,12 @@ int zfad_set_range(struct fa_dev *fa, struct zio_channel *chan, ...@@ -199,13 +199,12 @@ int zfad_set_range(struct fa_dev *fa, struct zio_channel *chan,
*/ */
int zfad_fsm_command(struct fa_dev *fa, uint32_t command) int zfad_fsm_command(struct fa_dev *fa, uint32_t command)
{ {
struct device *dev = &fa->fmc->dev;
struct zio_cset *cset = fa->zdev->cset; struct zio_cset *cset = fa->zdev->cset;
uint32_t val; uint32_t val;
if (command != FA100M14B4C_CMD_START && if (command != FA100M14B4C_CMD_START &&
command != FA100M14B4C_CMD_STOP) { command != FA100M14B4C_CMD_STOP) {
dev_info(dev, "Invalid command %i\n", command); dev_info(fa->msgdev, "Invalid command %i\n", command);
return -EINVAL; return -EINVAL;
} }
...@@ -236,7 +235,7 @@ int zfad_fsm_command(struct fa_dev *fa, uint32_t command) ...@@ -236,7 +235,7 @@ int zfad_fsm_command(struct fa_dev *fa, uint32_t command)
val = fa_readl(fa, fa->fa_adc_csr_base, val = fa_readl(fa, fa->fa_adc_csr_base,
&zfad_regs[ZFA_STA_SERDES_PLL]); &zfad_regs[ZFA_STA_SERDES_PLL]);
if (!val) { if (!val) {
dev_info(dev, "Cannot start acquisition: " dev_info(fa->msgdev, "Cannot start acquisition: "
"SerDes PLL not locked\n"); "SerDes PLL not locked\n");
return -EBUSY; return -EBUSY;
} }
...@@ -244,7 +243,7 @@ int zfad_fsm_command(struct fa_dev *fa, uint32_t command) ...@@ -244,7 +243,7 @@ int zfad_fsm_command(struct fa_dev *fa, uint32_t command)
val = fa_readl(fa, fa->fa_adc_csr_base, val = fa_readl(fa, fa->fa_adc_csr_base,
&zfad_regs[ZFA_STA_SERDES_SYNCED]); &zfad_regs[ZFA_STA_SERDES_SYNCED]);
if (!val) { if (!val) {
dev_info(dev, "Cannot start acquisition: " dev_info(fa->msgdev, "Cannot start acquisition: "
"SerDes not synchronized\n"); "SerDes not synchronized\n");
return -EBUSY; return -EBUSY;
} }
...@@ -259,15 +258,15 @@ int zfad_fsm_command(struct fa_dev *fa, uint32_t command) ...@@ -259,15 +258,15 @@ int zfad_fsm_command(struct fa_dev *fa, uint32_t command)
* from zfat_arm_trigger() or zfad_input_cset() * from zfat_arm_trigger() or zfad_input_cset()
*/ */
if (!(cset->ti->flags & ZIO_TI_ARMED)) { if (!(cset->ti->flags & ZIO_TI_ARMED)) {
dev_info(dev, "Cannot start acquisition: " dev_info(fa->msgdev, "Cannot start acquisition: "
"Trigger refuses to arm\n"); "Trigger refuses to arm\n");
return -EIO; return -EIO;
} }
dev_dbg(dev, "FSM START Command, Enable interrupts\n"); dev_dbg(fa->msgdev, "FSM START Command, Enable interrupts\n");
fa_enable_irqs(fa); fa_enable_irqs(fa);
} else { } else {
dev_dbg(dev, "FSM STOP Command, Disable interrupts\n"); dev_dbg(fa->msgdev, "FSM STOP Command, Disable interrupts\n");
fa->enable_auto_start = 0; fa->enable_auto_start = 0;
fa_disable_irqs(fa); fa_disable_irqs(fa);
} }
...@@ -282,7 +281,6 @@ int zfad_fsm_command(struct fa_dev *fa, uint32_t command) ...@@ -282,7 +281,6 @@ int zfad_fsm_command(struct fa_dev *fa, uint32_t command)
static int __fa_sdb_get_device(struct fa_dev *fa) static int __fa_sdb_get_device(struct fa_dev *fa)
{ {
struct fmc_device *fmc = fa->fmc; struct fmc_device *fmc = fa->fmc;
struct device *dev = fmc->hwdev;
int ret; int ret;
ret = fmc_scan_sdb_tree(fmc, 0); ret = fmc_scan_sdb_tree(fmc, 0);
...@@ -292,7 +290,7 @@ static int __fa_sdb_get_device(struct fa_dev *fa) ...@@ -292,7 +290,7 @@ static int __fa_sdb_get_device(struct fa_dev *fa)
ret = 0; ret = 0;
} }
if (ret < 0) { if (ret < 0) {
dev_err(dev, dev_err(fa->msgdev,
"%s: no SDB in the bitstream." "%s: no SDB in the bitstream."
"Are you sure you've provided the correct one?\n", "Are you sure you've provided the correct one?\n",
KBUILD_MODNAME); KBUILD_MODNAME);
...@@ -328,7 +326,6 @@ static int __fa_sdb_get_device(struct fa_dev *fa) ...@@ -328,7 +326,6 @@ static int __fa_sdb_get_device(struct fa_dev *fa)
static int __fa_init(struct fa_dev *fa) static int __fa_init(struct fa_dev *fa)
{ {
struct device *hwdev = fa->fmc->hwdev; struct device *hwdev = fa->fmc->hwdev;
struct device *msgdev = &fa->fmc->dev;
struct zio_device *zdev = fa->zdev; struct zio_device *zdev = fa->zdev;
int i, addr; int i, addr;
...@@ -336,7 +333,7 @@ static int __fa_init(struct fa_dev *fa) ...@@ -336,7 +333,7 @@ static int __fa_init(struct fa_dev *fa)
if (dma_set_mask(hwdev, DMA_BIT_MASK(64))) { if (dma_set_mask(hwdev, DMA_BIT_MASK(64))) {
/* Check if hardware supports 32-bit DMA */ /* Check if hardware supports 32-bit DMA */
if (dma_set_mask(hwdev, DMA_BIT_MASK(32))) { if (dma_set_mask(hwdev, DMA_BIT_MASK(32))) {
dev_err(msgdev, "32-bit DMA addressing not available\n"); dev_err(fa->msgdev, "32-bit DMA addressing not available\n");
return -EINVAL; return -EINVAL;
} }
} }
...@@ -447,6 +444,7 @@ int fa_probe(struct fmc_device *fmc) ...@@ -447,6 +444,7 @@ int fa_probe(struct fmc_device *fmc)
return -ENOMEM; return -ENOMEM;
fmc_set_drvdata(fmc, fa); fmc_set_drvdata(fmc, fa);
fa->fmc = fmc; fa->fmc = fmc;
fa->msgdev = &fa->fmc->dev;
/* apply carrier-specific hacks and workarounds */ /* apply carrier-specific hacks and workarounds */
fa->carrier_op = NULL; fa->carrier_op = NULL;
...@@ -463,7 +461,7 @@ int fa_probe(struct fmc_device *fmc) ...@@ -463,7 +461,7 @@ int fa_probe(struct fmc_device *fmc)
* driver was compiled without enable any carrier, so it cannot work * driver was compiled without enable any carrier, so it cannot work
*/ */
if (!fa->carrier_op) { if (!fa->carrier_op) {
dev_err(fmc->hwdev, dev_err(fa->msgdev,
"This binary doesn't support the '%s' carrier\n", "This binary doesn't support the '%s' carrier\n",
fmc->carrier_name); fmc->carrier_name);
return -ENODEV; return -ENODEV;
...@@ -479,18 +477,18 @@ int fa_probe(struct fmc_device *fmc) ...@@ -479,18 +477,18 @@ int fa_probe(struct fmc_device *fmc)
fwname = ""; /* reprogram will pick from module parameter */ fwname = ""; /* reprogram will pick from module parameter */
else else
fwname = fa->carrier_op->get_gwname(); fwname = fa->carrier_op->get_gwname();
dev_info(fmc->hwdev, "Gateware (%s)\n", fwname); dev_info(fa->msgdev, "Gateware (%s)\n", fwname);
/* We first write a new binary (and lm32) within the carrier */ /* We first write a new binary (and lm32) within the carrier */
err = fmc_reprogram(fmc, &fa_dev_drv, fwname, 0x0); err = fmc_reprogram(fmc, &fa_dev_drv, fwname, 0x0);
if (err) { if (err) {
dev_err(fmc->hwdev, "write firmware \"%s\": error %i\n", dev_err(fa->msgdev, "write firmware \"%s\": error %i\n",
fwname, err); fwname, err);
goto out; goto out;
} }
dev_info(fmc->hwdev, "Gateware successfully loaded\n"); dev_info(fa->msgdev, "Gateware successfully loaded\n");
} else { } else {
dev_info(fmc->hwdev, dev_info(fa->msgdev,
"Gateware already there. Set the \"gateware\" parameter to overwrite the current gateware\n"); "Gateware already there. Set the \"gateware\" parameter to overwrite the current gateware\n");
} }
...@@ -509,10 +507,10 @@ int fa_probe(struct fmc_device *fmc) ...@@ -509,10 +507,10 @@ int fa_probe(struct fmc_device *fmc)
/* init all subsystems */ /* init all subsystems */
for (i = 0, m = mods; i < ARRAY_SIZE(mods); i++, m++) { for (i = 0, m = mods; i < ARRAY_SIZE(mods); i++, m++) {
dev_dbg(&fmc->dev, "Calling init for \"%s\"\n", m->name); dev_dbg(fa->msgdev, "Calling init for \"%s\"\n", m->name);
err = m->init(fa); err = m->init(fa);
if (err) { if (err) {
dev_err(&fmc->dev, "error initializing %s\n", m->name); dev_err(fa->msgdev, "error initializing %s\n", m->name);
goto out; goto out;
} }
} }
......
...@@ -46,7 +46,7 @@ int zfad_dma_start(struct zio_cset *cset) ...@@ -46,7 +46,7 @@ int zfad_dma_start(struct zio_cset *cset)
if (val != FA100M14B4C_STATE_IDLE) { if (val != FA100M14B4C_STATE_IDLE) {
/* we can't DMA if the state machine is not idle */ /* we can't DMA if the state machine is not idle */
dev_warn(&fa->fmc->dev, dev_warn(fa->msgdev,
"Can't start DMA on the last acquisition, " "Can't start DMA on the last acquisition, "
"State Machine is not IDLE (status:%d)\n", val); "State Machine is not IDLE (status:%d)\n", val);
return -EBUSY; return -EBUSY;
...@@ -74,14 +74,14 @@ int zfad_dma_start(struct zio_cset *cset) ...@@ -74,14 +74,14 @@ int zfad_dma_start(struct zio_cset *cset)
* bytes * bytes
*/ */
dev_mem_off = trg_pos - (pre_samp * cset->ssize * nchan); dev_mem_off = trg_pos - (pre_samp * cset->ssize * nchan);
dev_dbg(&fa->fmc->dev, dev_dbg(fa->msgdev,
"Trigger @ 0x%08x, pre_samp %i, offset 0x%08x\n", "Trigger @ 0x%08x, pre_samp %i, offset 0x%08x\n",
trg_pos, pre_samp, dev_mem_off); trg_pos, pre_samp, dev_mem_off);
zfad_block[0].dev_mem_off = dev_mem_off; zfad_block[0].dev_mem_off = dev_mem_off;
} }
dev_dbg(&fa->fmc->dev, "Start DMA transfer\n"); dev_dbg(fa->msgdev, "Start DMA transfer\n");
err = fa->carrier_op->dma_start(cset); err = fa->carrier_op->dma_start(cset);
if (err) if (err)
return err; return err;
...@@ -128,7 +128,7 @@ void zfad_dma_done(struct zio_cset *cset) ...@@ -128,7 +128,7 @@ void zfad_dma_done(struct zio_cset *cset)
trig_timetag = (uint32_t *)(block->data + block->datalen trig_timetag = (uint32_t *)(block->data + block->datalen
- FA_TRIG_TIMETAG_BYTES); - FA_TRIG_TIMETAG_BYTES);
/* Timetag marker (metadata) used for debugging */ /* Timetag marker (metadata) used for debugging */
dev_dbg(&fa->fmc->dev, "trig_timetag metadata of the shot %d" dev_dbg(fa->msgdev, "trig_timetag metadata of the shot %d"
" (expected value: 0x6fc8ad2d): 0x%x\n", " (expected value: 0x6fc8ad2d): 0x%x\n",
i, *trig_timetag); i, *trig_timetag);
ctrl->tstamp.secs = *(++trig_timetag); ctrl->tstamp.secs = *(++trig_timetag);
...@@ -159,7 +159,7 @@ void zfad_dma_done(struct zio_cset *cset) ...@@ -159,7 +159,7 @@ void zfad_dma_done(struct zio_cset *cset)
* All DMA transfers done! Inform the trigger about this, so * All DMA transfers done! Inform the trigger about this, so
* it can store blocks into the buffer * it can store blocks into the buffer
*/ */
dev_dbg(&fa->fmc->dev, "%i blocks transfered\n", fa->n_shots); dev_dbg(fa->msgdev, "%i blocks transfered\n", fa->n_shots);
zio_trigger_data_done(cset); zio_trigger_data_done(cset);
/* /*
...@@ -176,7 +176,7 @@ void zfad_dma_done(struct zio_cset *cset) ...@@ -176,7 +176,7 @@ void zfad_dma_done(struct zio_cset *cset)
fa_writel(fa, fa->fa_adc_csr_base, &zfad_regs[ZFAT_CFG_SW_EN], fa_writel(fa, fa->fa_adc_csr_base, &zfad_regs[ZFAT_CFG_SW_EN],
ti->zattr_set.ext_zattr[6].value); ti->zattr_set.ext_zattr[6].value);
} else { } else {
dev_dbg(&fa->fmc->dev, "Software acquisition over\n"); dev_dbg(fa->msgdev, "Software acquisition over\n");
fa_writel(fa, fa->fa_adc_csr_base, &zfad_regs[ZFAT_CFG_SW_EN], fa_writel(fa, fa->fa_adc_csr_base, &zfad_regs[ZFAT_CFG_SW_EN],
1); 1);
} }
...@@ -199,7 +199,7 @@ void zfad_dma_error(struct zio_cset *cset) ...@@ -199,7 +199,7 @@ void zfad_dma_error(struct zio_cset *cset)
fa->n_dma_err++; fa->n_dma_err++;
if (fa->n_fires == 0) if (fa->n_fires == 0)
dev_err(&fa->fmc->dev, dev_err(fa->msgdev,
"DMA error occurs but no block was acquired\n"); "DMA error occurs but no block was acquired\n");
} }
...@@ -214,7 +214,7 @@ void zfat_irq_acq_end(struct zio_cset *cset) ...@@ -214,7 +214,7 @@ void zfat_irq_acq_end(struct zio_cset *cset)
{ {
struct fa_dev *fa = cset->zdev->priv_d; struct fa_dev *fa = cset->zdev->priv_d;
dev_dbg(&fa->fmc->dev, "Acquisition done\n"); dev_dbg(fa->msgdev, "Acquisition done\n");
/* /*
* because the driver doesn't listen anymore trig-event * because the driver doesn't listen anymore trig-event
* we agreed that the HW will provide a dedicated register * we agreed that the HW will provide a dedicated register
...@@ -228,7 +228,7 @@ void zfat_irq_acq_end(struct zio_cset *cset) ...@@ -228,7 +228,7 @@ void zfat_irq_acq_end(struct zio_cset *cset)
&zfad_regs[ZFAT_SHOTS_REM]); &zfad_regs[ZFAT_SHOTS_REM]);
if (fa->n_fires != fa->n_shots) { if (fa->n_fires != fa->n_shots) {
dev_err(&fa->fmc->dev, dev_err(fa->msgdev,
"Expected %i trigger fires, but %i occurs\n", "Expected %i trigger fires, but %i occurs\n",
fa->n_shots, fa->n_fires); fa->n_shots, fa->n_fires);
} }
...@@ -286,7 +286,7 @@ end: ...@@ -286,7 +286,7 @@ end:
zfad_dma_error(cset); zfad_dma_error(cset);
} else if (fa->enable_auto_start) { } else if (fa->enable_auto_start) {
/* Automatic start next acquisition */ /* Automatic start next acquisition */
dev_dbg(&fa->fmc->dev, "Automatic start\n"); dev_dbg(fa->msgdev, "Automatic start\n");
zfad_fsm_command(fa, FA100M14B4C_CMD_START); zfad_fsm_command(fa, FA100M14B4C_CMD_START);
} }
...@@ -305,10 +305,9 @@ end: ...@@ -305,10 +305,9 @@ end:
static void fa_get_irq_status(struct fa_dev *fa, int irq_core_base, static void fa_get_irq_status(struct fa_dev *fa, int irq_core_base,
uint32_t *irq_status) uint32_t *irq_status)
{ {
/* Get current interrupts status */ /* Get current interrupts status */
*irq_status = fa_readl(fa, irq_core_base, &zfad_regs[ZFA_IRQ_ADC_SRC]); *irq_status = fa_readl(fa, irq_core_base, &zfad_regs[ZFA_IRQ_ADC_SRC]);
dev_dbg(&fa->fmc->dev, dev_dbg(fa->msgdev,
"IRQ 0x%x fired an interrupt. IRQ status register: 0x%x\n", "IRQ 0x%x fired an interrupt. IRQ status register: 0x%x\n",
irq_core_base, *irq_status); irq_core_base, *irq_status);
...@@ -347,7 +346,7 @@ irqreturn_t fa_irq_handler(int irq_core_base, void *dev_id) ...@@ -347,7 +346,7 @@ irqreturn_t fa_irq_handler(int irq_core_base, void *dev_id)
if (!status) if (!status)
return IRQ_NONE; /* No interrupt fired by this mezzanine */ return IRQ_NONE; /* No interrupt fired by this mezzanine */
dev_dbg(&fa->fmc->dev, "Handle ADC interrupts fmc slot: %d\n", dev_dbg(fa->msgdev, "Handle ADC interrupts fmc slot: %d\n",
fmc->slot_id); fmc->slot_id);
if (status & FA_IRQ_ADC_ACQ_END) { if (status & FA_IRQ_ADC_ACQ_END) {
...@@ -375,7 +374,7 @@ irqreturn_t fa_irq_handler(int irq_core_base, void *dev_id) ...@@ -375,7 +374,7 @@ irqreturn_t fa_irq_handler(int irq_core_base, void *dev_id)
} else /* current Acquiistion has been stopped */ } else /* current Acquiistion has been stopped */
fmc_irq_ack(fmc); fmc_irq_ack(fmc);
} else { /* unexpected interrupt we have to ack anyway */ } else { /* unexpected interrupt we have to ack anyway */
dev_err(&fa->fmc->dev, dev_err(fa->msgdev,
"%s unexpected interrupt 0x%x\n", "%s unexpected interrupt 0x%x\n",
__func__, status); __func__, status);
fmc_irq_ack(fmc); fmc_irq_ack(fmc);
...@@ -391,7 +390,7 @@ int fa_setup_irqs(struct fa_dev *fa) ...@@ -391,7 +390,7 @@ int fa_setup_irqs(struct fa_dev *fa)
int err; int err;
/* Request IRQ */ /* Request IRQ */
dev_dbg(&fa->fmc->dev, "%s request irq fmc slot: %d\n", dev_dbg(fa->msgdev, "%s request irq fmc slot: %d\n",
__func__, fa->fmc->slot_id); __func__, fa->fmc->slot_id);
/* VIC svec setup */ /* VIC svec setup */
fa_writel(fa, fa->fa_irq_vic_base, fa_writel(fa, fa->fa_irq_vic_base,
...@@ -410,7 +409,7 @@ int fa_setup_irqs(struct fa_dev *fa) ...@@ -410,7 +409,7 @@ int fa_setup_irqs(struct fa_dev *fa)
"fmc-adc-100m14b", "fmc-adc-100m14b",
0 /*VIC is used */); 0 /*VIC is used */);
if (err) { if (err) {
dev_err(&fa->fmc->dev, "can't request irq %i (error %i)\n", dev_err(fa->msgdev, "can't request irq %i (error %i)\n",
fa->fmc->irq, err); fa->fmc->irq, err);
return err; return err;
} }
...@@ -450,7 +449,7 @@ int fa_free_irqs(struct fa_dev *fa) ...@@ -450,7 +449,7 @@ int fa_free_irqs(struct fa_dev *fa)
int fa_enable_irqs(struct fa_dev *fa) int fa_enable_irqs(struct fa_dev *fa)
{ {
dev_dbg(&fa->fmc->dev, "%s Enable interrupts fmc slot:%d\n", dev_dbg(fa->msgdev, "%s Enable interrupts fmc slot:%d\n",
__func__, fa->fmc->slot_id); __func__, fa->fmc->slot_id);
fa_writel(fa, fa->fa_irq_adc_base, fa_writel(fa, fa->fa_irq_adc_base,
...@@ -464,7 +463,7 @@ int fa_enable_irqs(struct fa_dev *fa) ...@@ -464,7 +463,7 @@ int fa_enable_irqs(struct fa_dev *fa)
int fa_disable_irqs(struct fa_dev *fa) int fa_disable_irqs(struct fa_dev *fa)
{ {
dev_dbg(&fa->fmc->dev, "%s Disable interrupts fmc slot:%d\n", dev_dbg(fa->msgdev, "%s Disable interrupts fmc slot:%d\n",
__func__, fa->fmc->slot_id); __func__, fa->fmc->slot_id);
fa_writel(fa, fa->fa_irq_adc_base, fa_writel(fa, fa->fa_irq_adc_base,
...@@ -480,4 +479,3 @@ int fa_ack_irq(struct fa_dev *fa, int irq_id) ...@@ -480,4 +479,3 @@ int fa_ack_irq(struct fa_dev *fa, int irq_id)
{ {
return 0; return 0;
} }
...@@ -22,7 +22,6 @@ static char *fa_spec_get_gwname(void) ...@@ -22,7 +22,6 @@ static char *fa_spec_get_gwname(void)
static int fa_spec_init(struct fa_dev *fa) static int fa_spec_init(struct fa_dev *fa)
{ {
struct device *msgdev = &fa->fmc->dev;
struct fa_spec_data *cdata; struct fa_spec_data *cdata;
uint32_t val; uint32_t val;
...@@ -39,7 +38,7 @@ static int fa_spec_init(struct fa_dev *fa) ...@@ -39,7 +38,7 @@ static int fa_spec_init(struct fa_dev *fa)
cdata->fa_irq_dma_base = cdata->fa_irq_dma_base =
fmc_find_sdb_device(fa->fmc->sdb, 0xce42, 0xd5735ab4, NULL); fmc_find_sdb_device(fa->fmc->sdb, 0xce42, 0xd5735ab4, NULL);
dev_info(msgdev, dev_info(fa->msgdev,
"Spec Base addrs: irq_dmma:0x%x, dma_ctrl:0x%x, csr:0x%x\n", "Spec Base addrs: irq_dmma:0x%x, dma_ctrl:0x%x, csr:0x%x\n",
cdata->fa_irq_dma_base, cdata->fa_dma_base, cdata->fa_irq_dma_base, cdata->fa_dma_base,
fa->fa_carrier_csr_base); fa->fa_carrier_csr_base);
...@@ -55,21 +54,21 @@ static int fa_spec_init(struct fa_dev *fa) ...@@ -55,21 +54,21 @@ static int fa_spec_init(struct fa_dev *fa)
val = fa_readl(fa, fa->fa_carrier_csr_base, val = fa_readl(fa, fa->fa_carrier_csr_base,
&fa_spec_regs[ZFA_CAR_FMC_PRES]); &fa_spec_regs[ZFA_CAR_FMC_PRES]);
if (val) { if (val) {
dev_err(msgdev, "No FCM ADC plugged\n"); dev_err(fa->msgdev, "No FCM ADC plugged\n");
return -ENODEV; return -ENODEV;
} }
/* Verify that system PLL is locked (1 is calibrated) */ /* Verify that system PLL is locked (1 is calibrated) */
val = fa_readl(fa, fa->fa_carrier_csr_base, val = fa_readl(fa, fa->fa_carrier_csr_base,
&fa_spec_regs[ZFA_CAR_SYS_PLL]); &fa_spec_regs[ZFA_CAR_SYS_PLL]);
if (!val) { if (!val) {
dev_err(msgdev, "System PLL not locked\n"); dev_err(fa->msgdev, "System PLL not locked\n");
return -ENODEV; return -ENODEV;
} }
/* Verify that DDR3 calibration is done (1 is calibrated) */ /* Verify that DDR3 calibration is done (1 is calibrated) */
val = fa_readl(fa, fa->fa_carrier_csr_base, val = fa_readl(fa, fa->fa_carrier_csr_base,
&fa_spec_regs[ZFA_CAR_DDR_CAL]); &fa_spec_regs[ZFA_CAR_DDR_CAL]);
if (!val) { if (!val) {
dev_err(msgdev, "DDR3 Calibration not done\n"); dev_err(fa->msgdev, "DDR3 Calibration not done\n");
return -ENODEV; return -ENODEV;
} }
...@@ -79,7 +78,7 @@ static int fa_spec_init(struct fa_dev *fa) ...@@ -79,7 +78,7 @@ static int fa_spec_init(struct fa_dev *fa)
/* register carrier data */ /* register carrier data */
fa->carrier_data = cdata; fa->carrier_data = cdata;
dev_info(msgdev, "spec::%s successfully executed\n", __func__); dev_info(fa->msgdev, "spec::%s successfully executed\n", __func__);
return 0; return 0;
} }
...@@ -87,7 +86,7 @@ static int fa_spec_reset(struct fa_dev *fa) ...@@ -87,7 +86,7 @@ static int fa_spec_reset(struct fa_dev *fa)
{ {
/*struct spec_dev *spec = fa->fmc->carrier_data;*/ /*struct spec_dev *spec = fa->fmc->carrier_data;*/
dev_info(&fa->fmc->dev, "%s: resetting ADC core through Gennum.\n", dev_info(fa->msgdev, "%s: resetting ADC core through Gennum.\n",
__func__); __func__);
return 0; return 0;
} }
...@@ -129,12 +128,12 @@ static int fa_spec_setup_irqs(struct fa_dev *fa) ...@@ -129,12 +128,12 @@ static int fa_spec_setup_irqs(struct fa_dev *fa)
err = fmc_irq_request(fmc, fa_spec_irq_handler, err = fmc_irq_request(fmc, fa_spec_irq_handler,
"fmc-adc-100m14b", 0); "fmc-adc-100m14b", 0);
if (err) { if (err) {
dev_err(&fmc->dev, "can't request irq 0x%x (error %i)\n", dev_err(fa->msgdev, "can't request irq 0x%x (error %i)\n",
fmc->irq, err); fmc->irq, err);
return err; return err;
} }
fmc_gpio_config(fmc, fa_gpio_on, ARRAY_SIZE(fa_gpio_on)); fmc_gpio_config(fmc, fa_gpio_on, ARRAY_SIZE(fa_gpio_on));
dev_info(&fmc->dev, "spec::%s successfully executed\n", __func__); dev_info(fa->msgdev, "spec::%s successfully executed\n", __func__);
/* Add SPEC specific IRQ sources to listen */ /* Add SPEC specific IRQ sources to listen */
fa->irq_src |= FA_IRQ_SRC_DMA; fa->irq_src |= FA_IRQ_SRC_DMA;
......
...@@ -71,7 +71,7 @@ static int gncore_dma_fill(struct zio_dma_sg *zsg) ...@@ -71,7 +71,7 @@ static int gncore_dma_fill(struct zio_dma_sg *zsg)
&fa_spec_regs[ZFA_DMA_BR_LAST], item->attribute); &fa_spec_regs[ZFA_DMA_BR_LAST], item->attribute);
} }
dev_dbg(zsg->zsgt->hwdev, "DMA item %d (block %d)\n" dev_dbg(fa->msgdev, "DMA item %d (block %d)\n"
" addr 0x%x\n" " addr 0x%x\n"
" addr_l 0x%x\n" " addr_l 0x%x\n"
" addr_h 0x%x\n" " addr_h 0x%x\n"
...@@ -148,6 +148,6 @@ void fa_spec_dma_error(struct zio_cset *cset) ...@@ -148,6 +148,6 @@ void fa_spec_dma_error(struct zio_cset *cset)
val = fa_readl(fa, spec_data->fa_dma_base, val = fa_readl(fa, spec_data->fa_dma_base,
&fa_spec_regs[ZFA_DMA_STA]); &fa_spec_regs[ZFA_DMA_STA]);
if (val) if (val)
dev_err(&fa->fmc->dev, dev_err(fa->msgdev,
"DMA error (status 0x%x). All acquisition lost\n", val); "DMA error (status 0x%x). All acquisition lost\n", val);
} }
...@@ -32,12 +32,12 @@ ...@@ -32,12 +32,12 @@
static void fa_get_irq_status(struct fa_dev *fa, int irq_core_base, static void fa_get_irq_status(struct fa_dev *fa, int irq_core_base,
uint32_t *irq_status) uint32_t *irq_status)
{ {
/* Get current interrupts status */ /* Get current interrupts status */
*irq_status = fa_readl(fa, irq_core_base, *irq_status = fa_readl(fa, irq_core_base,
&fa_spec_regs[ZFA_IRQ_DMA_SRC]); &fa_spec_regs[ZFA_IRQ_DMA_SRC]);
dev_dbg(&fa->fmc->dev, "core DMA: 0x%x fired an interrupt. IRQ status register: 0x%x\n", dev_dbg(fa->msgdev,
irq_core_base, *irq_status); "core DMA: 0x%x fired an interrupt. IRQ status register: 0x%x\n",
irq_core_base, *irq_status);
if (*irq_status) if (*irq_status)
/* Clear current interrupts status */ /* Clear current interrupts status */
fa_writel(fa, irq_core_base, fa_writel(fa, irq_core_base,
...@@ -79,7 +79,7 @@ irqreturn_t fa_spec_irq_handler(int irq_core_base, void *ptr) ...@@ -79,7 +79,7 @@ irqreturn_t fa_spec_irq_handler(int irq_core_base, void *ptr)
* with DMA with two different programs/drivers ... well *you* * with DMA with two different programs/drivers ... well *you*
* have a problem and this driver may crash badly. * have a problem and this driver may crash badly.
*/ */
dev_err(&fa->fmc->dev, dev_err(fa->msgdev,
"No programmed shot, implies no DMA to perform\n"); "No programmed shot, implies no DMA to perform\n");
goto out; goto out;
...@@ -95,7 +95,7 @@ irqreturn_t fa_spec_irq_handler(int irq_core_base, void *ptr) ...@@ -95,7 +95,7 @@ irqreturn_t fa_spec_irq_handler(int irq_core_base, void *ptr)
goto out; goto out;
} }
dev_dbg(&fa->fmc->dev, "Handle ADC interrupts\n"); dev_dbg(fa->msgdev, "Handle ADC interrupts\n");
if (status & FA_SPEC_IRQ_DMA_DONE) if (status & FA_SPEC_IRQ_DMA_DONE)
zfad_dma_done(cset); zfad_dma_done(cset);
...@@ -120,4 +120,3 @@ out: ...@@ -120,4 +120,3 @@ out:
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -103,7 +103,8 @@ int fa_svec_dma_start(struct zio_cset *cset) ...@@ -103,7 +103,8 @@ int fa_svec_dma_start(struct zio_cset *cset)
fa_dma_block[0].dev_mem_off/4); fa_dma_block[0].dev_mem_off/4);
/* Execute DMA shot by shot */ /* Execute DMA shot by shot */
for (i = 0; i < fa->n_shots; ++i) { for (i = 0; i < fa->n_shots; ++i) {
pr_debug("configure DMA descriptor shot %d " dev_dbg(fa->msgdev,
"configure DMA descriptor shot %d "
"vme addr: 0x%llx destination address: 0x%p len: %d\n", "vme addr: 0x%llx destination address: 0x%p len: %d\n",
i, (long long)vme_addr, fa_dma_block[i].block->data, i, (long long)vme_addr, fa_dma_block[i].block->data,
(int)fa_dma_block[i].block->datalen); (int)fa_dma_block[i].block->datalen);
...@@ -129,6 +130,6 @@ void fa_svec_dma_error(struct zio_cset *cset) ...@@ -129,6 +130,6 @@ void fa_svec_dma_error(struct zio_cset *cset)
{ {
struct fa_dev *fa = cset->zdev->priv_d; struct fa_dev *fa = cset->zdev->priv_d;
dev_err(&fa->fmc->dev, dev_err(fa->msgdev,
"DMA error. All acquisition lost\n"); "DMA error. All acquisition lost\n");
} }
...@@ -258,7 +258,7 @@ static int zfad_conf_set(struct device *dev, struct zio_attribute *zattr, ...@@ -258,7 +258,7 @@ static int zfad_conf_set(struct device *dev, struct zio_attribute *zattr,
break; break;
case ZFA_UTC_COARSE: case ZFA_UTC_COARSE:
if (usr_val >= FA100M14B4C_UTC_CLOCK_FREQ) { if (usr_val >= FA100M14B4C_UTC_CLOCK_FREQ) {
dev_err(dev, dev_err(fa->msgdev,
"ticks time must be in the range [0, %d]\n", "ticks time must be in the range [0, %d]\n",
FA100M14B4C_UTC_CLOCK_FREQ); FA100M14B4C_UTC_CLOCK_FREQ);
return -EINVAL; return -EINVAL;
...@@ -363,14 +363,14 @@ static inline int zfat_overflow_detection(struct zio_ti *ti) ...@@ -363,14 +363,14 @@ static inline int zfat_overflow_detection(struct zio_ti *ti)
ti_zattr[ZIO_ATTR_TRIG_POST_SAMP].value; ti_zattr[ZIO_ATTR_TRIG_POST_SAMP].value;
shot_size = ((nsamples + 2) * ti->cset->ssize) * FA100M14B4C_NCHAN; shot_size = ((nsamples + 2) * ti->cset->ssize) * FA100M14B4C_NCHAN;
if ( (shot_size * nshot_t) > FA100M14B4C_MAX_ACQ_BYTE ) { if ( (shot_size * nshot_t) > FA100M14B4C_MAX_ACQ_BYTE ) {
dev_err(&ti->head.dev, "Cannot acquire, dev memory overflow\n"); dev_err(fa->msgdev, "Cannot acquire, dev memory overflow\n");
return -ENOMEM; return -ENOMEM;
} }
/* in case of multi shot, each shot cannot exceed the dpram size */ /* in case of multi shot, each shot cannot exceed the dpram size */
if ( (nshot_t > 1) && if ( (nshot_t > 1) &&
(nsamples > fa->mshot_max_samples) ) { (nsamples > fa->mshot_max_samples) ) {
dev_err(&ti->head.dev, "Cannot acquire such amount of samples " dev_err(fa->msgdev, "Cannot acquire such amount of samples "
"(req: %d , max: %d) in multi shot mode." "(req: %d , max: %d) in multi shot mode."
"dev memory overflow\n", "dev memory overflow\n",
nsamples, fa->mshot_max_samples); nsamples, fa->mshot_max_samples);
...@@ -432,13 +432,13 @@ static int zfad_input_cset(struct zio_cset *cset) ...@@ -432,13 +432,13 @@ static int zfad_input_cset(struct zio_cset *cset)
if (err) if (err)
return err; return err;
dev_dbg(&fa->fmc->dev, "Ready to acquire\n"); dev_dbg(fa->msgdev, "Ready to acquire\n");
/* ZIO should configure only the interleaved channel */ /* ZIO should configure only the interleaved channel */
if (!cset->interleave) if (!cset->interleave)
return -EINVAL; return -EINVAL;
/* nsamples can't be 0 */ /* nsamples can't be 0 */
if (!cset->interleave->current_ctrl->nsamples) { if (!cset->interleave->current_ctrl->nsamples) {
dev_info(&fa->fmc->dev, "pre + post = 0: can't acquire\n"); dev_info(fa->msgdev, "pre + post = 0: can't acquire\n");
return -EINVAL; return -EINVAL;
} }
...@@ -484,7 +484,7 @@ static int zfad_zio_probe(struct zio_device *zdev) ...@@ -484,7 +484,7 @@ static int zfad_zio_probe(struct zio_device *zdev)
{ {
struct fa_dev *fa = zdev->priv_d; struct fa_dev *fa = zdev->priv_d;
dev_dbg(&zdev->head.dev, "%s:%d\n", __func__, __LINE__); dev_dbg(fa->msgdev, "%s:%d\n", __func__, __LINE__);
/* Save also the pointer to the real zio_device */ /* Save also the pointer to the real zio_device */
fa->zdev = zdev; fa->zdev = zdev;
...@@ -598,7 +598,6 @@ void fa_zio_unregister(void) ...@@ -598,7 +598,6 @@ void fa_zio_unregister(void)
*/ */
int fa_zio_init(struct fa_dev *fa) int fa_zio_init(struct fa_dev *fa)
{ {
struct device *msgdev = &fa->fmc->dev;
int err; int err;
if (adc_buffer) if (adc_buffer)
...@@ -607,7 +606,7 @@ int fa_zio_init(struct fa_dev *fa) ...@@ -607,7 +606,7 @@ int fa_zio_init(struct fa_dev *fa)
/* Allocate the hardware zio_device for registration */ /* Allocate the hardware zio_device for registration */
fa->hwzdev = zio_allocate_device(); fa->hwzdev = zio_allocate_device();
if (IS_ERR(fa->hwzdev)) { if (IS_ERR(fa->hwzdev)) {
dev_err(msgdev, "Cannot allocate ZIO device\n"); dev_err(fa->msgdev, "Cannot allocate ZIO device\n");
return PTR_ERR(fa->hwzdev); return PTR_ERR(fa->hwzdev);
} }
...@@ -619,7 +618,7 @@ int fa_zio_init(struct fa_dev *fa) ...@@ -619,7 +618,7 @@ int fa_zio_init(struct fa_dev *fa)
err = zio_register_device(fa->hwzdev, "adc-100m14b", err = zio_register_device(fa->hwzdev, "adc-100m14b",
fa->fmc->device_id); fa->fmc->device_id);
if (err) { if (err) {
dev_err(msgdev, "Cannot register ZIO device fmc-adc-100m14b\n"); dev_err(fa->msgdev, "Cannot register ZIO device fmc-adc-100m14b\n");
zio_free_device(fa->hwzdev); zio_free_device(fa->hwzdev);
} }
return err; return err;
......
...@@ -104,13 +104,13 @@ static int zfat_conf_set(struct device *dev, struct zio_attribute *zattr, ...@@ -104,13 +104,13 @@ static int zfat_conf_set(struct device *dev, struct zio_attribute *zattr,
switch (zattr->id) { switch (zattr->id) {
case ZFAT_SHOTS_NB: case ZFAT_SHOTS_NB:
if (!tmp_val) { if (!tmp_val) {
dev_err(dev, "nshots cannot be 0\n"); dev_err(fa->msgdev, "nshots cannot be 0\n");
return -EINVAL; return -EINVAL;
} }
break; break;
case ZFAT_POST: case ZFAT_POST:
if (tmp_val < 2) { if (tmp_val < 2) {
dev_err(dev, "minimum post samples 2 (HW limitation)\n"); dev_err(fa->msgdev, "minimum post samples 2 (HW limitation)\n");
return -EINVAL; return -EINVAL;
} }
tmp_val--; /* Remove one sample for the trigger */ tmp_val--; /* Remove one sample for the trigger */
...@@ -118,12 +118,12 @@ static int zfat_conf_set(struct device *dev, struct zio_attribute *zattr, ...@@ -118,12 +118,12 @@ static int zfat_conf_set(struct device *dev, struct zio_attribute *zattr,
case ZFAT_SW: case ZFAT_SW:
/* Fire if software trigger is enabled (index 5) */ /* Fire if software trigger is enabled (index 5) */
if (!ti->zattr_set.ext_zattr[FA100M14B4C_TATTR_SW_EN].value) { if (!ti->zattr_set.ext_zattr[FA100M14B4C_TATTR_SW_EN].value) {
dev_info(dev, "sw trigger is not enabled\n"); dev_info(fa->msgdev, "sw trigger is not enabled\n");
return -EPERM; return -EPERM;
} }
/* Fire if nsamples!=0 */ /* Fire if nsamples!=0 */
if (!ti->nsamples) { if (!ti->nsamples) {
dev_info(dev, "pre + post = 0: cannot acquire\n"); dev_info(fa->msgdev, "pre + post = 0: cannot acquire\n");
return -EINVAL; return -EINVAL;
} }
/* /*
...@@ -191,7 +191,7 @@ static struct zio_ti *zfat_create(struct zio_trigger_type *trig, ...@@ -191,7 +191,7 @@ static struct zio_ti *zfat_create(struct zio_trigger_type *trig,
if (!fa) { if (!fa) {
/* This only happens if we have a bug in the init sequence */ /* This only happens if we have a bug in the init sequence */
dev_err(&cset->head.dev, "No FMC device associated\n"); dev_err(fa->msgdev, "No FMC device associated\n");
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
...@@ -259,7 +259,7 @@ static int zfat_data_done(struct zio_cset *cset) ...@@ -259,7 +259,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->dev, "Data done\n"); dev_dbg(fa->msgdev, "Data done\n");
/* Nothing to store */ /* Nothing to store */
if (!zfad_block) if (!zfad_block)
...@@ -268,11 +268,11 @@ static int zfat_data_done(struct zio_cset *cset) ...@@ -268,11 +268,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->dev, "Store Block %i/%i\n", dev_dbg(fa->msgdev, "Store Block %i/%i\n",
i + 1, fa->n_shots); i + 1, fa->n_shots);
zio_buffer_store_block(bi, zfad_block[i].block); zio_buffer_store_block(bi, zfad_block[i].block);
} else { /* Free un-filled blocks */ } else { /* Free un-filled blocks */
dev_dbg(&fa->fmc->dev, "Free un-acquired block %d/%d " dev_dbg(fa->msgdev, "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);
zio_buffer_free_block(bi, zfad_block[i].block); zio_buffer_free_block(bi, zfad_block[i].block);
...@@ -297,7 +297,6 @@ static int zfat_arm_trigger(struct zio_ti *ti) ...@@ -297,7 +297,6 @@ static int zfat_arm_trigger(struct zio_ti *ti)
{ {
struct zio_channel *interleave = ti->cset->interleave; struct zio_channel *interleave = ti->cset->interleave;
struct fa_dev *fa = ti->cset->zdev->priv_d; struct fa_dev *fa = ti->cset->zdev->priv_d;
struct device *msgdev = &fa->fmc->dev;
struct zio_block *block; struct zio_block *block;
struct zfad_block *zfad_block; struct zfad_block *zfad_block;
unsigned int size; unsigned int size;
...@@ -305,17 +304,17 @@ static int zfat_arm_trigger(struct zio_ti *ti) ...@@ -305,17 +304,17 @@ static int zfat_arm_trigger(struct zio_ti *ti)
int i, err = 0; int i, err = 0;
struct zio_attribute *ti_zattr = ti->zattr_set.std_zattr; struct zio_attribute *ti_zattr = ti->zattr_set.std_zattr;
dev_dbg(msgdev, "Arming trigger\n"); dev_dbg(fa->msgdev, "Arming trigger\n");
/* Update the current control: sequence, nsamples and tstamp */ /* Update the current control: sequence, nsamples and tstamp */
interleave->current_ctrl->nsamples = ti->nsamples; interleave->current_ctrl->nsamples = ti->nsamples;
/* Allocate the necessary blocks for multi-shot acquisition */ /* Allocate the necessary blocks for multi-shot acquisition */
fa->n_shots = ti->zattr_set.std_zattr[ZIO_ATTR_TRIG_N_SHOTS].value; fa->n_shots = ti->zattr_set.std_zattr[ZIO_ATTR_TRIG_N_SHOTS].value;
dev_dbg(msgdev, "programmed shot %i\n", fa->n_shots); dev_dbg(fa->msgdev, "programmed shot %i\n", fa->n_shots);
if (!fa->n_shots) { if (!fa->n_shots) {
dev_info(msgdev, "Cannot arm. No programmed shots\n"); dev_info(fa->msgdev, "Cannot arm. No programmed shots\n");
return -EINVAL; return -EINVAL;
} }
...@@ -344,7 +343,7 @@ static int zfat_arm_trigger(struct zio_ti *ti) ...@@ -344,7 +343,7 @@ static int zfat_arm_trigger(struct zio_ti *ti)
/* check if size is 32 bits word aligned: should be always the case */ /* check if size is 32 bits word aligned: should be always the case */
if (size % 4) { if (size % 4) {
/* should never happen: increase the size accordling */ /* should never happen: increase the size accordling */
dev_warn(msgdev, dev_warn(fa->msgdev,
"\nzio data block size should 32bit word aligned." "\nzio data block size should 32bit word aligned."
"original size:%d was increased by %d bytes\n", "original size:%d was increased by %d bytes\n",
size, size%4); size, size%4);
...@@ -353,11 +352,11 @@ static int zfat_arm_trigger(struct zio_ti *ti) ...@@ -353,11 +352,11 @@ static int zfat_arm_trigger(struct zio_ti *ti)
dev_mem_off = 0; dev_mem_off = 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(msgdev, "Allocating block %d ...\n", i); dev_dbg(fa->msgdev, "Allocating block %d ...\n", i);
block = zio_buffer_alloc_block(interleave->bi, size, block = zio_buffer_alloc_block(interleave->bi, size,
GFP_ATOMIC); GFP_ATOMIC);
if (!block) { if (!block) {
dev_err(msgdev, dev_err(fa->msgdev,
"\narm trigger fail, cannot allocate block\n"); "\narm trigger fail, cannot allocate block\n");
err = -ENOMEM; err = -ENOMEM;
goto out_allocate; goto out_allocate;
...@@ -369,7 +368,7 @@ static int zfat_arm_trigger(struct zio_ti *ti) ...@@ -369,7 +368,7 @@ static int zfat_arm_trigger(struct zio_ti *ti)
zfad_block[i].block = block; zfad_block[i].block = block;
zfad_block[i].dev_mem_off = dev_mem_off; zfad_block[i].dev_mem_off = dev_mem_off;
dev_mem_off += size; dev_mem_off += size;
dev_dbg(msgdev, "next dev_mem_off 0x%x (+%d)\n", dev_dbg(fa->msgdev, "next dev_mem_off 0x%x (+%d)\n",
dev_mem_off, size); dev_mem_off, size);
} }
...@@ -402,7 +401,7 @@ static void zfat_abort(struct zio_ti *ti) ...@@ -402,7 +401,7 @@ static void zfat_abort(struct zio_ti *ti)
struct zfad_block *zfad_block = cset->interleave->priv_d; struct zfad_block *zfad_block = cset->interleave->priv_d;
unsigned int i; unsigned int i;
dev_dbg(&fa->fmc->dev, "Aborting trigger\n"); dev_dbg(fa->msgdev, "Aborting trigger\n");
/* Nothing to free */ /* Nothing to free */
if (!zfad_block) if (!zfad_block)
...@@ -419,7 +418,10 @@ static void zfat_abort(struct zio_ti *ti) ...@@ -419,7 +418,10 @@ static void zfat_abort(struct zio_ti *ti)
static int zfat_push(struct zio_ti *ti, struct zio_channel *chan, static int zfat_push(struct zio_ti *ti, struct zio_channel *chan,
struct zio_block *block) struct zio_block *block)
{ {
dev_err(&ti->head.dev, "trigger \"%s\" does not support output\n", struct zio_cset *cset = ti->cset;
struct fa_dev *fa = cset->zdev->priv_d;
dev_err(fa->msgdev, "trigger \"%s\" does not support output\n",
ti->head.name); ti->head.name);
return -EIO; return -EIO;
} }
......
...@@ -309,6 +309,7 @@ struct fa_calib { ...@@ -309,6 +309,7 @@ struct fa_calib {
* *
*/ */
struct fa_dev { struct fa_dev {
struct device *msgdev; /**< device used to print messages */
/* the pointer to the fmc_device generic structure */ /* the pointer to the fmc_device generic structure */
struct fmc_device *fmc; struct fmc_device *fmc;
/* the pointer to the real zio_device in use */ /* the pointer to the real zio_device in use */
...@@ -461,7 +462,7 @@ static inline void fa_writel(struct fa_dev *fa, ...@@ -461,7 +462,7 @@ static inline void fa_writel(struct fa_dev *fa,
cur &= ~field->mask; /* clear bits according to the mask */ cur &= ~field->mask; /* clear bits according to the mask */
val = usr_val * (field->mask & -(field->mask)); val = usr_val * (field->mask & -(field->mask));
if (val & ~field->mask) if (val & ~field->mask)
dev_warn(fa->fmc->hwdev, dev_warn(fa->msgdev,
"addr 0x%lx: value 0x%x doesn't fit mask 0x%x\n", "addr 0x%lx: value 0x%x doesn't fit mask 0x%x\n",
base_off+field->offset, val, field->mask); base_off+field->offset, val, field->mask);
val &= field->mask; val &= field->mask;
......
...@@ -56,7 +56,7 @@ int fa_spi_xfer(struct fa_dev *fa, int cs, int num_bits, ...@@ -56,7 +56,7 @@ int fa_spi_xfer(struct fa_dev *fa, int cs, int num_bits,
while (fa_ioread(fa, fa->fa_spi_base + FA_SPI_CTRL) while (fa_ioread(fa, fa->fa_spi_base + FA_SPI_CTRL)
& FA_SPI_CTRL_BUSY) { & FA_SPI_CTRL_BUSY) {
if (jiffies > j) { if (jiffies > j) {
dev_err(&fa->fmc->dev, "SPI transfer error\n"); dev_err(fa->msgdev, "SPI transfer error\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -89,7 +89,7 @@ int fa_spi_init(struct fa_dev *fa) ...@@ -89,7 +89,7 @@ int fa_spi_init(struct fa_dev *fa)
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
tx = 0x8000 | (i << 8); tx = 0x8000 | (i << 8);
fa_spi_xfer(fa, FA_SPI_SS_ADC, 16, tx, &rx); fa_spi_xfer(fa, FA_SPI_SS_ADC, 16, tx, &rx);
dev_dbg(&fa->fmc->dev, "LTC register %02x: 0x%02x\n", dev_dbg(fa->msgdev, "LTC register %02x: 0x%02x\n",
i, rx & 0xff); i, rx & 0xff);
} }
} }
......
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