History

Merge tag 'staging-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

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

Linus Torvalds committed 5 years ago

Commit 1d4345e2 parents 3001c35 2cafd4614 files · +75 −48Browse files

Unified · Split

14 files
  1. MAINTAINERS +3 −4
  2. drivers/counter/stm32-timer-cnt.c +33 −22
  3. drivers/iio/adc/Kconfig +3 −0
  4. drivers/iio/adc/ab8500-gpadc.c +1 −1
  5. drivers/iio/adc/ad7949.c +1 −1
  6. drivers/iio/adc/qcom-spmi-vadc.c +1 −1
  7. drivers/iio/gyro/mpu3050-core.c +2 −0
  8. drivers/iio/humidity/hid-sensor-humidity.c +7 −5
  9. drivers/iio/imu/adis16400.c +1 −2
  10. drivers/iio/light/hid-sensor-prox.c +11 −2
  11. drivers/iio/temperature/hid-sensor-temperature.c +8 −6
  12. drivers/staging/comedi/drivers/cb_pcidas.c +1 −1
  13. drivers/staging/comedi/drivers/cb_pcidas64.c +1 −1
  14. drivers/staging/vt6655/rxtx.h +2 −2
MAINTAINERS+3−4
@@ -1181,7 +1181,7 @@ M: Joel Fernandes <joel@joelfernandes.org> · 1180 unmodified lines
11811181 M: Christian Brauner <christian@brauner.io>
11821182 M: Hridya Valsaraju <hridya@google.com>
11831183 M: Suren Baghdasaryan <surenb@google.com>
1184−L: devel@driverdev.osuosl.org
1184+L: linux-kernel@vger.kernel.org
11851185 S: Supported
11861186 T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
11871187 F: drivers/android/
@@ -8116,7 +8116,6 @@ F: drivers/crypto/hisilicon/sec2/sec_main.c · 6928 unmodified lines
81168116
81178117 HISILICON STAGING DRIVERS FOR HIKEY 960/970
81188118 M: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
8119−L: devel@driverdev.osuosl.org
81208119 S: Maintained
81218120 F: drivers/staging/hikey9xx/
81228121
@@ -17040,7 +17039,7 @@ F: drivers/staging/vt665?/ · 8917 unmodified lines
1704017039
1704117040 STAGING SUBSYSTEM
1704217041 M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17043−L: devel@driverdev.osuosl.org
17042+L: linux-staging@lists.linux.dev
1704417043 S: Supported
1704517044 T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
1704617045 F: drivers/staging/
@@ -19135,7 +19134,7 @@ VME SUBSYSTEM · 2088 unmodified lines
1913519134 M: Martyn Welch <martyn@welchs.me.uk>
1913619135 M: Manohar Vanga <manohar.vanga@gmail.com>
1913719136 M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19138−L: devel@driverdev.osuosl.org
19137+L: linux-kernel@vger.kernel.org
1913919138 S: Maintained
1914019139 T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
1914119140 F: Documentation/driver-api/vme.rst
drivers/counter/stm32-timer-cnt.c+33−22
@@ -31,7 +31,7 @@ struct stm32_timer_cnt { · 30 unmodified lines
3131 struct counter_device counter;
3232 struct regmap *regmap;
3333 struct clk *clk;
34− u32 ceiling;
34+ u32 max_arr;
3535 bool enabled;
3636 struct stm32_timer_regs bak;
3737 };
@@ -44,13 +44,14 @@ struct stm32_timer_cnt { · 6 unmodified lines
4444 * @STM32_COUNT_ENCODER_MODE_3: counts on both TI1FP1 and TI2FP2 edges
4545 */
4646 enum stm32_count_function {
47− STM32_COUNT_SLAVE_MODE_DISABLED = -1,
47+ STM32_COUNT_SLAVE_MODE_DISABLED,
4848 STM32_COUNT_ENCODER_MODE_1,
4949 STM32_COUNT_ENCODER_MODE_2,
5050 STM32_COUNT_ENCODER_MODE_3,
5151 };
5252
5353 static enum counter_count_function stm32_count_functions[] = {
54+ [STM32_COUNT_SLAVE_MODE_DISABLED] = COUNTER_COUNT_FUNCTION_INCREASE,
5455 [STM32_COUNT_ENCODER_MODE_1] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A,
5556 [STM32_COUNT_ENCODER_MODE_2] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B,
5657 [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
7374 const unsigned long val)
7475 {
7576 struct stm32_timer_cnt *const priv = counter->priv;
77+ u32 ceiling;
7678
77− if (val > priv->ceiling)
79+ regmap_read(priv->regmap, TIM_ARR, &ceiling);
80+ if (val > ceiling)
7881 return -EINVAL;
7982
8083 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
9093 regmap_read(priv->regmap, TIM_SMCR, &smcr);
9194
9295 switch (smcr & TIM_SMCR_SMS) {
96+ case 0:
97+ *function = STM32_COUNT_SLAVE_MODE_DISABLED;
98+ return 0;
9399 case 1:
94100 *function = STM32_COUNT_ENCODER_MODE_1;
95101 return 0;
@@ -99,9 +105,9 @@ static int stm32_count_function_get(struct counter_device *counter, · 3 unmodified lines
99105 case 3:
100106 *function = STM32_COUNT_ENCODER_MODE_3;
101107 return 0;
108+ default:
109+ return -EINVAL;
102110 }
103−
104− return -EINVAL;
105111 }
106112
107113 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
112118 u32 cr1, sms;
113119
114120 switch (function) {
121+ case STM32_COUNT_SLAVE_MODE_DISABLED:
122+ sms = 0;
123+ break;
115124 case STM32_COUNT_ENCODER_MODE_1:
116125 sms = 1;
117126 break;
@@ -122,8 +131,7 @@ static int stm32_count_function_set(struct counter_device *counter, · 4 unmodified lines
122131 sms = 3;
123132 break;
124133 default:
125− sms = 0;
126− break;
134+ return -EINVAL;
127135 }
128136
129137 /* Store enable status */
@@ -131,10 +139,6 @@ static int stm32_count_function_set(struct counter_device *counter, · 1 unmodified line
131139
132140 regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0);
133141
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−
138142 regmap_update_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS, sms);
139143
140144 /* Make sure that registers are updated */
@@ -185,11 +189,13 @@ static ssize_t stm32_count_ceiling_write(struct counter_device *counter, · 44 unmodified lines
185189 if (ret)
186190 return ret;
187191
192+ if (ceiling > priv->max_arr)
193+ return -ERANGE;
194+
188195 /* TIMx_ARR register shouldn't be buffered (ARPE=0) */
189196 regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0);
190197 regmap_write(priv->regmap, TIM_ARR, ceiling);
191198
192− priv->ceiling = ceiling;
193199 return len;
194200 }
195201
@@ -274,31 +280,36 @@ static int stm32_action_get(struct counter_device *counter, · 78 unmodified lines
274280 size_t function;
275281 int err;
276282
277− /* Default action mode (e.g. STM32_COUNT_SLAVE_MODE_DISABLED) */
278− *action = STM32_SYNAPSE_ACTION_NONE;
279−
280283 err = stm32_count_function_get(counter, count, &function);
281284 if (err)
282− return 0;
285+ return err;
283286
284287 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;
285292 case STM32_COUNT_ENCODER_MODE_1:
286293 /* counts up/down on TI1FP1 edge depending on TI2FP2 level */
287294 if (synapse->signal->id == count->synapses[0].signal->id)
288295 *action = STM32_SYNAPSE_ACTION_BOTH_EDGES;
289− break;
296+ else
297+ *action = STM32_SYNAPSE_ACTION_NONE;
298+ return 0;
290299 case STM32_COUNT_ENCODER_MODE_2:
291300 /* counts up/down on TI2FP2 edge depending on TI1FP1 level */
292301 if (synapse->signal->id == count->synapses[1].signal->id)
293302 *action = STM32_SYNAPSE_ACTION_BOTH_EDGES;
294− break;
303+ else
304+ *action = STM32_SYNAPSE_ACTION_NONE;
305+ return 0;
295306 case STM32_COUNT_ENCODER_MODE_3:
296307 /* counts up/down on both TI1FP1 and TI2FP2 edges */
297308 *action = STM32_SYNAPSE_ACTION_BOTH_EDGES;
298− break;
309+ return 0;
310+ default:
311+ return -EINVAL;
299312 }
300−
301− return 0;
302313 }
303314
304315 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
359370
360371 priv->regmap = ddata->regmap;
361372 priv->clk = ddata->clk;
362− priv->ceiling = ddata->max_arr;
373+ priv->max_arr = ddata->max_arr;
363374
364375 priv->counter.name = dev_name(dev);
365376 priv->counter.parent = dev;
drivers/iio/adc/Kconfig+3−0
@@ -266,6 +266,8 @@ config ADI_AXI_ADC · 265 unmodified lines
266266 select IIO_BUFFER
267267 select IIO_BUFFER_HW_CONSUMER
268268 select IIO_BUFFER_DMAENGINE
269+ depends on HAS_IOMEM
270+ depends on OF
269271 help
270272 Say yes here to build support for Analog Devices Generic
271273 AXI ADC IP core. The IP core is used for interfacing with
@@ -923,6 +925,7 @@ config STM32_ADC_CORE · 651 unmodified lines
923925 depends on ARCH_STM32 || COMPILE_TEST
924926 depends on OF
925927 depends on REGULATOR
928+ depends on HAS_IOMEM
926929 select IIO_BUFFER
927930 select MFD_STM32_TIMERS
928931 select IIO_STM32_TIMER_TRIGGER
drivers/iio/adc/ab8500-gpadc.c+1−1
@@ -918,7 +918,7 @@ static int ab8500_gpadc_read_raw(struct iio_dev *indio_dev, · 917 unmodified lines
918918 return processed;
919919
920920 /* Return millivolt or milliamps or millicentigrades */
921− *val = processed * 1000;
921+ *val = processed;
922922 return IIO_VAL_INT;
923923 }
924924
drivers/iio/adc/ad7949.c+1−1
@@ -91,7 +91,7 @@ static int ad7949_spi_read_channel(struct ad7949_adc_chip *ad7949_adc, int *val, · 90 unmodified lines
9191 int ret;
9292 int i;
9393 int bits_per_word = ad7949_adc->resolution;
94− int mask = GENMASK(ad7949_adc->resolution, 0);
94+ int mask = GENMASK(ad7949_adc->resolution - 1, 0);
9595 struct spi_message msg;
9696 struct spi_transfer tx[] = {
9797 {
drivers/iio/adc/qcom-spmi-vadc.c+1−1
@@ -597,7 +597,7 @@ static const struct vadc_channels vadc_chans[] = { · 596 unmodified lines
597597 VADC_CHAN_NO_SCALE(P_MUX16_1_3, 1)
598598
599599 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)
601601 VADC_CHAN_NO_SCALE(LR_MUX3_XO_THERM, 0)
602602 VADC_CHAN_NO_SCALE(LR_MUX4_AMUX_THM1, 0)
603603 VADC_CHAN_NO_SCALE(LR_MUX5_AMUX_THM2, 0)
drivers/iio/gyro/mpu3050-core.c+2−0
@@ -551,6 +551,8 @@ static irqreturn_t mpu3050_trigger_handler(int irq, void *p) · 550 unmodified lines
551551 MPU3050_FIFO_R,
552552 &fifo_values[offset],
553553 toread);
554+ if (ret)
555+ goto out_trigger_unlock;
554556
555557 dev_dbg(mpu3050->dev,
556558 "%04x %04x %04x %04x %04x\n",
drivers/iio/humidity/hid-sensor-humidity.c+7−5
@@ -15,7 +15,10 @@ · 14 unmodified lines
1515 struct hid_humidity_state {
1616 struct hid_sensor_common common_attributes;
1717 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;
1922 int scale_pre_decml;
2023 int scale_post_decml;
2124 int scale_precision;
@@ -125,9 +128,8 @@ static int humidity_proc_event(struct hid_sensor_hub_device *hsdev, · 103 unmodified lines
125128 struct hid_humidity_state *humid_st = iio_priv(indio_dev);
126129
127130 if (atomic_read(&humid_st->common_attributes.data_ready))
128− iio_push_to_buffers_with_timestamp(indio_dev,
129− &humid_st->humidity_data,
130− iio_get_time_ns(indio_dev));
131+ iio_push_to_buffers_with_timestamp(indio_dev, &humid_st->scan,
132+ iio_get_time_ns(indio_dev));
131133
132134 return 0;
133135 }
@@ -142,7 +144,7 @@ static int humidity_capture_sample(struct hid_sensor_hub_device *hsdev, · 8 unmodified lines
142144
143145 switch (usage_id) {
144146 case HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY:
145− humid_st->humidity_data = *(s32 *)raw_data;
147+ humid_st->scan.humidity_data = *(s32 *)raw_data;
146148
147149 return 0;
148150 default:
drivers/iio/imu/adis16400.c+1−2
@@ -462,8 +462,7 @@ static int adis16400_initial_setup(struct iio_dev *indio_dev) · 461 unmodified lines
462462 if (ret)
463463 goto err_ret;
464464
465− ret = sscanf(indio_dev->name, "adis%u\n", &device_id);
466− if (ret != 1) {
465+ if (sscanf(indio_dev->name, "adis%u\n", &device_id) != 1) {
467466 ret = -EINVAL;
468467 goto err_ret;
469468 }
drivers/iio/light/hid-sensor-prox.c+11−2
@@ -23,6 +23,9 @@ struct prox_state { · 22 unmodified lines
2323 struct hid_sensor_common common_attributes;
2424 struct hid_sensor_hub_attribute_info prox_attr;
2525 u32 human_presence;
26+ int scale_pre_decml;
27+ int scale_post_decml;
28+ int scale_precision;
2629 };
2730
2831 /* Channel definitions */
@@ -93,8 +96,9 @@ static int prox_read_raw(struct iio_dev *indio_dev, · 64 unmodified lines
9396 ret_type = IIO_VAL_INT;
9497 break;
9598 case IIO_CHAN_INFO_SCALE:
96− *val = prox_state->prox_attr.units;
97− ret_type = IIO_VAL_INT;
99+ *val = prox_state->scale_pre_decml;
100+ *val2 = prox_state->scale_post_decml;
101+ ret_type = prox_state->scale_precision;
98102 break;
99103 case IIO_CHAN_INFO_OFFSET:
100104 *val = hid_sensor_convert_exponent(
@@ -234,6 +238,11 @@ static int prox_parse_report(struct platform_device *pdev, · 133 unmodified lines
234238 HID_USAGE_SENSOR_HUMAN_PRESENCE,
235239 &st->common_attributes.sensitivity);
236240
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+
237246 return ret;
238247 }
239248
drivers/iio/temperature/hid-sensor-temperature.c+8−6
@@ -15,7 +15,10 @@ · 14 unmodified lines
1515 struct temperature_state {
1616 struct hid_sensor_common common_attributes;
1717 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;
1922 int scale_pre_decml;
2023 int scale_post_decml;
2124 int scale_precision;
@@ -32,7 +35,7 @@ static const struct iio_chan_spec temperature_channels[] = { · 10 unmodified lines
3235 BIT(IIO_CHAN_INFO_SAMP_FREQ) |
3336 BIT(IIO_CHAN_INFO_HYSTERESIS),
3437 },
35− IIO_CHAN_SOFT_TIMESTAMP(3),
38+ IIO_CHAN_SOFT_TIMESTAMP(1),
3639 };
3740
3841 /* 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
123126 struct temperature_state *temp_st = iio_priv(indio_dev);
124127
125128 if (atomic_read(&temp_st->common_attributes.data_ready))
126− iio_push_to_buffers_with_timestamp(indio_dev,
127− &temp_st->temperature_data,
128− iio_get_time_ns(indio_dev));
129+ iio_push_to_buffers_with_timestamp(indio_dev, &temp_st->scan,
130+ iio_get_time_ns(indio_dev));
129131
130132 return 0;
131133 }
@@ -140,7 +142,7 @@ static int temperature_capture_sample(struct hid_sensor_hub_device *hsdev, · 8 unmodified lines
140142
141143 switch (usage_id) {
142144 case HID_USAGE_SENSOR_DATA_ENVIRONMENTAL_TEMPERATURE:
143− temp_st->temperature_data = *(s32 *)raw_data;
145+ temp_st->scan.temperature_data = *(s32 *)raw_data;
144146 return 0;
145147 default:
146148 return -EINVAL;
drivers/staging/comedi/drivers/cb_pcidas.c+1−1
@@ -1281,7 +1281,7 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev, · 1280 unmodified lines
12811281 devpriv->amcc + AMCC_OP_REG_INTCSR);
12821282
12831283 ret = request_irq(pcidev->irq, cb_pcidas_interrupt, IRQF_SHARED,
1284− dev->board_name, dev);
1284+ "cb_pcidas", dev);
12851285 if (ret) {
12861286 dev_dbg(dev->class_dev, "unable to allocate irq %d\n",
12871287 pcidev->irq);
drivers/staging/comedi/drivers/cb_pcidas64.c+1−1
@@ -4035,7 +4035,7 @@ static int auto_attach(struct comedi_device *dev, · 4034 unmodified lines
40354035 init_stc_registers(dev);
40364036
40374037 retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
4038− dev->board_name, dev);
4038+ "cb_pcidas64", dev);
40394039 if (retval) {
40404040 dev_dbg(dev->class_dev, "unable to allocate irq %u\n",
40414041 pcidev->irq);
drivers/staging/vt6655/rxtx.h+2−2
@@ -150,7 +150,7 @@ struct vnt_cts { · 149 unmodified lines
150150 u16 reserved;
151151 struct ieee80211_cts data;
152152 u16 reserved2;
153−} __packed;
153+} __packed __aligned(2);
154154
155155 struct vnt_cts_fb {
156156 struct vnt_phy_field b;
@@ -160,7 +160,7 @@ struct vnt_cts_fb { · 3 unmodified lines
160160 __le16 cts_duration_ba_f1;
161161 struct ieee80211_cts data;
162162 u16 reserved2;
163−} __packed;
163+} __packed __aligned(2);
164164
165165 struct vnt_tx_fifo_head {
166166 u8 tx_key[WLAN_KEY_LEN_CCMP];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t