Skip to content

Commit 98fde47

Browse files
ribaldagregkh
authored andcommitted
iio: hid-sensor-prox: Split difference from multiple channels
[ Upstream commit 4eba4d9 ] 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 <ribalda@chromium.org> Link: https://patch.msgid.link/20241216-fix-hid-sensor-v2-1-ff8c1959ec4a@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2904d6c commit 98fde47

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

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)