Lines Matching refs:scan_index
233 .scan_index = _scan_index, \
244 .scan_index = _scan_index, \
418 scan_mask |= BIT_ULL(indio_dev->channels[i].scan_index); in ams_enable_channel_sequence()
687 if (chan->scan_index >= AMS_CTRL_SEQ_BASE) { in ams_read_raw()
692 } else if (chan->scan_index >= AMS_PS_SEQ_MAX) in ams_read_raw()
704 if (chan->scan_index < AMS_PS_SEQ_MAX) in ams_read_raw()
706 else if (chan->scan_index >= AMS_PS_SEQ_MAX && in ams_read_raw()
707 chan->scan_index < AMS_CTRL_SEQ_BASE) in ams_read_raw()
730 static int ams_get_alarm_offset(int scan_index, enum iio_event_direction dir) in ams_get_alarm_offset() argument
734 if (scan_index >= AMS_PS_SEQ_MAX) in ams_get_alarm_offset()
735 scan_index -= AMS_PS_SEQ_MAX; in ams_get_alarm_offset()
738 if (scan_index < AMS_SEQ_SUPPLY7) in ams_get_alarm_offset()
746 switch (scan_index) { in ams_get_alarm_offset()
781 int scan_index = 0, i; in ams_event_to_channel() local
785 scan_index = AMS_PS_SEQ_MAX; in ams_event_to_channel()
790 scan_index += AMS_SEQ_TEMP; in ams_event_to_channel()
793 scan_index += AMS_SEQ_SUPPLY1; in ams_event_to_channel()
796 scan_index += AMS_SEQ_SUPPLY2; in ams_event_to_channel()
799 scan_index += AMS_SEQ_SUPPLY3; in ams_event_to_channel()
802 scan_index += AMS_SEQ_SUPPLY4; in ams_event_to_channel()
805 scan_index += AMS_SEQ_SUPPLY5; in ams_event_to_channel()
808 scan_index += AMS_SEQ_SUPPLY6; in ams_event_to_channel()
811 scan_index += AMS_SEQ_SUPPLY7; in ams_event_to_channel()
814 scan_index += AMS_SEQ_SUPPLY8; in ams_event_to_channel()
817 scan_index += AMS_SEQ_SUPPLY9; in ams_event_to_channel()
820 scan_index += AMS_SEQ_SUPPLY10; in ams_event_to_channel()
823 scan_index += AMS_SEQ_VCCAMS; in ams_event_to_channel()
826 scan_index += AMS_SEQ_TEMP_REMOTE; in ams_event_to_channel()
833 if (dev->channels[i].scan_index == scan_index) in ams_event_to_channel()
839 static int ams_get_alarm_mask(int scan_index) in ams_get_alarm_mask() argument
843 if (scan_index >= AMS_PS_SEQ_MAX) { in ams_get_alarm_mask()
845 scan_index -= AMS_PS_SEQ_MAX; in ams_get_alarm_mask()
848 switch (scan_index) { in ams_get_alarm_mask()
887 return !!(ams->alarm_mask & ams_get_alarm_mask(chan->scan_index)); in ams_read_event_config()
899 alarm = ams_get_alarm_mask(chan->scan_index); in ams_write_event_config()
922 unsigned int offset = ams_get_alarm_offset(chan->scan_index, dir); in ams_read_event_value()
926 if (chan->scan_index >= AMS_PS_SEQ_MAX) in ams_read_event_value()
949 offset = ams_get_alarm_offset(chan->scan_index, IIO_EV_DIR_FALLING); in ams_write_event_value()
951 if (chan->scan_index >= AMS_PS_SEQ_MAX) in ams_write_event_value()
961 offset = ams_get_alarm_offset(chan->scan_index, dir); in ams_write_event_value()
962 if (chan->scan_index >= AMS_PS_SEQ_MAX) in ams_write_event_value()
1301 if (ams_channels[i].scan_index < AMS_CTRL_SEQ_BASE) { in ams_parse_firmware()
1304 ams_get_alarm_offset(ams_channels[i].scan_index, in ams_parse_firmware()
1307 ams_get_alarm_offset(ams_channels[i].scan_index, in ams_parse_firmware()
1309 if (ams_channels[i].scan_index >= AMS_PS_SEQ_MAX) { in ams_parse_firmware()