Commit 85bc40be authored by Jorge Machado's avatar Jorge Machado

Adapt kernel sources to the new structure

parent a3efe86e
......@@ -20,7 +20,10 @@ ccflags-y += -DGIT_VERSION=\"$(GIT_VERSION)\"
obj-m += wr-dio.o
wr-dio-y = fmc-dio.o
wr-dio-y = ./hw/wr-dio-regs.o
wr-dio-y += ./hw/wr-dio-regs_v1.o
wr-dio-y += ./hw/wr-dio-regs_v2.o
wr-dio-y += fmc-dio.o
wr-dio-y += fmc-dio-internal.o
wr-dio-y += fmc-dio-mdev.o
wr-dio-y += fmc-dio-gpio.o
\ No newline at end of file
This diff is collapsed.
......@@ -55,7 +55,7 @@ static int fmc_dio_resource_map(struct fmc_dio *dio)
{
int i,err;
struct platform_device *dev = dio->pdev;
struct fmc_device *fmc = dio->fmc;
//struct fmc_device *fmc = dio->fmc;
struct resource *r;
void __iomem *mem;
......@@ -171,6 +171,18 @@ static int fmc_dio_pl_probe(struct platform_device *dev)
dio->board = dev->id_entry->driver_data;
dio->pdev = dev;
dio->version = dio->board;
if(dio->version == FMC_DIO_BOARD_SPEC) {
printk("DIO driver. Detected DIO V1");
}
else if(dio->version == FMC_DIOv2_BOARD_SPEC) {
printk("DIO driver. Detected DIO V2");
}
else{
printk("DIO driver. DIO not detected");
}
/* Map the resources for the FMC DIO */
ret = fmc_dio_resource_map(dio);
if(ret)
......@@ -239,6 +251,10 @@ static const struct platform_device_id fmc_dio_id_table[] = {
.name = "fmc-dio-spec",
.driver_data = FMC_DIO_BOARD_SPEC,
},
{ /* SPEC compatible */
.name = "fmc-diov2-spec",
.driver_data = FMC_DIOv2_BOARD_SPEC,
},
{},
};
......
......@@ -52,6 +52,7 @@ struct fmc_dio_gpio_block {
/* Board constants */
#define FMC_DIO_BOARD_SPEC 0
#define FMC_DIOv2_BOARD_SPEC 1
/**
* @brief FMC DIO structure
......@@ -74,6 +75,8 @@ struct fmc_dio {
int board; /**< Board info */
int version; //*< HDL version */
void *priv; /**< Private data for FMC DIO */
};
......@@ -104,6 +107,7 @@ enum wr_dio_cmd_name {
WR_DIO_CMD_STAMP,
WR_DIO_CMD_DAC,
WR_DIO_CMD_INOUT,
WR_DIO_CMD_IRQ,
};
/*
......
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