Pull staging and IIO driver fixes from Greg KH: "Some small staging and IIO driver fixes: - MAINTAINERS changes for the move of the staging mailing list - comedi driver fixes to get request_irq() to work correctly - counter driver fixes for reported issues with iio devices - tiny iio driver fixes for reported issues. All of these have been in linux-next with no reported problems" * tag 'staging-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: vt665x: fix alignment constraints staging: comedi: cb_pcidas64: fix request_irq() warn staging: comedi: cb_pcidas: fix request_irq() warn MAINTAINERS: move the staging subsystem to lists.linux.dev MAINTAINERS: move some real subsystems off of the staging mailing list iio: gyro: mpu3050: Fix error handling in mpu3050_trigger_handler iio: hid-sensor-temperature: Fix issues of timestamp channel iio: hid-sensor-humidity: Fix alignment issue of timestamp channel counter: stm32-timer-cnt: fix ceiling miss-alignment with reload register counter: stm32-timer-cnt: fix ceiling write max value counter: stm32-timer-cnt: Report count function when SLAVE_MODE_DISABLED iio: adc: ab8500-gpadc: Fix off by 10 to 3 iio:adc:stm32-adc: Add HAS_IOMEM dependency iio: adis16400: Fix an error code in adis16400_initial_setup() iio: adc: adi-axi-adc: add proper Kconfig dependencies iio: adc: ad7949: fix wrong ADC result due to incorrect bit mask iio: hid-sensor-prox: Fix scale not correct issue iio:adc:qcom-spmi-vadc: add default scale to LR_MUX2_BAT_ID channel
Unified · Split
| @@ -1181,7 +1181,7 @@ M: Joel Fernandes <joel@joelfernandes.org> · 1180 unmodified lines | |||
| 1181 | M: Christian Brauner <christian@brauner.io> | 1181 | M: Christian Brauner <christian@brauner.io> |
| 1182 | M: Hridya Valsaraju <hridya@google.com> | 1182 | M: Hridya Valsaraju <hridya@google.com> |
| 1183 | M: Suren Baghdasaryan <surenb@google.com> | 1183 | M: Suren Baghdasaryan <surenb@google.com> |
| 1184 | L: devel@driverdev.osuosl.org | 1184 | L: linux-kernel@vger.kernel.org |
| 1185 | S: Supported | 1185 | S: Supported |
| 1186 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git | 1186 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git |
| 1187 | F: drivers/android/ | 1187 | F: drivers/android/ |
| @@ -8116,7 +8116,6 @@ F: drivers/crypto/hisilicon/sec2/sec_main.c · 6928 unmodified lines | |||
| 8116 | 8116 | ||
| 8117 | HISILICON STAGING DRIVERS FOR HIKEY 960/970 | 8117 | HISILICON STAGING DRIVERS FOR HIKEY 960/970 |
| 8118 | M: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 8118 | M: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
| 8119 | L: devel@driverdev.osuosl.org | ||
| 8120 | S: Maintained | 8119 | S: Maintained |
| 8121 | F: drivers/staging/hikey9xx/ | 8120 | F: drivers/staging/hikey9xx/ |
| 8122 | 8121 | ||
| @@ -17040,7 +17039,7 @@ F: drivers/staging/vt665?/ · 8917 unmodified lines | |||
| 17040 | 17039 | ||
| 17041 | STAGING SUBSYSTEM | 17040 | STAGING SUBSYSTEM |
| 17042 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 17041 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| 17043 | L: devel@driverdev.osuosl.org | 17042 | L: linux-staging@lists.linux.dev |
| 17044 | S: Supported | 17043 | S: Supported |
| 17045 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git | 17044 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git |
| 17046 | F: drivers/staging/ | 17045 | F: drivers/staging/ |
| @@ -19135,7 +19134,7 @@ VME SUBSYSTEM · 2088 unmodified lines | |||
| 19135 | M: Martyn Welch <martyn@welchs.me.uk> | 19134 | M: Martyn Welch <martyn@welchs.me.uk> |
| 19136 | M: Manohar Vanga <manohar.vanga@gmail.com> | 19135 | M: Manohar Vanga <manohar.vanga@gmail.com> |
| 19137 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 19136 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| 19138 | L: devel@driverdev.osuosl.org | 19137 | L: linux-kernel@vger.kernel.org |
| 19139 | S: Maintained | 19138 | S: Maintained |
| 19140 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git | 19139 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git |
| 19141 | F: Documentation/driver-api/vme.rst | 19140 | F: Documentation/driver-api/vme.rst |
| @@ -31,7 +31,7 @@ struct stm32_timer_cnt { · 30 unmodified lines | |||
| 31 | struct counter_device counter; | 31 | struct counter_device counter; |
| 32 | struct regmap *regmap; | 32 | struct regmap *regmap; |
| 33 | struct clk *clk; | 33 | struct clk *clk; |
| 34 | u32 ceiling; | 34 | u32 max_arr; |
| 35 | bool enabled; | 35 | bool enabled; |
| 36 | struct stm32_timer_regs bak; | 36 | struct stm32_timer_regs bak; |
| 37 | }; | 37 | }; |
| @@ -44,13 +44,14 @@ struct stm32_timer_cnt { · 6 unmodified lines | |||
| 44 | * @STM32_COUNT_ENCODER_MODE_3: counts on both TI1FP1 and TI2FP2 edges | 44 | * @STM32_COUNT_ENCODER_MODE_3: counts on both TI1FP1 and TI2FP2 edges |
| 45 | */ | 45 | */ |
| 46 | enum stm32_count_function { | 46 | enum stm32_count_function { |
| 47 | STM32_COUNT_SLAVE_MODE_DISABLED = -1, | 47 | STM32_COUNT_SLAVE_MODE_DISABLED, |
| 48 | STM32_COUNT_ENCODER_MODE_1, | 48 | STM32_COUNT_ENCODER_MODE_1, |
| 49 | STM32_COUNT_ENCODER_MODE_2, | 49 | STM32_COUNT_ENCODER_MODE_2, |
| 50 | STM32_COUNT_ENCODER_MODE_3, | 50 | STM32_COUNT_ENCODER_MODE_3, |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | static enum counter_count_function stm32_count_functions[] = { | 53 | static enum counter_count_function stm32_count_functions[] = { |
| 54 | [STM32_COUNT_SLAVE_MODE_DISABLED] = COUNTER_COUNT_FUNCTION_INCREASE, | ||
| 54 | [STM32_COUNT_ENCODER_MODE_1] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A, | 55 | [STM32_COUNT_ENCODER_MODE_1] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A, |
| 55 | [STM32_COUNT_ENCODER_MODE_2] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B, | 56 | [STM32_COUNT_ENCODER_MODE_2] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B, |
| 56 | [STM32_COUNT_ENCODER_MODE_3] = COUNTER_COUNT_FUNCTION_QUADRATURE_X4, | 57 | [STM32_COUNT_ENCODER_MODE_3] = COUNTER_COUNT_FUNCTION_QUADRATURE_X4, |
| @@ -73,8 +74,10 @@ static int stm32_count_write(struct counter_device *counter, · 16 unmodified lines | |||
| 73 | const unsigned long val) | 74 | const unsigned long val) |
| 74 | { | 75 | { |
| 75 | struct stm32_timer_cnt *const priv = counter->priv; | 76 | struct stm32_timer_cnt *const priv = counter->priv; |
| 77 | u32 ceiling; | ||
| 76 | 78 | ||
| 77 | if (val > priv->ceiling) | 79 | regmap_read(priv->regmap, TIM_ARR, &ceiling); |
| 80 | if (val > ceiling) | ||
| 78 | return -EINVAL; | 81 | return -EINVAL; |
| 79 | 82 | ||
| 80 | return regmap_write(priv->regmap, TIM_CNT, val); | 83 | return regmap_write(priv->regmap, TIM_CNT, val); |
| @@ -90,6 +93,9 @@ static int stm32_count_function_get(struct counter_device *counter, · 9 unmodified lines | |||
| 90 | regmap_read(priv->regmap, TIM_SMCR, &smcr); | 93 | regmap_read(priv->regmap, TIM_SMCR, &smcr); |
| 91 | 94 | ||
| 92 | switch (smcr & TIM_SMCR_SMS) { | 95 | switch (smcr & TIM_SMCR_SMS) { |
| 96 | case 0: | ||
| 97 | *function = STM32_COUNT_SLAVE_MODE_DISABLED; | ||
| 98 | return 0; | ||
| 93 | case 1: | 99 | case 1: |
| 94 | *function = STM32_COUNT_ENCODER_MODE_1; | 100 | *function = STM32_COUNT_ENCODER_MODE_1; |
| 95 | return 0; | 101 | return 0; |
| @@ -99,9 +105,9 @@ static int stm32_count_function_get(struct counter_device *counter, · 3 unmodified lines | |||
| 99 | case 3: | 105 | case 3: |
| 100 | *function = STM32_COUNT_ENCODER_MODE_3; | 106 | *function = STM32_COUNT_ENCODER_MODE_3; |
| 101 | return 0; | 107 | return 0; |
| 108 | default: | ||
| 109 | return -EINVAL; | ||
| 102 | } | 110 | } |
| 103 | |||
| 104 | return -EINVAL; | ||
| 105 | } | 111 | } |
| 106 | 112 | ||
| 107 | static int stm32_count_function_set(struct counter_device *counter, | 113 | static int stm32_count_function_set(struct counter_device *counter, |
| @@ -112,6 +118,9 @@ static int stm32_count_function_set(struct counter_device *counter, · 4 unmodified lines | |||
| 112 | u32 cr1, sms; | 118 | u32 cr1, sms; |
| 113 | 119 | ||
| 114 | switch (function) { | 120 | switch (function) { |
| 121 | case STM32_COUNT_SLAVE_MODE_DISABLED: | ||
| 122 | sms = 0; | ||
| 123 | break; | ||
| 115 | case STM32_COUNT_ENCODER_MODE_1: | 124 | case STM32_COUNT_ENCODER_MODE_1: |
| 116 | sms = 1; | 125 | sms = 1; |
| 117 | break; | 126 | break; |
| @@ -122,8 +131,7 @@ static int stm32_count_function_set(struct counter_device *counter, · 4 unmodified lines | |||
| 122 | sms = 3; | 131 | sms = 3; |
| 123 | break; | 132 | break; |
| 124 | default: | 133 | default: |
| 125 | sms = 0; | 134 | return -EINVAL; |
| 126 | break; | ||
| 127 | } | 135 | } |
| 128 | 136 | ||
| 129 | /* Store enable status */ | 137 | /* Store enable status */ |
| @@ -131,10 +139,6 @@ static int stm32_count_function_set(struct counter_device *counter, · 1 unmodified line | |||
| 131 | 139 | ||
| 132 | regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); | 140 | regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); |
| 133 | 141 | ||
| 134 | /* TIMx_ARR register shouldn't be buffered (ARPE=0) */ | ||
| 135 | regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); | ||
| 136 | regmap_write(priv->regmap, TIM_ARR, priv->ceiling); | ||
| 137 | |||
| 138 | regmap_update_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS, sms); | 142 | regmap_update_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS, sms); |
| 139 | 143 | ||
| 140 | /* Make sure that registers are updated */ | 144 | /* Make sure that registers are updated */ |
| @@ -185,11 +189,13 @@ static ssize_t stm32_count_ceiling_write(struct counter_device *counter, · 44 unmodified lines | |||
| 185 | if (ret) | 189 | if (ret) |
| 186 | return ret; | 190 | return ret; |
| 187 | 191 | ||
| 192 | if (ceiling > priv->max_arr) | ||
| 193 | return -ERANGE; | ||
| 194 | |||
| 188 | /* TIMx_ARR register shouldn't be buffered (ARPE=0) */ | 195 | /* TIMx_ARR register shouldn't be buffered (ARPE=0) */ |
| 189 | regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); | 196 | regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); |
| 190 | regmap_write(priv->regmap, TIM_ARR, ceiling); | 197 | regmap_write(priv->regmap, TIM_ARR, ceiling); |
| 191 | 198 | ||
| 192 | priv->ceiling = ceiling; | ||
| 193 | return len; | 199 | return len; |
| 194 | } | 200 | } |
| 195 | 201 | ||
| @@ -274,31 +280,36 @@ static int stm32_action_get(struct counter_device *counter, · 78 unmodified lines | |||
| 274 | size_t function; | 280 | size_t function; |
| 275 | int err; | 281 | int err; |
| 276 | 282 | ||
| 277 | /* Default action mode (e.g. STM32_COUNT_SLAVE_MODE_DISABLED) */ | ||
| 278 | *action = STM32_SYNAPSE_ACTION_NONE; | ||
| 279 | |||
| 280 | err = stm32_count_function_get(counter, count, &function); | 283 | err = stm32_count_function_get(counter, count, &function); |
| 281 | if (err) | 284 | if (err) |
| 282 | return 0; | 285 | return err; |
| 283 | 286 | ||
| 284 | switch (function) { | 287 | switch (function) { |
| 288 | case STM32_COUNT_SLAVE_MODE_DISABLED: | ||
| 289 | /* counts on internal clock when CEN=1 */ | ||
| 290 | *action = STM32_SYNAPSE_ACTION_NONE; | ||
| 291 | return 0; | ||
| 285 | case STM32_COUNT_ENCODER_MODE_1: | 292 | case STM32_COUNT_ENCODER_MODE_1: |
| 286 | /* counts up/down on TI1FP1 edge depending on TI2FP2 level */ | 293 | /* counts up/down on TI1FP1 edge depending on TI2FP2 level */ |
| 287 | if (synapse->signal->id == count->synapses[0].signal->id) | 294 | if (synapse->signal->id == count->synapses[0].signal->id) |
| 288 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; | 295 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; |
| 289 | break; | 296 | else |
| 297 | *action = STM32_SYNAPSE_ACTION_NONE; | ||
| 298 | return 0; | ||
| 290 | case STM32_COUNT_ENCODER_MODE_2: | 299 | case STM32_COUNT_ENCODER_MODE_2: |
| 291 | /* counts up/down on TI2FP2 edge depending on TI1FP1 level */ | 300 | /* counts up/down on TI2FP2 edge depending on TI1FP1 level */ |
| 292 | if (synapse->signal->id == count->synapses[1].signal->id) | 301 | if (synapse->signal->id == count->synapses[1].signal->id) |
| 293 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; | 302 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; |
| 294 | break; | 303 | else |
| 304 | *action = STM32_SYNAPSE_ACTION_NONE; | ||
| 305 | return 0; | ||
| 295 | case STM32_COUNT_ENCODER_MODE_3: | 306 | case STM32_COUNT_ENCODER_MODE_3: |
| 296 | /* counts up/down on both TI1FP1 and TI2FP2 edges */ | 307 | /* counts up/down on both TI1FP1 and TI2FP2 edges */ |
| 297 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; | 308 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; |
| 298 | break; | 309 | return 0; |
| 310 | default: | ||
| 311 | return -EINVAL; | ||
| 299 | } | 312 | } |
| 300 | |||
| 301 | return 0; | ||
| 302 | } | 313 | } |
| 303 | 314 | ||
| 304 | static const struct counter_ops stm32_timer_cnt_ops = { | 315 | static const struct counter_ops stm32_timer_cnt_ops = { |
| @@ -359,7 +370,7 @@ static int stm32_timer_cnt_probe(struct platform_device *pdev) · 54 unmodified lines | |||
| 359 | 370 | ||
| 360 | priv->regmap = ddata->regmap; | 371 | priv->regmap = ddata->regmap; |
| 361 | priv->clk = ddata->clk; | 372 | priv->clk = ddata->clk; |
| 362 | priv->ceiling = ddata->max_arr; | 373 | priv->max_arr = ddata->max_arr; |
| 363 | 374 | ||
| 364 | priv->counter.name = dev_name(dev); | 375 | priv->counter.name = dev_name(dev); |
| 365 | priv->counter.parent = dev; | 376 | priv->counter.parent = dev; |
| @@ -266,6 +266,8 @@ config ADI_AXI_ADC · 265 unmodified lines | |||
| 266 | select IIO_BUFFER | 266 | select IIO_BUFFER |
| 267 | select IIO_BUFFER_HW_CONSUMER | 267 | select IIO_BUFFER_HW_CONSUMER |
| 268 | select IIO_BUFFER_DMAENGINE | 268 | select IIO_BUFFER_DMAENGINE |
| 269 | depends on HAS_IOMEM | ||
| 270 | depends on OF | ||
| 269 | help | 271 | help |
| 270 | Say yes here to build support for Analog Devices Generic | 272 | Say yes here to build support for Analog Devices Generic |
| 271 | AXI ADC IP core. The IP core is used for interfacing with | 273 | AXI ADC IP core. The IP core is used for interfacing with |
| @@ -923,6 +925,7 @@ config STM32_ADC_CORE · 651 unmodified lines | |||
| 923 | depends on ARCH_STM32 || COMPILE_TEST | 925 | depends on ARCH_STM32 || COMPILE_TEST |
| 924 | depends on OF | 926 | depends on OF |
| 925 | depends on REGULATOR | 927 | depends on REGULATOR |
| 928 | depends on HAS_IOMEM | ||
| 926 | select IIO_BUFFER | 929 | select IIO_BUFFER |
| 927 | select MFD_STM32_TIMERS | 930 | select MFD_STM32_TIMERS |
| 928 | select IIO_STM32_TIMER_TRIGGER | 931 | select IIO_STM32_TIMER_TRIGGER |
| @@ -918,7 +918,7 @@ static int ab8500_gpadc_read_raw(struct iio_dev *indio_dev, · 917 unmodified lines | |||
| 918 | return processed; | 918 | return processed; |
| 919 | 919 | ||
| 920 | /* Return millivolt or milliamps or millicentigrades */ | 920 | /* Return millivolt or milliamps or millicentigrades */ |
| 921 | *val = processed * 1000; | 921 | *val = processed; |
| 922 | return IIO_VAL_INT; | 922 | return IIO_VAL_INT; |
| 923 | } | 923 | } |
| 924 | 924 | ||
| @@ -91,7 +91,7 @@ static int ad7949_spi_read_channel(struct ad7949_adc_chip *ad7949_adc, int *val, · 90 unmodified lines | |||
| 91 | int ret; | 91 | int ret; |
| 92 | int i; | 92 | int i; |
| 93 | int bits_per_word = ad7949_adc->resolution; | 93 | int bits_per_word = ad7949_adc->resolution; |
| 94 | int mask = GENMASK(ad7949_adc->resolution, 0); | 94 | int mask = GENMASK(ad7949_adc->resolution - 1, 0); |
| 95 | struct spi_message msg; | 95 | struct spi_message msg; |
| 96 | struct spi_transfer tx[] = { | 96 | struct spi_transfer tx[] = { |
| 97 | { | 97 | { |
| @@ -597,7 +597,7 @@ static const struct vadc_channels vadc_chans[] = { · 596 unmodified lines | |||
| 597 | VADC_CHAN_NO_SCALE(P_MUX16_1_3, 1) | 597 | VADC_CHAN_NO_SCALE(P_MUX16_1_3, 1) |
| 598 | 598 | ||
| 599 | VADC_CHAN_NO_SCALE(LR_MUX1_BAT_THERM, 0) | 599 | VADC_CHAN_NO_SCALE(LR_MUX1_BAT_THERM, 0) |
| 600 | VADC_CHAN_NO_SCALE(LR_MUX2_BAT_ID, 0) | 600 | VADC_CHAN_VOLT(LR_MUX2_BAT_ID, 0, SCALE_DEFAULT) |
| 601 | VADC_CHAN_NO_SCALE(LR_MUX3_XO_THERM, 0) | 601 | VADC_CHAN_NO_SCALE(LR_MUX3_XO_THERM, 0) |
| 602 | VADC_CHAN_NO_SCALE(LR_MUX4_AMUX_THM1, 0) | 602 | VADC_CHAN_NO_SCALE(LR_MUX4_AMUX_THM1, 0) |
| 603 | VADC_CHAN_NO_SCALE(LR_MUX5_AMUX_THM2, 0) | 603 | VADC_CHAN_NO_SCALE(LR_MUX5_AMUX_THM2, 0) |
| @@ -551,6 +551,8 @@ static irqreturn_t mpu3050_trigger_handler(int irq, void *p) · 550 unmodified lines | |||
| 551 | MPU3050_FIFO_R, | 551 | MPU3050_FIFO_R, |
| 552 | &fifo_values[offset], | 552 | &fifo_values[offset], |
| 553 | toread); | 553 | toread); |
| 554 | if (ret) | ||
| 555 | goto out_trigger_unlock; | ||
| 554 | 556 | ||
| 555 | dev_dbg(mpu3050->dev, | 557 | dev_dbg(mpu3050->dev, |
| 556 | "%04x %04x %04x %04x %04x\n", | 558 | "%04x %04x %04x %04x %04x\n", |
| @@ -15,7 +15,10 @@ · 14 unmodified lines | |||
| 15 | struct hid_humidity_state { | 15 | struct hid_humidity_state { |
| 16 | struct hid_sensor_common common_attributes; | 16 | struct hid_sensor_common common_attributes; |
| 17 | struct hid_sensor_hub_attribute_info humidity_attr; | 17 | struct hid_sensor_hub_attribute_info humidity_attr; |
| 18 | s32 humidity_data; | 18 | struct { |
| 19 | s32 humidity_data; | ||
| 20 | u64 timestamp __aligned(8); | ||
| 21 | } scan; | ||
| 19 | int scale_pre_decml; | 22 | int scale_pre_decml; |
| 20 | int scale_post_decml; | 23 | int scale_post_decml; |
| 21 | int scale_precision; | 24 | int scale_precision; |
| @@ -125,9 +128,8 @@ static int humidity_proc_event(struct hid_sensor_hub_device *hsdev, · 103 unmodified lines | |||
| 125 | struct hid_humidity_state *humid_st = iio_priv(indio_dev); | 128 | struct hid_humidity_state *humid_st = iio_priv(indio_dev); |
| 126 | 129 | ||
| 127 | if (atomic_read(&humid_st->common_attributes.data_ready)) | 130 | if (atomic_read(&humid_st->common_attributes.data_ready)) |
| 128 | iio_push_to_buffers_with_timestamp(indio_dev, | 131 | iio_push_to_buffers_with_timestamp(indio_dev, &humid_st->scan, |
| 129 | &humid_st->humidity_data, | 132 | iio_get_time_ns(indio_dev)); |
| 130 | iio_get_time_ns(indio_dev)); | ||
| 131 | 133 | ||
| 132 | return 0; | 134 | return 0; |
| 133 | } | 135 | } |
| @@ -142,7 +144,7 @@ static int humidity_capture_sample(struct hid_sensor_hub_device *hsdev, · 8 unmodified lines | |||
| 142 | 144 | ||
| 143 | switch (usage_id) { | 145 | switch (usage_id) { |
| 144 | case HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY: | 146 | case HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY: |
| 145 | humid_st->humidity_data = *(s32 *)raw_data; | 147 | humid_st->scan.humidity_data = *(s32 *)raw_data; |
| 146 | 148 | ||
| 147 | return 0; | 149 | return 0; |
| 148 | default: | 150 | default: |
| @@ -462,8 +462,7 @@ static int adis16400_initial_setup(struct iio_dev *indio_dev) · 461 unmodified lines | |||
| 462 | if (ret) | 462 | if (ret) |
| 463 | goto err_ret; | 463 | goto err_ret; |
| 464 | 464 | ||
| 465 | ret = sscanf(indio_dev->name, "adis%u\n", &device_id); | 465 | if (sscanf(indio_dev->name, "adis%u\n", &device_id) != 1) { |
| 466 | if (ret != 1) { | ||
| 467 | ret = -EINVAL; | 466 | ret = -EINVAL; |
| 468 | goto err_ret; | 467 | goto err_ret; |
| 469 | } | 468 | } |
| @@ -23,6 +23,9 @@ struct prox_state { · 22 unmodified lines | |||
| 23 | struct hid_sensor_common common_attributes; | 23 | struct hid_sensor_common common_attributes; |
| 24 | struct hid_sensor_hub_attribute_info prox_attr; | 24 | struct hid_sensor_hub_attribute_info prox_attr; |
| 25 | u32 human_presence; | 25 | u32 human_presence; |
| 26 | int scale_pre_decml; | ||
| 27 | int scale_post_decml; | ||
| 28 | int scale_precision; | ||
| 26 | }; | 29 | }; |
| 27 | 30 | ||
| 28 | /* Channel definitions */ | 31 | /* Channel definitions */ |
| @@ -93,8 +96,9 @@ static int prox_read_raw(struct iio_dev *indio_dev, · 64 unmodified lines | |||
| 93 | ret_type = IIO_VAL_INT; | 96 | ret_type = IIO_VAL_INT; |
| 94 | break; | 97 | break; |
| 95 | case IIO_CHAN_INFO_SCALE: | 98 | case IIO_CHAN_INFO_SCALE: |
| 96 | *val = prox_state->prox_attr.units; | 99 | *val = prox_state->scale_pre_decml; |
| 97 | ret_type = IIO_VAL_INT; | 100 | *val2 = prox_state->scale_post_decml; |
| 101 | ret_type = prox_state->scale_precision; | ||
| 98 | break; | 102 | break; |
| 99 | case IIO_CHAN_INFO_OFFSET: | 103 | case IIO_CHAN_INFO_OFFSET: |
| 100 | *val = hid_sensor_convert_exponent( | 104 | *val = hid_sensor_convert_exponent( |
| @@ -234,6 +238,11 @@ static int prox_parse_report(struct platform_device *pdev, · 133 unmodified lines | |||
| 234 | HID_USAGE_SENSOR_HUMAN_PRESENCE, | 238 | HID_USAGE_SENSOR_HUMAN_PRESENCE, |
| 235 | &st->common_attributes.sensitivity); | 239 | &st->common_attributes.sensitivity); |
| 236 | 240 | ||
| 241 | st->scale_precision = hid_sensor_format_scale( | ||
| 242 | hsdev->usage, | ||
| 243 | &st->prox_attr, | ||
| 244 | &st->scale_pre_decml, &st->scale_post_decml); | ||
| 245 | |||
| 237 | return ret; | 246 | return ret; |
| 238 | } | 247 | } |
| 239 | 248 | ||
| @@ -15,7 +15,10 @@ · 14 unmodified lines | |||
| 15 | struct temperature_state { | 15 | struct temperature_state { |
| 16 | struct hid_sensor_common common_attributes; | 16 | struct hid_sensor_common common_attributes; |
| 17 | struct hid_sensor_hub_attribute_info temperature_attr; | 17 | struct hid_sensor_hub_attribute_info temperature_attr; |
| 18 | s32 temperature_data; | 18 | struct { |
| 19 | s32 temperature_data; | ||
| 20 | u64 timestamp __aligned(8); | ||
| 21 | } scan; | ||
| 19 | int scale_pre_decml; | 22 | int scale_pre_decml; |
| 20 | int scale_post_decml; | 23 | int scale_post_decml; |
| 21 | int scale_precision; | 24 | int scale_precision; |
| @@ -32,7 +35,7 @@ static const struct iio_chan_spec temperature_channels[] = { · 10 unmodified lines | |||
| 32 | BIT(IIO_CHAN_INFO_SAMP_FREQ) | | 35 | BIT(IIO_CHAN_INFO_SAMP_FREQ) | |
| 33 | BIT(IIO_CHAN_INFO_HYSTERESIS), | 36 | BIT(IIO_CHAN_INFO_HYSTERESIS), |
| 34 | }, | 37 | }, |
| 35 | IIO_CHAN_SOFT_TIMESTAMP(3), | 38 | IIO_CHAN_SOFT_TIMESTAMP(1), |
| 36 | }; | 39 | }; |
| 37 | 40 | ||
| 38 | /* Adjust channel real bits based on report descriptor */ | 41 | /* Adjust channel real bits based on report descriptor */ |
| @@ -123,9 +126,8 @@ static int temperature_proc_event(struct hid_sensor_hub_device *hsdev, · 84 unmodified lines | |||
| 123 | struct temperature_state *temp_st = iio_priv(indio_dev); | 126 | struct temperature_state *temp_st = iio_priv(indio_dev); |
| 124 | 127 | ||
| 125 | if (atomic_read(&temp_st->common_attributes.data_ready)) | 128 | if (atomic_read(&temp_st->common_attributes.data_ready)) |
| 126 | iio_push_to_buffers_with_timestamp(indio_dev, | 129 | iio_push_to_buffers_with_timestamp(indio_dev, &temp_st->scan, |
| 127 | &temp_st->temperature_data, | 130 | iio_get_time_ns(indio_dev)); |
| 128 | iio_get_time_ns(indio_dev)); | ||
| 129 | 131 | ||
| 130 | return 0; | 132 | return 0; |
| 131 | } | 133 | } |
| @@ -140,7 +142,7 @@ static int temperature_capture_sample(struct hid_sensor_hub_device *hsdev, · 8 unmodified lines | |||
| 140 | 142 | ||
| 141 | switch (usage_id) { | 143 | switch (usage_id) { |
| 142 | case HID_USAGE_SENSOR_DATA_ENVIRONMENTAL_TEMPERATURE: | 144 | case HID_USAGE_SENSOR_DATA_ENVIRONMENTAL_TEMPERATURE: |
| 143 | temp_st->temperature_data = *(s32 *)raw_data; | 145 | temp_st->scan.temperature_data = *(s32 *)raw_data; |
| 144 | return 0; | 146 | return 0; |
| 145 | default: | 147 | default: |
| 146 | return -EINVAL; | 148 | return -EINVAL; |
| @@ -1281,7 +1281,7 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev, · 1280 unmodified lines | |||
| 1281 | devpriv->amcc + AMCC_OP_REG_INTCSR); | 1281 | devpriv->amcc + AMCC_OP_REG_INTCSR); |
| 1282 | 1282 | ||
| 1283 | ret = request_irq(pcidev->irq, cb_pcidas_interrupt, IRQF_SHARED, | 1283 | ret = request_irq(pcidev->irq, cb_pcidas_interrupt, IRQF_SHARED, |
| 1284 | dev->board_name, dev); | 1284 | "cb_pcidas", dev); |
| 1285 | if (ret) { | 1285 | if (ret) { |
| 1286 | dev_dbg(dev->class_dev, "unable to allocate irq %d\n", | 1286 | dev_dbg(dev->class_dev, "unable to allocate irq %d\n", |
| 1287 | pcidev->irq); | 1287 | pcidev->irq); |
| @@ -4035,7 +4035,7 @@ static int auto_attach(struct comedi_device *dev, · 4034 unmodified lines | |||
| 4035 | init_stc_registers(dev); | 4035 | init_stc_registers(dev); |
| 4036 | 4036 | ||
| 4037 | retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED, | 4037 | retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED, |
| 4038 | dev->board_name, dev); | 4038 | "cb_pcidas64", dev); |
| 4039 | if (retval) { | 4039 | if (retval) { |
| 4040 | dev_dbg(dev->class_dev, "unable to allocate irq %u\n", | 4040 | dev_dbg(dev->class_dev, "unable to allocate irq %u\n", |
| 4041 | pcidev->irq); | 4041 | pcidev->irq); |
| @@ -150,7 +150,7 @@ struct vnt_cts { · 149 unmodified lines | |||
| 150 | u16 reserved; | 150 | u16 reserved; |
| 151 | struct ieee80211_cts data; | 151 | struct ieee80211_cts data; |
| 152 | u16 reserved2; | 152 | u16 reserved2; |
| 153 | } __packed; | 153 | } __packed __aligned(2); |
| 154 | 154 | ||
| 155 | struct vnt_cts_fb { | 155 | struct vnt_cts_fb { |
| 156 | struct vnt_phy_field b; | 156 | struct vnt_phy_field b; |
| @@ -160,7 +160,7 @@ struct vnt_cts_fb { · 3 unmodified lines | |||
| 160 | __le16 cts_duration_ba_f1; | 160 | __le16 cts_duration_ba_f1; |
| 161 | struct ieee80211_cts data; | 161 | struct ieee80211_cts data; |
| 162 | u16 reserved2; | 162 | u16 reserved2; |
| 163 | } __packed; | 163 | } __packed __aligned(2); |
| 164 | 164 | ||
| 165 | struct vnt_tx_fifo_head { | 165 | struct vnt_tx_fifo_head { |
| 166 | u8 tx_key[WLAN_KEY_LEN_CCMP]; | 166 | u8 tx_key[WLAN_KEY_LEN_CCMP]; |