Commit c7c14486 authored by Federico Vaga's avatar Federico Vaga

fmc-adc: remove code dependency to spec-sw

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent 202c78de
[submodule "spec-sw"]
path = spec-sw
url = git@ohwr.org:fmc-projects/spec/spec-sw.git
[submodule "zio"]
path = zio
url = git@ohwr.org:misc/zio.git
......
......@@ -17,9 +17,8 @@ gitmodules:
# The user can override, using environment variables, all these three:
FMC_BUS ?= fmc-bus
SPEC_SW ?= spec-sw
ZIO ?= zio
SUBMOD = $(FMC_BUS) $(SPEC_SW) $(ZIO)
SUBMOD = $(FMC_BUS) $(ZIO)
prereq:
for d in $(SUBMOD); do $(MAKE) -C $$d || exit 1; done
......
LINUX ?= /lib/modules/$(shell uname -r)/build
ZIO ?= $(M)/../zio
SPEC_SW ?= $(M)/../spec-sw
FMC_BUS ?= $(M)/../fmc-bus
KBUILD_EXTRA_SYMBOLS := \
$(ZIO)/Module.symvers \
$(SPEC_SW)/kernel/Module.symvers \
$(FMC_BUS)/kernel/Module.symvers
ccflags-y = \
-I$(ZIO)/include \
-I$(SPEC_SW)/kernel \
-I$(SPEC_SW)/kernel/include \
-I$(FMC_BUS)/kernel/include \
-I$M
......
......@@ -10,7 +10,9 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include "spec.h"
#include <linux/fmc.h>
#include "fmc-adc.h"
static struct fmc_driver fa_dev_drv;
......@@ -37,10 +39,6 @@ int fa_probe(struct fmc_device *fmc)
struct fa_dev *fa;
int err, i = 0;
if (strcmp(fmc->carrier_name, "SPEC")) {
dev_err(fmc->hwdev, "ADC work only on spec\n");
return -EINVAL;
}
pr_info("%s:%d\n", __func__, __LINE__);
/* Driver data */
fa = devm_kzalloc(&fmc->dev, sizeof(struct fa_dev), GFP_KERNEL);
......@@ -49,7 +47,7 @@ int fa_probe(struct fmc_device *fmc)
fmc_set_drvdata(fmc, fa);
fa->fmc = fmc;
/* We first write a new binary (and lm32) within the spec */
/* We first write a new binary (and lm32) within the carrier */
err = fmc->op->reprogram(fmc, &fa_dev_drv, fa_binaries);
if (err) {
dev_err(fmc->hwdev, "write firmware \"%s\": error %i\n",
......
......@@ -14,11 +14,12 @@
#include <linux/dma-mapping.h>
#include <linux/scatterlist.h>
#include <linux/fmc.h>
#include <linux/zio.h>
#include <linux/zio-buffer.h>
#include <linux/zio-trigger.h>
#include "spec.h"
#include "fmc-adc.h"
......
......@@ -15,12 +15,13 @@
#include <linux/time.h>
#include <linux/delay.h>
#include <linux/fmc.h>
#include <linux/zio.h>
#include <linux/zio-buffer.h>
#include <linux/zio-trigger.h>
#include <linux/zio-utils.h>
#include "spec.h"
#include "fmc-adc.h"
int enable_auto_start = 0;
......@@ -1078,9 +1079,7 @@ void fa_zio_unregister(void)
int fa_zio_init(struct fa_dev *fa)
{
struct device *hwdev = fa->fmc->hwdev;
struct spec_dev *spec = fa->fmc->carrier_data;
struct pci_dev *pdev = spec->pdev;
uint32_t dev_id, val;
uint32_t val;
int err;
/* Check if hardware supports 64-bit DMA */
......@@ -1132,11 +1131,8 @@ int fa_zio_init(struct fa_dev *fa)
fa->hwzdev->owner = THIS_MODULE;
fa->hwzdev->priv_d = fa;
/* Our dev_id is bus+devfn */
dev_id = (pdev->bus->number << 8) | pdev->devfn;
/* Register the hardware zio_device */
err = zio_register_device(fa->hwzdev, "fmc-adc", dev_id);
err = zio_register_device(fa->hwzdev, "fmc-adc", fa->fmc->device_id);
if (err) {
dev_err(hwdev, "Cannot register ZIO device fmc-adc\n");
goto out_dev;
......
......@@ -13,13 +13,14 @@
#include <linux/dma-mapping.h>
#include <linux/scatterlist.h>
#include <linux/fmc.h>
#include <linux/zio.h>
#include <linux/zio-sysfs.h>
#include <linux/zio-buffer.h>
#include <linux/zio-trigger.h>
#include <linux/zio-utils.h>
#include "spec.h"
#include "fmc-adc.h"
struct zfat_instance {
......
......@@ -7,10 +7,12 @@
#ifndef _fa_dev_H_
#define _fa_dev_H_
#include <linux/scatterlist.h>
#include <linux/fmc.h>
#include <linux/zio.h>
#include <linux/zio-utils.h>
#include "spec.h"
#define FA_GATEWARE_DEFAULT_NAME "fmc/fmc-adc.bin"
......@@ -77,7 +79,6 @@ struct dma_item {
* fa_dev: is the descriptor of the FMC ADC mezzanine
*
* @fmc: the pointer to the fmc_device generic structure
* @spec: this driver depends on spec (FIXME no svec at the moment)
* @zdev: is the pointer to the real zio_device in use
* @hwzdev: is the pointer to the fake zio_device, used to initialize and
* to remove a zio_device
......@@ -90,7 +91,6 @@ struct dma_item {
*/
struct fa_dev {
struct fmc_device *fmc;
struct spec_dev *spec;
struct zio_device *zdev;
struct zio_device *hwzdev;
......@@ -333,11 +333,6 @@ static inline struct fa_dev *get_zfadc(struct device *dev)
return NULL;
}
static inline struct spec_dev *get_spec(struct device *dev)
{
return get_zfadc(dev)->spec;
}
static inline int zfa_common_conf_set(struct fa_dev *fa,
enum zfadc_dregs_enum index,
uint32_t usr_val)
......
spec-sw @ 54fa87ec
Subproject commit 54fa87ecd2330f20361f1571a60ca0e972783e01
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