Commit 353f92ed authored by Federico Vaga's avatar Federico Vaga

fmc-adc: update the driver to fmc-bus version 1.0

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent 48dc3381
......@@ -5,7 +5,7 @@ SPEC_SW ?= $(HOME)/spec-sw
KBUILD_EXTRA_SYMBOLS := $(ZIO)/Module.symvers $(SPEC_SW)/kernel/Module.symvers
ccflags-y = -I$(ZIO)/include -I$(SPEC_SW)/kernel -I$(SPEC_SW)/kernel/include -I$M
ccflags-y = -I$(ZIO)/include -I$(SPEC_SW)/fmc-bus/kernel/include -I$(SPEC_SW)/kernel -I$M
ccflags-y += -DDEBUG # temporary
......
......@@ -85,6 +85,7 @@ int fa_remove(struct fmc_device *fmc)
return 0;
}
static struct fmc_driver fa_dev__drv = {
.version = FMC_VERSION,
.driver.name = KBUILD_MODNAME,
.probe = fa_probe,
.remove = fa_remove,
......
......@@ -412,6 +412,14 @@ static irqreturn_t zfadc_irq(int irq, void *ptr)
return IRQ_HANDLED;
}
struct fmc_gpio zfat_gpio_cfg[] = {
{
.gpio = FMC_GPIO_IRQ(0),
.mode = GPIOF_DIR_IN,
.irqmode = IRQF_TRIGGER_RISING,
}
};
/* create an instance of the FMC-ADC trigger */
static struct zio_ti *zfat_create(struct zio_trigger_type *trig,
struct zio_cset *cset,
......@@ -431,6 +439,11 @@ static struct zio_ti *zfat_create(struct zio_trigger_type *trig,
return ERR_PTR(-ENOMEM);
zfat->fa = fa;
/* Configure GPIO for IRQ */
fa->fmc->op->gpio_config(fa->fmc, zfat_gpio_cfg,
ARRAY_SIZE(zfat_gpio_cfg));
/* Request IRQ */
err = fa->fmc->op->irq_request(fa->fmc, zfadc_irq, "fmc-adc",
IRQF_SHARED);
if (err) {
......
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