From patchwork Wed Jan 10 11:12:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 124048 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5139503qgn; Wed, 10 Jan 2018 03:13:35 -0800 (PST) X-Google-Smtp-Source: ACJfBosWShaWrH52tpIqrZldFCUyBR4IijJoHX0B+/bt7I98uXQIoB0HV+4Aa/H42GeZJKM/L/D1 X-Received: by 10.28.218.207 with SMTP id r198mr14205282wmg.37.1515582814946; Wed, 10 Jan 2018 03:13:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515582814; cv=none; d=google.com; s=arc-20160816; b=DCmZ8hct5CYcbjLlcYda+4e14uI987QbCQCcZgulfjqLPhiro9Pw4CZ5L9DpjEMDmI l23St8puEtfNmOEuUw5COuWofJpplbKIye2+RcpuR3JaZOoxY0uMEGcebKTe8sZiPzJS VOxRdRKCdGFh4XK2jhD4LEqJnLIzDJVE7tIUnd5AJIhT6rIsEb27ZLbJe/XEmD1YLZDV M/DePPH5HJk/GpY9nZehdSng89Z7a5xdRq6VblYcRHKpCQOCuVT/2Xa4FmQTsRY6aUPM UzVwM8Ca9HoAF7MaAHoH3lz+eYOQialVaz2PZ6wzhuPDtI26C+73KHoqIGBnuwrYVdQB vl9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=q6v/k8SmT2PEsiNCZJ7jXvDsZZ1nCRZpiKXH50ks2E8=; b=b8K4MNRHdmWndLXtxyocoYPjyAbXeo6sW0gJdxet8HTYMJwzPsJAE1vonEHgOKXPiC oLaPOD9u/P4XTYwxgUdM2huxgGxGhwXOLU3K1ELePR5y+IWdIRBUV7biyUpW0CYd4WXe YUrY+c5rKweAMocuryo+2ZtzdEhfEm9AGcEtqEHQcevbtwPTwAiAfTK8r/3o459kaCV+ QJleV/pHAYU0YC9fatQBmm4fr1Xv9mIICbE8WYXE9Ta18osd+5AhnmnB0L7lOE47YxGT xXogbSU3oqEalbWXZ9IOW70DgxuTB0dQgyM64yvXGGdzF22A6QEiSvxDqkkh1EpShgce jQ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=F2mYsl0T; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id l22si1249811wrc.75.2018.01.10.03.13.34; Wed, 10 Jan 2018 03:13:34 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=F2mYsl0T; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 328622677C0; Wed, 10 Jan 2018 12:13:04 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E318E2677BF; Wed, 10 Jan 2018 12:13:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 11B4E2677B3 for ; Wed, 10 Jan 2018 12:12:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=7NkQq2bWfliBc4uvfDOVNER+C5lKYUMzdY3YASZcm4c=; b=F2mYsl0T/xVw /NSqBJlJrO2acr5M7oaoYuw9PjAW/25TIB7w5j/7BRth/2lIqEUgxQbMYY5F2OewdlWYIbwpt9ckv Np9D2T0XuVkg3o5xoaMVWSMxtQH6lLa3DWaQ+69UVZ79PmQhsNHWmH/uklxS8uvjDN3Lh4m5M9WQV XwHWw=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eZEJV-0000jd-ES; Wed, 10 Jan 2018 11:12:57 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1eZEJU-0004sb-VM; Wed, 10 Jan 2018 11:12:56 +0000 From: Mark Brown To: Arnaud Pouliquen In-Reply-To: Message-Id: Date: Wed, 10 Jan 2018 11:12:56 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "IIO: consumer: allow to set buffer sizes" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch IIO: consumer: allow to set buffer sizes has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 16cbca06fa8288a4f58426fc898b141e12ee8008 Mon Sep 17 00:00:00 2001 From: Arnaud Pouliquen Date: Wed, 10 Jan 2018 11:13:13 +0100 Subject: [PATCH] IIO: consumer: allow to set buffer sizes Add iio consumer API to set buffer size and watermark according to sysfs API. Signed-off-by: Arnaud Pouliquen Reviewed-by: Jonathan Cameron Signed-off-by: Mark Brown --- drivers/iio/buffer/industrialio-buffer-cb.c | 11 +++++++++++ include/linux/iio/consumer.h | 11 +++++++++++ 2 files changed, 22 insertions(+) -- 2.15.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/drivers/iio/buffer/industrialio-buffer-cb.c b/drivers/iio/buffer/industrialio-buffer-cb.c index 4847534700e7..ea63c838eeae 100644 --- a/drivers/iio/buffer/industrialio-buffer-cb.c +++ b/drivers/iio/buffer/industrialio-buffer-cb.c @@ -104,6 +104,17 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, } EXPORT_SYMBOL_GPL(iio_channel_get_all_cb); +int iio_channel_cb_set_buffer_watermark(struct iio_cb_buffer *cb_buff, + size_t watermark) +{ + if (!watermark) + return -EINVAL; + cb_buff->buffer.watermark = watermark; + + return 0; +} +EXPORT_SYMBOL_GPL(iio_channel_cb_set_buffer_watermark); + int iio_channel_start_all_cb(struct iio_cb_buffer *cb_buff) { return iio_update_buffers(cb_buff->indio_dev, &cb_buff->buffer, diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index 2017f35db17c..9887f4f8e2a8 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h @@ -133,6 +133,17 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, int (*cb)(const void *data, void *private), void *private); +/** + * iio_channel_cb_set_buffer_watermark() - set the buffer watermark. + * @cb_buffer: The callback buffer from whom we want the channel + * information. + * @watermark: buffer watermark in bytes. + * + * This function allows to configure the buffer watermark. + */ +int iio_channel_cb_set_buffer_watermark(struct iio_cb_buffer *cb_buffer, + size_t watermark); + /** * iio_channel_release_all_cb() - release and unregister the callback. * @cb_buffer: The callback buffer that was allocated.