From: Hans Verkuil <hverkuil@xs4all.nl>
To: Shuah Khan <shuah.kh@samsung.com>,
gregkh@linuxfoundation.org, m.chehab@samsung.com,
olebowle@gmx.com, ttmesterr@gmail.com,
dheitmueller@kernellabs.com, cb.xiong@samsung.com,
yongjun_wei@trendmicro.com.cn, hans.verkuil@cisco.com,
prabhakar.csengg@gmail.com, laurent.pinchart@ideasonboard.com,
sakari.ailus@linux.intel.com, crope@iki.fi,
wade_farnsworth@mentor.com, ricardo.ribalda@gmail.com
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 1/4] drivers/base: add managed token dev resource
Date: Fri, 27 Jun 2014 15:55:10 +0200 [thread overview]
Message-ID: <53AD77BE.9010703@xs4all.nl> (raw)
In-Reply-To: <ae186e950b2719174354f9a2262a072571143a46.1403652043.git.shuah.kh@samsung.com>
On 06/25/2014 01:57 AM, Shuah Khan wrote:
> Add a managed token resource that can be created at device level
> which can be used as a large grain lock by diverse group of drivers
> such as the media drivers that share a resource.
>
> Media devices often have hardware resources that are shared
> across several functions. These devices appear as a group of
> independent devices. Each device implements a function which
> could be shared by one or more functions supported by the same
> device. For example, tuner is shared by analog and digital TV
> functions.
>
> Media drivers that control a single media TV stick are a
> diversified group. Analog and digital TV function drivers have
> to coordinate access to their shared functions.
>
> Some media devices provide multiple almost-independent functions.
> USB and PCI core aids in allowing multiple drivers to handle these
> almost-independent functions. In this model, a media device could
> have snd-usb-audio driving the audio function.
>
> As a result, snd-usb-audio driver has to coordinate with the media
> driver analog and digital function drivers.
>
> A shared managed resource framework at drivers/base level will
> allow a media device to be controlled by drivers that don't
> fall under drivers/media and share functions with other media
> drivers.
>
> Token resource manages a unique named string resource which is
> derived from common bus_name, and hardware address fields from
> the struct device.
>
> Interfaces:
> devm_token_create()
> devm_token_destroy()
> devm_token_lock()
> devm_token_unlock()
> Usage:
> Create token: Call devm_token_create() with a token id string.
> Lock token: Call devm_token_lock() to lock or try lock a token.
> Unlock token: Call devm_token_unlock().
> Destroy token: Call devm_token_destroy() to delete the token.
>
> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
> ---
> drivers/base/Makefile | 2 +-
> drivers/base/token_devres.c | 134 ++++++++++++++++++++++++++++++++++++++++++
> include/linux/token_devres.h | 19 ++++++
> 3 files changed, 154 insertions(+), 1 deletion(-)
> create mode 100644 drivers/base/token_devres.c
> create mode 100644 include/linux/token_devres.h
>
> diff --git a/drivers/base/Makefile b/drivers/base/Makefile
> index 04b314e..924665b 100644
> --- a/drivers/base/Makefile
> +++ b/drivers/base/Makefile
> @@ -4,7 +4,7 @@ obj-y := component.o core.o bus.o dd.o syscore.o \
> driver.o class.o platform.o \
> cpu.o firmware.o init.o map.o devres.o \
> attribute_container.o transport_class.o \
> - topology.o container.o
> + topology.o container.o token_devres.o
> obj-$(CONFIG_DEVTMPFS) += devtmpfs.o
> obj-$(CONFIG_DMA_CMA) += dma-contiguous.o
> obj-y += power/
> diff --git a/drivers/base/token_devres.c b/drivers/base/token_devres.c
> new file mode 100644
> index 0000000..86bcd25
> --- /dev/null
> +++ b/drivers/base/token_devres.c
> @@ -0,0 +1,134 @@
> +/*
> + * drivers/base/token_devres.c - managed token resource
> + *
> + * Copyright (c) 2014 Shuah Khan <shuah.kh@samsung.com>
> + * Copyright (c) 2014 Samsung Electronics Co., Ltd.
Just a small one:
I don't know the Samsung guidelines, but I would expect that the copyright is
with Samsung, not with you as well. You are the author, but you most likely
do not have the copyright, that's with Samsung.
Regards,
Hans
next prev parent reply other threads:[~2014-06-27 13:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 23:57 [PATCH 0/4] media: tuner large grain locking Shuah Khan
2014-06-24 23:57 ` [PATCH 1/4] drivers/base: add managed token dev resource Shuah Khan
2014-06-27 13:55 ` Hans Verkuil [this message]
2014-06-24 23:57 ` [PATCH 2/4] media: dvb-fe changes to use tuner token Shuah Khan
2014-06-24 23:57 ` [PATCH 3/4] media: v4l2-core " Shuah Khan
2014-06-27 13:34 ` Hans Verkuil
2014-06-24 23:57 ` [PATCH 4/4] media: au0828 changes to use token devres for tuner access Shuah Khan
2014-06-27 13:52 ` Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53AD77BE.9010703@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=cb.xiong@samsung.com \
--cc=crope@iki.fi \
--cc=dheitmueller@kernellabs.com \
--cc=gregkh@linuxfoundation.org \
--cc=hans.verkuil@cisco.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=olebowle@gmx.com \
--cc=prabhakar.csengg@gmail.com \
--cc=ricardo.ribalda@gmail.com \
--cc=sakari.ailus@linux.intel.com \
--cc=shuah.kh@samsung.com \
--cc=ttmesterr@gmail.com \
--cc=wade_farnsworth@mentor.com \
--cc=yongjun_wei@trendmicro.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.