All of lore.kernel.org
 help / color / mirror / Atom feed
* Sony tuner chip driver questions
@ 2016-07-28 22:12 Bird, Timothy
  2016-07-29  6:40 ` Berry, Tom
  2016-07-29 10:57 ` Mauro Carvalho Chehab
  0 siblings, 2 replies; 5+ messages in thread
From: Bird, Timothy @ 2016-07-28 22:12 UTC (permalink / raw)
  To: linux-media
  Cc: Shimizu, Kazuhiro, Yamamoto, Masayuki, Yonezawa, Kota, Matsumoto,
	Toshihiko, Watanabe, Satoshi (SSS),
	Berry, Tom, Takiguchi, Yasunari, Rowand, Frank, tbird20d

Hello Linux-media people... :-)

A group at Sony would like to develop a proper kernel driver
for a TV/tuner chip that Sony produces, and we'd like to ask some questions
before we get started.

FYI - I'm kicking off the conversation thread, but I'm not a TV or media-driver
person, so please excuse anything that sounds strangely worded or is just
a really dumb question.  I have experts CC:ed who can clarify anything I
misstate. :-)

First some background:
The chip is in the same family as other chips for which there
are currently some kernel drivers in mainline, produced by
3rd parties (not Sony). The drivers already in the tree are
linux/media/dvb-frontend/cxd2820.c, cxd2841er.c, and ascot2e.c.

Currently Sony provides a user-space driver to its customers, but
we'd like to switch to an in-kernel driver.

The chip has a tuner and demodulator included.

First, we will be delivering the actual video data over SPI.  Currently,
we only see examples of doing this over PCI and USB busses.  Are
there any examples of the appropriate method to transfer video
data (or other high-volume data) over SPI?  If not, are there any
recommendations or tips for going about this?

Second, the current drivers for the cxd2820 and cxd2841 seem to
use a lot of hard-coded register values (and don't appear to use
device tree).  We're not sure if these drivers are the best examples
to follow in creating a new dvb driver for Linux.  Is there a 
recommended driver or example that shows the most recent or
preferred good structure for such drivers, that we should use
in starting ours?  

Is DVB is the correct kernel subsystem to use for this driver, or
is V4L more appropriate?

If we have multiple files in our driver, should we put them all in
the dvb-frontend directory, or should they be sprinkled around
in different directories based on function?  Or should we create
a 'sony' directory somewhere to hold them?

What debugging tools, if any, are available for testing dvb drivers
in the kernel?

Do any current tuner drivers support dual-tuner configurations?

Thanks for any assistance or information you can provide to help us
get started.
 -- Tim Bird
Senior Staff Software Engineer, Sony North America

P.S.  We are ramping up the project now, but will likely get to 
major development effort in a month or two.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Sony tuner chip driver questions
  2016-07-28 22:12 Sony tuner chip driver questions Bird, Timothy
@ 2016-07-29  6:40 ` Berry, Tom
  2016-07-29 10:57 ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 5+ messages in thread
From: Berry, Tom @ 2016-07-29  6:40 UTC (permalink / raw)
  To: Bird, Timothy, linux-media
  Cc: Shimizu, Kazuhiro, Yamamoto, Masayuki, Yonezawa, Kota, Matsumoto,
	Toshihiko, Watanabe, Satoshi (SSS),
	Takiguchi, Yasunari, Rowand, Frank, tbird20d

Hello Tim and Linux-media team.

Thanks for the introduction.
We look forward to working with the Linux Media group.

Just a comment on the SPI interface in this TV tuner.
The device acts as an SPI slave.
The SPI bus is used for both, control interface (internal register read/writes) and also for transfer of the MPEG TS packet data.

Regards
Tom
 

-----Original Message-----
From: Bird, Timothy 
Sent: Friday, July 29, 2016 7:12 AM
To: linux-media@vger.kernel.org
Cc: Shimizu, Kazuhiro; Yamamoto, Masayuki; Yonezawa, Kota; Matsumoto, Toshihiko; Watanabe, Satoshi (SSS); Berry, Tom; Takiguchi, Yasunari; Rowand, Frank; tbird20d@gmail.com
Subject: Sony tuner chip driver questions

Hello Linux-media people... :-)

A group at Sony would like to develop a proper kernel driver for a TV/tuner chip that Sony produces, and we'd like to ask some questions before we get started.

FYI - I'm kicking off the conversation thread, but I'm not a TV or media-driver person, so please excuse anything that sounds strangely worded or is just a really dumb question.  I have experts CC:ed who can clarify anything I misstate. :-)

First some background:
The chip is in the same family as other chips for which there are currently some kernel drivers in mainline, produced by 3rd parties (not Sony). The drivers already in the tree are linux/media/dvb-frontend/cxd2820.c, cxd2841er.c, and ascot2e.c.

Currently Sony provides a user-space driver to its customers, but we'd like to switch to an in-kernel driver.

The chip has a tuner and demodulator included.

First, we will be delivering the actual video data over SPI.  Currently, we only see examples of doing this over PCI and USB busses.  Are there any examples of the appropriate method to transfer video data (or other high-volume data) over SPI?  If not, are there any recommendations or tips for going about this?

Second, the current drivers for the cxd2820 and cxd2841 seem to use a lot of hard-coded register values (and don't appear to use device tree).  We're not sure if these drivers are the best examples to follow in creating a new dvb driver for Linux.  Is there a recommended driver or example that shows the most recent or preferred good structure for such drivers, that we should use in starting ours?  

Is DVB is the correct kernel subsystem to use for this driver, or is V4L more appropriate?

If we have multiple files in our driver, should we put them all in the dvb-frontend directory, or should they be sprinkled around in different directories based on function?  Or should we create a 'sony' directory somewhere to hold them?

What debugging tools, if any, are available for testing dvb drivers in the kernel?

Do any current tuner drivers support dual-tuner configurations?

Thanks for any assistance or information you can provide to help us get started.
 -- Tim Bird
Senior Staff Software Engineer, Sony North America

P.S.  We are ramping up the project now, but will likely get to major development effort in a month or two.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Sony tuner chip driver questions
  2016-07-28 22:12 Sony tuner chip driver questions Bird, Timothy
  2016-07-29  6:40 ` Berry, Tom
@ 2016-07-29 10:57 ` Mauro Carvalho Chehab
  2016-08-01  6:55   ` Takiguchi, Yasunari
  1 sibling, 1 reply; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-29 10:57 UTC (permalink / raw)
  To: Bird, Timothy
  Cc: linux-media, Shimizu, Kazuhiro, Yamamoto, Masayuki, Yonezawa,
	Kota, Matsumoto, Toshihiko, Watanabe, Satoshi (SSS),
	Berry, Tom, Takiguchi, Yasunari, Rowand, Frank, tbird20d

Em Thu, 28 Jul 2016 22:12:10 +0000
"Bird, Timothy" <Tim.Bird@am.sony.com> escreveu:

> Hello Linux-media people... :-)
> 
> A group at Sony would like to develop a proper kernel driver
> for a TV/tuner chip that Sony produces, and we'd like to ask some questions
> before we get started.

Nice! Be welcomed to the community!

> FYI - I'm kicking off the conversation thread, but I'm not a TV or media-driver
> person, so please excuse anything that sounds strangely worded or is just
> a really dumb question.  I have experts CC:ed who can clarify anything I
> misstate. :-)
> 
> First some background:
> The chip is in the same family as other chips for which there
> are currently some kernel drivers in mainline, produced by
> 3rd parties (not Sony). The drivers already in the tree are
> linux/media/dvb-frontend/cxd2820.c, cxd2841er.c, and ascot2e.c.

I'm familiar with this driver, as I fixed a few things there
related to stats report.

> Currently Sony provides a user-space driver to its customers, but
> we'd like to switch to an in-kernel driver.
> 
> The chip has a tuner and demodulator included.

At the DVB frontend, the tuner and demodulators should be implemented
on different drivers, even when both are encapsulated on the same
silicon.

By using two drivers, it makes easier to review the code. It also
helps to better encapsulate the functions on each part of the chip.

> First, we will be delivering the actual video data over SPI.  Currently,
> we only see examples of doing this over PCI and USB busses.  Are
> there any examples of the appropriate method to transfer video
> data (or other high-volume data) over SPI?  If not, are there any
> recommendations or tips for going about this?

There aren't many DVB drivers that aren't either PCI or USB.
There's one at drivers/media/mmc/siano/smssdio.c, but I guess this
is not the best example. ST is working on upstreaming drivers for
some of their SoCs. They're placing their drivers under
drivers/media/platform/sti. Maybe this could help you more on that.

Yet, it would be nice if you could explain a little bit more your
architecture, for us to help more on that. We'll likely do a media
workshop in Berlin (either at ELCE or LinuxCon Europe - yet to
be defined).

> Second, the current drivers for the cxd2820 and cxd2841 seem to
> use a lot of hard-coded register values (and don't appear to use
> device tree).

There are some DT stuff at c8sectpfe/c8sectpfe-core.c. We don't use
DT for PCI or USB drivers, be cause it is not needed there.

Also, specially when the same driver can be used with both embedded
and non-embedded hardware, what we do is to provide a setup
structure for the demod and for the tuner drivers, that it is
passed via a function call from the main driver.

It is up to the main driver to do the device-specific initialization.

In practice, media devices can be very complex, so we can't let
them initialize on some random order. So, the main driver
orchestrates the other ones, making the init to happen at the
right places. I suspect that this is the model used by the
c8sectpfe driver as well.

At the V4L side, we use DT for the drivers used on SoC, but
then we need to add a hack to synchronize their initialization,
via v4l2-async.

> We're not sure if these drivers are the best examples
> to follow in creating a new dvb driver for Linux.  Is there a 
> recommended driver or example that shows the most recent or
> preferred good structure for such drivers, that we should use
> in starting ours? 

The DVB core didn't change much over the years. So, you won't see
much code diversity there. I suspect you should start looking
at the STi drivers and at the drivers for the Sony components
that are already there.

If the silicon you're wanting to add support is very similar to
an already existing driver, the best, IMHO, is to modify such
driver to add extra functionality, instead of starting from scratch.

> Is DVB is the correct kernel subsystem to use for this driver, or
> is V4L more appropriate?

If your driver is for digital TV, it has to use the DVB subsystem.
If it also provides analog TV, then you'll need to write it as a
hybrid driver, implementing both APIs.

There are some examples in the Kernel about how do to that, like
cx88.

> 
> If we have multiple files in our driver, should we put them all in
> the dvb-frontend directory, or should they be sprinkled around
> in different directories based on function? Or should we create
> a 'sony' directory somewhere to hold them?


The tuner part of the driver should be at drivers/media/tuners;
the frontend part at drivers/media/dvb-frontend, and the main
driver at drivers/media/platform. If each of those drivers
is splitted on multiple c files, then it could be interesting to
have a subdir there at the subdirs.

> What debugging tools, if any, are available for testing dvb drivers
> in the kernel?

We have several tools available at v4l-utils:
	https://git.linuxtv.org/v4l-utils.git/

It provides tools for remote controllers, V4L and DVB. It also
provides libraries for both V4L and DVB usage.

Most distros package it on different packages, depending on the
functions of what's there.

I also recommend using Kaffeine for testing:
	https://www.kde.org/applications/multimedia/kaffeine/development

Starting with version 2.x, Kaffeine now uses libdvbv5 (provided
by the v4l-utils tree). I wrote two articles about it:
	https://blogs.s-osg.org/?s=kaffeine

> Do any current tuner drivers support dual-tuner configurations?

Yes. One such example is the netup_unidvb driver, with actually
uses some Sony chipsets. It is for a dual-tuner, dual-CI PCIe
board.


Thanks,
Mauro

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Sony tuner chip driver questions
  2016-07-29 10:57 ` Mauro Carvalho Chehab
@ 2016-08-01  6:55   ` Takiguchi, Yasunari
  2016-08-19  9:44     ` Takiguchi, Yasunari
  0 siblings, 1 reply; 5+ messages in thread
From: Takiguchi, Yasunari @ 2016-08-01  6:55 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Bird, Timothy
  Cc: linux-media, Shimizu, Kazuhiro, Yamamoto, Masayuki, Yonezawa,
	Kota, Matsumoto, Toshihiko, Watanabe, Satoshi (SSS),
	Berry, Tom, Rowand, Frank, tbird20d, Takiguchi, Yasunari

Dear Mauro

Thanks for your replying.

I am checking your comments and linux/media codes.

I need to discuss with our members about our driver's structure.
Especially,
1. SPI
> There aren't many DVB drivers that aren't either PCI or USB.
> There's one at drivers/media/mmc/siano/smssdio.c, but I guess this is not the
> best example. ST is working on upstreaming drivers for some of their SoCs. They're
> placing their drivers under drivers/media/platform/sti. Maybe this could help you more on that.

2.Tuner & Demodulator
> At the DVB frontend, the tuner and demodulators should be implemented on different
> drivers, even when both are encapsulated on the same silicon.
> By using two drivers, it makes easier to review the code. It also helps to better
> encapsulate the functions on each part of the chip.
Our codes for tuner and demodulator driver of user-space are encapsulated in order to optimize tuner control sequence.

I will send comments and additional questions after we have internal discussion.

Thanks,
Takiguchi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Sony tuner chip driver questions
  2016-08-01  6:55   ` Takiguchi, Yasunari
@ 2016-08-19  9:44     ` Takiguchi, Yasunari
  0 siblings, 0 replies; 5+ messages in thread
From: Takiguchi, Yasunari @ 2016-08-19  9:44 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Bird, Timothy
  Cc: linux-media, Shimizu, Kazuhiro, Yamamoto, Masayuki, Yonezawa,
	Kota, Matsumoto, Toshihiko, Watanabe, Satoshi (SSS),
	Berry, Tom, Rowand, Frank, tbird20d, Takiguchi, Yasunari

Dear Mauro

We discuss about
> At the DVB frontend, the tuner and demodulators should be implemented
> on different drivers, even when both are encapsulated on the same silicon.
with our HW developers and SW designers.

Our codes for tuner and demodulator driver of user-space driver are encapsulated 
in order to optimize tuner control sequence.
(Our tuner driver often have to set rf tuner registers and demodulator alternately. )
And there are some registers which simultaneously set parameter for tuner and demodulator block.
Additionally, we think about current TV tuner IC trend and linux tuner driver.

I summarized our study results and proposals as follows.

・In our case the tuner and demodulator are single chip architecture, so the tuner control cannot be distinguished from demodulator functionality. It is therefore difficult to separate tuner code and demodulator code.
・We understand that single chip solutions may become more popular for smartphone and low power tuner device (USB, etc) so mixed driver will be main stream.
・We intend to add the driver incorporating tuner and demodulator code to /media/dvb-frontend/XXXX (XXXX is our tuner name folder)
・We will create our driver to have same API structure as the current tuner and demodulator driver code.
  (drivers/media/dvb-frontends/m88rs2000.c and tda10071.c also seem to have tuner and demodulator code.
  We would like to refer to their codes for our creating.)

Could you give us your advice and comments?

Best Regards & Thanks
Takiguchi


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-19 15:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-28 22:12 Sony tuner chip driver questions Bird, Timothy
2016-07-29  6:40 ` Berry, Tom
2016-07-29 10:57 ` Mauro Carvalho Chehab
2016-08-01  6:55   ` Takiguchi, Yasunari
2016-08-19  9:44     ` Takiguchi, Yasunari

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.