]> Git Repo - linux.git/commitdiff
Merge tag 'iio-fixes-for-3.14a' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorGreg Kroah-Hartman <[email protected]>
Fri, 7 Feb 2014 16:57:00 +0000 (08:57 -0800)
committerGreg Kroah-Hartman <[email protected]>
Fri, 7 Feb 2014 16:57:00 +0000 (08:57 -0800)
Jonathan writes:

First set of IIO fixes for the 3.14 cycle.

Included is the patch previously set as the fourth round for 3.13 which was
to late to be appropriate.

* Another endian fix (ad799x adc) due to missuse of the IIO_ST macro (which
  is going away very shortly)
* A reversed error check in ad5933 which will make the probe fail.
* A buffer overflow in the example code in the documentation.
* ad799x was freeing an irq that might or might not have been requested.
* tsl2563 was checking the wrong element of chan_spec for modifiers. Thus some
  sysfs reads would give the wrong values.
* A missing dependency on HAS_IOMEM in spear_adc and lpc32xx was causing some
  test build failures (on s390 and perhaps elsewhere).

I also have a few fixes queued up for things that went in during the 3.14
merge window which will follow as a separate pull request (to avoid rebasing
my tree).

1  2 
drivers/iio/light/tsl2563.c
drivers/staging/iio/adc/ad799x_core.c

index 3d8110157f2d4b33557be5415504ca81b992cf4d,2be6df3a1350c7c15e711e59ee76524a7b0b05c2..94daa9fc12478b868dbe73a5cdce7a767bdc34a3
@@@ -460,10 -460,14 +460,14 @@@ static int tsl2563_write_raw(struct iio
  {
        struct tsl2563_chip *chip = iio_priv(indio_dev);
  
-       if (chan->channel == IIO_MOD_LIGHT_BOTH)
+       if (mask != IIO_CHAN_INFO_CALIBSCALE)
+               return -EINVAL;
+       if (chan->channel2 == IIO_MOD_LIGHT_BOTH)
                chip->calib0 = calib_from_sysfs(val);
-       else
+       else if (chan->channel2 == IIO_MOD_LIGHT_IR)
                chip->calib1 = calib_from_sysfs(val);
+       else
+               return -EINVAL;
  
        return 0;
  }
@@@ -472,14 -476,14 +476,14 @@@ static int tsl2563_read_raw(struct iio_
                            struct iio_chan_spec const *chan,
                            int *val,
                            int *val2,
-                           long m)
+                           long mask)
  {
        int ret = -EINVAL;
        u32 calib0, calib1;
        struct tsl2563_chip *chip = iio_priv(indio_dev);
  
        mutex_lock(&chip->lock);
-       switch (m) {
+       switch (mask) {
        case IIO_CHAN_INFO_RAW:
        case IIO_CHAN_INFO_PROCESSED:
                switch (chan->type) {
                        ret = tsl2563_get_adc(chip);
                        if (ret)
                                goto error_ret;
-                       if (chan->channel == 0)
+                       if (chan->channel2 == IIO_MOD_LIGHT_BOTH)
                                *val = chip->data0;
                        else
                                *val = chip->data1;
                break;
  
        case IIO_CHAN_INFO_CALIBSCALE:
-               if (chan->channel == 0)
+               if (chan->channel2 == IIO_MOD_LIGHT_BOTH)
                        *val = calib_to_sysfs(chip->calib0);
                else
                        *val = calib_to_sysfs(chip->calib1);
@@@ -702,10 -706,10 +706,10 @@@ static const struct iio_info tsl2563_in
        .driver_module = THIS_MODULE,
        .read_raw = &tsl2563_read_raw,
        .write_raw = &tsl2563_write_raw,
 -      .read_event_value_new = &tsl2563_read_thresh,
 -      .write_event_value_new = &tsl2563_write_thresh,
 -      .read_event_config_new = &tsl2563_read_interrupt_config,
 -      .write_event_config_new = &tsl2563_write_interrupt_config,
 +      .read_event_value = &tsl2563_read_thresh,
 +      .write_event_value = &tsl2563_write_thresh,
 +      .read_event_config = &tsl2563_read_interrupt_config,
 +      .write_event_config = &tsl2563_write_interrupt_config,
  };
  
  static int tsl2563_probe(struct i2c_client *client,
        struct iio_dev *indio_dev;
        struct tsl2563_chip *chip;
        struct tsl2563_platform_data *pdata = client->dev.platform_data;
 +      struct device_node *np = client->dev.of_node;
        int err = 0;
        u8 id = 0;
  
  
        if (pdata)
                chip->cover_comp_gain = pdata->cover_comp_gain;
 +      else if (np)
 +              of_property_read_u32(np, "amstaos,cover-comp-gain",
 +                                   &chip->cover_comp_gain);
        else
                chip->cover_comp_gain = 1;
  
index 5ea36410f716e7cb380f60bfbfee83dfde160d52,c1b601acfd9018338f40bd3a3a2cbebcfb19e134..31a2be68806084c16e3fb392f5fd7ae9e15dfcf0
@@@ -377,9 -377,9 +377,9 @@@ static const struct iio_info ad7991_inf
  static const struct iio_info ad7993_4_7_8_info = {
        .read_raw = &ad799x_read_raw,
        .event_attrs = &ad799x_event_attrs_group,
 -      .read_event_config_new = &ad799x_read_event_config,
 -      .read_event_value_new = &ad799x_read_event_value,
 -      .write_event_value_new = &ad799x_write_event_value,
 +      .read_event_config = &ad799x_read_event_config,
 +      .read_event_value = &ad799x_read_event_value,
 +      .write_event_value = &ad799x_write_event_value,
        .driver_module = THIS_MODULE,
        .update_scan_mode = ad7997_8_update_scan_mode,
  };
@@@ -409,7 -409,13 +409,13 @@@ static const struct iio_event_spec ad79
        .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
        .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
        .scan_index = (_index), \
-       .scan_type = IIO_ST('u', _realbits, 16, 12 - (_realbits)), \
+       .scan_type = { \
+               .sign = 'u', \
+               .realbits = (_realbits), \
+               .storagebits = 16, \
+               .shift = 12 - (_realbits), \
+               .endianness = IIO_BE, \
+       }, \
        .event_spec = _ev_spec, \
        .num_event_specs = _num_ev_spec, \
  }
@@@ -588,7 -594,8 +594,8 @@@ static int ad799x_probe(struct i2c_clie
        return 0;
  
  error_free_irq:
-       free_irq(client->irq, indio_dev);
+       if (client->irq > 0)
+               free_irq(client->irq, indio_dev);
  error_cleanup_ring:
        ad799x_ring_cleanup(indio_dev);
  error_disable_reg:
This page took 0.074684 seconds and 4 git commands to generate.