Skip to content

Commit

Permalink
Merge branch 'staging-linus' into staging-next
Browse files Browse the repository at this point in the history
This is to get the comedi fixes, and resolve the issue in comdi_test.c
and comedi_fops.c that were caused by changes in both branches.

It also allows the fwserial driver changes to be applied, as they
required the fixes that are in staging-linus.

Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Jan 7, 2013
2 parents d7f9729 + e16a922 commit 17cb3be
Show file tree
Hide file tree
Showing 49 changed files with 1,366 additions and 967 deletions.
1 change: 1 addition & 0 deletions drivers/iio/accel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ config HID_SENSOR_ACCEL_3D
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
select HID_SENSOR_IIO_COMMON
select HID_SENSOR_IIO_TRIGGER
tristate "HID Accelerometers 3D"
help
Say yes here to build support for the HID SENSOR
Expand Down
6 changes: 5 additions & 1 deletion drivers/iio/adc/ad7266.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,11 @@ static int __devinit ad7266_probe(struct spi_device *spi)
if (ret)
goto error_put_reg;

st->vref_uv = regulator_get_voltage(st->reg);
ret = regulator_get_voltage(st->reg);
if (ret < 0)
goto error_disable_reg;

st->vref_uv = ret;
} else {
/* Use internal reference */
st->vref_uv = 2500000;
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/adc/at91_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p)
*timestamp = pf->timestamp;
}

iio_push_to_buffers(indio_dev, (u8 *)st->buffer);
iio_push_to_buffers(idev, (u8 *)st->buffer);

iio_trigger_notify_done(idev->trig);

Expand Down
13 changes: 6 additions & 7 deletions drivers/iio/adc/max1363.c
Original file line number Diff line number Diff line change
Expand Up @@ -1558,17 +1558,18 @@ static int __devinit max1363_probe(struct i2c_client *client,

return 0;
error_free_irq:
free_irq(st->client->irq, indio_dev);
if (client->irq)
free_irq(st->client->irq, indio_dev);
error_uninit_buffer:
iio_triggered_buffer_cleanup(indio_dev);
error_free_available_scan_masks:
kfree(indio_dev->available_scan_masks);
error_unregister_map:
iio_map_array_unregister(indio_dev, client->dev.platform_data);
error_disable_reg:
regulator_disable(st->reg);
error_put_reg:
regulator_put(st->reg);
error_unregister_map:
iio_map_array_unregister(indio_dev, client->dev.platform_data);
error_free_device:
iio_device_free(indio_dev);
error_out:
Expand All @@ -1585,10 +1586,8 @@ static int __devexit max1363_remove(struct i2c_client *client)
free_irq(st->client->irq, indio_dev);
iio_triggered_buffer_cleanup(indio_dev);
kfree(indio_dev->available_scan_masks);
if (!IS_ERR(st->reg)) {
regulator_disable(st->reg);
regulator_put(st->reg);
}
regulator_disable(st->reg);
regulator_put(st->reg);
iio_map_array_unregister(indio_dev, client->dev.platform_data);
iio_device_free(indio_dev);

Expand Down
13 changes: 12 additions & 1 deletion drivers/iio/common/hid-sensors/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,25 @@ menu "Hid Sensor IIO Common"
config HID_SENSOR_IIO_COMMON
tristate "Common modules for all HID Sensor IIO drivers"
depends on HID_SENSOR_HUB
select IIO_TRIGGER if IIO_BUFFER
select HID_SENSOR_IIO_TRIGGER if IIO_BUFFER
help
Say yes here to build support for HID sensor to use
HID sensor common processing for attributes and IIO triggers.
There are many attributes which can be shared among multiple
HID sensor drivers, this module contains processing for those
attributes.

config HID_SENSOR_IIO_TRIGGER
tristate "Common module (trigger) for all HID Sensor IIO drivers"
depends on HID_SENSOR_HUB && HID_SENSOR_IIO_COMMON
select IIO_TRIGGER
help
Say yes here to build trigger support for HID sensors.
Triggers will be send if all requested attributes were read.

If this driver is compiled as a module, it will be named
hid-sensor-trigger.

config HID_SENSOR_ENUM_BASE_QUIRKS
bool "ENUM base quirks for HID Sensor IIO drivers"
depends on HID_SENSOR_IIO_COMMON
Expand Down
3 changes: 2 additions & 1 deletion drivers/iio/common/hid-sensors/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
#

obj-$(CONFIG_HID_SENSOR_IIO_COMMON) += hid-sensor-iio-common.o
hid-sensor-iio-common-y := hid-sensor-attributes.o hid-sensor-trigger.o
obj-$(CONFIG_HID_SENSOR_IIO_TRIGGER) += hid-sensor-trigger.o
hid-sensor-iio-common-y := hid-sensor-attributes.o
6 changes: 5 additions & 1 deletion drivers/iio/dac/ad5380.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,11 @@ static int __devinit ad5380_probe(struct device *dev, struct regmap *regmap,
goto error_free_reg;
}

st->vref = regulator_get_voltage(st->vref_reg);
ret = regulator_get_voltage(st->vref_reg);
if (ret < 0)
goto error_disable_reg;

st->vref = ret;
} else {
st->vref = st->chip_info->int_vref;
ctrl |= AD5380_CTRL_INT_VREF_EN;
Expand Down
6 changes: 5 additions & 1 deletion drivers/iio/dac/ad5446.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ static int __devinit ad5446_probe(struct device *dev, const char *name,
if (ret)
goto error_put_reg;

voltage_uv = regulator_get_voltage(reg);
ret = regulator_get_voltage(reg);
if (ret < 0)
goto error_disable_reg;

voltage_uv = ret;
}

indio_dev = iio_device_alloc(sizeof(*st));
Expand Down
6 changes: 5 additions & 1 deletion drivers/iio/dac/ad5504.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ static int __devinit ad5504_probe(struct spi_device *spi)
if (ret)
goto error_put_reg;

voltage_uv = regulator_get_voltage(reg);
ret = regulator_get_voltage(reg);
if (ret < 0)
goto error_disable_reg;

voltage_uv = ret;
}

spi_set_drvdata(spi, indio_dev);
Expand Down
6 changes: 5 additions & 1 deletion drivers/iio/dac/ad5624r_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,11 @@ static int __devinit ad5624r_probe(struct spi_device *spi)
if (ret)
goto error_put_reg;

voltage_uv = regulator_get_voltage(st->reg);
ret = regulator_get_voltage(st->reg);
if (ret < 0)
goto error_disable_reg;

voltage_uv = ret;
}

spi_set_drvdata(spi, indio_dev);
Expand Down
6 changes: 5 additions & 1 deletion drivers/iio/dac/ad5686.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ static int __devinit ad5686_probe(struct spi_device *spi)
if (ret)
goto error_put_reg;

voltage_uv = regulator_get_voltage(st->reg);
ret = regulator_get_voltage(st->reg);
if (ret < 0)
goto error_disable_reg;

voltage_uv = ret;
}

st->chip_info =
Expand Down
13 changes: 11 additions & 2 deletions drivers/iio/dac/ad5791.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@ static int __devinit ad5791_probe(struct spi_device *spi)
if (ret)
goto error_put_reg_pos;

pos_voltage_uv = regulator_get_voltage(st->reg_vdd);
ret = regulator_get_voltage(st->reg_vdd);
if (ret < 0)
goto error_disable_reg_pos;

pos_voltage_uv = ret;
}

st->reg_vss = regulator_get(&spi->dev, "vss");
Expand All @@ -374,7 +378,11 @@ static int __devinit ad5791_probe(struct spi_device *spi)
if (ret)
goto error_put_reg_neg;

neg_voltage_uv = regulator_get_voltage(st->reg_vss);
ret = regulator_get_voltage(st->reg_vss);
if (ret < 0)
goto error_disable_reg_neg;

neg_voltage_uv = ret;
}

st->pwr_down = true;
Expand Down Expand Up @@ -428,6 +436,7 @@ static int __devinit ad5791_probe(struct spi_device *spi)
if (!IS_ERR(st->reg_vss))
regulator_put(st->reg_vss);

error_disable_reg_pos:
if (!IS_ERR(st->reg_vdd))
regulator_disable(st->reg_vdd);
error_put_reg_pos:
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/frequency/adf4350.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
} while ((st->r1_mod > ADF4350_MAX_MODULUS) && r_cnt);
} while (r_cnt == 0);

tmp = freq * (u64)st->r1_mod + (st->fpfd > 1);
tmp = freq * (u64)st->r1_mod + (st->fpfd >> 1);
do_div(tmp, st->fpfd); /* Div round closest (n + d/2)/d */
st->r0_fract = do_div(tmp, st->r1_mod);
st->r0_int = tmp;
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/gyro/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ config HID_SENSOR_GYRO_3D
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
select HID_SENSOR_IIO_COMMON
select HID_SENSOR_IIO_TRIGGER
tristate "HID Gyroscope 3D"
help
Say yes here to build support for the HID SENSOR
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/light/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ config HID_SENSOR_ALS
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
select HID_SENSOR_IIO_COMMON
select HID_SENSOR_IIO_TRIGGER
tristate "HID ALS"
help
Say yes here to build support for the HID SENSOR
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/magnetometer/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ config HID_SENSOR_MAGNETOMETER_3D
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
select HID_SENSOR_IIO_COMMON
select HID_SENSOR_IIO_TRIGGER
tristate "HID Magenetometer 3D"
help
Say yes here to build support for the HID SENSOR
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/comedi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ config COMEDI_ADQ12B

config COMEDI_NI_AT_A2150
tristate "NI AT-A2150 ISA card support"
select COMEDI_FC
depends on VIRT_TO_BUS
---help---
Enable support for National Instruments AT-A2150 cards
Expand Down
4 changes: 4 additions & 0 deletions drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,7 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,
{
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_device *dev = comedi_dev_from_minor(minor);
struct comedi_file_info *info = comedi_file_info_from_minor(minor);
int rc;

if (!dev)
Expand All @@ -1660,6 +1661,9 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,
if (cmd == COMEDI_DEVCONFIG) {
rc = do_devconfig_ioctl(dev,
(struct comedi_devconfig __user *)arg);
if (rc == 0)
/* Evade comedi_auto_unconfig(). */
info->hardware_device = NULL;
goto done;
}

Expand Down
16 changes: 8 additions & 8 deletions drivers/staging/comedi/drivers/ni_pcimio.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ static const struct ni_board_struct ni_boards[] = {
.ao_range_table = &range_ni_M_625x_ao,
.reg_type = ni_reg_625x,
.ao_unipolar = 0,
.ao_speed = 357,
.ao_speed = 350,
.num_p0_dio_channels = 8,
.caldac = {caldac_none},
.has_8255 = 0,
Expand All @@ -982,7 +982,7 @@ static const struct ni_board_struct ni_boards[] = {
.ao_range_table = &range_ni_M_625x_ao,
.reg_type = ni_reg_625x,
.ao_unipolar = 0,
.ao_speed = 357,
.ao_speed = 350,
.num_p0_dio_channels = 8,
.caldac = {caldac_none},
.has_8255 = 0,
Expand All @@ -1001,7 +1001,7 @@ static const struct ni_board_struct ni_boards[] = {
.ao_range_table = &range_ni_M_625x_ao,
.reg_type = ni_reg_625x,
.ao_unipolar = 0,
.ao_speed = 357,
.ao_speed = 350,
.num_p0_dio_channels = 8,
.caldac = {caldac_none},
.has_8255 = 0,
Expand Down Expand Up @@ -1037,7 +1037,7 @@ static const struct ni_board_struct ni_boards[] = {
.ao_range_table = &range_ni_M_625x_ao,
.reg_type = ni_reg_625x,
.ao_unipolar = 0,
.ao_speed = 357,
.ao_speed = 350,
.num_p0_dio_channels = 32,
.caldac = {caldac_none},
.has_8255 = 0,
Expand All @@ -1056,7 +1056,7 @@ static const struct ni_board_struct ni_boards[] = {
.ao_range_table = &range_ni_M_625x_ao,
.reg_type = ni_reg_625x,
.ao_unipolar = 0,
.ao_speed = 357,
.ao_speed = 350,
.num_p0_dio_channels = 32,
.caldac = {caldac_none},
.has_8255 = 0,
Expand Down Expand Up @@ -1092,7 +1092,7 @@ static const struct ni_board_struct ni_boards[] = {
.ao_range_table = &range_ni_M_628x_ao,
.reg_type = ni_reg_628x,
.ao_unipolar = 1,
.ao_speed = 357,
.ao_speed = 350,
.num_p0_dio_channels = 8,
.caldac = {caldac_none},
.has_8255 = 0,
Expand All @@ -1111,7 +1111,7 @@ static const struct ni_board_struct ni_boards[] = {
.ao_range_table = &range_ni_M_628x_ao,
.reg_type = ni_reg_628x,
.ao_unipolar = 1,
.ao_speed = 357,
.ao_speed = 350,
.num_p0_dio_channels = 8,
.caldac = {caldac_none},
.has_8255 = 0,
Expand Down Expand Up @@ -1147,7 +1147,7 @@ static const struct ni_board_struct ni_boards[] = {
.ao_range_table = &range_ni_M_628x_ao,
.reg_type = ni_reg_628x,
.ao_unipolar = 1,
.ao_speed = 357,
.ao_speed = 350,
.num_p0_dio_channels = 32,
.caldac = {caldac_none},
.has_8255 = 0,
Expand Down
4 changes: 3 additions & 1 deletion drivers/staging/fwserial/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ config FIREWIRE_SERIAL
depends on FIREWIRE
help
This enables TTY over IEEE 1394, providing high-speed serial
connectivity to cabled peers.
connectivity to cabled peers. This driver implements a
ad-hoc transport protocol and is currently limited to
Linux-to-Linux communication.

To compile this driver as a module, say M here: the module will
be called firewire-serial.
14 changes: 3 additions & 11 deletions drivers/staging/fwserial/TODO
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TODOs
-----
TODOs prior to this driver moving out of staging
------------------------------------------------
1. Implement retries for RCODE_BUSY, RCODE_NO_ACK and RCODE_SEND_ERROR
- I/O is handled asynchronously which presents some issues when error
conditions occur.
Expand All @@ -11,17 +11,9 @@ TODOs
-- Issues with firewire stack --
1. This driver uses the same unregistered vendor id that the firewire core does
(0xd00d1e). Perhaps this could be exposed as a define in
firewire-constants.h?
2. MAX_ASYNC_PAYLOAD needs to be publicly exposed by core/ohci
- otherwise how will this driver know the max size of address window to
open for one packet write?
firewire.h?
3. Maybe device_max_receive() and link_speed_to_max_payload() should be
taken up by the firewire core?
4. To avoid dropping rx data while still limiting the maximum buffering,
the size of the AR context must be known. How to expose this to drivers?
5. Explore if bigger AR context will reduce RCODE_BUSY responses
(or auto-grow to certain max size -- but this would require major surgery
as the current AR is contiguously mapped)

-- Issues with TTY core --
1. Hack for alternate device name scheme
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/fwserial/fwserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static void dump_profile(struct seq_file *m, struct stats *stats)
/* Returns the max receive packet size for the given card */
static inline int device_max_receive(struct fw_device *fw_device)
{
return 1 << (clamp_t(int, fw_device->max_rec, 8U, 13U) + 1);
return 1 << (clamp_t(int, fw_device->max_rec, 8U, 11U) + 1);
}

static void fwtty_log_tx_error(struct fwtty_port *port, int rcode)
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/fwserial/fwserial.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,10 @@ static inline void fwtty_bind_console(struct fwtty_port *port,
*/
static inline int link_speed_to_max_payload(unsigned speed)
{
static const int max_async[] = { 307, 614, 1229, 2458, 4916, 9832, };
BUILD_BUG_ON(ARRAY_SIZE(max_async) - 1 != SCODE_3200);
static const int max_async[] = { 307, 614, 1229, 2458, };
BUILD_BUG_ON(ARRAY_SIZE(max_async) - 1 != SCODE_800);

speed = clamp(speed, (unsigned) SCODE_100, (unsigned) SCODE_3200);
speed = clamp(speed, (unsigned) SCODE_100, (unsigned) SCODE_800);
if (limit_bw)
return max_async[speed];
else
Expand Down
Loading

0 comments on commit 17cb3be

Please sign in to comment.