[GIT PULL FOR v3.10] au0828 driver overhaul and tuner-core fixes
Hi Mauro, This pull request is unchanged from http://patchwork.linuxtv.org/patch/17577/, except for being rebased. I've also added my tuner-core patch and your three tuner-core patches as requested. Regards, Hans The following changes since commit 7bce33daeaca26a3ea3f6099fdfe4e11ea46cac6: [media] solo6x10: prefix sources with 'solo6x10-' (2013-03-25 08:54:05 -0300) are available in the git repository at: git://linuxtv.org/hverkuil/media_tree.git au0828d for you to fetch changes up to e9ee202be209c28559eb13d30e630a242e2beb22: tuner-core: handle errors when getting signal strength/afc (2013-03-25 15:53:19 +0100) Hans Verkuil (16): au8522_decoder: convert to the control framework. au0828: fix querycap. au0828: frequency handling fixes. au0828: fix intendation coding style issue. au0828: fix audio input handling. au0828: convert to the control framework. au0828: add prio, control event and log_status support au0828: add try_fmt_vbi support, zero vbi.reserved, pix.priv. au0828: replace deprecated current_norm by g_std. au8522_decoder: remove obsolete control ops. au0828: fix disconnect sequence. au0828: simplify i2c_gate_ctrl. au0828: don't change global state information on open(). au0828: fix initial video routing. au0828: improve firmware loading & locking. tuner-core: don't set has_signal/get_afc if not supported Mauro Carvalho Chehab (3): tuner-core: return afc instead of zero tuner-core: Remove the now uneeded checks at fe_has_signal/get_afc tuner-core: handle errors when getting signal strength/afc drivers/media/dvb-frontends/au8522_decoder.c | 123 +++ drivers/media/dvb-frontends/au8522_priv.h|6 +- drivers/media/usb/au0828/au0828-core.c | 61 -- drivers/media/usb/au0828/au0828-video.c | 287 - drivers/media/usb/au0828/au0828.h|7 ++ drivers/media/v4l2-core/tuner-core.c | 23 --- 6 files changed, 274 insertions(+), 233 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL FOR v3.10] au0828 driver overhaul
On Sun March 24 2013 18:55:50 Devin Heitmueller wrote: > On Sun, Mar 24, 2013 at 1:51 PM, Mauro Carvalho Chehab > wrote: > > drivers/media/dvb-frontends/au8522_decoder.c:static int > > au8522_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) > > drivers/media/dvb-frontends/au8522_decoder.c-{ > > drivers/media/dvb-frontends/au8522_decoder.c- int val = 0; > > drivers/media/dvb-frontends/au8522_decoder.c- struct au8522_state > > *state = to_state(sd); > > drivers/media/dvb-frontends/au8522_decoder.c- u8 lock_status; > > drivers/media/dvb-frontends/au8522_decoder.c- > > drivers/media/dvb-frontends/au8522_decoder.c- /* Interrogate the > > decoder to see if we are getting a real signal */ > > drivers/media/dvb-frontends/au8522_decoder.c- lock_status = > > au8522_readreg(state, 0x00); > > drivers/media/dvb-frontends/au8522_decoder.c- if (lock_status == 0xa2) > > drivers/media/dvb-frontends/au8522_decoder.c- vt->signal = > > 0x; > > drivers/media/dvb-frontends/au8522_decoder.c- else > > drivers/media/dvb-frontends/au8522_decoder.c- vt->signal = 0x00; > > drivers/media/dvb-frontends/au8522_decoder.c- > > drivers/media/dvb-frontends/au8522_decoder.c- vt->capability |= > > drivers/media/dvb-frontends/au8522_decoder.c- > > V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_LANG1 | > > drivers/media/dvb-frontends/au8522_decoder.c- > > V4L2_TUNER_CAP_LANG2 | V4L2_TUNER_CAP_SAP; > > drivers/media/dvb-frontends/au8522_decoder.c- > > drivers/media/dvb-frontends/au8522_decoder.c- val = V4L2_TUNER_SUB_MONO; > > drivers/media/dvb-frontends/au8522_decoder.c- vt->rxsubchans = val; > > drivers/media/dvb-frontends/au8522_decoder.c- vt->audmode = > > V4L2_TUNER_MODE_STEREO; > > drivers/media/dvb-frontends/au8522_decoder.c- return 0; > > > > As if the i2c gate is on a wrong state, au8522_readreg() won't > > work anymore. > > Note that au8522_g_tuner function never actually talks to the tuner. > It's handled entirely within the au8522 driver, which is not behind > the gate. The I2C gate is only required if talking to the xc5000, not > the au8522. > > There's something else broken here. I suspect it's probably some > artifact of the conversion to the new control framework (if I had to > guess). Rather than guessing I'll be doing some testing this week. It could also be a crappy antenna connection as that's been giving me some grief lately (due to an unholy BNC-to-F-connector-to-coax adapter chain). Regards, Hans -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL FOR v3.10] au0828 driver overhaul
On Sun, Mar 24, 2013 at 1:51 PM, Mauro Carvalho Chehab wrote: > drivers/media/dvb-frontends/au8522_decoder.c:static int au8522_g_tuner(struct > v4l2_subdev *sd, struct v4l2_tuner *vt) > drivers/media/dvb-frontends/au8522_decoder.c-{ > drivers/media/dvb-frontends/au8522_decoder.c- int val = 0; > drivers/media/dvb-frontends/au8522_decoder.c- struct au8522_state *state > = to_state(sd); > drivers/media/dvb-frontends/au8522_decoder.c- u8 lock_status; > drivers/media/dvb-frontends/au8522_decoder.c- > drivers/media/dvb-frontends/au8522_decoder.c- /* Interrogate the decoder > to see if we are getting a real signal */ > drivers/media/dvb-frontends/au8522_decoder.c- lock_status = > au8522_readreg(state, 0x00); > drivers/media/dvb-frontends/au8522_decoder.c- if (lock_status == 0xa2) > drivers/media/dvb-frontends/au8522_decoder.c- vt->signal = 0x; > drivers/media/dvb-frontends/au8522_decoder.c- else > drivers/media/dvb-frontends/au8522_decoder.c- vt->signal = 0x00; > drivers/media/dvb-frontends/au8522_decoder.c- > drivers/media/dvb-frontends/au8522_decoder.c- vt->capability |= > drivers/media/dvb-frontends/au8522_decoder.c- > V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_LANG1 | > drivers/media/dvb-frontends/au8522_decoder.c- > V4L2_TUNER_CAP_LANG2 | V4L2_TUNER_CAP_SAP; > drivers/media/dvb-frontends/au8522_decoder.c- > drivers/media/dvb-frontends/au8522_decoder.c- val = V4L2_TUNER_SUB_MONO; > drivers/media/dvb-frontends/au8522_decoder.c- vt->rxsubchans = val; > drivers/media/dvb-frontends/au8522_decoder.c- vt->audmode = > V4L2_TUNER_MODE_STEREO; > drivers/media/dvb-frontends/au8522_decoder.c- return 0; > > As if the i2c gate is on a wrong state, au8522_readreg() won't > work anymore. Note that au8522_g_tuner function never actually talks to the tuner. It's handled entirely within the au8522 driver, which is not behind the gate. The I2C gate is only required if talking to the xc5000, not the au8522. There's something else broken here. I suspect it's probably some artifact of the conversion to the new control framework (if I had to guess). Devin -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL FOR v3.10] au0828 driver overhaul
Em Fri, 22 Mar 2013 14:50:28 -0400 Devin Heitmueller escreveu: > On Fri, Mar 22, 2013 at 12:38 PM, Hans Verkuil wrote: > > It works fine with qv4l2, but there is still a bug causing tvtime to fail. > > That's caused by commit e58071f024aa337b7ce41682578b33895b024f8b, applied > > August last year, that broke g_tuner: after that 'signal' would always be 0 > > and tvtime expects signal to be non-zero for a valid frequency. I don't think so: tvtime has a way to either honor signal or to ignore it via GUI. As there are tuners that can't provide any signal level, I suspect that this is the reason why it was coded this way. > > The signal > > field is set by the au8522, but g_tuner is only called for the tuner (well, > > also for au8522 but since the i2c gate is set for the tuner that won't do > > anything). As far as I remember, there are a few drivers or boards whose signal information is provided by the bridge and not by the tuner. I think that this still works. For example: drivers/media/pci/bt8xx/bttv-driver.c:static int bttv_g_tuner(struct file *file, void *priv, drivers/media/pci/bt8xx/bttv-driver.c-struct v4l2_tuner *t) drivers/media/pci/bt8xx/bttv-driver.c-{ drivers/media/pci/bt8xx/bttv-driver.c-struct bttv_fh *fh = priv; drivers/media/pci/bt8xx/bttv-driver.c-struct bttv *btv = fh->btv; drivers/media/pci/bt8xx/bttv-driver.c- drivers/media/pci/bt8xx/bttv-driver.c-if (0 != t->index) drivers/media/pci/bt8xx/bttv-driver.c-return -EINVAL; drivers/media/pci/bt8xx/bttv-driver.c- drivers/media/pci/bt8xx/bttv-driver.c-t->rxsubchans = V4L2_TUNER_SUB_MONO; drivers/media/pci/bt8xx/bttv-driver.c-t->capability = V4L2_TUNER_CAP_NORM; drivers/media/pci/bt8xx/bttv-driver.c-bttv_call_all(btv, tuner, g_tuner, t); drivers/media/pci/bt8xx/bttv-driver.c-strcpy(t->name, "Television"); drivers/media/pci/bt8xx/bttv-driver.c-t->type = V4L2_TUNER_ANALOG_TV; drivers/media/pci/bt8xx/bttv-driver.c-if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC) drivers/media/pci/bt8xx/bttv-driver.c-t->signal = 0x; drivers/media/pci/bt8xx/bttv-driver.c- drivers/media/pci/bt8xx/bttv-driver.c-if (btv->audio_mode_gpio) drivers/media/pci/bt8xx/bttv-driver.c-btv->audio_mode_gpio(btv, t, 0); drivers/media/pci/bt8xx/bttv-driver.c- drivers/media/pci/bt8xx/bttv-driver.c-return 0; changeset e58071f024aa337b7ce41682578b33895b024f8b doesn't affect it. > Wait, are you saying that the G_TUNER call is no longer being routed > to the au8522 driver? The signal level has always been set to a > nonzero value by au8522 if a signal is present, and thus the state of > the i2c gate isn't relevant. The logic there seems to need a proper I2C gate setting: drivers/media/dvb-frontends/au8522_decoder.c:static int au8522_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) drivers/media/dvb-frontends/au8522_decoder.c-{ drivers/media/dvb-frontends/au8522_decoder.c- int val = 0; drivers/media/dvb-frontends/au8522_decoder.c- struct au8522_state *state = to_state(sd); drivers/media/dvb-frontends/au8522_decoder.c- u8 lock_status; drivers/media/dvb-frontends/au8522_decoder.c- drivers/media/dvb-frontends/au8522_decoder.c- /* Interrogate the decoder to see if we are getting a real signal */ drivers/media/dvb-frontends/au8522_decoder.c- lock_status = au8522_readreg(state, 0x00); drivers/media/dvb-frontends/au8522_decoder.c- if (lock_status == 0xa2) drivers/media/dvb-frontends/au8522_decoder.c- vt->signal = 0x; drivers/media/dvb-frontends/au8522_decoder.c- else drivers/media/dvb-frontends/au8522_decoder.c- vt->signal = 0x00; drivers/media/dvb-frontends/au8522_decoder.c- drivers/media/dvb-frontends/au8522_decoder.c- vt->capability |= drivers/media/dvb-frontends/au8522_decoder.c- V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_LANG1 | drivers/media/dvb-frontends/au8522_decoder.c- V4L2_TUNER_CAP_LANG2 | V4L2_TUNER_CAP_SAP; drivers/media/dvb-frontends/au8522_decoder.c- drivers/media/dvb-frontends/au8522_decoder.c- val = V4L2_TUNER_SUB_MONO; drivers/media/dvb-frontends/au8522_decoder.c- vt->rxsubchans = val; drivers/media/dvb-frontends/au8522_decoder.c- vt->audmode = V4L2_TUNER_MODE_STEREO; drivers/media/dvb-frontends/au8522_decoder.c- return 0; As if the i2c gate is on a wrong state, au8522_readreg() won't work anymore. > This is because the xc5000 driver didn't > actually have implemented a call to return the signal level. > > If what you're saying is true, then the behavior of the framework > itself changed, and who knows what else is broken. I don't think that the framework behavior has changed with that regards. Anyway, until we have this issue fixed, I'll mark this patch as "changes requested". Regards, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info
Re: [GIT PULL FOR v3.10] au0828 driver overhaul
On Fri, Mar 22, 2013 at 12:38 PM, Hans Verkuil wrote: > It works fine with qv4l2, but there is still a bug causing tvtime to fail. > That's caused by commit e58071f024aa337b7ce41682578b33895b024f8b, applied > August last year, that broke g_tuner: after that 'signal' would always be 0 > and tvtime expects signal to be non-zero for a valid frequency. The signal > field is set by the au8522, but g_tuner is only called for the tuner (well, > also for au8522 but since the i2c gate is set for the tuner that won't do > anything). Wait, are you saying that the G_TUNER call is no longer being routed to the au8522 driver? The signal level has always been set to a nonzero value by au8522 if a signal is present, and thus the state of the i2c gate isn't relevant. This is because the xc5000 driver didn't actually have implemented a call to return the signal level. If what you're saying is true, then the behavior of the framework itself changed, and who knows what else is broken. Devin -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL FOR v3.10] au0828 driver overhaul
On Fri, Mar 22, 2013 at 12:38 PM, Hans Verkuil wrote: > It works fine with qv4l2, but there is still a bug causing tvtime to fail. > That's caused by commit e58071f024aa337b7ce41682578b33895b024f8b, applied > August last year, that broke g_tuner: after that 'signal' would always be 0 > and tvtime expects signal to be non-zero for a valid frequency. The signal > field is set by the au8522, but g_tuner is only called for the tuner (well, > also for au8522 but since the i2c gate is set for the tuner that won't do > anything). During your testing, did you bisect the entire media tree or just the au0828/au8522 driver. This discovery is pretty damn surprising since I actively test with tvtime whenever I do any work on that driver. Are you sure something else in the framework didn't change which caused breakage for this driver? Devin -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[GIT PULL FOR v3.10] au0828 driver overhaul
Hi all, This pull request converts the au0828/au8522 drivers to the latest frameworks, except for vb2 as usual. Tested with a WinTV aero generously donated by Hauppauge some time ago. I also did a lot of fixes in the disconnect handling and setting up the right routing/std information at the right time. It works fine with qv4l2, but there is still a bug causing tvtime to fail. That's caused by commit e58071f024aa337b7ce41682578b33895b024f8b, applied August last year, that broke g_tuner: after that 'signal' would always be 0 and tvtime expects signal to be non-zero for a valid frequency. The signal field is set by the au8522, but g_tuner is only called for the tuner (well, also for au8522 but since the i2c gate is set for the tuner that won't do anything). I have a patch for that but I want to convert that to using an i2c mux instead. For the time being I'd like to get this merged since at least it is in a lot better shape. Note: this pull request sits on top of this 'const' pull request: http://patchwork.linuxtv.org/patch/17568/ Regards, Hans The following changes since commit 8bf1a5a826d06a9b6f65b3e8dffb9be59d8937c3: v4l2-ioctl: add precision when printing names. (2013-03-22 11:59:21 +0100) are available in the git repository at: git://linuxtv.org/hverkuil/media_tree.git au0828c for you to fetch changes up to fbb5b69d62a7eb9b1dc4783a52ebe45c850c510a: au0828: improve firmware loading & locking. (2013-03-22 17:34:15 +0100) Hans Verkuil (15): au8522_decoder: convert to the control framework. au0828: fix querycap. au0828: frequency handling fixes. au0828: fix intendation coding style issue. au0828: fix audio input handling. au0828: convert to the control framework. au0828: add prio, control event and log_status support au0828: add try_fmt_vbi support, zero vbi.reserved, pix.priv. au0828: replace deprecated current_norm by g_std. au8522_decoder: remove obsolete control ops. au0828: fix disconnect sequence. au0828: simplify i2c_gate_ctrl. au0828: don't change global state information on open(). au0828: fix initial video routing. au0828: improve firmware loading & locking. drivers/media/dvb-frontends/au8522_decoder.c | 123 -- drivers/media/dvb-frontends/au8522_priv.h|6 +- drivers/media/usb/au0828/au0828-core.c | 61 + drivers/media/usb/au0828/au0828-video.c | 287 drivers/media/usb/au0828/au0828.h|7 ++ 5 files changed, 261 insertions(+), 223 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL FOR v3.10] au0828 driver overhaul
On Fri March 22 2013 17:22:24 Hans Verkuil wrote: > Hi all, > > This pull request converts the au0828/au8522 drivers to the latest frameworks, > except for vb2 as usual. > > Tested with a WinTV aero generously donated by Hauppauge some time ago. > > I also did a lot of fixes in the disconnect handling and setting up the > right routing/std information at the right time. > > It works fine with qv4l2, but there is still a bug causing tvtime to fail. > That's caused by commit e58071f024aa337b7ce41682578b33895b024f8b, applied > August last year, that broke g_tuner: after that 'signal' would always be 0 > and tvtime expects signal to be non-zero for a valid frequency. The signal > field is set by the au8522, but g_tuner is only called for the tuner (well, > also for au8522 but since the i2c gate is set for the tuner that won't do > anything). > > I have a patch for that but I want to convert that to using an i2c mux > instead. > > For the time being I'd like to get this merged since at least it is in a > lot better shape. > > Note: this pull request sits on top of this 'const' pull request: > > http://patchwork.linuxtv.org/patch/17568/ > > Regards, > > Hans Oops, missed a compiler warning relating to the const changes. Nacked-by: Hans Verkuil I'll post a new, fixed, version. Regards, Hans > > The following changes since commit 8bf1a5a826d06a9b6f65b3e8dffb9be59d8937c3: > > v4l2-ioctl: add precision when printing names. (2013-03-22 11:59:21 +0100) > > are available in the git repository at: > > git://linuxtv.org/hverkuil/media_tree.git au0828b > > for you to fetch changes up to 9b216a590115ea8aac389b9bb9248b7adce25f7f: > > au0828: improve firmware loading & locking. (2013-03-22 17:13:57 +0100) > > > Hans Verkuil (15): > au8522_decoder: convert to the control framework. > au0828: fix querycap. > au0828: frequency handling fixes. > au0828: fix intendation coding style issue. > au0828: fix audio input handling. > au0828: convert to the control framework. > au0828: add prio, control event and log_status support > au0828: add try_fmt_vbi support, zero vbi.reserved, pix.priv. > au0828: replace deprecated current_norm by g_std. > au8522_decoder: remove obsolete control ops. > au0828: fix disconnect sequence. > au0828: simplify i2c_gate_ctrl. > au0828: don't change global state information on open(). > au0828: fix initial video routing. > au0828: improve firmware loading & locking. > > drivers/media/dvb-frontends/au8522_decoder.c | 123 > -- > drivers/media/dvb-frontends/au8522_priv.h|6 +- > drivers/media/usb/au0828/au0828-core.c | 61 + > drivers/media/usb/au0828/au0828-video.c | 286 > > drivers/media/usb/au0828/au0828.h|7 ++ > 5 files changed, 260 insertions(+), 223 deletions(-) > -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[GIT PULL FOR v3.10] au0828 driver overhaul
Hi all, This pull request converts the au0828/au8522 drivers to the latest frameworks, except for vb2 as usual. Tested with a WinTV aero generously donated by Hauppauge some time ago. I also did a lot of fixes in the disconnect handling and setting up the right routing/std information at the right time. It works fine with qv4l2, but there is still a bug causing tvtime to fail. That's caused by commit e58071f024aa337b7ce41682578b33895b024f8b, applied August last year, that broke g_tuner: after that 'signal' would always be 0 and tvtime expects signal to be non-zero for a valid frequency. The signal field is set by the au8522, but g_tuner is only called for the tuner (well, also for au8522 but since the i2c gate is set for the tuner that won't do anything). I have a patch for that but I want to convert that to using an i2c mux instead. For the time being I'd like to get this merged since at least it is in a lot better shape. Note: this pull request sits on top of this 'const' pull request: http://patchwork.linuxtv.org/patch/17568/ Regards, Hans The following changes since commit 8bf1a5a826d06a9b6f65b3e8dffb9be59d8937c3: v4l2-ioctl: add precision when printing names. (2013-03-22 11:59:21 +0100) are available in the git repository at: git://linuxtv.org/hverkuil/media_tree.git au0828b for you to fetch changes up to 9b216a590115ea8aac389b9bb9248b7adce25f7f: au0828: improve firmware loading & locking. (2013-03-22 17:13:57 +0100) Hans Verkuil (15): au8522_decoder: convert to the control framework. au0828: fix querycap. au0828: frequency handling fixes. au0828: fix intendation coding style issue. au0828: fix audio input handling. au0828: convert to the control framework. au0828: add prio, control event and log_status support au0828: add try_fmt_vbi support, zero vbi.reserved, pix.priv. au0828: replace deprecated current_norm by g_std. au8522_decoder: remove obsolete control ops. au0828: fix disconnect sequence. au0828: simplify i2c_gate_ctrl. au0828: don't change global state information on open(). au0828: fix initial video routing. au0828: improve firmware loading & locking. drivers/media/dvb-frontends/au8522_decoder.c | 123 -- drivers/media/dvb-frontends/au8522_priv.h|6 +- drivers/media/usb/au0828/au0828-core.c | 61 + drivers/media/usb/au0828/au0828-video.c | 286 drivers/media/usb/au0828/au0828.h|7 ++ 5 files changed, 260 insertions(+), 223 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html