Module Name: src
Committed By: jmcneill
Date: Sun Oct 2 19:15:40 UTC 2011
Modified Files:
src/sys/dev/usb: auvitek.c auvitek_dtv.c auvitek_video.c auvitekvar.h
Log Message:
Attempt to load the xc5k firmware at attach time using config_mountroot. If
it is unavailable the driver will try again on the next open of either the
video or dtv device.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/usb/auvitek.c \
src/sys/dev/usb/auvitekvar.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/auvitek_dtv.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/usb/auvitek_video.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/usb/auvitek.c
diff -u src/sys/dev/usb/auvitek.c:1.6 src/sys/dev/usb/auvitek.c:1.7
--- src/sys/dev/usb/auvitek.c:1.6 Sun Oct 2 16:30:58 2011
+++ src/sys/dev/usb/auvitek.c Sun Oct 2 19:15:39 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: auvitek.c,v 1.6 2011/10/02 16:30:58 jmcneill Exp $ */
+/* $NetBSD: auvitek.c,v 1.7 2011/10/02 19:15:39 jmcneill Exp $ */
/*-
* Copyright (c) 2010 Jared D. McNeill <[email protected]>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auvitek.c,v 1.6 2011/10/02 16:30:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auvitek.c,v 1.7 2011/10/02 19:15:39 jmcneill Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -254,11 +254,28 @@ auvitek_attach(device_t parent, device_t
return;
}
+ config_mountroot(self, auvitek_attach_tuner);
+
auvitek_video_attach(sc);
auvitek_audio_attach(sc);
auvitek_dtv_attach(sc);
}
+void
+auvitek_attach_tuner(device_t self)
+{
+ struct auvitek_softc *sc = device_private(self);
+
+ mutex_enter(&sc->sc_subdev_lock);
+ if (sc->sc_xc5k == NULL) {
+ sc->sc_xc5k = xc5k_open(sc->sc_dev, &sc->sc_i2c, 0xc2 >> 1,
+ auvitek_board_tuner_reset, sc,
+ auvitek_board_get_if_frequency(sc),
+ FE_ATSC);
+ }
+ mutex_exit(&sc->sc_subdev_lock);
+}
+
static int
auvitek_detach(device_t self, int flags)
{
Index: src/sys/dev/usb/auvitekvar.h
diff -u src/sys/dev/usb/auvitekvar.h:1.6 src/sys/dev/usb/auvitekvar.h:1.7
--- src/sys/dev/usb/auvitekvar.h:1.6 Sun Oct 2 16:30:58 2011
+++ src/sys/dev/usb/auvitekvar.h Sun Oct 2 19:15:40 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: auvitekvar.h,v 1.6 2011/10/02 16:30:58 jmcneill Exp $ */
+/* $NetBSD: auvitekvar.h,v 1.7 2011/10/02 19:15:40 jmcneill Exp $ */
/*-
* Copyright (c) 2010 Jared D. McNeill <[email protected]>
@@ -136,6 +136,7 @@ struct auvitek_softc {
/* auvitek.c */
uint8_t auvitek_read_1(struct auvitek_softc *, uint16_t);
void auvitek_write_1(struct auvitek_softc *, uint16_t, uint8_t);
+void auvitek_attach_tuner(device_t);
/* auvitek_audio.c */
int auvitek_audio_attach(struct auvitek_softc *);
Index: src/sys/dev/usb/auvitek_dtv.c
diff -u src/sys/dev/usb/auvitek_dtv.c:1.3 src/sys/dev/usb/auvitek_dtv.c:1.4
--- src/sys/dev/usb/auvitek_dtv.c:1.3 Tue Aug 9 01:42:24 2011
+++ src/sys/dev/usb/auvitek_dtv.c Sun Oct 2 19:15:40 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: auvitek_dtv.c,v 1.3 2011/08/09 01:42:24 jmcneill Exp $ */
+/* $NetBSD: auvitek_dtv.c,v 1.4 2011/10/02 19:15:40 jmcneill Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <[email protected]>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auvitek_dtv.c,v 1.3 2011/08/09 01:42:24 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auvitek_dtv.c,v 1.4 2011/10/02 19:15:40 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -149,15 +149,7 @@ auvitek_dtv_open(void *priv, int flags)
if (sc->sc_dying)
return EIO;
- mutex_enter(&sc->sc_subdev_lock);
- if (sc->sc_xc5k == NULL) {
- sc->sc_xc5k = xc5k_open(sc->sc_dev, &sc->sc_i2c, 0xc2 >> 1,
- auvitek_board_tuner_reset, sc,
- auvitek_board_get_if_frequency(sc),
- FE_ATSC);
- }
- mutex_exit(&sc->sc_subdev_lock);
-
+ auvitek_attach_tuner(sc->sc_dev);
if (sc->sc_xc5k == NULL)
return ENXIO;
Index: src/sys/dev/usb/auvitek_video.c
diff -u src/sys/dev/usb/auvitek_video.c:1.5 src/sys/dev/usb/auvitek_video.c:1.6
--- src/sys/dev/usb/auvitek_video.c:1.5 Tue Aug 9 01:42:24 2011
+++ src/sys/dev/usb/auvitek_video.c Sun Oct 2 19:15:40 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: auvitek_video.c,v 1.5 2011/08/09 01:42:24 jmcneill Exp $ */
+/* $NetBSD: auvitek_video.c,v 1.6 2011/10/02 19:15:40 jmcneill Exp $ */
/*-
* Copyright (c) 2010 Jared D. McNeill <[email protected]>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auvitek_video.c,v 1.5 2011/08/09 01:42:24 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auvitek_video.c,v 1.6 2011/10/02 19:15:40 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -173,14 +173,7 @@ auvitek_open(void *opaque, int flags)
if (sc->sc_dying)
return EIO;
- mutex_enter(&sc->sc_subdev_lock);
- if (sc->sc_xc5k == NULL) {
- sc->sc_xc5k = xc5k_open(sc->sc_dev, &sc->sc_i2c, 0xc2 >> 1,
- auvitek_board_tuner_reset, sc,
- auvitek_board_get_if_frequency(sc),
- FE_ATSC);
- }
- mutex_exit(&sc->sc_subdev_lock);
+ auvitek_attach_tuner(sc->sc_dev);
if (sc->sc_xc5k == NULL)
return ENXIO;