Skip to content

Commit 4eba4d9

Browse files
ribaldajic23
authored andcommitted
iio: hid-sensor-prox: Split difference from multiple channels
When the driver was originally created, it was decided that sampling_frequency and hysteresis would be shared_per_type instead of shared_by_all (even though it is internally shared by all). Eg: in_proximity_raw in_proximity_sampling_frequency When we introduced support for more channels, we continued with shared_by_type which. Eg: in_proximity0_raw in_proximity1_raw in_proximity_sampling_frequency in_attention_raw in_attention_sampling_frequency Ideally we should change to shared_by_all, but it is not an option, because the current naming has been a stablished ABI by now. Luckily we can use separate instead. That will be more consistent: in_proximity0_raw in_proximity0_sampling_frequency in_proximity1_raw in_proximity1_sampling_frequency in_attention_raw in_attention_sampling_frequency Fixes: 596ef5c ("iio: hid-sensor-prox: Add support for more channels") Signed-off-by: Ricardo Ribalda <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 5d702aa commit 4eba4d9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/iio/light/hid-sensor-prox.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ static const u32 prox_sensitivity_addresses[] = {
4949
#define PROX_CHANNEL(_is_proximity, _channel) \
5050
{\
5151
.type = _is_proximity ? IIO_PROXIMITY : IIO_ATTENTION,\
52-
.info_mask_separate = _is_proximity ? BIT(IIO_CHAN_INFO_RAW) :\
53-
BIT(IIO_CHAN_INFO_PROCESSED),\
54-
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |\
52+
.info_mask_separate = \
53+
(_is_proximity ? BIT(IIO_CHAN_INFO_RAW) :\
54+
BIT(IIO_CHAN_INFO_PROCESSED)) |\
55+
BIT(IIO_CHAN_INFO_OFFSET) |\
5556
BIT(IIO_CHAN_INFO_SCALE) |\
5657
BIT(IIO_CHAN_INFO_SAMP_FREQ) |\
5758
BIT(IIO_CHAN_INFO_HYSTERESIS),\

0 commit comments

Comments
 (0)