From patchwork Thu Aug 30 20:38:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10582785 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A4CF8920 for ; Thu, 30 Aug 2018 20:39:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93A2B2C1F6 for ; Thu, 30 Aug 2018 20:39:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85E052C1F9; Thu, 30 Aug 2018 20:39:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F31542C1F6 for ; Thu, 30 Aug 2018 20:39:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727288AbeHaAnV (ORCPT ); Thu, 30 Aug 2018 20:43:21 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:37462 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727173AbeHaAnU (ORCPT ); Thu, 30 Aug 2018 20:43:20 -0400 Received: by mail-wm0-f65.google.com with SMTP id n11-v6so3289186wmc.2 for ; Thu, 30 Aug 2018 13:39:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CLTtmOLStEGICs7y2sUOjr7GRAXe63kpsHcH/s6GlW4=; b=P952LTMHZWjjSPT+vnrh4rlj/5VgZyqyJ/kqdRZSOnBQAH9a6PVyd9o2J1JQFfFhNR kD9gL7KbDNDf4jvEBf74NFikUUnya/J3qXv1+BawbuUI/39+9fROIKi79lw6Y8K+mx3F 3CfEvB0akSopAHvRmoCwwNOxsNhe7CQ+XBlHZm8tCmFDNIW1CsuXDGEuwNd3CmyC+xc4 nJ2zgrny4lvYWQcVhH2YQ3kuPl+b2Wlu2wS+/j1zqQk3ScfigXSZzu5GcPY0eoxDuEjy EsWEV/rqmMBd/i/S83jqBT8IRw36EgKn03Pqgza2mv6ZGoVUoEeDYJF0ostAhncWRVun 5cdw== X-Gm-Message-State: APzg51AtMsV/0SH+wai3rZokuMRstF72qucmrr8v4X+RZ0IHasMHEpPN ThwqkWZ7XJIdqpUZCxt93EEasw== X-Google-Smtp-Source: ANB0Vda2K0mIpo38XQu9UrWvib0AFtyaJTkggtKxX65EW9q2W2mBQ00ynZCtIaAfkLARwCILk6Ni4Q== X-Received: by 2002:a1c:3a92:: with SMTP id h140-v6mr3011332wma.41.1535661561643; Thu, 30 Aug 2018 13:39:21 -0700 (PDT) Received: from localhost.localdomain ([151.66.53.29]) by smtp.gmail.com with ESMTPSA id y10-v6sm5378714wrl.87.2018.08.30.13.39.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 13:39:20 -0700 (PDT) From: Lorenzo Bianconi To: jic23@kernel.org Cc: linux-iio@vger.kernel.org Subject: [PATCH] iio: imu: st_lsm6dsx: take into account ts samples in wm configuration Date: Thu, 30 Aug 2018 22:38:59 +0200 Message-Id: <20180830203859.6527-1-lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.18.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Take into account hw timer samples in pattern length computation used in st_lsm6dsx_update_watermark routine for watermark configuration Fixes: 213451076bd3 ("iio: imu: st_lsm6dsx: add hw timestamp support") Signed-off-by: Lorenzo Bianconi --- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c index 7589f2ad1dae..2b49d928f4c0 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c @@ -187,9 +187,10 @@ static int st_lsm6dsx_set_fifo_odr(struct st_lsm6dsx_sensor *sensor, int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark) { - u16 fifo_watermark = ~0, cur_watermark, sip = 0, fifo_th_mask; + u16 fifo_watermark = ~0, cur_watermark, fifo_th_mask; struct st_lsm6dsx_hw *hw = sensor->hw; struct st_lsm6dsx_sensor *cur_sensor; + u16 sip = hw->ts_sip; int i, err, data; __le16 wdata;