Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361281
b: refs/heads/master
c: ebf47be
h: refs/heads/master
i:
  361279: 69f1184
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Mar 13, 2013
1 parent 3b29ce1 commit 5105058
Show file tree
Hide file tree
Showing 64 changed files with 344 additions and 757 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ad8395e149e86ca3a76b6ae300c0d0a92b7f7e17
refs/heads/master: ebf47beb660e5580df7bee06d5cf9d37c0f22fac
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ Required properties:
- "nvidia,tegra20-uart"
- "nxp,lpc3220-uart"
- "ibm,qpace-nwp-serial"
- "altr,16550-FIFO32"
- "altr,16550-FIFO64"
- "altr,16550-FIFO128"
- "serial" if the port type is unknown.
- reg : offset and length of the register set for the device.
- interrupts : should contain uart interrupt.
Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/iio/common/st_sensors/st_sensors_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static int st_sensors_match_odr(struct st_sensors *sensor,
int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr)
{
int err;
struct st_sensor_odr_avl odr_out = {0, 0};
struct st_sensor_odr_avl odr_out;
struct st_sensor_data *sdata = iio_priv(indio_dev);

err = st_sensors_match_odr(sdata->sensor, odr, &odr_out);
Expand Down Expand Up @@ -114,7 +114,7 @@ static int st_sensors_match_fs(struct st_sensors *sensor,

static int st_sensors_set_fullscale(struct iio_dev *indio_dev, unsigned int fs)
{
int err, i = 0;
int err, i;
struct st_sensor_data *sdata = iio_priv(indio_dev);

err = st_sensors_match_fs(sdata->sensor, fs, &i);
Expand All @@ -139,13 +139,14 @@ static int st_sensors_set_fullscale(struct iio_dev *indio_dev, unsigned int fs)

int st_sensors_set_enable(struct iio_dev *indio_dev, bool enable)
{
bool found;
u8 tmp_value;
int err = -EINVAL;
bool found = false;
struct st_sensor_odr_avl odr_out = {0, 0};
struct st_sensor_odr_avl odr_out;
struct st_sensor_data *sdata = iio_priv(indio_dev);

if (enable) {
found = false;
tmp_value = sdata->sensor->pw.value_on;
if ((sdata->sensor->odr.addr == sdata->sensor->pw.addr) &&
(sdata->sensor->odr.mask == sdata->sensor->pw.mask)) {
Expand Down
64 changes: 26 additions & 38 deletions trunk/drivers/iio/dac/ad5064.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define AD5064_ADDR(x) ((x) << 20)
#define AD5064_CMD(x) ((x) << 24)

#define AD5064_ADDR_DAC(chan) (chan)
#define AD5064_ADDR_ALL_DAC 0xF

#define AD5064_CMD_WRITE_INPUT_N 0x0
Expand Down Expand Up @@ -130,15 +131,15 @@ static int ad5064_write(struct ad5064_state *st, unsigned int cmd,
}

static int ad5064_sync_powerdown_mode(struct ad5064_state *st,
const struct iio_chan_spec *chan)
unsigned int channel)
{
unsigned int val;
int ret;

val = (0x1 << chan->address);
val = (0x1 << channel);

if (st->pwr_down[chan->channel])
val |= st->pwr_down_mode[chan->channel] << 8;
if (st->pwr_down[channel])
val |= st->pwr_down_mode[channel] << 8;

ret = ad5064_write(st, AD5064_CMD_POWERDOWN_DAC, 0, val, 0);

Expand Down Expand Up @@ -168,7 +169,7 @@ static int ad5064_set_powerdown_mode(struct iio_dev *indio_dev,
mutex_lock(&indio_dev->mlock);
st->pwr_down_mode[chan->channel] = mode + 1;

ret = ad5064_sync_powerdown_mode(st, chan);
ret = ad5064_sync_powerdown_mode(st, chan->channel);
mutex_unlock(&indio_dev->mlock);

return ret;
Expand Down Expand Up @@ -204,7 +205,7 @@ static ssize_t ad5064_write_dac_powerdown(struct iio_dev *indio_dev,
mutex_lock(&indio_dev->mlock);
st->pwr_down[chan->channel] = pwr_down;

ret = ad5064_sync_powerdown_mode(st, chan);
ret = ad5064_sync_powerdown_mode(st, chan->channel);
mutex_unlock(&indio_dev->mlock);
return ret ? ret : len;
}
Expand Down Expand Up @@ -257,7 +258,7 @@ static int ad5064_write_raw(struct iio_dev *indio_dev,

switch (mask) {
case IIO_CHAN_INFO_RAW:
if (val >= (1 << chan->scan_type.realbits) || val < 0)
if (val > (1 << chan->scan_type.realbits) || val < 0)
return -EINVAL;

mutex_lock(&indio_dev->mlock);
Expand Down Expand Up @@ -291,44 +292,34 @@ static const struct iio_chan_spec_ext_info ad5064_ext_info[] = {
{ },
};

#define AD5064_CHANNEL(chan, addr, bits) { \
#define AD5064_CHANNEL(chan, bits) { \
.type = IIO_VOLTAGE, \
.indexed = 1, \
.output = 1, \
.channel = (chan), \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \
.address = addr, \
.address = AD5064_ADDR_DAC(chan), \
.scan_type = IIO_ST('u', (bits), 16, 20 - (bits)), \
.ext_info = ad5064_ext_info, \
}

#define DECLARE_AD5064_CHANNELS(name, bits) \
const struct iio_chan_spec name[] = { \
AD5064_CHANNEL(0, 0, bits), \
AD5064_CHANNEL(1, 1, bits), \
AD5064_CHANNEL(2, 2, bits), \
AD5064_CHANNEL(3, 3, bits), \
AD5064_CHANNEL(4, 4, bits), \
AD5064_CHANNEL(5, 5, bits), \
AD5064_CHANNEL(6, 6, bits), \
AD5064_CHANNEL(7, 7, bits), \
}

#define DECLARE_AD5065_CHANNELS(name, bits) \
const struct iio_chan_spec name[] = { \
AD5064_CHANNEL(0, 0, bits), \
AD5064_CHANNEL(1, 3, bits), \
AD5064_CHANNEL(0, bits), \
AD5064_CHANNEL(1, bits), \
AD5064_CHANNEL(2, bits), \
AD5064_CHANNEL(3, bits), \
AD5064_CHANNEL(4, bits), \
AD5064_CHANNEL(5, bits), \
AD5064_CHANNEL(6, bits), \
AD5064_CHANNEL(7, bits), \
}

static DECLARE_AD5064_CHANNELS(ad5024_channels, 12);
static DECLARE_AD5064_CHANNELS(ad5044_channels, 14);
static DECLARE_AD5064_CHANNELS(ad5064_channels, 16);

static DECLARE_AD5065_CHANNELS(ad5025_channels, 12);
static DECLARE_AD5065_CHANNELS(ad5045_channels, 14);
static DECLARE_AD5065_CHANNELS(ad5065_channels, 16);

static const struct ad5064_chip_info ad5064_chip_info_tbl[] = {
[ID_AD5024] = {
.shared_vref = false,
Expand All @@ -337,7 +328,7 @@ static const struct ad5064_chip_info ad5064_chip_info_tbl[] = {
},
[ID_AD5025] = {
.shared_vref = false,
.channels = ad5025_channels,
.channels = ad5024_channels,
.num_channels = 2,
},
[ID_AD5044] = {
Expand All @@ -347,7 +338,7 @@ static const struct ad5064_chip_info ad5064_chip_info_tbl[] = {
},
[ID_AD5045] = {
.shared_vref = false,
.channels = ad5045_channels,
.channels = ad5044_channels,
.num_channels = 2,
},
[ID_AD5064] = {
Expand All @@ -362,7 +353,7 @@ static const struct ad5064_chip_info ad5064_chip_info_tbl[] = {
},
[ID_AD5065] = {
.shared_vref = false,
.channels = ad5065_channels,
.channels = ad5064_channels,
.num_channels = 2,
},
[ID_AD5628_1] = {
Expand Down Expand Up @@ -438,7 +429,6 @@ static int ad5064_probe(struct device *dev, enum ad5064_type type,
{
struct iio_dev *indio_dev;
struct ad5064_state *st;
unsigned int midscale;
unsigned int i;
int ret;

Expand Down Expand Up @@ -475,20 +465,18 @@ static int ad5064_probe(struct device *dev, enum ad5064_type type,
goto error_free_reg;
}

for (i = 0; i < st->chip_info->num_channels; ++i) {
st->pwr_down_mode[i] = AD5064_LDAC_PWRDN_1K;
st->dac_cache[i] = 0x8000;
}

indio_dev->dev.parent = dev;
indio_dev->name = name;
indio_dev->info = &ad5064_info;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = st->chip_info->channels;
indio_dev->num_channels = st->chip_info->num_channels;

midscale = (1 << indio_dev->channels[0].scan_type.realbits) / 2;

for (i = 0; i < st->chip_info->num_channels; ++i) {
st->pwr_down_mode[i] = AD5064_LDAC_PWRDN_1K;
st->dac_cache[i] = midscale;
}

ret = iio_device_register(indio_dev);
if (ret)
goto error_disable_reg;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/iio/imu/inv_mpu6050/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
config INV_MPU6050_IIO
tristate "Invensense MPU6050 devices"
depends on I2C && SYSFS
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
This driver supports the Invensense MPU6050 devices.
Expand Down
16 changes: 6 additions & 10 deletions trunk/drivers/staging/comedi/drivers/dt9812.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,13 +947,12 @@ static int dt9812_di_rinsn(struct comedi_device *dev,
unsigned int *data)
{
struct comedi_dt9812 *devpriv = dev->private;
unsigned int channel = CR_CHAN(insn->chanspec);
int n;
u8 bits = 0;

dt9812_digital_in(devpriv->slot, &bits);
for (n = 0; n < insn->n; n++)
data[n] = ((1 << channel) & bits) != 0;
data[n] = ((1 << insn->chanspec) & bits) != 0;
return n;
}

Expand All @@ -962,13 +961,12 @@ static int dt9812_do_winsn(struct comedi_device *dev,
unsigned int *data)
{
struct comedi_dt9812 *devpriv = dev->private;
unsigned int channel = CR_CHAN(insn->chanspec);
int n;
u8 bits = 0;

dt9812_digital_out_shadow(devpriv->slot, &bits);
for (n = 0; n < insn->n; n++) {
u8 mask = 1 << channel;
u8 mask = 1 << insn->chanspec;

bits &= ~mask;
if (data[n])
Expand All @@ -983,13 +981,13 @@ static int dt9812_ai_rinsn(struct comedi_device *dev,
unsigned int *data)
{
struct comedi_dt9812 *devpriv = dev->private;
unsigned int channel = CR_CHAN(insn->chanspec);
int n;

for (n = 0; n < insn->n; n++) {
u16 value = 0;

dt9812_analog_in(devpriv->slot, channel, &value, DT9812_GAIN_1);
dt9812_analog_in(devpriv->slot, insn->chanspec, &value,
DT9812_GAIN_1);
data[n] = value;
}
return n;
Expand All @@ -1000,13 +998,12 @@ static int dt9812_ao_rinsn(struct comedi_device *dev,
unsigned int *data)
{
struct comedi_dt9812 *devpriv = dev->private;
unsigned int channel = CR_CHAN(insn->chanspec);
int n;
u16 value;

for (n = 0; n < insn->n; n++) {
value = 0;
dt9812_analog_out_shadow(devpriv->slot, channel, &value);
dt9812_analog_out_shadow(devpriv->slot, insn->chanspec, &value);
data[n] = value;
}
return n;
Expand All @@ -1017,11 +1014,10 @@ static int dt9812_ao_winsn(struct comedi_device *dev,
unsigned int *data)
{
struct comedi_dt9812 *devpriv = dev->private;
unsigned int channel = CR_CHAN(insn->chanspec);
int n;

for (n = 0; n < insn->n; n++)
dt9812_analog_out(devpriv->slot, channel, data[n]);
dt9812_analog_out(devpriv->slot, insn->chanspec, data[n]);
return n;
}

Expand Down
31 changes: 12 additions & 19 deletions trunk/drivers/staging/comedi/drivers/usbdux.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,14 +730,10 @@ static void usbduxsub_ao_IsocIrq(struct urb *urb)
static int usbduxsub_start(struct usbduxsub *usbduxsub)
{
int errcode = 0;
uint8_t *local_transfer_buffer;

local_transfer_buffer = kmalloc(1, GFP_KERNEL);
if (!local_transfer_buffer)
return -ENOMEM;
uint8_t local_transfer_buffer[16];

/* 7f92 to zero */
*local_transfer_buffer = 0;
local_transfer_buffer[0] = 0;
errcode = usb_control_msg(usbduxsub->usbdev,
/* create a pipe for a control transfer */
usb_sndctrlpipe(usbduxsub->usbdev, 0),
Expand All @@ -755,25 +751,22 @@ static int usbduxsub_start(struct usbduxsub *usbduxsub)
1,
/* Timeout */
BULK_TIMEOUT);
if (errcode < 0)
if (errcode < 0) {
dev_err(&usbduxsub->interface->dev,
"comedi_: control msg failed (start)\n");

kfree(local_transfer_buffer);
return errcode;
return errcode;
}
return 0;
}

static int usbduxsub_stop(struct usbduxsub *usbduxsub)
{
int errcode = 0;
uint8_t *local_transfer_buffer;

local_transfer_buffer = kmalloc(1, GFP_KERNEL);
if (!local_transfer_buffer)
return -ENOMEM;
uint8_t local_transfer_buffer[16];

/* 7f92 to one */
*local_transfer_buffer = 1;
local_transfer_buffer[0] = 1;
errcode = usb_control_msg(usbduxsub->usbdev,
usb_sndctrlpipe(usbduxsub->usbdev, 0),
/* bRequest, "Firmware" */
Expand All @@ -788,12 +781,12 @@ static int usbduxsub_stop(struct usbduxsub *usbduxsub)
1,
/* Timeout */
BULK_TIMEOUT);
if (errcode < 0)
if (errcode < 0) {
dev_err(&usbduxsub->interface->dev,
"comedi_: control msg failed (stop)\n");

kfree(local_transfer_buffer);
return errcode;
return errcode;
}
return 0;
}

static int usbduxsub_upload(struct usbduxsub *usbduxsub,
Expand Down
Loading

0 comments on commit 5105058

Please sign in to comment.