mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luis Henriques <luis.henriques@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	kernel-team@lists.ubuntu.com
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Jonathan Cameron <jic23@kernel.org>,
	Luis Henriques <luis.henriques@canonical.com>
Subject: [PATCH 3.16.y-ckt 06/71] iio: adis16400: Fix burst transfer for adis16448
Date: Thu, 25 Jun 2015 11:01:45 +0100	[thread overview]
Message-ID: <1435226570-3669-7-git-send-email-luis.henriques@canonical.com> (raw)
In-Reply-To: <1435226570-3669-1-git-send-email-luis.henriques@canonical.com>

3.16.7-ckt14 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: Lars-Peter Clausen <lars@metafoo.de>

commit d046ba268adb87c7780494ecf897cbafbf100d57 upstream.

The adis16448, unlike the other chips in this family, in addition to the
hardware channels also sends out the DIAG_STAT register in burst mode
before them. Handle that case by skipping over the first 2 bytes before we
pass the received data to the buffer.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Fixes: 76ada52f7f5d ("iio:adis16400: Add support for the adis16448")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/iio/imu/adis16400.h        |  1 +
 drivers/iio/imu/adis16400_buffer.c | 10 +++++++++-
 drivers/iio/imu/adis16400_core.c   |  3 ++-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/imu/adis16400.h b/drivers/iio/imu/adis16400.h
index 1e8fd2e81d45..73b189c1c0fb 100644
--- a/drivers/iio/imu/adis16400.h
+++ b/drivers/iio/imu/adis16400.h
@@ -139,6 +139,7 @@
 #define ADIS16400_NO_BURST		BIT(1)
 #define ADIS16400_HAS_SLOW_MODE		BIT(2)
 #define ADIS16400_HAS_SERIAL_NUMBER	BIT(3)
+#define ADIS16400_BURST_DIAG_STAT	BIT(4)
 
 struct adis16400_state;
 
diff --git a/drivers/iio/imu/adis16400_buffer.c b/drivers/iio/imu/adis16400_buffer.c
index 629ae84d4e62..90c24a23c679 100644
--- a/drivers/iio/imu/adis16400_buffer.c
+++ b/drivers/iio/imu/adis16400_buffer.c
@@ -29,6 +29,8 @@ int adis16400_update_scan_mode(struct iio_dev *indio_dev,
 
 	/* All but the timestamp channel */
 	burst_length = (indio_dev->num_channels - 1) * sizeof(u16);
+	if (st->variant->flags & ADIS16400_BURST_DIAG_STAT)
+		burst_length += sizeof(u16);
 
 	adis->xfer = kcalloc(2, sizeof(*adis->xfer), GFP_KERNEL);
 	if (!adis->xfer)
@@ -63,6 +65,7 @@ irqreturn_t adis16400_trigger_handler(int irq, void *p)
 	struct adis16400_state *st = iio_priv(indio_dev);
 	struct adis *adis = &st->adis;
 	u32 old_speed_hz = st->adis.spi->max_speed_hz;
+	void *buffer;
 	int ret;
 
 	if (!adis->buffer)
@@ -83,7 +86,12 @@ irqreturn_t adis16400_trigger_handler(int irq, void *p)
 		spi_setup(st->adis.spi);
 	}
 
-	iio_push_to_buffers_with_timestamp(indio_dev, adis->buffer,
+	if (st->variant->flags & ADIS16400_BURST_DIAG_STAT)
+		buffer = adis->buffer + sizeof(u16);
+	else
+		buffer = adis->buffer;
+
+	iio_push_to_buffers_with_timestamp(indio_dev, buffer,
 		pf->timestamp);
 
 	iio_trigger_notify_done(indio_dev->trig);
diff --git a/drivers/iio/imu/adis16400_core.c b/drivers/iio/imu/adis16400_core.c
index ba2c48d69e5f..10265263fa1a 100644
--- a/drivers/iio/imu/adis16400_core.c
+++ b/drivers/iio/imu/adis16400_core.c
@@ -805,7 +805,8 @@ static struct adis16400_chip_info adis16400_chips[] = {
 		.channels = adis16448_channels,
 		.num_channels = ARRAY_SIZE(adis16448_channels),
 		.flags = ADIS16400_HAS_PROD_ID |
-				ADIS16400_HAS_SERIAL_NUMBER,
+				ADIS16400_HAS_SERIAL_NUMBER |
+				ADIS16400_BURST_DIAG_STAT,
 		.gyro_scale_micro = IIO_DEGREE_TO_RAD(10000), /* 0.01 deg/s */
 		.accel_scale_micro = IIO_G_TO_M_S_2(833), /* 1/1200 g */
 		.temp_scale_nano = 73860000, /* 0.07386 C */

  parent reply	other threads:[~2015-06-25 10:22 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 10:01 [3.16.y-ckt stable] Linux 3.16.7-ckt14 stable review Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 01/71] iio: adis16400: Report pressure channel scale Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 02/71] iio: adis16400: Use != channel indices for the two voltage channels Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 03/71] iio: adis16400: Compute the scan mask from channel indices Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 04/71] iio: adis16400: Remove unused variable Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 05/71] iio: adis16400: Fix burst mode Luis Henriques
2015-06-25 10:01 ` Luis Henriques [this message]
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 07/71] USB: serial: ftdi_sio: Add support for a Motion Tracker Development Board Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 08/71] iio: adc: twl6030-gpadc: Fix modalias Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 09/71] serial: imx: Fix DMA handling for IDLE condition aborts Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 10/71] usb: dwc3: gadget: Fix incorrect DEPCMD and DGCMD status macros Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 11/71] ALSA: usb-audio: Add mic volume fix quirk for Logitech Quickcam Fusion Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 12/71] ozwpan: Use proper check to prevent heap overflow Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 13/71] ozwpan: Use unsigned ints " Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 14/71] ozwpan: divide-by-zero leading to panic Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 15/71] ozwpan: unchecked signed subtraction leads to DoS Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 16/71] n_tty: Fix auditing support for cannonical mode Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 17/71] drm/i915/hsw: Fix workaround for server AUX channel clock divisor Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 18/71] x86/asm/irq: Stop relying on magic JMP behavior for early_idt_handlers Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 19/71] lib: Fix strnlen_user() to not touch memory after specified maximum Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 20/71] Input: elantech - fix detection of touchpads where the revision matches a known rate Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 21/71] ALSA: hda/realtek - Add a fixup for another Acer Aspire 9420 Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 22/71] ALSA: usb-audio: add MAYA44 USB+ mixer control names Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 23/71] ALSA: usb-audio: fix missing input volume controls in MAYA44 USB(+) Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 24/71] USB: cp210x: add ID for HubZ dual ZigBee and Z-Wave dongle Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 25/71] Input: elantech - add new icbody type Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 26/71] MIPS: Fix enabling of DEBUG_STACKOVERFLOW Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 27/71] xfrm: fix a race in xfrm_state_lookup_byspi Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 28/71] kconfig: Fix warning "‘jump’ may be used uninitialized" Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 29/71] scripts/sortextable: suppress warning: `relocs_size' may be used uninitialized Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 30/71] thermal: step_wise: Revert optimization Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 31/71] MIPS: KVM: Do not sign extend on unsigned MMIO load Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 32/71] arch/x86/kvm/mmu.c: work around gcc-4.4.4 bug Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 33/71] net: core: Correct an over-stringent device loop detection Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 34/71] net: phy: Allow EEE for all RGMII variants Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 35/71] net: dp83640: fix broken calibration routine Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 36/71] net: dp83640: reinforce locking rules Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 37/71] unix/caif: sk_socket can disappear when state is unlocked Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 38/71] xen/netback: Properly initialize credit_bytes Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 39/71] udp: fix behavior of wrong checksums Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 40/71] xen: netback: read hotplug script once at start of day Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 41/71] ipv4/udp: Verify multicast group is ours in upd_v4_early_demux() Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 42/71] bridge: disable softirqs around br_fdb_update to avoid lockup Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 43/71] drm/i915: Assume dual channel LVDS if pixel clock necessitates it Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 44/71] Btrfs: send, add missing check for dead clone root Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 45/71] Btrfs: send, don't leave without decrementing clone root's send_progress Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 46/71] btrfs: incorrect handling for fiemap_fill_next_extent return Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 47/71] btrfs: cleanup orphans while looking up default subvolume Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 48/71] Drivers: hv: vmbus: Add support for VMBus panic notifier handler Luis Henriques
2015-06-30 16:19   ` Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 49/71] Drivers: hv: vmbus: Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 50/71] iommu/vt-d: Allow RMRR on graphics devices too Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 51/71] iommu/vt-d: Fix passthrough mode with translation-disabled devices Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 52/71] ata: ahci_mvebu: Fix wrongly set base address for the MBus window setting Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 53/71] virtio_pci: Clear stale cpumask when setting irq affinity Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 54/71] irqchip: sunxi-nmi: Fix off-by-one error in irq iterator Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 55/71] pata_octeon_cf: fix broken build Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 56/71] Input: synaptics - add min/max quirk for Lenovo S540 Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 57/71] drm/i915: Fix DDC probe for passive adapters Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 58/71] cfg80211: wext: clear sinfo struct before calling driver Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 59/71] mm/memory_hotplug.c: set zone->wait_table to null after freeing it Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 60/71] ring-buffer-benchmark: Fix the wrong sched_priority of producer Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 61/71] block: fix ext_dev_lock lockdep report Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 62/71] iser-target: Fix variable-length response error completion Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 63/71] iser-target: release stale iser connections Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 64/71] ALSA: hda - adding a DAC/pin preference map for a HP Envy TS machine Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 65/71] drm/mgag200: Reject non-character-cell-aligned mode widths Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 66/71] crypto: caam - fix uninitialized state->buf_dma field Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 67/71] crypto: caam - improve initalization for context state saves Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 68/71] crypto: caam - fix RNG buffer cache alignment Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 69/71] tracing: Have filter check for balanced ops Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 70/71] drm/radeon: fix freeze for laptop with Turks/Thames GPU Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 71/71] Revert "tools/vm: fix page-flags build" Luis Henriques

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435226570-3669-7-git-send-email-luis.henriques@canonical.com \
    --to=luis.henriques@canonical.com \
    --cc=jic23@kernel.org \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®