Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging:iio:adc:ad7280a: Drop buggy support for early termination of AUX alert.

This functionality is intended to allow for a few temperature
sensors to be missing (and hence not worth reading) on the final
device in a chain. The ones removed are 3 and 5 (unlike for
the ADC channels where it is 4 and 5).

The datasheet includes a foot note 3 to Table 12 that makes this complex
to support.

"(3) To remove AUX5 or AUX5 and AUX3 from the alert detection, conversions
on three auxiliary ADC input channels only must be selected in the
control register."

This mode has never been supported by the driver.

As this support would be complex to add and the rework is being done
against a QEMU model developed for the purposes of verifying nothing
is broken, it is better to drop this support for now.

Reported-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-16-jic23@kernel.org

-22
-22
drivers/staging/iio/adc/ad7280a.c
··· 1022 1022 break; 1023 1023 } 1024 1024 } 1025 - if (device_property_present(dev, "adi,temp-alert-last-chan")) { 1026 - u32 val; 1027 - 1028 - ret = device_property_read_u32(dev, "adi,temp-alert-last-chan", &val); 1029 - if (ret) 1030 - return ret; 1031 - 1032 - switch (val) { 1033 - case 3: 1034 - st->chain_last_alert_ignore |= AD7280A_ALERT_REMOVE_AUX3_AUX5; 1035 - break; 1036 - case 4: 1037 - st->chain_last_alert_ignore |= AD7280A_ALERT_REMOVE_AUX5; 1038 - break; 1039 - case 5: 1040 - break; 1041 - default: 1042 - dev_err(dev, 1043 - "Firmware provided last temp alert channel invalid\n"); 1044 - break; 1045 - } 1046 - } 1047 1025 crc8_populate_msb(st->crc_tab, POLYNOM); 1048 1026 1049 1027 st->spi->max_speed_hz = AD7280A_MAX_SPI_CLK_HZ;