1. 18 Jun, 2013 1 commit
  2. 17 Jun, 2013 8 commits
  3. 13 Jun, 2013 26 commits
  4. 12 Jun, 2013 5 commits
    • Sebastian Andrzej Siewior's avatar
      iio: ti_am335x_adc: check if we found the value · 1460c152
      Sebastian Andrzej Siewior authored
      Usually we get all the values we wanted but it is possible, that te ADC
      unit is busy performing the conversation for the HW events. In that case
      -EBUSY is returned and the user may re-call the function.
      Acked-by: default avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      1460c152
    • Sebastian Andrzej Siewior's avatar
      iio: ti_am335x_adc: Allow to specify input line · 18926ede
      Sebastian Andrzej Siewior authored
      The TSC part allows to specify the input lines. The IIO part assumes
      that it usues always the last few, that means if IIO has adc-channels
      set to 2 it will use channel 6 and 7. However it might make sense to use
      only 6.
      This patch changes the device property (which was introduced recently
      and was never in an official release) in a way that the user can specify
      which of the AIN lines should be used. In Addition to this, the name is
      now AINx where x is the channel number i.e. for AIN6 we would have 6.
      Prior this, it always started counting at 0 which is confusing. In
      addition to this, it also checks for correct step number during reading
      and does not rely on proper FIFO depth.
      Acked-by: default avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      18926ede
    • Sebastian Andrzej Siewior's avatar
      input: ti_am335x_tsc: return IRQ_NONE if there was no IRQ for us · 9a28b883
      Sebastian Andrzej Siewior authored
      The previous patch ("input/ti_am335x_tsc: ACK the HW_PEN irq in ISR")
      acked the interrupt so we don't freeze if we don't handle an enabled
      interrupt source. The interrupt core has a mechanism for this and to get
      it work one should only say that it handled an interrupt if it is
      actually the case.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      9a28b883
    • Sebastian Andrzej Siewior's avatar
      input: ti_am335x_tsc: ACK the HW_PEN irq in ISR · 00789e5d
      Sebastian Andrzej Siewior authored
      The interrupt source IRQENB_HW_PEN is enabled in suspend and suposed to
      be used as a wake up source. Once this interrupt source is unmaksed, the
      devices ends up in ISR and never continues.
      This change ACKs the interrupt and disables it so the system does not
      freeze.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      00789e5d
    • Sebastian Andrzej Siewior's avatar
      input: ti_am335x_adc: use only FIFO0 and clean up a little · 8c896308
      Sebastian Andrzej Siewior authored
      The driver programs a threshold of "coordinate_readouts" say 5. The
      REG_FIFO0THR registers says it should it be programmed to "threshold
      minus one". The driver does not expect just 5 coordinates but 5 * 2 + 2.
      Multiplied by two because 5 for X and 5 for Y and plus 2 because we have
      two Z.
      The whole thing kind of works because It reads the 5 coordinates for X
      and Y from FIFO0 and FIFO1 and the last element in each FIFO is ignored
      within the loop and read later.
      Nothing guaranties that FIFO1 is ready by the time it is read. In fact I
      could see that that FIFO1 reaturns for Y channels 8,9, 10, 12, 6 and for
      Y channel 7 for Z. The problem is that channel 7 and channel 12 got
      somehow mixed up.
      The other Problem is that FIFO1 is also used by the IIO part leading to
      wrong results if both (tsc & adc) are used.
      
      The patch tries to clean up the whole thing a little:
      - Remove the +1 and -1 in REG_STEPCONFIG, REG_STEPDELAY and its counter
        part in the for loop. This is just confusing.
      
      - Use only FIFO0 in TSC. The fifo has space for 64 entries so should be
        fine.
      
      - Read the whole FIFO in one function and check the channel.
      
      - in case we dawdle around, make sure we only read a multiple of our
        coordinate set. On the second interrupt we will cleanup the remaining
        enties.
      Acked-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      8c896308