Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3107640pxm; Mon, 28 Feb 2022 12:09:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKjhhVdCEKyLhmiBxCO3eodGoshvEmbg0icfJllQca5t8ndAQklvqlt6X7vJ4baqKBaPc+ X-Received: by 2002:a17:902:ead1:b0:14f:95e1:86fe with SMTP id p17-20020a170902ead100b0014f95e186femr21987196pld.21.1646078987144; Mon, 28 Feb 2022 12:09:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646078987; cv=none; d=google.com; s=arc-20160816; b=XIOenW5j5c15+b+42TE9iGPy2hsVhcdKsXx51Gf128Bj+XRC+lvqNRLGKXKZCf0UXs zSVlbAVJyiQzv7e7bOSdGJyMWz5outku8ubca/Q0aPoQIeoRlnX2U91Lbsz0dJ1PKAJ0 kSJghrpqQtFwolibJxx2w1obC0zZOcFFR+gX3IYZpbYuKZKEAq5HClNjJRa/kmsr/5wF LZU3t9l3/MrnkumWWiGIRgy/G0Vbqp+r1u0VANQ7P7mXL72zMz9Hlc4hip6YybKtPkB/ LyB56XHngwGQb2e3Jzs6nOGiuKDyRfCz+3ZICuGcxftm0byvOkQ0xk/X7EPDVNuXa9pC MlBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WiAe69ucGTZzQnR+CzFDb4uIPVNRvUJKxUKn5tjb5JU=; b=EJYeik5RtYh85bBt0kMPoyZcvZDgdaQxVKGMIS+VrPP4U5Bo9v952g2JmXx4qXb4wU k3SEAfTq4KcfCqkyJltB4ipyIOQDNcfXBrZ7JenBSKJxaqMxsM/mBtqXMxTnPqckaQxU qe5sKMIuH1X2pqgi8u++XK/DZtLmCLV2lR7MmdYIaaaY2Z6TKi3/+Nz19d2ocrUssv0H 303ale+ApLiBN//V1onOLXeYgRY3BTgX9IwXbzL02rdt7XkLKfsCYx3NIdXZg1+iIyL9 mAprdGFj02Wn+lVPXpN/VQNBh+UqNLe+NbaGzNwpI7p4s6EvP6UIyl5ZzWFWdVUMWq90 ahgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="KE/ongn3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d12-20020a170902cecc00b0014fcbe95c4csi10765372plg.150.2022.02.28.12.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:09:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="KE/ongn3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B348713CA1F; Mon, 28 Feb 2022 11:34:02 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240404AbiB1SIw (ORCPT + 99 others); Mon, 28 Feb 2022 13:08:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240753AbiB1SD7 (ORCPT ); Mon, 28 Feb 2022 13:03:59 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEA86286EB; Mon, 28 Feb 2022 09:47:45 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 74E4060748; Mon, 28 Feb 2022 17:47:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C765C340E7; Mon, 28 Feb 2022 17:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070450; bh=6Bs3KRMBEnBHVY5wgZ6eTF3ehTlTDXNCkx6jttAQhII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KE/ongn3/EKvL94wJNutZP23/r9GoWqvXSIjZyYkxYLd1Gs78eG9KjZNFau0lxIsf /8gPR2xoMW8Z6dkYtN/T49STwbc5iC9Snktas0znQ9/eKke0bFzsiRlSVwMCF+sCoW ZnITRDpB4/o94INiLzq1B4hv8VF8NkORxL3AlTLU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julia Pineda , =?UTF-8?q?Nuno=20S=C3=A1?= , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.16 114/164] iio:imu:adis16480: fix buffering for devices with no burst mode Date: Mon, 28 Feb 2022 18:24:36 +0100 Message-Id: <20220228172410.775930203@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172359.567256961@linuxfoundation.org> References: <20220228172359.567256961@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nuno Sá commit b0e85f95e30d4d2dc22ea123a30dba36406879a1 upstream. The trigger handler defined in the driver assumes that burst mode is being used. Hence, for devices that do not support it, we have to use the adis library default trigger implementation. Tested-by: Julia Pineda Fixes: 941f130881fa9 ("iio: adis16480: support burst read function") Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20220114132608.241-1-nuno.sa@analog.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/imu/adis16480.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/iio/imu/adis16480.c +++ b/drivers/iio/imu/adis16480.c @@ -1403,6 +1403,7 @@ static int adis16480_probe(struct spi_de { const struct spi_device_id *id = spi_get_device_id(spi); const struct adis_data *adis16480_data; + irq_handler_t trigger_handler = NULL; struct iio_dev *indio_dev; struct adis16480 *st; int ret; @@ -1474,8 +1475,12 @@ static int adis16480_probe(struct spi_de st->clk_freq = st->chip_info->int_clk; } + /* Only use our trigger handler if burst mode is supported */ + if (adis16480_data->burst_len) + trigger_handler = adis16480_trigger_handler; + ret = devm_adis_setup_buffer_and_trigger(&st->adis, indio_dev, - adis16480_trigger_handler); + trigger_handler); if (ret) return ret;