Skip to content

Commit 252bf9f

Browse files
committed
Merge tag 'staging-4.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging/IIO fixes from Greg KH: "Here are a few small IIO and one staging driver fix for 4.10-rc7. They fix some reported issues with the drivers. All of them have been in linux-next for a week or so with no reported issues" * tag 'staging-4.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: greybus: timesync: validate platform state callback iio: dht11: Use usleep_range instead of msleep for start signal iio: adc: palmas_gpadc: retrieve a valid iio_dev in suspend/resume iio: health: max30100: fixed parenthesis around FIFO count check iio: health: afe4404: retrieve a valid iio_dev in suspend/resume iio: health: afe4403: retrieve a valid iio_dev in suspend/resume
2 parents 8fcdcc4 + b17c1bb commit 252bf9f

File tree

6 files changed

+17
-9
lines changed

6 files changed

+17
-9
lines changed

drivers/iio/adc/palmas_gpadc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ static int palmas_adc_wakeup_reset(struct palmas_gpadc *adc)
775775

776776
static int palmas_gpadc_suspend(struct device *dev)
777777
{
778-
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
778+
struct iio_dev *indio_dev = dev_get_drvdata(dev);
779779
struct palmas_gpadc *adc = iio_priv(indio_dev);
780780
int wakeup = adc->wakeup1_enable || adc->wakeup2_enable;
781781
int ret;
@@ -798,7 +798,7 @@ static int palmas_gpadc_suspend(struct device *dev)
798798

799799
static int palmas_gpadc_resume(struct device *dev)
800800
{
801-
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
801+
struct iio_dev *indio_dev = dev_get_drvdata(dev);
802802
struct palmas_gpadc *adc = iio_priv(indio_dev);
803803
int wakeup = adc->wakeup1_enable || adc->wakeup2_enable;
804804
int ret;

drivers/iio/health/afe4403.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ MODULE_DEVICE_TABLE(of, afe4403_of_match);
422422

423423
static int __maybe_unused afe4403_suspend(struct device *dev)
424424
{
425-
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
425+
struct iio_dev *indio_dev = spi_get_drvdata(to_spi_device(dev));
426426
struct afe4403_data *afe = iio_priv(indio_dev);
427427
int ret;
428428

@@ -443,7 +443,7 @@ static int __maybe_unused afe4403_suspend(struct device *dev)
443443

444444
static int __maybe_unused afe4403_resume(struct device *dev)
445445
{
446-
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
446+
struct iio_dev *indio_dev = spi_get_drvdata(to_spi_device(dev));
447447
struct afe4403_data *afe = iio_priv(indio_dev);
448448
int ret;
449449

drivers/iio/health/afe4404.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ MODULE_DEVICE_TABLE(of, afe4404_of_match);
428428

429429
static int __maybe_unused afe4404_suspend(struct device *dev)
430430
{
431-
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
431+
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
432432
struct afe4404_data *afe = iio_priv(indio_dev);
433433
int ret;
434434

@@ -449,7 +449,7 @@ static int __maybe_unused afe4404_suspend(struct device *dev)
449449

450450
static int __maybe_unused afe4404_resume(struct device *dev)
451451
{
452-
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
452+
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
453453
struct afe4404_data *afe = iio_priv(indio_dev);
454454
int ret;
455455

drivers/iio/health/max30100.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static irqreturn_t max30100_interrupt_handler(int irq, void *private)
238238

239239
mutex_lock(&data->lock);
240240

241-
while (cnt || (cnt = max30100_fifo_count(data) > 0)) {
241+
while (cnt || (cnt = max30100_fifo_count(data)) > 0) {
242242
ret = max30100_read_measurement(data);
243243
if (ret)
244244
break;

drivers/iio/humidity/dht11.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@
7171
* a) select an implementation using busy loop polling on those systems
7272
* b) use the checksum to do some probabilistic decoding
7373
*/
74-
#define DHT11_START_TRANSMISSION 18 /* ms */
74+
#define DHT11_START_TRANSMISSION_MIN 18000 /* us */
75+
#define DHT11_START_TRANSMISSION_MAX 20000 /* us */
7576
#define DHT11_MIN_TIMERES 34000 /* ns */
7677
#define DHT11_THRESHOLD 49000 /* ns */
7778
#define DHT11_AMBIG_LOW 23000 /* ns */
@@ -228,7 +229,8 @@ static int dht11_read_raw(struct iio_dev *iio_dev,
228229
ret = gpio_direction_output(dht11->gpio, 0);
229230
if (ret)
230231
goto err;
231-
msleep(DHT11_START_TRANSMISSION);
232+
usleep_range(DHT11_START_TRANSMISSION_MIN,
233+
DHT11_START_TRANSMISSION_MAX);
232234
ret = gpio_direction_input(dht11->gpio);
233235
if (ret)
234236
goto err;

drivers/staging/greybus/timesync_platform.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,18 @@ u32 gb_timesync_platform_get_clock_rate(void)
4545

4646
int gb_timesync_platform_lock_bus(struct gb_timesync_svc *pdata)
4747
{
48+
if (!arche_platform_change_state_cb)
49+
return 0;
50+
4851
return arche_platform_change_state_cb(ARCHE_PLATFORM_STATE_TIME_SYNC,
4952
pdata);
5053
}
5154

5255
void gb_timesync_platform_unlock_bus(void)
5356
{
57+
if (!arche_platform_change_state_cb)
58+
return;
59+
5460
arche_platform_change_state_cb(ARCHE_PLATFORM_STATE_ACTIVE, NULL);
5561
}
5662

0 commit comments

Comments
 (0)