public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
To: "Jesse Huang (黃建興)" <jesse.huang@mstarsemi.com>
Cc: "mchehab@kernel.org" <mchehab@kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"Yishin Tung (童怡新)" <yishin.tung@mstarsemi.com>,
	"Zink Hsin (辛鴻杰)" <zink.hsin@mediatek.com>,
	"MF Hsieh (謝明甫)" <mf.hsieh@mstarsemi.com>,
	"Junyou Lin (林俊裕)" <junyou.lin@mstarsemi.com>
Subject: Re: Using big platform driver as foundation to implement TV driver framework in Linux
Date: Tue, 14 Aug 2018 06:38:32 -0300	[thread overview]
Message-ID: <20180814063832.3bb75cd4@coco.lan> (raw)
In-Reply-To: <a60afd4a1035444aa3bbbb1f07af52b0@MSTARMBS01.mstarsemi.com.tw>

Hi Jesse,

Em Mon, 13 Aug 2018 01:32:45 +0000
Jesse Huang (黃建興) <jesse.huang@mstarsemi.com> escreveu:

> Hi Mchehab,
> Hi Linux-Media,
> 
> MTK/MStar try to move TV SOC proprietary driver framework to Linux TV driver.
> 
> But, we also need to share/re-use driver code to non-OS which is a size limitation low cost system.
> 
> Normally, each Linux driver need to control registers directly by it self. For example:
> ===============================(sample code begin)
> linux-3.18-exynos7270-sandbox.opensw0312.rebase-3d91408\drivers\media\pci\cx25821\cx25821-video.c
> static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
> {
>     struct cx25821_channel *chan = video_drvdata(file);
> 
>     if (i != V4L2_BUF_TYPE_VIDEO_CAPTURE)
>         return -EINVAL;
> 
>     if (chan->streaming_fh && chan->streaming_fh != priv)
>         return -EBUSY;
>     chan->streaming_fh = priv;
> 
>     return videobuf_streamon(&chan->vidq);
> }
> ===============================(sample code end)
> 
> 
> 
> But, in our concept, we hope to provide an entire proprietary a driver as a “MTK TV platform driver”. Base on this driver to implement Linux standard TV driver.
> If will look like this:
> ===============================(sample code begin)
> static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
> {
>     return mtk_tv_platform->video->streamon();
> }
> 
> The mtk_tv_platform will be register when setup_arch()
> void __init setup_arch(char **cmdline_p)
> {
> return platform_device_register(&mtk_tv_platform);
> }
> ===============================(sample code end)
> 
> Would this kid of implement method can be accept for Linux upstream/submit driver rule? What kind of framework design guide line/rule we should follow? Would it possible to have some reference for us.
> 
> If this method is possible, we can share a lot of human resource to both maintain for Linux and non-Linux project.

Not sure if I understand what you want to do.

The Linux Kernel is under a GPL version 2 license, meaning that
anyone wanting to do Kernel development should license their work
under those terms.

In other words, If you want to submit a driver to the Linux Kernel, the
needed software to control the hardware should all be upstreamed using
GPL version 2, including all register settings.

In the specific case of image enhancement algorithms, like 3A, we're
currently working on a solution that would allow a third party software
(ideally open source, but it could be a binary code) to run on
userspace, receiving metadata from the hardware via a documented
userspace, and using the standard V4L2 API to adjust the hardware,
after doing some (usually proprietary) processing.

So, if you're willing to contribute under this terms, we can help you.

It could still be possible to share code with other OS, depending on
how you write the driver, but we don't accept any other OS-dependent
code (like #ifdefs inside Linux). What other vendors usually do is
to either encapsulate the other-os dependent part on a different
source file (not submitted to Linux) or to internally have some
sort of process to strip #ifdefs when submitting drivers to Linux.

If otherwise all you want is to have a wrapper driver to run some
proprietary driver, then shipping such solution would likely be a
copyright violation and we can't help you.

Thanks,
Mauro

       reply	other threads:[~2018-08-14 12:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a60afd4a1035444aa3bbbb1f07af52b0@MSTARMBS01.mstarsemi.com.tw>
2018-08-14  9:38 ` Mauro Carvalho Chehab [this message]
2018-08-15  2:47   ` Using big platform driver as foundation to implement TV driver framework in Linux Jesse Huang (黃建興)

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=20180814063832.3bb75cd4@coco.lan \
    --to=mchehab+samsung@kernel.org \
    --cc=jesse.huang@mstarsemi.com \
    --cc=junyou.lin@mstarsemi.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mf.hsieh@mstarsemi.com \
    --cc=yishin.tung@mstarsemi.com \
    --cc=zink.hsin@mediatek.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox