Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1211107

Re: [PATCH v5 6/8] iio: gyro: bmg160: optimize i2c transfers in trigger handler

From Wolfram Sang <wsa@the-dreams.de>
Newsgroups linux.kernel
Subject Re: [PATCH v5 6/8] iio: gyro: bmg160: optimize i2c transfers in trigger handler
Date 2015-08-21 12:30 +0200
Message-ID <pZRKa-Pi-9@gated-at.bofh.it> (permalink)
References <pWFm9-7bv-7@gated-at.bofh.it> <pWFmb-7bv-55@gated-at.bofh.it> <pY2qn-4ld-25@gated-at.bofh.it> <pYoAz-2Ok-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, Aug 17, 2015 at 11:09:43AM +0200, Markus Pargmann wrote:
> On Sun, Aug 16, 2015 at 10:24:47AM +0100, Jonathan Cameron wrote:
> > On 12/08/15 15:31, Irina Tirdea wrote:
> > > Some i2c busses (e.g.: Synopsys DesignWare I2C adapter) need to
> > > enable/disable the bus at each i2c transfer and must wait for
> > > the enable/disable to happen before sending the data.
> > > 
> > > When reading data in the trigger handler, the bmg160 driver does
> > > one i2c transfer for each axis. This has an impact on the frequency
> > > of the gyroscope at high sample rates due to additional delays
> > > introduced by the i2c bus at each transfer.
> > > 
> > > Reading all axis values in one i2c transfer reduces the delays
> > > introduced by the i2c bus. Uses i2c_smbus_read_i2c_block_data_or_emulated
> > > that will fallback to reading each axis as a separate word in case i2c
> > > block read is not supported.
> > > 
> > > Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
> > > Acked-by: Jonathan Cameron <jic23@kernel.org>
> > > Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > Note, that in the meantime the bmg160 driver just went all regmap
> > on us (as part of adding SPI support - though that step hasn't
> > happened yet).  Hence we'll need a means of telling regmap about this
> > possibility.
> 
> Perhaps this is covered by a regmap_bulk_read()?
> 
> The series[1] I am working on implements a i2c smbus block data regmap
> bus driver. Regmap should then automatically do a block read in
> regmap_bulk_read.

Hmm, so doesn't your series make Irina's series obsolete? It addresses
the same problem only at a different layer (i2c core vs. regmap), or? It
would mean that i2c client drivers which want to support byte, word, or
block transfers should be converted to regmap. I assume most of the
potential candidates are register based devices anyhow. Then, regmap
would be the proper abstraction layer. Have I overlooked something?

Thanks,

   Wolfram

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v5 6/8] iio: gyro: bmg160: optimize i2c transfers in  trigger handler Wolfram Sang <wsa@the-dreams.de> - 2015-08-21 12:30 +0200
  Re: [PATCH v5 6/8] iio: gyro: bmg160: optimize i2c transfers in  trigger handler "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com> - 2015-08-21 18:00 +0200
    Re: [PATCH v5 6/8] iio: gyro: bmg160: optimize i2c transfers in  trigger handler Wolfram Sang <wsa@the-dreams.de> - 2015-08-22 06:10 +0200
      Re: [PATCH v5 6/8] iio: gyro: bmg160: optimize i2c transfers in  trigger handler Jonathan Cameron <jic23@kernel.org> - 2015-08-22 19:30 +0200
        Re: [PATCH v5 6/8] iio: gyro: bmg160: optimize i2c transfers in  trigger handler Wolfram Sang <wsa@the-dreams.de> - 2015-08-24 13:50 +0200

csiph-web