diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-23 15:53:07 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-23 15:53:07 -0400 |
| commit | 9d23108df359e572a0dca0b631bfee9f5e0fa9ea (patch) | |
| tree | 3af88906d9ebb51aedb4fa067cd20cdac2f1ac04 | |
| parent | e04a0a5ab92d4f74d29dd749e9de8d51ee94b3da (diff) | |
| parent | 617408101362c830779b8b4c7eca9efefe0beab1 (diff) | |
Merge tag 'staging-3.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging fixes from Greg KH:
"Here are a number of small staging tree and iio driver fixes. Nothing
major, just lots of little things"
* tag 'staging-3.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (34 commits)
iio:buffer_cb: Add missing iio_buffer_init()
iio: Prevent race between IIO chardev opening and IIO device free
iio: fix: Keep a reference to the IIO device for open file descriptors
iio: Stop sampling when the device is removed
iio: Fix crash when scan_bytes is computed with active_scan_mask == NULL
iio: Fix mcp4725 dev-to-indio_dev conversion in suspend/resume
iio: Fix bma180 dev-to-indio_dev conversion in suspend/resume
iio: Fix tmp006 dev-to-indio_dev conversion in suspend/resume
iio: iio_device_add_event_sysfs() bugfix
staging: iio: ade7854-spi: Fix return value
staging:iio:hmc5843: Fix measurement conversion
iio: isl29018: Fix uninitialized value
staging:iio:dummy fix kfifo_buf kconfig dependency issue if kfifo modular and buffer enabled for built in dummy driver.
iio: at91: fix adc_clk overflow
staging: line6: add bounds check in snd_toneport_source_put()
Staging: comedi: Fix dependencies for drivers misclassified as PCI
staging: r8188eu: Adjust RX gain
staging: r8188eu: Fix smatch warning in core/rtw_ieee80211.
staging: r8188eu: Fix smatch error in core/rtw_mlme_ext.c
staging: r8188eu: Fix Smatch off-by-one warning in hal/rtl8188e_hal_init.c
...
35 files changed, 160 insertions, 97 deletions
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index 12e32e6b4103..81e3dc260993 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c | |||
| @@ -620,7 +620,7 @@ static int bma180_remove(struct i2c_client *client) | |||
| 620 | #ifdef CONFIG_PM_SLEEP | 620 | #ifdef CONFIG_PM_SLEEP |
| 621 | static int bma180_suspend(struct device *dev) | 621 | static int bma180_suspend(struct device *dev) |
| 622 | { | 622 | { |
| 623 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); | 623 | struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); |
| 624 | struct bma180_data *data = iio_priv(indio_dev); | 624 | struct bma180_data *data = iio_priv(indio_dev); |
| 625 | int ret; | 625 | int ret; |
| 626 | 626 | ||
| @@ -633,7 +633,7 @@ static int bma180_suspend(struct device *dev) | |||
| 633 | 633 | ||
| 634 | static int bma180_resume(struct device *dev) | 634 | static int bma180_resume(struct device *dev) |
| 635 | { | 635 | { |
| 636 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); | 636 | struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); |
| 637 | struct bma180_data *data = iio_priv(indio_dev); | 637 | struct bma180_data *data = iio_priv(indio_dev); |
| 638 | int ret; | 638 | int ret; |
| 639 | 639 | ||
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 84be63bdf038..0f16b553e063 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c | |||
| @@ -556,7 +556,7 @@ static const struct iio_info at91_adc_info = { | |||
| 556 | 556 | ||
| 557 | static int at91_adc_probe(struct platform_device *pdev) | 557 | static int at91_adc_probe(struct platform_device *pdev) |
| 558 | { | 558 | { |
| 559 | unsigned int prsc, mstrclk, ticks, adc_clk, shtim; | 559 | unsigned int prsc, mstrclk, ticks, adc_clk, adc_clk_khz, shtim; |
| 560 | int ret; | 560 | int ret; |
| 561 | struct iio_dev *idev; | 561 | struct iio_dev *idev; |
| 562 | struct at91_adc_state *st; | 562 | struct at91_adc_state *st; |
| @@ -649,6 +649,7 @@ static int at91_adc_probe(struct platform_device *pdev) | |||
| 649 | */ | 649 | */ |
| 650 | mstrclk = clk_get_rate(st->clk); | 650 | mstrclk = clk_get_rate(st->clk); |
| 651 | adc_clk = clk_get_rate(st->adc_clk); | 651 | adc_clk = clk_get_rate(st->adc_clk); |
| 652 | adc_clk_khz = adc_clk / 1000; | ||
| 652 | prsc = (mstrclk / (2 * adc_clk)) - 1; | 653 | prsc = (mstrclk / (2 * adc_clk)) - 1; |
| 653 | 654 | ||
| 654 | if (!st->startup_time) { | 655 | if (!st->startup_time) { |
| @@ -662,15 +663,15 @@ static int at91_adc_probe(struct platform_device *pdev) | |||
| 662 | * defined in the electrical characteristics of the board, divided by 8. | 663 | * defined in the electrical characteristics of the board, divided by 8. |
| 663 | * The formula thus is : Startup Time = (ticks + 1) * 8 / ADC Clock | 664 | * The formula thus is : Startup Time = (ticks + 1) * 8 / ADC Clock |
| 664 | */ | 665 | */ |
| 665 | ticks = round_up((st->startup_time * adc_clk / | 666 | ticks = round_up((st->startup_time * adc_clk_khz / |
| 666 | 1000000) - 1, 8) / 8; | 667 | 1000) - 1, 8) / 8; |
| 667 | /* | 668 | /* |
| 668 | * a minimal Sample and Hold Time is necessary for the ADC to guarantee | 669 | * a minimal Sample and Hold Time is necessary for the ADC to guarantee |
| 669 | * the best converted final value between two channels selection | 670 | * the best converted final value between two channels selection |
| 670 | * The formula thus is : Sample and Hold Time = (shtim + 1) / ADCClock | 671 | * The formula thus is : Sample and Hold Time = (shtim + 1) / ADCClock |
| 671 | */ | 672 | */ |
| 672 | shtim = round_up((st->sample_hold_time * adc_clk / | 673 | shtim = round_up((st->sample_hold_time * adc_clk_khz / |
| 673 | 1000000) - 1, 1); | 674 | 1000) - 1, 1); |
| 674 | 675 | ||
| 675 | reg = AT91_ADC_PRESCAL_(prsc) & st->registers->mr_prescal_mask; | 676 | reg = AT91_ADC_PRESCAL_(prsc) & st->registers->mr_prescal_mask; |
| 676 | reg |= AT91_ADC_STARTUP_(ticks) & st->registers->mr_startup_mask; | 677 | reg |= AT91_ADC_STARTUP_(ticks) & st->registers->mr_startup_mask; |
diff --git a/drivers/iio/buffer_cb.c b/drivers/iio/buffer_cb.c index 9d19ba74f22b..415f3c6efd72 100644 --- a/drivers/iio/buffer_cb.c +++ b/drivers/iio/buffer_cb.c | |||
| @@ -41,6 +41,8 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, | |||
| 41 | goto error_ret; | 41 | goto error_ret; |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | iio_buffer_init(&cb_buff->buffer); | ||
| 45 | |||
| 44 | cb_buff->private = private; | 46 | cb_buff->private = private; |
| 45 | cb_buff->cb = cb; | 47 | cb_buff->cb = cb; |
| 46 | cb_buff->buffer.access = &iio_cb_access; | 48 | cb_buff->buffer.access = &iio_cb_access; |
diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c index 1f4a48e6a82c..1397b6e0e414 100644 --- a/drivers/iio/dac/mcp4725.c +++ b/drivers/iio/dac/mcp4725.c | |||
| @@ -37,21 +37,21 @@ struct mcp4725_data { | |||
| 37 | 37 | ||
| 38 | static int mcp4725_suspend(struct device *dev) | 38 | static int mcp4725_suspend(struct device *dev) |
| 39 | { | 39 | { |
| 40 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); | 40 | struct mcp4725_data *data = iio_priv(i2c_get_clientdata( |
| 41 | struct mcp4725_data *data = iio_priv(indio_dev); | 41 | to_i2c_client(dev))); |
| 42 | u8 outbuf[2]; | 42 | u8 outbuf[2]; |
| 43 | 43 | ||
| 44 | outbuf[0] = (data->powerdown_mode + 1) << 4; | 44 | outbuf[0] = (data->powerdown_mode + 1) << 4; |
| 45 | outbuf[1] = 0; | 45 | outbuf[1] = 0; |
| 46 | data->powerdown = true; | 46 | data->powerdown = true; |
| 47 | 47 | ||
| 48 | return i2c_master_send(to_i2c_client(dev), outbuf, 2); | 48 | return i2c_master_send(data->client, outbuf, 2); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | static int mcp4725_resume(struct device *dev) | 51 | static int mcp4725_resume(struct device *dev) |
| 52 | { | 52 | { |
| 53 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); | 53 | struct mcp4725_data *data = iio_priv(i2c_get_clientdata( |
| 54 | struct mcp4725_data *data = iio_priv(indio_dev); | 54 | to_i2c_client(dev))); |
| 55 | u8 outbuf[2]; | 55 | u8 outbuf[2]; |
| 56 | 56 | ||
| 57 | /* restore previous DAC value */ | 57 | /* restore previous DAC value */ |
| @@ -59,7 +59,7 @@ static int mcp4725_resume(struct device *dev) | |||
| 59 | outbuf[1] = data->dac_value & 0xff; | 59 | outbuf[1] = data->dac_value & 0xff; |
| 60 | data->powerdown = false; | 60 | |
