Commit a814a6f0 authored by Federico Vaga's avatar Federico Vaga Committed by Federico Vaga

kernel: read temp when necessary

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 0800471f
......@@ -146,8 +146,6 @@ struct fmctdc_dev {
struct zio_device *zdev, *hwzdev;
/* is acquisition mode active? */
int acquisition_on;
/* temperature readout timer */
struct timer_list temp_timer;
/* carrier specific functions (init/exit/reset/readout/irq handling) */
struct ft_carrier_specific *carrier_specific;
/* carrier private data */
......
......@@ -47,15 +47,6 @@ module_param_named(buffer_size, ft_buffer_size, int, 0444);
MODULE_PARM_DESC(verbose,
"Number of timestamps in each channel's software FIFO buffer.");
static void ft_temp_timer_handler(unsigned long arg)
{
struct fmctdc_dev *ft = (struct fmctdc_dev *)arg;
ft_read_temp(ft, ft->verbose);
mod_timer(&ft->temp_timer, jiffies + 5 * HZ);
}
static int ft_init_channel(struct fmctdc_dev *ft, int channel)
{
struct ft_channel_state *st = &ft->channels[channel - 1];
......@@ -305,10 +296,6 @@ int ft_probe(struct fmc_device *fmc)
ft_enable_acquisition(ft, 1);
/* start temperature polling timer */
setup_timer(&ft->temp_timer, ft_temp_timer_handler, (unsigned long)ft);
mod_timer(&ft->temp_timer, jiffies + 5 * HZ);
ft->initialized = 1;
return 0;
......@@ -329,8 +316,6 @@ int ft_remove(struct fmc_device *fmc)
if (!ft->initialized)
return 0; /* No init, no exit */
del_timer_sync(&ft->temp_timer);
ft_enable_acquisition(ft, 0);
ft_irq_exit(ft);
......
......@@ -42,7 +42,7 @@ static struct zio_attribute ft_zattr_dev[] = {
ZIO_ATTR_EXT("coarse", _RW_, FT_ATTR_DEV_COARSE, 0),
ZIO_ATTR_EXT("command", S_IWUGO, FT_ATTR_DEV_COMMAND, 0),
ZIO_ATTR_EXT("enable_inputs", _RW_, FT_ATTR_DEV_ENABLE_INPUTS, 0),
ZIO_ATTR_EXT("temperature", S_IRUGO, FT_ATTR_DEV_TEMP, 0)
ZIO_PARAM_EXT("temperature", S_IRUGO, FT_ATTR_DEV_TEMP, 0)
};
/* Extended attributes for the TDC (== input) cset */
......@@ -125,14 +125,9 @@ static int ft_zio_info_get(struct device *dev, struct zio_attribute *zattr,
return 0;
case FT_ATTR_DEV_TEMP:
if (ft->temp_ready) {
attr[FT_ATTR_DEV_TEMP].value = ft->temp;
*usr_val = ft->temp;
return 0;
} else
return -EAGAIN;
ft_read_temp(ft, ft->verbose);
*usr_val = ft->temp;
return 0;
case FT_ATTR_DEV_COARSE:
case FT_ATTR_DEV_SECONDS:
{
......
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