public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Bee Hock Goh <beehock@gmail.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: Help needed in understanding v4l2_device_call_all
Date: Thu, 22 Apr 2010 17:35:55 -0300	[thread overview]
Message-ID: <4BD0B32B.8060505@redhat.com> (raw)
In-Reply-To: <x2m6e8e83e21004062310ia0eef09fgf97bcfafcdf25737@mail.gmail.com>

Bee Hock Goh wrote:
> Hi,
> 
> I am trying to understand how the subdev function are triggered when I
> use v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, g_tuner,t) on
> tm600-video.

It calls tuner-core.c code, with g_tuner command. tuner-core
checks what's the used tuner and, in the case of tm6000, calls the corresponding
function at tuner-xc2028. This is implemented on tuner_g_tuner() function.

The function basically does some sanity checks, and some common tuner code, but
the actual implementation is handled by some callbacks that the driver needs to
define (get_afc, get_status, is_stereo, has_signal). In general, drivers use
get_status for it:
                fe_tuner_ops->get_status(&t->fe, &tuner_status);


You will find a good example of how to implement such code at tuner-simple 
simple_get_status() function.

In the case of tuner-xc2028, we never found a way for it to properly report the
status of the tuner lock. That's why this function is not implemented on the driver.

> How am i able to link the callback from the tuner_xc2028 function?

The callback is used by tuner-xc2028 when it detects the need of changing the
firmware (or when the firmware is not loaded yet, or when you select a standard
that it is not supported by the current firmware).

Basically, xc2028 driver will use the callback that was set previously via:

	v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &xc2028_cfg);


> 
> Please help me to understand or directly me to any documentation that
> I can read up?
> 
> thanks,
>  Hock.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 

Cheers,
Mauro

  reply	other threads:[~2010-04-22 20:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-07  6:10 Help needed in understanding v4l2_device_call_all Bee Hock Goh
2010-04-22 20:35 ` Mauro Carvalho Chehab [this message]
2010-04-23  2:20   ` Bee Hock Goh
2010-04-23 12:22     ` Mauro Carvalho Chehab
2010-04-23 15:23     ` Stefan Ringel
2010-04-23 15:28       ` Bee Hock Goh
2010-04-23 15:32         ` Stefan Ringel
2010-04-23 16:52           ` Mauro Carvalho Chehab

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=4BD0B32B.8060505@redhat.com \
    --to=mchehab@redhat.com \
    --cc=beehock@gmail.com \
    --cc=linux-media@vger.kernel.org \
    /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