Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp489209lqo; Wed, 8 May 2024 06:15:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWC1ZckHp4LaWFpR/rHdj/p6flhNdMTLUc8a0SpaaQ/7Xpjxso99dlBC2z3mIDKewO25/8nZ988+BtVyKWMc9GJ2ENxyabKxbL0ZXBlPg== X-Google-Smtp-Source: AGHT+IGGNNqix7TzUDD4yQYTz7Neuv4UESDJrSDXc4lDJL4pJuC5eT5IZFD7QTbhN9PyZjPsqwoY X-Received: by 2002:a17:902:c40d:b0:1e4:3b58:7720 with SMTP id d9443c01a7336-1eeb03a6976mr30061555ad.2.1715174113970; Wed, 08 May 2024 06:15:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715174113; cv=pass; d=google.com; s=arc-20160816; b=BEfqYyX09Um60wduPBTGmPa/8PdipwAfwgjGJj+Bd2KgEgy2AnGOSstztKdotDGyMC D17R0SiotkDJsML0S3hcVNny+RVXskgBJdI0vu7Uh4ZoIVlKySIUyR6XNdYbXEkPIcNn C96qi1ngFOi4Ed724ueoKJOv3ybdfxd5+ANXCTrjsuaLe537ubBz299hBTkRMELVwIU9 z1Jvp5aal8Lld9/bJ0RtQIHqHRahg1rkCtw//CArLZpQdoxiZS7tqZeIno/bSs03Opuw YmADP279MretrFzGdMv4wD357SC1zOxIGPRogjEcuY2aGPxUTWH98rftHpInLIHEMDQ9 Kvqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=HsLyyy8j5G4b/HhLyl+d8G98qlBv+azGHzBJ8yf9oS0=; fh=VRZ59XTJk+vKK+PzZYzobhLOrPPnd0S+IzUz6nGRzNM=; b=wKwhfkjWuX0+PBkNpjGlhNE27G1OPl/wE2Xx2a7UtS7eh5PiAYe1OgMD/GbRaziz2/ I84lDPUCSHD8lmiH5KUkJ89GJ65HQ9lWFL+HdqZjfPKBswlx3IEqCURZfvIVNF34V1rt Ctgfxmfz9jUUV6Kn3VAoW0APvhb/UIrYSGH9FJDInFSYpmNfT39AYnsdAKsuyZjMMc8y wJeqgJyq4D+6q24jqFkhyCj3VQ8ctoZrRLqQ1Uaa0In0TLCm4vzVqYc0YdohNRBJMbQf S7n0+74wY5OSE0oXfJ2flFKIIiPEFd9TCjJqZkpFwAqtLVBKodtvAJxEBtpZtTskSF+K X5pA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bFFmNANC; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-173280-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173280-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k12-20020a170902c40c00b001eadb402587si12959594plk.339.2024.05.08.06.15.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 06:15:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173280-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bFFmNANC; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-173280-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173280-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4A2D42848D3 for ; Wed, 8 May 2024 13:14:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6AD2A7E767; Wed, 8 May 2024 13:13:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bFFmNANC" Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 173F67E573; Wed, 8 May 2024 13:13:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715174003; cv=none; b=NJ3Flk3fI7X19k6Pgdlv5X8HDtX3rUiPlBYwqZ/uVRY3um3XQI5i429P2l3RLt1qpLcv3yp66jGG9IylpJtvFjNjxwfSLlQxwmUVmtJFMRO7BpzKKIZvU6oTMyNrzGMPj0RroPsIkS1SsHcGZrKwqX0nPiVT7M9rVGehBzi4KlE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715174003; c=relaxed/simple; bh=8ZjEBstzzUZOFpwRTIZ0cxsULvTEL6ice7hRMQ0ZpJU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=abKZ49nEwJcJ6XuUCjigUKYW1Jzh5+WNHwYE0ySuQqSdKZ4tdalWHkI13dv8fWQvtEn83SzTGbG+WUf5Y0HJeJDoISMHoN2iZuEkoEyawzd71V9iyZdLGTThIzIlNY5e/ikUc35jHGPC+fbIUiYJEV5Ev7wp8KKtEn5P3tCRf1c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bFFmNANC; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-41dc9c83e57so4727175e9.0; Wed, 08 May 2024 06:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715174000; x=1715778800; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HsLyyy8j5G4b/HhLyl+d8G98qlBv+azGHzBJ8yf9oS0=; b=bFFmNANCNgF5TbvEdv5oCJCsMtbxaiFSCgqb3J1FmYYvajP3V8nU+U7TnuJz4WjRYT sfzNg2GMJ94HoBT/9iW5IgO4EIROZGqWfexjYv+Kw32NESllTaFN867oUoxPTZ3Bx2Ma OOYxl30qLlVU1JxVqwmYZyTQnY6m/tdJtgJlPQptuxzwax06VhaWCSr6zrrr/hkNjxuL ShQ8nt0LPP9hcJdELk7UtC5B0+3hi6k9LEt62rWoHCqnHYOBb2Y7z66gbTeSz/mM5zGK CflEGrRSDZ5/Id3djQLsa7ru3PiqU052P/MriCVoEtKGx78tAWHtnBIed4GvRL9zCTs/ TZgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715174000; x=1715778800; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HsLyyy8j5G4b/HhLyl+d8G98qlBv+azGHzBJ8yf9oS0=; b=h4mmQMhMewBKQEujG8avTKCzxba8OAyf0e+0KdWl+uON+sc2iN88uYXfz0hkrcAuiR nGxK9ibc7cgQERktw35jRsbr2rM7XpR5wAUWaY0Qnzc+POt6jM5qyTxJEvi37CaFAvel aykZkPvxzlBaYpu0CBHSUTgt+tyitf7aIhIrtWVJXIVnXl9kDKsSBqcAwMuphXSuSV95 IAefJotSYIRbrvWoxkpSUNcVJIJbwx8O7pqTtoa5nM6iFr5pJW87+F+eUzmxL9z4LTQO ixcUsk1bkoLBWiXcJO9H58da7KvZBo1JbtYaXzvl1Tf6YO7ye0J7t0g/WsgL71HWJW+9 no9Q== X-Forwarded-Encrypted: i=1; AJvYcCXQURVbgnHmyx8QovJ6jAWiyMvyCYSmgxvEIu1+bI4cb2I0Bg3FUMFeQIEts6sea0o8mGMkHCTPq91YTu5M30WwU9yopikxulZWM92M3yygv+KJDecIriCFUdkkEDea3NUws8kI+A== X-Gm-Message-State: AOJu0Ywqc/RNN9iu4/ZTMrRLapqMuoecbw2N/maQzAZ/G7LYBo1mAalI 6LEJl8nirAYO0rZpocKu5RO8YoRPOhw6y0ZXwuTxXN/1rCA0nngMkuS0bFsjzBc= X-Received: by 2002:a05:600c:3b0c:b0:417:eb5d:281b with SMTP id 5b1f17b1804b1-41f2db24c81mr51179125e9.17.1715173999743; Wed, 08 May 2024 06:13:19 -0700 (PDT) Received: from rbolboac.. ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41f88110f3esm22848365e9.29.2024.05.08.06.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 06:13:19 -0700 (PDT) From: Ramona Gradinariu To: linux-kernel@vger.kernel.org, jic23@kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh@kernel.org, nuno.sa@analog.com Cc: Ramona Gradinariu Subject: [PATCH v2 5/8] iio: imu: adis16475: Create push single sample API Date: Wed, 8 May 2024 16:13:07 +0300 Message-Id: <20240508131310.880479-6-ramona.bolboaca13@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240508131310.880479-1-ramona.bolboaca13@gmail.com> References: <20240508131310.880479-1-ramona.bolboaca13@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Create push single sample API reposnsible for pushing a single sample into the buffer. This is a preparation patch for FIFO support where more than one sample has to be pushed in the trigger handler. Signed-off-by: Ramona Gradinariu --- changes in v2: - no changes drivers/iio/imu/adis16475.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c index f9455ecb348c..ab955efdad92 100644 --- a/drivers/iio/imu/adis16475.c +++ b/drivers/iio/imu/adis16475.c @@ -1249,9 +1249,8 @@ static void adis16475_burst32_check(struct adis16475 *st) } } -static irqreturn_t adis16475_trigger_handler(int irq, void *p) +static int adis16475_push_single_sample(struct iio_poll_func *pf) { - struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; struct adis16475 *st = iio_priv(indio_dev); struct adis *adis = &st->adis; @@ -1340,6 +1339,15 @@ static irqreturn_t adis16475_trigger_handler(int irq, void *p) * array. */ adis16475_burst32_check(st); + return ret; +} + +static irqreturn_t adis16475_trigger_handler(int irq, void *p) +{ + struct iio_poll_func *pf = p; + struct iio_dev *indio_dev = pf->indio_dev; + + adis16475_push_single_sample(pf); iio_trigger_notify_done(indio_dev->trig); return IRQ_HANDLED; -- 2.34.1