From patchwork Thu Sep 19 20:32:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11153253 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E51E16B1 for ; Thu, 19 Sep 2019 20:32:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 36E7621907 for ; Thu, 19 Sep 2019 20:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392505AbfISUcR (ORCPT ); Thu, 19 Sep 2019 16:32:17 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:44526 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387854AbfISUcQ (ORCPT ); Thu, 19 Sep 2019 16:32:16 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dafna) with ESMTPSA id DCE7E28E5C9 From: Dafna Hirschfeld To: linux-media@vger.kernel.org Cc: dafna.hirschfeld@collabora.com, laurent.pinchart@ideasonboard.com, helen.koike@collabora.com, ezequiel@collabora.com, andre.almeida@collabora.com, skhan@linuxfoundation.org, hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com Subject: [PATCH 0/5] media: vimc: use configfs in order to configure devices topologies Date: Thu, 19 Sep 2019 23:32:03 +0300 Message-Id: <20190919203208.12515-1-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patchset introduces the usage of configfs in order to create vimc devices with a configured topology. A patch introducing configfs usage was already sent by Helen Koike: https://patchwork.linuxtv.org/patch/53397/ . The current patch is based on her patch but suggests a new API for using configfs. It uses symlinks to represent a link between two entities, an approach already used in the kernel by usb gadgets composed with configfs to associate usb gadget's functions to its configurations. For example, a topology of sensor->capture will be created with the following commands: CONFIGFS_ROOT=/sys/kernel/config mkdir ${CONFIGFS_ROOT}/vimc/mdev/ mkdir ${CONFIGFS_ROOT}/vimc/mdev/vimc-sensor:sen mkdir ${CONFIGFS_ROOT}/vimc/mdev/vimc-capture:cap tree ${CONFIGFS_ROOT} /configfs/ `-- vimc `-- mdev |-- hotplug |-- vimc-capture:cap | `-- pad:sink:0 `-- vimc-sensor:sen `-- pad:source:0 mkdir ${CONFIGFS_ROOT}/vimc/mdev/vimc-sensor:sen/pad:source:0/to-cap ln -s ${CONFIGFS_ROOT}/vimc/mdev/vimc-capture:cap/pad:sink:0 ${CONFIGFS_ROOT}/vimc/mdev/vimc-sensor:sen/pad:source:0/to-cap tree ${CONFIGFS_ROOT} /configfs/ `-- vimc `-- mdev |-- hotplug |-- vimc-capture:cap | `-- pad:sink:0 `-- vimc-sensor:sen `-- pad:source:0 `-- to-cap |-- enabled |-- immutable `-- pad:sink:0 -> ../../../../../vimc/mdev/vimc-capture:cap/pad:sink:0 There are several reasons to prefer the symlink approach in order to represent links between entities. The previous approach in which links are represented with directories of the form 'entity1:pad>->