Skip to content
Snippets Groups Projects
  1. Jan 14, 2015
  2. Jan 13, 2015
    • Nicholas Mc Guire's avatar
      i2c: imx: fix handling of wait_for_completion_timeout result · cb9eaba4
      Nicholas Mc Guire authored
      
      wait_for_completion_timeout does not return negative values so
      "result" handling here should be simplified to cover the actually
      possible cases only.
      
      Signed-off-by: default avatarNicholas Mc Guire <der.herr@hofr.at>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      cb9eaba4
    • Doug Anderson's avatar
      i2c: rk3x: Account for repeated start time requirement · 387f0de6
      Doug Anderson authored
      
      On Rockchip I2C the controller drops SDA low slightly too soon to meet
      the "repeated start" requirements.
      
      >From my own experimentation over a number of rates:
       - controller appears to drop SDA at .875x (7/8) programmed clk high.
       - controller appears to keep SCL high for 2x programmed clk high.
      
      The first rule isn't enough to meet tSU;STA requirements in
      Standard-mode on the system I tested on.  The second rule is probably
      enough to meet tHD;STA requirements in nearly all cases (especially
      after accounting for the first), but it doesn't hurt to account for it
      anyway just in case.
      
      Even though the repeated start requirement only need to be accounted
      for during a small part of the transfer, we'll adjust the timings for
      the whole transfer to meet it.  I believe that adjusting the timings
      in just the right place to switch things up for repeated start would
      require several extra interrupts and that doesn't seem terribly worth
      it.
      
      With this change and worst case rise/fall times, I see 100kHz i2c
      going to ~85kHz.  With slightly optimized rise/fall (800ns / 50ns) I
      see i2c going to ~89kHz.  Fast-mode isn't affected much because
      tSU;STA is shorter relative to tHD;STA there.
      
      As part of this change we needed to account for the SDA falling time.
      The specification indicates that this should be the same, but we'll
      follow Designware's lead and add a binding.  Note that we deviate from
      Designware and assign the default SDA falling time to be the same as
      the SCL falling time, which is incredibly likely.
      
      Signed-off-by: default avatarDoug Anderson <dianders@chromium.org>
      [wsa: rebased to i2c/for-next]
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      387f0de6
    • addy ke's avatar
      i2c: rk3x: fix bug that cause measured high_ns doesn't meet I2C specification · 1330e291
      addy ke authored
      The number of clock cycles to be written into the CLKDIV register
      that determines the I2C clk high phase includes the rise time.
      So to meet the timing requirements defined in the I2C specification
      which defines the minimal time SCL has to be high, the rise time
      has to taken into account. The same applies to the low phase with
      falling time.
      
      In my test on RK3288-Pink2 board, which is not an upstream board yet,
      if external pull-up resistor is 4.7K, rise_ns is about 700ns.
      So the measured high_ns is about 3900ns, which is less than 4000ns
      (the minimum high_ns in I2C specification for Standard-mode).
      
      To fix this bug min_low_ns should include fall time and min_high_ns
      should include rise time.
      
      This patch merged the patch from chromium project which can get the
      rise and fall times for signals from the device tree. This allows us
      to more accurately calculate timings. see:
      https://chromium-review.googlesource.com/#/c/232774/
      
      
      
      Signed-off-by: default avatarAddy Ke <addy.ke@rock-chips.com>
      Reviewed-by: default avatarDoug Anderson <dianders@chromium.org>
      Tested-by: default avatarDoug Anderson <dianders@chromium.org>
      [wsa: fixed a typo in the docs]
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      1330e291
    • Harini Katakam's avatar
      i2c: cadence: Handle > 252 byte transfers · 9fae82e1
      Harini Katakam authored
      
      The I2C controller sends a NACK to the slave when transfer size register
      reaches zero, irrespective of the hold bit. So, in order to handle transfers
      greater than 252 bytes, the transfer size register has to be maintained at a
      value >= 1. This patch implements the same.
      The interrupt status is cleared at the beginning of the isr instead of
      the end, to avoid missing any interrupts.
      
      Signed-off-by: default avatarHarini Katakam <harinik@xilinx.com>
      [wsa: added braces around else branch]
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      9fae82e1
    • Wolfram Sang's avatar
      i2c: pmcmsp: remove dead code · 1c574993
      Wolfram Sang authored
      
      CPPCHECK rightfully says:
      
      drivers/i2c/busses/i2c-pmcmsp.c:151: style: The function 'pmcmsptwi_reg_to_clock' is never used.
      
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      1c574993
  3. Dec 22, 2014
    • Lars-Peter Clausen's avatar
      i2c: Remove support for legacy PM · 523c5b89
      Lars-Peter Clausen authored
      
      There haven't been any I2C driver that use the legacy suspend/resume
      callbacks for a while now and new drivers are supposed to use PM ops. So
      remove support for legacy suspend/resume for I2C drivers.
      
      Since there aren't any special bus specific things to do during
      suspend/resume and since the PM core will automatically fallback directly to
      using the device's PM ops if no bus PM ops are specified there is no need to
      have any I2C bus PM ops.
      
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      523c5b89
  4. Dec 20, 2014
  5. Dec 19, 2014
  6. Dec 18, 2014
  7. Dec 17, 2014
    • Geert Uytterhoeven's avatar
      i2c: sh_mobile: I2C_SH_MOBILE should depend on HAS_DMA · f16ea4f0
      Geert Uytterhoeven authored
      
      If NO_DMA=y:
      
      drivers/built-in.o: In function `sh_mobile_i2c_dma_unmap':
      i2c-sh_mobile.c:(.text+0x60de42): undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `sh_mobile_i2c_xfer_dma':
      i2c-sh_mobile.c:(.text+0x60df22): undefined reference to `dma_map_single'
      i2c-sh_mobile.c:(.text+0x60df2e): undefined reference to `dma_mapping_error'
      
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      f16ea4f0
    • Wolfram Sang's avatar
      i2c: sh_mobile: rework deferred probing · 55f5f986
      Wolfram Sang authored
      
      DMA is opt-in for this driver. So, we can't use deferred probing for
      requesting DMA channels in probe, because our driver would get endlessly
      deferred if DMA support is compiled in AND the DMA driver is missing.
      Because we can't know when the DMA driver might show up, we always try
      again when a DMA transfer would be possible. The downside is that there
      is more overhead for setting up PIO transfers under the above scenario.
      But well, having DMA enabled and the proper DMA driver missing looks
      like a broken or test config anyhow.
      
      Reported-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      55f5f986
    • Wolfram Sang's avatar
      i2c: sh_mobile: refactor DMA setup · e844a799
      Wolfram Sang authored
      
      Refactor DMA setup to keep the errno so we can implement better
      deferred probe support in the next step.
      
      Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      e844a799
    • Thomas Petazzoni's avatar
      i2c: mv64xxx: rework offload support to fix several problems · 00d8689b
      Thomas Petazzoni authored
      
      Originally, the I2C controller supported by the i2c-mv64xxx driver
      requires a lot of software support: an interrupt is generated at each
      step of an I2C transaction (after the start bit, after sending the
      address, etc.) and the driver is in charge of re-programming the I2C
      controller to do the next step of the I2C transaction. This explains
      the fairly complex state machine that the driver has.
      
      On Marvell Armada XP and later processors (Armada 375, 38x, etc.), the
      I2C controller was extended with a part called the "I2C Bridge", which
      allows to offload the I2C transaction completely to the
      hardware. Initial support for this mechanism was added in commit
      930ab3d4 ("i2c: mv64xxx: Add I2C Transaction Generator support").
      
      However, the implementation done in this commit has two related
      issues, which this commit fixes by completely changing how the offload
      implementation is done:
      
       * SMBus read transfers, where there is one write to select the
         register immediately followed in the same transaction by one read,
         were making the processor hang. This was easier visible on the
         Marvell Armada XP WRT1900AC platform using a driver for an I2C LED
         controller, or on other Armada XP platforms by using a simple
         'i2cget' command to read an I2C EEPROM.
      
       * The implementation was based on the fact that the offload engine
         was re-programmed to transfer each message of an I2C xfer: this
         meant that each message sent with the offload engine was starting
         with a normal I2C start sequence. However, the I2C subsystem
         assumes that all messages belonging to the same xfer will use the
         so-called "repeated start" so that the entire I2C xfer is seen as
         one transfer by the I2C devices and cannot be interrupt by other
         I2C masters on the same bus.
      
      In fact, the "I2C Bridge" allows to offload three types of xfer:
      
       - xfer of one write message
       - xfer of one read message
       - xfer of one write message followed by one read message
      
      For all other situations, we have to fallback to not using the "I2C
      Bridge" in order to get proper I2C semantics.
      
      Therefore, this commit reworks the offload implementation to put it
      not at the message level, but at the xfer level: in the
      mv64xxx_i2c_xfer() function, we decide if the transaction can be
      offloaded (in which case it is handled by the
      mv64xxx_i2c_offload_xfer() function), or otherwise it is handled by
      the slow path (implemented in the existing mv64xxx_i2c_execute_msg()).
      
      This allows to simplify the state machine, which no longer needs to
      have any state related to the offload implementation: the offload
      implementation is now completely separated from the slow path (with
      the exception of the interrupt handler, of course).
      
      In summary:
      
       - mv64xxx_i2c_can_offload() will analyze an I2C xfer and decided of
         the "I2C Bridge" can be used to offload it or not.
      
       - mv64xxx_i2c_offload_xfer() will actually program the "I2C Bridge"
         to offload one xfer (of either one or two messages), and block
         using mv64xxx_i2c_wait_for_completion() until the xfer completes.
      
       - The interrupt handler mv64xxx_i2c_intr() is modified to push the
         offload related code to a separate function,
         mv64xxx_i2c_intr_offload(). It will take care of reading the
         received data if needed.
      
      This commit was tested on:
      
       - Armada XP OpenBlocks AX3-4 (EEPROM on I2C and RTC on I2C)
       - Armada XP WRT1900AC (LED controller on I2C)
       - Armada XP GP (EEPROM on I2C)
      
      Fixes: 930ab3d4 ("i2c: mv64xxx: Add I2C Transaction Generator support")
      Cc: <stable@vger.kernel.org> # v3.12+
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      [wsa: fixed checkpatch warnings]
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      00d8689b
    • Thomas Petazzoni's avatar
    • Ilya Dryomov's avatar
      rbd: don't treat CEPH_OSD_OP_DELETE as extent op · 7e868b6e
      Ilya Dryomov authored
      
      CEPH_OSD_OP_DELETE is not an extent op, stop treating it as such.  This
      sneaked in with discard patches - it's one of the three osd ops (the
      other two are CEPH_OSD_OP_TRUNCATE and CEPH_OSD_OP_ZERO) that discard
      is implemented with.
      
      Signed-off-by: default avatarIlya Dryomov <idryomov@redhat.com>
      Reviewed-by: default avatarAlex Elder <elder@linaro.org>
      7e868b6e
    • SF Markus Elfring's avatar
      ceph, rbd: delete unnecessary checks before two function calls · e96a650a
      SF Markus Elfring authored
      
      The functions ceph_put_snap_context() and iput() test whether their
      argument is NULL and then return immediately. Thus the test around the
      call is not needed.
      
      This issue was detected by using the Coccinelle software.
      
      Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
      [idryomov@redhat.com: squashed rbd.c hunk, changelog]
      Signed-off-by: default avatarIlya Dryomov <idryomov@redhat.com>
      e96a650a
    • Krzysztof Kozlowski's avatar
      clk: samsung: Fix Exynos 5420 pinctrl setup and clock disable failure due to domain being gated · f1e9203e
      Krzysztof Kozlowski authored
      
      Audio subsystem clocks are located in separate block. On Exynos 5420 if
      clock for this block (from main clock domain) 'mau_epll' is gated then
      any read or write to audss registers will block.
      
      This kind of boot hang was observed on Arndale Octa and Peach Pi/Pit
      after introducing runtime PM to pl330 DMA driver. After that commit the
      'mau_epll' was gated, because the "amba" clock was disabled and there
      were no more users of mau_epll.
      
      The system hang on one of steps:
      1. Disabling unused clocks from audss block.
      2. During audss GPIO setup (just before probing i2s0 because
         samsung_pinmux_setup() tried to access memory from audss block which was
         gated.
      
      Add a workaround for this by enabling the 'mau_epll' clock in probe.
      
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Acked-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
      Tested-by: default avatarJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Tested-by: default avatarKevin Hilman <khilman@linaro.org>
      Signed-off-by: default avatarMichael Turquette <mturquette@linaro.org>
      f1e9203e
    • Al Viro's avatar
      lustre: get rid of playing with ->fs · 1ad581eb
      Al Viro authored
      
      * removed several pieces of dead code in lustre_compat25.h
      * don't open-code current_umask() (and BTW, 0755 & (S_IRWXUGO | S_ISVTX)
      is better spelled as 0755)
      * fix broken attempt to get the pathname by dentry - abusing d_path() for
      that is simply wrong.
      
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      1ad581eb
    • Hans Verkuil's avatar
      [media] bq/c-qcam, w9966, pms: move to staging in preparation for removal · 427ae153
      Hans Verkuil authored
      
      These drivers haven't been tested in a long, long time. The hardware is
      ancient and hopelessly obsolete. These drivers also need to be converted
      to newer media frameworks but due to the lack of hardware that's going
      to be impossible. In addition, cheaper and vastly better hardware is
      available today.
      
      So these drivers are a prime candidate for removal. If someone is
      interested in working on these drivers to prevent their removal, then
      please contact the linux-media mailinglist.
      
      Let's be honest, the age of parallel port webcams and ISA video capture
      boards is really gone.
      
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      427ae153
    • Hans Verkuil's avatar
      [media] tlg2300: move to staging in preparation for removal · ea2e813e
      Hans Verkuil authored
      
      This driver hasn't been tested in a long, long time. The company that made
      this chip has gone bust many years ago and hardware using this chip is next
      to impossible to find.
      
      This driver needs to be converted to newer media frameworks but due to the
      lack of hardware that's going to be impossible. Since cheap alternatives are
      easily available, there is little point in keeping this driver alive.
      
      In other words, this driver is a prime candidate for removal. If someone is
      interested in working on this driver to prevent its removal, then please
      contact the linux-media mailinglist.
      
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: default avatarHuang Shijie <shijie8@gmail.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      ea2e813e
    • Hans Verkuil's avatar
      [media] vino/saa7191: move to staging in preparation for removal · c1d9e03d
      Hans Verkuil authored
      
      These drivers haven't been tested in a long, long time. The hardware is
      ancient and hopelessly obsolete. These drivers also need to be converted
      to newer media frameworks but due to the lack of hardware that's going
      to be impossible.
      
      So these drivers are a prime candidate for removal. If someone is
      interested in working on these drivers to prevent their removal, then
      please contact the linux-media mailinglist.
      
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      c1d9e03d
    • Hans Verkuil's avatar
      [media] cx88: remove leftover start_video_dma() call · 389208e1
      Hans Verkuil authored
      
      The start_streaming op is responsible for starting the video dma,
      so it shouldn't be called anymore from the buf_queue op.
      
      Unfortunately, this call to start_video_dma() was added to the
      start_streaming op, but was forgotten to be removed from the
      buf_queue op, which is where it used to be before the vb2 conversion.
      
      Calling this function twice causes very hard to find errors: sometimes
      it works, sometimes it doesn't. It took me a whole friggin' day
      to track this down, and in the end it was just luck that my eye suddenly
      triggered on that line.
      
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      389208e1
    • Hans Verkuil's avatar
      [media] cx88: add missing alloc_ctx support · 165d0043
      Hans Verkuil authored
      
      The cx88 vb2 conversion and the vb2 dma_sg improvements were developed separately and
      were merged separately. Unfortunately, the patch updating drivers to the dma_sg
      improvements didn't take the updated cx88 driver into account. Basically two ships
      passing in the night, unaware of one another even though both ships have the same
      owner, i.e. me :-)
      
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Reported-by: default avatarChris Lee <updatelee@gmail.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      165d0043
    • Hans Verkuil's avatar
      [media] v4l2-ioctl: WARN_ON if querycap didn't fill device_caps · 454a4e72
      Hans Verkuil authored
      
      This is easy to forget to do in drivers. While v4l2-compliance will check for it,
      not everyone remembers to run it. So warn about it.
      
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      454a4e72
    • Hans Verkuil's avatar
      [media] vivid: fix CROP_BOUNDS typo for video output · bb9ff078
      Hans Verkuil authored
      
      An error was returned if composing was not supported, instead of if
      cropping was not supported.
      
      A classic copy-and-paste bug. Found with v4l2-compliance.
      
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Cc: <stable@vger.kernel.org>      # for v3.18
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      bb9ff078
  8. Dec 16, 2014
Loading