From patchwork Fri Feb 24 14:48:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 94480 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp721870qgi; Fri, 24 Feb 2017 06:49:26 -0800 (PST) X-Received: by 10.98.205.3 with SMTP id o3mr3846252pfg.148.1487947766242; Fri, 24 Feb 2017 06:49:26 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si7587033pls.17.2017.02.24.06.49.25; Fri, 24 Feb 2017 06:49:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751334AbdBXOtW (ORCPT + 25 others); Fri, 24 Feb 2017 09:49:22 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37308 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751265AbdBXOtN (ORCPT ); Fri, 24 Feb 2017 09:49:13 -0500 Received: by mail-wm0-f43.google.com with SMTP id v77so16221643wmv.0 for ; Fri, 24 Feb 2017 06:49:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Fe/9OHM4gkWHWX6sTD17pdhHGNJLcd/pQ41Qq/2L3j4=; b=WUFx06HIGU1QExzMFrkYxlWM4h33wLfSjyclSTl6mzI0rXlRjL0P88cQ817XfZxbST aZOq2VxzZPmzLQNPUoNJKPuwd1IeALAISOYWopKuBhBY2zdP5So2zAtQXf+bfeqkCKwt 11myIDiv0a4lN6JEvcTgPcBJmiYPXVLDtvW1I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Fe/9OHM4gkWHWX6sTD17pdhHGNJLcd/pQ41Qq/2L3j4=; b=pLsLu42fJSWOrf1ezUgI78C7omRPbsA/GzyP75Rg0hH6U+v3Mc4E291gnZlhdSfyFc cYv9yknEpxEzkJ0n4tvNQHK5pamXXT2sgCXJRIQdOH5yAhYHnznnxJIO8CE7veHJLWRP kmPnBCt5g1EVev/HAFDmcWlgfvxGABDQ5jWLAPZrwM/StVIyvI07XyiCEWcGBc3st02G xnd3bxDeOMy6AUmkL9lTloQDF0/CGkjKI0OloflvmVNahqM9qCBe8vGC9rRcAoViByz+ zmWMnmijYhFjqk2pcQzcGawDzwg74eANzn/HU9O8Ta4MAg6OL8BLJ2rMQyHso+70tMrG uTPQ== X-Gm-Message-State: AMke39nDEZW3z3rile6l8JFIs70RfoIsE6T38D0L60AmZ01e4RGBnssHqfogK/VG5+7zE7TZ X-Received: by 10.28.103.69 with SMTP id b66mr3011695wmc.73.1487947751833; Fri, 24 Feb 2017 06:49:11 -0800 (PST) Received: from lmenx321.st.com. ([80.215.37.106]) by smtp.gmail.com with ESMTPSA id y65sm2630703wmb.5.2017.02.24.06.49.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Feb 2017 06:49:11 -0800 (PST) From: Benjamin Gaignard X-Google-Original-From: Benjamin Gaignard To: linux-kernel@vger.kernel.org, jic23@kernel.org, linux-iio@vger.kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Cc: fabrice.gasnier@st.com, linaro-kernel@lists.linaro.org, benjamin.gaignard@linaro.org, Benjamin Gaignard Subject: [PATCH v3 0/2] Add parent_trigger attribute to triggers Date: Fri, 24 Feb 2017 15:48:13 +0100 Message-Id: <1487947695-9305-1-git-send-email-benjamin.gaignard@st.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org version 3: - try to provide better description of parent_trigger usages - add one channel to get counter raw value version 2: - Do not automatically set parent_trigger attribute on all triggers. Let driver decide to use it. - Improve documentation of parent_trigger - Improve slave modes documentation Thoses patches add parent_trigger attribute to IIO triggers. Parent trigger edges or levels could be used to control current trigger. For example current trigger could be started on parent rising edges or be enabled only when parent trigger level is high. Since there is many ways to use parent edges and levels to control current trigger behavoir an additional custom sysfs attribute may be needed to describe those control modes. Similary to what already exist to validate a device, a new (optional) validate_trigger function is added in iio_trigger structure and should be filled by drivers. For STM32 triggers parent trigger edges or levels could used in various ways. To be able to select them "in_count0_count_mode" attribute is added to STM32 triggers. When setting a parent trigger on STM32 trigger "trigger_rising_edges" mode is automatically set so current trigger is clock by the rising edges of it parent. Benjamin Gaignard (2): iio: Allow triggers to be used as parent of others triggers iio: stm32 trigger: Implement parent trigger feature .../ABI/testing/sysfs-bus-iio-timer-stm32 | 63 +++++ .../ABI/testing/sysfs-bus-iio-trigger-sysfs | 15 ++ drivers/iio/industrialio-trigger.c | 69 ++++++ drivers/iio/trigger/stm32-timer-trigger.c | 256 ++++++++++++++++++++- include/linux/iio/trigger.h | 7 +- include/linux/mfd/stm32-timers.h | 2 + 6 files changed, 405 insertions(+), 7 deletions(-) -- 1.9.1