From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43B08C433ED for ; Mon, 10 May 2021 06:41:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0EF6A61448 for ; Mon, 10 May 2021 06:41:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbhEJGmL (ORCPT ); Mon, 10 May 2021 02:42:11 -0400 Received: from first.geanix.com ([116.203.34.67]:53626 "EHLO first.geanix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229863AbhEJGmL (ORCPT ); Mon, 10 May 2021 02:42:11 -0400 Received: from [192.168.100.10] (unknown [185.233.254.173]) by first.geanix.com (Postfix) with ESMTPSA id 24CA9468733; Mon, 10 May 2021 06:41:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=geanix.com; s=first; t=1620628863; bh=BZsHyvKkcHMBhTQzhatvVIgBZci74t801/6tnFGIu7g=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=OHD2PPCXyRxX3EZ4r2uPtmWH0lDKXTsI8MetGc6vliV/1eGnHsB2W42UEZ9hCtJGp N+0ABzPH0WPdtYJG9sv2ryUUQcqxWWKGz+SwsrWscyTS4iNEWT6zUfXbqMS9hASVlp fGl1uvFsFEelbuQyaa4jyOaBoNIktIomnSzUuZcYc1CB1fdiMB0EzgbUlZXmDb3tql p0qHIjfbDvdaRZeuLIQdUh4cat+ymR29FyGLBmuNa6kfr+SWdKpX0deH0+AUrhLs/v bncqJGqMQbuViCBmPeBpkiNoB+Li3OluDEYVmwleeaCYiViA6qEBT6eMgjlt8sprYN mSxSPEitT1e0A== Subject: Re: [PATCH] iio: imu: st_lsm6dsx: do not roundup set samplerate To: Lorenzo Bianconi Cc: lorenzo.bianconi83@gmail.com, jic23@kernel.org, linux-iio@vger.kernel.org References: <20210507103220.2194009-1-sean@geanix.com> From: Sean Nyekjaer Message-ID: <303a2899-2aff-410f-3bce-e40a7d7637e9@geanix.com> Date: Mon, 10 May 2021 08:41:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On 10/05/2021 08.28, Lorenzo Bianconi wrote: >> On 07/05/2021 13.02, Lorenzo Bianconi wrote: >>>> The correct way to set the sampling rate to 12.5 Hz before >>>> commit f8710f0357bc ("iio: imu: st_lsm6dsx: express odr in mHZ") >>>> was to write 13 Hz to sampling_frequency. >>>> Before this patch writing 13 to samplerate results in sample rate set >>>> to 26 Hz. >>>> Now we return EINVAL if the sampling rate is not in table. >>>> >>>> Signed-off-by: Sean Nyekjaer >>> >>> I think this patch is breaking i2c-master support available in st_lsm6dsx, have you tested it? >>> >> I have not tested with i2c-master. >> But it's not nice to round up sample rate from user space without any notice. > > the point is accel odr is used as trigger for i2c-slave sampling. Connected > i2c slave devices have different sample rates (e.g. LIS2MDL), so we need to > select the lower accel odr greather than slave device one. > > Regards, > Lorenzo > We could open up for custom sample rates if i2c-slaves are enabled? /Sean