Skip to content

Commit

Permalink
Merge tag 'staging-4.10-rc7' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/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
  • Loading branch information
Linus Torvalds committed Feb 4, 2017
2 parents 8fcdcc4 + b17c1bb commit 252bf9f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions drivers/iio/adc/palmas_gpadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ static int palmas_adc_wakeup_reset(struct palmas_gpadc *adc)

static int palmas_gpadc_suspend(struct device *dev)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct palmas_gpadc *adc = iio_priv(indio_dev);
int wakeup = adc->wakeup1_enable || adc->wakeup2_enable;
int ret;
Expand All @@ -798,7 +798,7 @@ static int palmas_gpadc_suspend(struct device *dev)

static int palmas_gpadc_resume(struct device *dev)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct palmas_gpadc *adc = iio_priv(indio_dev);
int wakeup = adc->wakeup1_enable || adc->wakeup2_enable;
int ret;
Expand Down
4 changes: 2 additions & 2 deletions drivers/iio/health/afe4403.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ MODULE_DEVICE_TABLE(of, afe4403_of_match);

static int __maybe_unused afe4403_suspend(struct device *dev)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct iio_dev *indio_dev = spi_get_drvdata(to_spi_device(dev));
struct afe4403_data *afe = iio_priv(indio_dev);
int ret;

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

static int __maybe_unused afe4403_resume(struct device *dev)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct iio_dev *indio_dev = spi_get_drvdata(to_spi_device(dev));
struct afe4403_data *afe = iio_priv(indio_dev);
int ret;

Expand Down
4 changes: 2 additions & 2 deletions drivers/iio/health/afe4404.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ MODULE_DEVICE_TABLE(of, afe4404_of_match);

static int __maybe_unused afe4404_suspend(struct device *dev)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
struct afe4404_data *afe = iio_priv(indio_dev);
int ret;

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

static int __maybe_unused afe4404_resume(struct device *dev)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
struct afe4404_data *afe = iio_priv(indio_dev);
int ret;

Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/health/max30100.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static irqreturn_t max30100_interrupt_handler(int irq, void *private)

mutex_lock(&data->lock);

while (cnt || (cnt = max30100_fifo_count(data) > 0)) {
while (cnt || (cnt = max30100_fifo_count(data)) > 0) {
ret = max30100_read_measurement(data);
if (ret)
break;
Expand Down
6 changes: 4 additions & 2 deletions drivers/iio/humidity/dht11.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
* a) select an implementation using busy loop polling on those systems
* b) use the checksum to do some probabilistic decoding
*/
#define DHT11_START_TRANSMISSION 18 /* ms */
#define DHT11_START_TRANSMISSION_MIN 18000 /* us */
#define DHT11_START_TRANSMISSION_MAX 20000 /* us */
#define DHT11_MIN_TIMERES 34000 /* ns */
#define DHT11_THRESHOLD 49000 /* ns */
#define DHT11_AMBIG_LOW 23000 /* ns */
Expand Down Expand Up @@ -228,7 +229,8 @@ static int dht11_read_raw(struct iio_dev *iio_dev,
ret = gpio_direction_output(dht11->gpio, 0);
if (ret)
goto err;
msleep(DHT11_START_TRANSMISSION);
usleep_range(DHT11_START_TRANSMISSION_MIN,
DHT11_START_TRANSMISSION_MAX);
ret = gpio_direction_input(dht11->gpio);
if (ret)
goto err;
Expand Down
6 changes: 6 additions & 0 deletions drivers/staging/greybus/timesync_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,18 @@ u32 gb_timesync_platform_get_clock_rate(void)

int gb_timesync_platform_lock_bus(struct gb_timesync_svc *pdata)
{
if (!arche_platform_change_state_cb)
return 0;

return arche_platform_change_state_cb(ARCHE_PLATFORM_STATE_TIME_SYNC,
pdata);
}

void gb_timesync_platform_unlock_bus(void)
{
if (!arche_platform_change_state_cb)
return;

arche_platform_change_state_cb(ARCHE_PLATFORM_STATE_ACTIVE, NULL);
}

Expand Down

0 comments on commit 252bf9f

Please sign in to comment.