Commit bd1e41c4 authored by Miguel Gómez Sexto's avatar Miguel Gómez Sexto

tdc: Added device attributes time threshold and timestamps threshold

Signed-off-by: Miguel Gómez Sexto's avatarMiguel Gómez <magomez@igalia.com>
parent 97475890
......@@ -22,12 +22,19 @@
#include "tdc.h"
#include "hw/tdc_regs.h"
#define _RW_ (S_IRUGO | S_IWUGO) /* I want 80-col lines so this lazy thing */
/* The sample size. Mandatory, device-wide */
DEFINE_ZATTR_STD(ZDEV, tdc_zattr_dev_std) = {
ZATTR_REG(zdev, ZATTR_NBITS, S_IRUGO, 0, 32), /* FIXME: 32 bits. Really? */
};
static struct zio_attribute tdc_zattr_dev[] = {
ZATTR_EXT_REG("version", S_IRUGO, TDC_ATTR_DEV_VERSION, TDC_VERSION),
ZATTR_EXT_REG("tstamps-thresh", _RW_, TDC_ATTR_DEV_TSTAMPS_THRESH, 100),
ZATTR_EXT_REG("time-thresh", _RW_, TDC_ATTR_DEV_TIME_THRESH, 100),
};
static struct zio_cset tdc_cset[] = {
{
SET_OBJECT_NAME("tdc-test"), /* TODO: change name and complete */
......@@ -55,7 +62,8 @@ static struct zio_device tdc_tmpl = {
.n_cset = ARRAY_SIZE(tdc_cset),
.zattr_set = {
.std_zattr = tdc_zattr_dev_std,
.ext_zattr = NULL, /* TODO: */
.ext_zattr = tdc_zattr_dev,
.n_ext_attr = ARRAY_SIZE(tdc_zattr_dev),
},
};
......
#ifndef __FMC_TDC_H__
#define __FMC_TDC_H__
#define TDC_VERSION 1
struct spec_tdc {
struct spec_dev *spec;
struct zio_device *zdev, *hwzdev;
......@@ -9,6 +11,14 @@ struct spec_tdc {
unsigned char __iomem *gn412x_regs;
};
/* Device-wide ZIO attributes */
enum tdc_zattr_dev_idx {
TDC_ATTR_DEV_VERSION = 0,
TDC_ATTR_DEV_TSTAMPS_THRESH,
TDC_ATTR_DEV_TIME_THRESH,
TDC_ATTR_DEV__LAST,
};
extern int tdc_zio_register_device(struct spec_tdc *tdc);
extern void tdc_zio_remove(struct spec_tdc *tdc);
extern int tdc_zio_init(void);
......
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