01 Oct, 2013

2 commits


28 Sep, 2013

1 commit


21 Sep, 2013

8 commits

  • Make sure to properly initialize the IIO buffer data structure.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Jonathan Cameron

    Lars-Peter Clausen
     
  • Set the IIO device as the parent for the character device

    We need to make sure that the IIO device is not freed while the character device
    exists, otherwise the freeing of the IIO device might race against the file open
    callback. Do this by setting the character device's parent to the IIO device,
    this will cause the character device to grab a reference to the IIO device and
    only release it once the character device itself has been removed.

    Also move the registration of the character device before the registration of
    the IIO device to avoid the (rather theoretical case) that the IIO device is
    already freed again before we can add the character device and grab a reference
    to the IIO device.

    We also need to move the call to cdev_del() from iio_dev_release() to
    iio_device_unregister() (where it should have been in the first place anyway) to
    avoid a reference cycle. As iio_dev_release() is only called once all reference
    are dropped, but the character device holds a reference to the IIO device.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Jonathan Cameron

    Lars-Peter Clausen
     
  • Make sure that the IIO device is not freed while we still have file descriptors
    for it.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Jonathan Cameron

    Lars-Peter Clausen
     
  • Make sure to stop sampling when the device is removed, otherwise it will
    continue to sample forever.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Jonathan Cameron

    Lars-Peter Clausen
     
  • if device has available_scan_masks set and the buffer is enabled without
    any scan_elements enabled, in a NULL pointer is dereferenced in iio_compute_scan_bytes()

    [ 18.993713] Unable to handle kernel NULL pointer dereference at virtual address 00000000
    [ 19.002593] pgd = debd4000
    [ 19.005432] [00000000] *pgd=9ebc0831, *pte=00000000, *ppte=00000000
    [ 19.012329] Internal error: Oops: 17 [#1] PREEMPT ARM
    [ 19.017639] Modules linked in:
    [ 19.020843] CPU: 0 Not tainted (3.9.11-00036-g75c888a-dirty #207)
    [ 19.027587] PC is at _find_first_bit_le+0xc/0x2c
    [ 19.032440] LR is at iio_compute_scan_bytes+0x2c/0xf4
    [ 19.037719] pc : [] lr : [] psr: 200d0013
    [ 19.037719] sp : debd9ed0 ip : 00000000 fp : 000802bc
    [ 19.049713] r10: 00000000 r9 : 00000000 r8 : deb67250
    [ 19.055206] r7 : 00000000 r6 : 00000000 r5 : 00000000 r4 : deb67000
    [ 19.062011] r3 : de96ec00 r2 : 00000000 r1 : 00000004 r0 : 00000000
    [ 19.068847] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    [ 19.076324] Control: 10c5387d Table: 9ebd4019 DAC: 00000015

    problem is the rollback code in iio_update_buffers(), old_mask may be NULL (e.g. on first
    call)

    I'm not too confident about the fix; works for me...

    Signed-off-by: Peter Meerwald
    Reviewed-by: Lars-Peter Clausen
    Signed-off-by: Jonathan Cameron

    Peter Meerwald
     
  • dev_to_iio_dev() is a false friend

    Signed-off-by: Peter Meerwald
    Signed-off-by: Jonathan Cameron

    Peter Meerwald
     
  • dev_to_iio_dev() is a false friend

    Signed-off-by: Peter Meerwald
    Cc: Oleksandr Kravchenko
    Signed-off-by: Jonathan Cameron

    Peter Meerwald
     
  • dev_to_iio_dev() is a false friend

    Signed-off-by: Peter Meerwald
    Signed-off-by: Jonathan Cameron

    Peter Meerwald
     

19 Sep, 2013

2 commits

  • Fix mask generation for modified channels.

    Signed-off-by: Lukasz Czerwinski
    Signed-off-by: Jonathan Cameron

    Lukasz Czerwinski
     
  • The adc_clk variable is currently defined using a 32-bits unsigned integer,
    which will overflow under some very valid range of operations.

    Such overflow will occur if, for example, the parent clock is set to a
    20MHz frequency and the ADC startup time is larger than 215ns.

    To fix this, introduce an intermediate variable holding the clock rate
    in kHz.

    Signed-off-by: Josh Wu
    Acked-by: Maxime Ripard
    Signed-off-by: Jonathan Cameron

    Josh Wu
     

13 Sep, 2013

1 commit


04 Sep, 2013

1 commit

  • Pull staging tree merge from Greg KH:
    "Here's the bit staging tree pull request for 3.12-rc1.

    Lots of staging driver updates, and fixes. Lustre is finally enabled
    in the build, and lots of cleanup started happening in it. There's a
    new wireless driver in here, and 2 new TTY drivers, which cause the
    overall lines added/removed to be quite large on the "added" side.

    The IIO driver updates are also coming through here, as they are tied
    to the staging iio drivers"

    * tag 'staging-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (942 commits)
    staging: dwc2: make dwc2_core_params documentation more complete
    staging: dwc2: validate the value for phy_utmi_width
    staging: dwc2: interpret all hwcfg and related register at init time
    staging: dwc2: properly mask the GRXFSIZ register
    staging: dwc2: remove redundant register reads
    staging: dwc2: re-use hptxfsiz variable
    staging: dwc2: simplify debug output in dwc_hc_init
    staging: dwc2: add missing shift
    staging: dwc2: simplify register shift expressions
    staging: dwc2: only read the snpsid register once
    staging: dwc2: unshift non-bool register value constants
    staging: dwc2: fix off-by-one in check for max_packet_count parameter
    staging: dwc2: remove specific fifo size constants
    Staging:BCM:DDRInit.c:Renaming __FUNCTION__
    staging: bcm: remove Version.h file.
    staging: rtl8188eu: off by one in rtw_set_802_11_add_wep()
    staging: r8188eu: copying one byte too much
    staging: rtl8188eu: || vs && typo
    staging: r8188eu: off by one bugs
    staging: crystalhd: Resolve sparse 'different base types' warnings.
    ...

    Linus Torvalds
     

30 Aug, 2013

2 commits


29 Aug, 2013

2 commits


20 Aug, 2013

18 commits


18 Aug, 2013

1 commit


17 Aug, 2013

2 commits

  • The GPADC is general purpose ADC found on TWL6030, and TWL6032 PMIC,
    known also as Phoenix and PhoenixLite.

    The TWL6030 and TWL6032 have GPADC with 17 and 19 channels
    respectively. Some channels have current source and are used for
    measuring voltage drop on resistive load for detecting battery ID
    resistance, or measuring voltage drop on NTC resistors for external
    temperature measurements. Some channels measure voltage, (i.e. battery
    voltage), and have voltage dividers, thus, capable to scale voltage.
    Some channels are dedicated for measuring die temperature.

    Some channels are calibrated in 2 points, having offsets from ideal
    values kept in trim registers. This is used to correct measurements.

    The differences between GPADC in TWL6030 and TWL6032:
    - 10 bit vs 12 bit ADC;
    - 17 vs 19 channels;
    - channels have different purpose(i.e. battery voltage
    channel 8 vs channel 18);
    - trim values are interpreted differently.

    Based on the driver patched from Balaji TK, Graeme Gregory, Ambresh K,
    Girish S Ghongdemath.

    Signed-off-by: Balaji T K
    Signed-off-by: Graeme Gregory
    Signed-off-by: Oleksandr Kozaruk
    Signed-off-by: Jonathan Cameron

    Oleksandr Kozaruk
     
  • Using devm_iio_device_alloc makes code simpler.

    Signed-off-by: Sachin Kamat
    Cc: Denis Ciocca
    Signed-off-by: Jonathan Cameron

    Sachin Kamat