Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1205080rdd; Wed, 10 Jan 2024 11:53:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1X+xaihcN+3kgQgyfr1niP05ymJ/PmEJV2lXcvee+JlYsY/O4jmkZ1UlTUmx+E4AOCgpY X-Received: by 2002:a17:906:c04a:b0:a27:59a2:93ff with SMTP id bm10-20020a170906c04a00b00a2759a293ffmr13497ejb.161.1704916411580; Wed, 10 Jan 2024 11:53:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916411; cv=none; d=google.com; s=arc-20160816; b=wy552bmVDnNC6B5BwPbt8vb5+8liki/Y/OckW1/+Mi4ArQ016B887Hcv0IiudMDR6Z xSXDfMRODOM8Yiuh/pTK8Ky8X0KiLY+eqdO5BavqTb/vw9P9EBPDUam/Vlm7eRCd0hky s9Un08HKBZVKbxZgjwRpmkps++L+luhOzmuxqhuXgWZYnMc/wgKvD8obajiryNwpmMD4 tI97Y01EnFCNTGc87YI+lAcJ5bupIfsK1JB+6YzqcQ5foL+CU5nD0Oglwq3W+kH59ask c0IJDjOoT24+/ASbkgtBljqZO2k9cS0BEmV1dxFskb8ghGY7mAFI7i698Y4PQ+kUj7A5 1+RA== ARC-Message-Signature: i=1; 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=WoFvxKWdDooo1qSzC88EM9Nr4w+h9Vd46EFkbYPsSPw=; fh=cIqT9NcZdjUqupo3CRF2zie7E78k65IMo1it3Fi0alA=; b=hkTTh5SHEpHTJrSjZjLnC6bGOZFQdwMUKc/8l69Z4eFDCqy6vPJrAO5xLiui+VcUah J7RH/LZMAZb9UsDC+UHHIDTUp6SGcHTl/2iX56Bg2yqbQty0D+0o2k4lgnhrCN5IAlxG MgA9qMaTo+tYTQFmU1u4ClA/DGIDcmmyCybTUFs37ogNtMjY8fCEHwWtsZ+UORoj69do NnvlHbYr0dtxL5sDlHlZWuTpTLDLUVF8zXFSnaYsL8o2KnOTfPYP3+B0qp1GhimpkXNx HI3OEi678EEAnZA+MzmUMBB+IlznOzybqS9bei1xJiz5RHQUJds7LFixFSZgqLs2mVID ZxSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=DYtCGZ85; spf=pass (google.com: domain of linux-kernel+bounces-22681-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22681-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l25-20020a170906231900b00a2b87cb718csi1321586eja.608.2024.01.10.11.53.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 11:53:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22681-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=DYtCGZ85; spf=pass (google.com: domain of linux-kernel+bounces-22681-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22681-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1E1201F22F11 for ; Wed, 10 Jan 2024 19:53:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83B09524B4; Wed, 10 Jan 2024 19:51:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="DYtCGZ85" Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) (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 652604F892 for ; Wed, 10 Jan 2024 19:51:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-5955a4a9b23so2450180eaf.1 for ; Wed, 10 Jan 2024 11:51:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1704916278; x=1705521078; 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=WoFvxKWdDooo1qSzC88EM9Nr4w+h9Vd46EFkbYPsSPw=; b=DYtCGZ85pbfryJGNqhUF4Mwq/s2IJBCLYdbVXcZLOQTTMhJS86QolB3UIl1+Emd3nB P6ckUQiZlcgKwajSzt4FjkrPaY87p8sqQWrhlaIclD27u9YQLMHhY1Fw+l/lU4d0lejW ubUKXLJgEZ8pRnHY0PT5osdpTQDm3alUwirTkAbcpz6EFjJcGt6hI+kwYpkxx8PYImOJ oTyfdO73QCXeXWx1hl9OHm6IvpZmEovhyGlhSvzb8fxNsQq+ckrJk8f2MSywULRb0aF+ +wscSNVNacPlJS89FFH+DcLyrhP5gyhytLFKeL8R5/EWqDtXyeopuhGVbeqURHNH4+3f 6HGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916278; x=1705521078; 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=WoFvxKWdDooo1qSzC88EM9Nr4w+h9Vd46EFkbYPsSPw=; b=KKdAmgtQ+76da44NNLXhbWWMQr7myrblhzrrcZZWhg2fQDEHvH3TYU/HTodIA5xeJe 4RBhsfcJizJR1lNKzq31M/o6jUKESGWueua/g8dsljs1QN7zJTtyZ1s2t2g43Ijrh1Ll 40TyvKtKEJV64s53wakykcc7NIQjXtTQNsF1GjSlzJOIGAvXJs/dbp85+AWdtBvIk8Rz xsvxjm4aIbz3h7GhPA7hpE/Ogr9xorbshbdrJeJ6Iu25+IYSoJHkx/bd8N2Y84UCqVl5 jXMoMe8J+1OdvE40sTc8vixu+kYxizRgZTyOxQdn034vhs3QBzwUfWWY7PrRr7V3cKT8 5ayg== X-Gm-Message-State: AOJu0Yzt+DQZ49WlpoDUHzv0p2MkzejxAMk+/EGFVpb3F9a29lTP2gsn YRLuXj/1pqfczP6RVnhZGDeSv4Cfdl+O0Q== X-Received: by 2002:a05:6820:1ca2:b0:594:3789:1aaf with SMTP id ct34-20020a0568201ca200b0059437891aafmr100073oob.15.1704916278503; Wed, 10 Jan 2024 11:51:18 -0800 (PST) Received: from freyr.lechnology.com (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 187-20020a4a0dc4000000b00595b35927a3sm938513oob.39.2024.01.10.11.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 11:51:18 -0800 (PST) From: David Lechner To: Mark Brown , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Frank Rowand Cc: David Lechner , Thierry Reding , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Corbet , linux-spi@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/13] iio: buffer: dmaengine: export devm_iio_dmaengine_buffer_alloc() Date: Wed, 10 Jan 2024 13:49:51 -0600 Message-ID: <20240109-axi-spi-engine-series-3-v1-10-e42c6a986580@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109-axi-spi-engine-series-3-v1-0-e42c6a986580@baylibre.com> References: <20240109-axi-spi-engine-series-3-v1-0-e42c6a986580@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: b4 0.12.4 Content-Transfer-Encoding: 8bit This changes devm_iio_dmaengine_buffer_alloc() to an exported symbol. This will be used by drivers that need to allocate a DMA buffer without attaching it to an IIO device. Signed-off-by: David Lechner --- Documentation/driver-api/driver-model/devres.rst | 1 + drivers/iio/buffer/Kconfig | 14 +++++++------- drivers/iio/buffer/industrialio-buffer-dmaengine.c | 3 ++- include/linux/iio/buffer-dmaengine.h | 2 ++ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst index b23d4a2b68a6..60e4b7ba38e5 100644 --- a/Documentation/driver-api/driver-model/devres.rst +++ b/Documentation/driver-api/driver-model/devres.rst @@ -285,6 +285,7 @@ I2C IIO devm_iio_device_alloc() devm_iio_device_register() + devm_iio_dmaengine_buffer_alloc() devm_iio_dmaengine_buffer_setup() devm_iio_kfifo_buffer_setup() devm_iio_kfifo_buffer_setup_ext() diff --git a/drivers/iio/buffer/Kconfig b/drivers/iio/buffer/Kconfig index 925c5bf074bc..27d82fb4bc4d 100644 --- a/drivers/iio/buffer/Kconfig +++ b/drivers/iio/buffer/Kconfig @@ -40,6 +40,13 @@ config IIO_BUFFER_HW_CONSUMER Should be selected by drivers that want to use the generic Hw consumer interface. +config IIO_HW_TRIGGERED_BUFFER + tristate "Industrial I/O hardware triggered buffer support" + select AUXILIARY_BUS + select IIO_TRIGGER + help + Provides helper functions for setting up hardware triggered buffers. + config IIO_KFIFO_BUF tristate "Industrial I/O buffering based on kfifo" help @@ -53,10 +60,3 @@ config IIO_TRIGGERED_BUFFER select IIO_KFIFO_BUF help Provides helper functions for setting up triggered buffers. - -config IIO_HW_TRIGGERED_BUFFER - tristate "Industrial I/O hardware triggered buffer support" - select AUXILIARY_BUS - select IIO_TRIGGER - help - Provides helper functions for setting up hardware triggered buffers. diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c index c67ddf963bfb..03225939f223 100644 --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c @@ -244,7 +244,7 @@ static void __devm_iio_dmaengine_buffer_free(void *buffer) * * The buffer will be automatically de-allocated once the device gets destroyed. */ -static struct iio_buffer *devm_iio_dmaengine_buffer_alloc(struct device *dev, +struct iio_buffer *devm_iio_dmaengine_buffer_alloc(struct device *dev, const char *channel) { struct iio_buffer *buffer; @@ -261,6 +261,7 @@ static struct iio_buffer *devm_iio_dmaengine_buffer_alloc(struct device *dev, return buffer; } +EXPORT_SYMBOL_GPL(devm_iio_dmaengine_buffer_alloc); /** * devm_iio_dmaengine_buffer_setup() - Setup a DMA buffer for an IIO device diff --git a/include/linux/iio/buffer-dmaengine.h b/include/linux/iio/buffer-dmaengine.h index 5c355be89814..3ac616ddf5b9 100644 --- a/include/linux/iio/buffer-dmaengine.h +++ b/include/linux/iio/buffer-dmaengine.h @@ -10,6 +10,8 @@ struct iio_dev; struct device; +struct iio_buffer *devm_iio_dmaengine_buffer_alloc(struct device *dev, + const char *channel); int devm_iio_dmaengine_buffer_setup(struct device *dev, struct iio_dev *indio_dev, const char *channel); -- 2.43.0