From: H Hartley Sweeten Date: Mon, 14 Jul 2014 19:23:46 +0000 (-0700) Subject: staging: comedi: ni_mio_common: remove INSN_CONFIG_ANALOG_TRIG support code X-Git-Tag: v3.17-rc1~123^2~686 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ab15dce7e963c115cc063643cd6f50c55b606268;p=karo-tx-linux.git staging: comedi: ni_mio_common: remove INSN_CONFIG_ANALOG_TRIG support code None of the boardinfo that uses this code sets the 'has_analog_trig' flag so ni_ai_config_analog_trig() always returns -EINVAL. Also, the private data 'atrig_low', 'atrig_high', and 'atrig_mode' values that are set by ni_ai_config_analog_trig() are never used. Remove the incomplete INSN_CONFIG_ANALOG_TRIG support along with the unused boardinfo and private data members. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 13270b348f82..8854f18eaa16 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -2732,106 +2732,6 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) return 0; } -static int ni_ai_config_analog_trig(struct comedi_device *dev, - struct comedi_subdevice *s, - struct comedi_insn *insn, - unsigned int *data) -{ - const struct ni_board_struct *board = comedi_board(dev); - struct ni_private *devpriv = dev->private; - unsigned int a, b, modebits; - int err = 0; - - /* data[1] is flags - * data[2] is analog line - * data[3] is set level - * data[4] is reset level */ - if (!board->has_analog_trig) - return -EINVAL; - if ((data[1] & 0xffff0000) != COMEDI_EV_SCAN_BEGIN) { - data[1] &= (COMEDI_EV_SCAN_BEGIN | 0xffff); - err++; - } - if (data[2] >= board->n_adchan) { - data[2] = board->n_adchan - 1; - err++; - } - if (data[3] > 255) { /* a */ - data[3] = 255; - err++; - } - if (data[4] > 255) { /* b */ - data[4] = 255; - err++; - } - /* - * 00 ignore - * 01 set - * 10 reset - * - * modes: - * 1 level: +b- +a- - * high mode 00 00 01 10 - * low mode 00 00 10 01 - * 2 level: (a> 4); - } - devpriv->atrig_low = a; - devpriv->atrig_high = b; - switch (modebits) { - case 0x81: /* low hysteresis mode */ - devpriv->atrig_mode = 6; - break; - case 0x42: /* high hysteresis mode */ - devpriv->atrig_mode = 3; - break; - case 0x96: /* middle window mode */ - devpriv->atrig_mode = 2; - break; - default: - data[1] &= ~0xff; - err++; - } - } else { - /* one level mode */ - if (b != 0) { - data[4] = 0; - err++; - } - switch (modebits) { - case 0x06: /* high window mode */ - devpriv->atrig_high = a; - devpriv->atrig_mode = 0; - break; - case 0x09: /* low window mode */ - devpriv->atrig_low = a; - devpriv->atrig_mode = 1; - break; - default: - data[1] &= ~0xff; - err++; - } - } - if (err) - return -EAGAIN; - return 5; -} - static int ni_ai_insn_config(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) @@ -2842,8 +2742,6 @@ static int ni_ai_insn_config(struct comedi_device *dev, return -EINVAL; switch (data[0]) { - case INSN_CONFIG_ANALOG_TRIG: - return ni_ai_config_analog_trig(dev, s, insn, data); case INSN_CONFIG_ALT_SOURCE: if (devpriv->is_m_series) { if (data[1] & ~(MSeries_AI_Bypass_Cal_Sel_Pos_Mask | diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index bcb3835b23c9..2b937d37ae9b 100644 --- a/drivers/staging/comedi/drivers/ni_stc.h +++ b/drivers/staging/comedi/drivers/ni_stc.h @@ -1410,7 +1410,6 @@ struct ni_board_struct { int reg_type; unsigned int has_8255:1; - unsigned int has_analog_trig:1; enum caldac_enum caldac[3]; }; @@ -1471,10 +1470,6 @@ struct ni_private { unsigned clock_ns; unsigned clock_source; - unsigned short atrig_mode; - unsigned short atrig_high; - unsigned short atrig_low; - unsigned short pwm_up_count; unsigned short pwm_down_count;