Commit e6934ab4 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull staging driver fixes from Greg KH:
 "Here are a few fixes for staging and iio drivers that resolve issues
  reported in 3.16-rc1.

  All have been in linux-next just fine"

* tag 'staging-3.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  imx-drm: parallel-display: Fix DPMS default state.
  staging: android: timed_output: fix use after free of dev
  staging: comedi: addi_apci_1564: add addi_watchdog dependency
  staging: rtl8723au: Reference correct firmwarefiles with MODULE_FIRMWARE()
  staging: rtl8723au: Request correct firmware file for A-cut parts
  iio: adc: checking for NULL instead of IS_ERR() in probe
  iio: adc: at91: signedness bug in at91_adc_get_trigger_value_by_name()
  iio: mxs-lradc: fix divider
  iio: Fix endianness issue in ak8975_read_axis()
  staging/iio: IIO_SIMPLE_DUMMY_BUFFER neds IIO_BUFFER
  twl4030-madc: Request processed values in twl4030_get_madc_conversion
  staging: iio: tsl2x7x_core: fix proximity treshold
  iio: Fix two mpl3115 issues in measurement conversion
  iio: hid-sensors: Get feature report from sensor hub after changing power state
parents c3cb500e c026a3f3
...@@ -510,12 +510,11 @@ static int at91_adc_channel_init(struct iio_dev *idev) ...@@ -510,12 +510,11 @@ static int at91_adc_channel_init(struct iio_dev *idev)
return idev->num_channels; return idev->num_channels;
} }
static u8 at91_adc_get_trigger_value_by_name(struct iio_dev *idev, static int at91_adc_get_trigger_value_by_name(struct iio_dev *idev,
struct at91_adc_trigger *triggers, struct at91_adc_trigger *triggers,
const char *trigger_name) const char *trigger_name)
{ {
struct at91_adc_state *st = iio_priv(idev); struct at91_adc_state *st = iio_priv(idev);
u8 value = 0;
int i; int i;
for (i = 0; i < st->trigger_number; i++) { for (i = 0; i < st->trigger_number; i++) {
...@@ -528,15 +527,16 @@ static u8 at91_adc_get_trigger_value_by_name(struct iio_dev *idev, ...@@ -528,15 +527,16 @@ static u8 at91_adc_get_trigger_value_by_name(struct iio_dev *idev,
return -ENOMEM; return -ENOMEM;
if (strcmp(trigger_name, name) == 0) { if (strcmp(trigger_name, name) == 0) {
value = triggers[i].value;
kfree(name); kfree(name);
break; if (triggers[i].value == 0)
return -EINVAL;
return triggers[i].value;
} }
kfree(name); kfree(name);
} }
return value; return -EINVAL;
} }
static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state)
...@@ -546,14 +546,14 @@ static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) ...@@ -546,14 +546,14 @@ static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state)
struct iio_buffer *buffer = idev->buffer; struct iio_buffer *buffer = idev->buffer;
struct at91_adc_reg_desc *reg = st->registers; struct at91_adc_reg_desc *reg = st->registers;
u32 status = at91_adc_readl(st, reg->trigger_register); u32 status = at91_adc_readl(st, reg->trigger_register);
u8 value; int value;
u8 bit; u8 bit;
value = at91_adc_get_trigger_value_by_name(idev, value = at91_adc_get_trigger_value_by_name(idev,
st->trigger_list, st->trigger_list,
idev->trig->name); idev->trig->name);
if (value == 0) if (value < 0)
return -EINVAL; return value;
if (state) { if (state) {
st->buffer = kmalloc(idev->scan_bytes, GFP_KERNEL); st->buffer = kmalloc(idev->scan_bytes, GFP_KERNEL);
......
...@@ -121,8 +121,8 @@ static int men_z188_probe(struct mcb_device *dev, ...@@ -121,8 +121,8 @@ static int men_z188_probe(struct mcb_device *dev,
indio_dev->num_channels = ARRAY_SIZE(z188_adc_iio_channels); indio_dev->num_channels = ARRAY_SIZE(z188_adc_iio_channels);
mem = mcb_request_mem(dev, "z188-adc"); mem = mcb_request_mem(dev, "z188-adc");
if (!mem) if (IS_ERR(mem))
return -ENOMEM; return PTR_ERR(mem);
adc->base = ioremap(mem->start, resource_size(mem)); adc->base = ioremap(mem->start, resource_size(mem));
if (adc->base == NULL) if (adc->base == NULL)
......
...@@ -645,6 +645,7 @@ int twl4030_get_madc_conversion(int channel_no) ...@@ -645,6 +645,7 @@ int twl4030_get_madc_conversion(int channel_no)
req.channels = (1 << channel_no); req.channels = (1 << channel_no);
req.method = TWL4030_MADC_SW2; req.method = TWL4030_MADC_SW2;
req.active = 0; req.active = 0;
req.raw = 0;
req.func_cb = NULL; req.func_cb = NULL;
ret = twl4030_madc_conversion(&req); ret = twl4030_madc_conversion(&req);
if (ret < 0) if (ret < 0)
......
...@@ -75,6 +75,9 @@ int hid_sensor_power_state(struct hid_sensor_common *st, bool state) ...@@ -75,6 +75,9 @@ int hid_sensor_power_state(struct hid_sensor_common *st, bool state)
(s32)report_val); (s32)report_val);
} }
sensor_hub_get_feature(st->hsdev, st->power_state.report_id,
st->power_state.index,
&state_val);
return 0; return 0;
} }
EXPORT_SYMBOL(hid_sensor_power_state); EXPORT_SYMBOL(hid_sensor_power_state);
......
...@@ -373,8 +373,6 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val) ...@@ -373,8 +373,6 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val)
{ {
struct ak8975_data *data = iio_priv(indio_dev); struct ak8975_data *data = iio_priv(indio_dev);
struct i2c_client *client = data->client; struct i2c_client *client = data->client;
u16 meas_reg;
s16 raw;
int ret; int ret;
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -422,16 +420,11 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val) ...@@ -422,16 +420,11 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val)
dev_err(&client->dev, "Read axis data fails\n"); dev_err(&client->dev, "Read axis data fails\n");
goto exit; goto exit;
} }
meas_reg = ret;
mutex_unlock(&data->lock); mutex_unlock(&data->lock);
/* Endian conversion of the measured values. */
raw = (s16) (le16_to_cpu(meas_reg));
/* Clamp to valid range. */ /* Clamp to valid range. */
raw = clamp_t(s16, raw, -4096, 4095); *val = clamp_t(s16, ret, -4096, 4095);
*val = raw;
return IIO_VAL_INT; return IIO_VAL_INT;
exit: exit:
......
...@@ -98,7 +98,7 @@ static int mpl3115_read_raw(struct iio_dev *indio_dev, ...@@ -98,7 +98,7 @@ static int mpl3115_read_raw(struct iio_dev *indio_dev,
mutex_unlock(&data->lock); mutex_unlock(&data->lock);
if (ret < 0) if (ret < 0)
return ret; return ret;
*val = sign_extend32(be32_to_cpu(tmp) >> 12, 23); *val = be32_to_cpu(tmp) >> 12;
return IIO_VAL_INT; return IIO_VAL_INT;
case IIO_TEMP: /* in 0.0625 celsius / LSB */ case IIO_TEMP: /* in 0.0625 celsius / LSB */
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -112,7 +112,7 @@ static int mpl3115_read_raw(struct iio_dev *indio_dev, ...@@ -112,7 +112,7 @@ static int mpl3115_read_raw(struct iio_dev *indio_dev,
mutex_unlock(&data->lock); mutex_unlock(&data->lock);
if (ret < 0) if (ret < 0)
return ret; return ret;
*val = sign_extend32(be32_to_cpu(tmp) >> 20, 15); *val = sign_extend32(be32_to_cpu(tmp) >> 20, 11);
return IIO_VAL_INT; return IIO_VAL_INT;
default: default:
return -EINVAL; return -EINVAL;
...@@ -185,7 +185,7 @@ static const struct iio_chan_spec mpl3115_channels[] = { ...@@ -185,7 +185,7 @@ static const struct iio_chan_spec mpl3115_channels[] = {
BIT(IIO_CHAN_INFO_SCALE), BIT(IIO_CHAN_INFO_SCALE),
.scan_index = 0, .scan_index = 0,
.scan_type = { .scan_type = {
.sign = 's', .sign = 'u',
.realbits = 20, .realbits = 20,
.storagebits = 32, .storagebits = 32,
.shift = 12, .shift = 12,
......
...@@ -97,7 +97,6 @@ void timed_output_dev_unregister(struct timed_output_dev *tdev) ...@@ -97,7 +97,6 @@ void timed_output_dev_unregister(struct timed_output_dev *tdev)
{ {
tdev->enable(tdev, 0); tdev->enable(tdev, 0);
device_destroy(timed_output_class, MKDEV(0, tdev->index)); device_destroy(timed_output_class, MKDEV(0, tdev->index));
dev_set_drvdata(tdev->dev, NULL);
} }
EXPORT_SYMBOL_GPL(timed_output_dev_unregister); EXPORT_SYMBOL_GPL(timed_output_dev_unregister);
......
...@@ -651,6 +651,7 @@ config COMEDI_ADDI_APCI_1516 ...@@ -651,6 +651,7 @@ config COMEDI_ADDI_APCI_1516
config COMEDI_ADDI_APCI_1564 config COMEDI_ADDI_APCI_1564
tristate "ADDI-DATA APCI_1564 support" tristate "ADDI-DATA APCI_1564 support"
select COMEDI_ADDI_WATCHDOG
---help--- ---help---
Enable support for ADDI-DATA APCI_1564 cards Enable support for ADDI-DATA APCI_1564 cards
......
...@@ -37,6 +37,7 @@ config IIO_SIMPLE_DUMMY_EVENTS ...@@ -37,6 +37,7 @@ config IIO_SIMPLE_DUMMY_EVENTS
config IIO_SIMPLE_DUMMY_BUFFER config IIO_SIMPLE_DUMMY_BUFFER
boolean "Buffered capture support" boolean "Buffered capture support"
select IIO_BUFFER
select IIO_KFIFO_BUF select IIO_KFIFO_BUF
help help
Add buffered data capture to the simple dummy driver. Add buffered data capture to the simple dummy driver.
......
...@@ -846,6 +846,14 @@ static int mxs_lradc_read_single(struct iio_dev *iio_dev, int chan, int *val) ...@@ -846,6 +846,14 @@ static int mxs_lradc_read_single(struct iio_dev *iio_dev, int chan, int *val)
LRADC_CTRL1); LRADC_CTRL1);
mxs_lradc_reg_clear(lradc, 0xff, LRADC_CTRL0); mxs_lradc_reg_clear(lradc, 0xff, LRADC_CTRL0);
/* Enable / disable the divider per requirement */
if (test_bit(chan, &lradc->is_divided))
mxs_lradc_reg_set(lradc, 1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET,
LRADC_CTRL2);
else
mxs_lradc_reg_clear(lradc,
1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET, LRADC_CTRL2);
/* Clean the slot's previous content, then set new one. */ /* Clean the slot's previous content, then set new one. */
mxs_lradc_reg_clear(lradc, LRADC_CTRL4_LRADCSELECT_MASK(0), mxs_lradc_reg_clear(lradc, LRADC_CTRL4_LRADCSELECT_MASK(0),
LRADC_CTRL4); LRADC_CTRL4);
...@@ -961,15 +969,11 @@ static int mxs_lradc_write_raw(struct iio_dev *iio_dev, ...@@ -961,15 +969,11 @@ static int mxs_lradc_write_raw(struct iio_dev *iio_dev,
if (val == scale_avail[MXS_LRADC_DIV_DISABLED].integer && if (val == scale_avail[MXS_LRADC_DIV_DISABLED].integer &&
val2 == scale_avail[MXS_LRADC_DIV_DISABLED].nano) { val2 == scale_avail[MXS_LRADC_DIV_DISABLED].nano) {
/* divider by two disabled */ /* divider by two disabled */
writel(1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET,
lradc->base + LRADC_CTRL2 + STMP_OFFSET_REG_CLR);
clear_bit(chan->channel, &lradc->is_divided); clear_bit(chan->channel, &lradc->is_divided);
ret = 0; ret = 0;
} else if (val == scale_avail[MXS_LRADC_DIV_ENABLED].integer && } else if (val == scale_avail[MXS_LRADC_DIV_ENABLED].integer &&
val2 == scale_avail[MXS_LRADC_DIV_ENABLED].nano) { val2 == scale_avail[MXS_LRADC_DIV_ENABLED].nano) {
/* divider by two enabled */ /* divider by two enabled */
writel(1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET,
lradc->base + LRADC_CTRL2 + STMP_OFFSET_REG_SET);
set_bit(chan->channel, &lradc->is_divided); set_bit(chan->channel, &lradc->is_divided);
ret = 0; ret = 0;
} }
......
...@@ -667,9 +667,13 @@ static int tsl2x7x_chip_on(struct iio_dev *indio_dev) ...@@ -667,9 +667,13 @@ static int tsl2x7x_chip_on(struct iio_dev *indio_dev)
chip->tsl2x7x_config[TSL2X7X_PRX_COUNT] = chip->tsl2x7x_config[TSL2X7X_PRX_COUNT] =
chip->tsl2x7x_settings.prox_pulse_count; chip->tsl2x7x_settings.prox_pulse_count;
chip->tsl2x7x_config[TSL2X7X_PRX_MINTHRESHLO] = chip->tsl2x7x_config[TSL2X7X_PRX_MINTHRESHLO] =
chip->tsl2x7x_settings.prox_thres_low; (chip->tsl2x7x_settings.prox_thres_low) & 0xFF;
chip->tsl2x7x_config[TSL2X7X_PRX_MINTHRESHHI] =
(chip->tsl2x7x_settings.prox_thres_low >> 8) & 0xFF;
chip->tsl2x7x_config[TSL2X7X_PRX_MAXTHRESHLO] = chip->tsl2x7x_config[TSL2X7X_PRX_MAXTHRESHLO] =
chip->tsl2x7x_settings.prox_thres_high; (chip->tsl2x7x_settings.prox_thres_high) & 0xFF;
chip->tsl2x7x_config[TSL2X7X_PRX_MAXTHRESHHI] =
(chip->tsl2x7x_settings.prox_thres_high >> 8) & 0xFF;
/* and make sure we're not already on */ /* and make sure we're not already on */
if (chip->tsl2x7x_chip_status == TSL2X7X_CHIP_WORKING) { if (chip->tsl2x7x_chip_status == TSL2X7X_CHIP_WORKING) {
......
...@@ -173,6 +173,13 @@ static int imx_pd_register(struct drm_device *drm, ...@@ -173,6 +173,13 @@ static int imx_pd_register(struct drm_device *drm,
if (ret) if (ret)
return ret; return ret;
/* set the connector's dpms to OFF so that
* drm_helper_connector_dpms() won't return
* immediately since the current state is ON
* at this point.
*/
imxpd->connector.dpms = DRM_MODE_DPMS_OFF;
drm_encoder_helper_add(&imxpd->encoder, &imx_pd_encoder_helper_funcs); drm_encoder_helper_add(&imxpd->encoder, &imx_pd_encoder_helper_funcs);
drm_encoder_init(drm, &imxpd->encoder, &imx_pd_encoder_funcs, drm_encoder_init(drm, &imxpd->encoder, &imx_pd_encoder_funcs,
DRM_MODE_ENCODER_NONE); DRM_MODE_ENCODER_NONE);
......
...@@ -298,7 +298,7 @@ int rtl8723a_FirmwareDownload(struct rtw_adapter *padapter) ...@@ -298,7 +298,7 @@ int rtl8723a_FirmwareDownload(struct rtw_adapter *padapter)
RT_TRACE(_module_hal_init_c_, _drv_info_, ("+%s\n", __func__)); RT_TRACE(_module_hal_init_c_, _drv_info_, ("+%s\n", __func__));
if (IS_8723A_A_CUT(pHalData->VersionID)) { if (IS_8723A_A_CUT(pHalData->VersionID)) {
fw_name = "rtlwifi/rtl8723aufw.bin"; fw_name = "rtlwifi/rtl8723aufw_A.bin";
RT_TRACE(_module_hal_init_c_, _drv_info_, RT_TRACE(_module_hal_init_c_, _drv_info_,
("rtl8723a_FirmwareDownload: R8723FwImageArray_UMC " ("rtl8723a_FirmwareDownload: R8723FwImageArray_UMC "
"for RTL8723A A CUT\n")); "for RTL8723A A CUT\n"));
......
...@@ -29,7 +29,9 @@ MODULE_AUTHOR("Realtek Semiconductor Corp."); ...@@ -29,7 +29,9 @@ MODULE_AUTHOR("Realtek Semiconductor Corp.");
MODULE_AUTHOR("Larry Finger <Larry.Finger@lwfinger.net>"); MODULE_AUTHOR("Larry Finger <Larry.Finger@lwfinger.net>");
MODULE_AUTHOR("Jes Sorensen <Jes.Sorensen@redhat.com>"); MODULE_AUTHOR("Jes Sorensen <Jes.Sorensen@redhat.com>");
MODULE_VERSION(DRIVERVERSION); MODULE_VERSION(DRIVERVERSION);
MODULE_FIRMWARE("rtlwifi/rtl8821aefw.bin"); MODULE_FIRMWARE("rtlwifi/rtl8723aufw_A.bin");
MODULE_FIRMWARE("rtlwifi/rtl8723aufw_B.bin");
MODULE_FIRMWARE("rtlwifi/rtl8723aufw_B_NoBT.bin");
/* module param defaults */ /* module param defaults */
static int rtw_chip_version = 0x00; static int rtw_chip_version = 0x00;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment