diff --git a/sys/dev/video/cxm/cxm.c b/sys/dev/video/cxm/cxm.c
index 99477c7..984b442 100644
--- a/sys/dev/video/cxm/cxm.c
+++ b/sys/dev/video/cxm/cxm.c
@@ -1700,6 +1700,7 @@ cxm_attach( device_t dev )
 	sc = device_get_softc(dev);
 	unit = device_get_unit(dev);
 
+	sc->cxm_dev = dev;
 	sc->type = cxm_iTVC15_type;
 
 	switch(pci_get_device(dev)) {
@@ -1773,7 +1774,12 @@ cxm_attach( device_t dev )
 #ifdef CXM_PVR150
 	cx25840_initialize(sc->iicbus,1);
 	tda9887_initialize(sc->iicbus);
-	cxm_wm8775_init(sc);
+
+	if (cxm_wm8775_init(sc) < 0) {
+		device_printf(dev, "could not initialize wm8775\n");
+		error = ENXIO;
+		goto fail;
+	}
 
 	/* set the standard */
 	if (cxm_eeprom_get_std(sc)) {
@@ -2850,6 +2856,11 @@ cxm_ioctl( struct dev_ioctl_args *ap )
 #ifdef CXM_PVR150
 			arg = AUDIO_TUNER;
 			cx25840_command(sc->iicbus, AUDC_SET_INPUT, &arg);
+			if (cxm_wm8775_select_source(sc, source) < 0) {
+				device_printf(sc->cxm_dev,
+				    "error setting wm8775 input to tuner\n");
+				return ENXIO;
+			}
 			arg=CX25840_TUNER;
 			cx25840_command(sc->iicbus, VIDIOC_S_INPUT, &arg);
 		}
@@ -2865,6 +2876,11 @@ cxm_ioctl( struct dev_ioctl_args *ap )
 #ifdef CXM_PVR150
 			arg = AUDIO_EXTERN_1;
 			cx25840_command(sc->iicbus, AUDC_SET_INPUT, &arg);
+			if (cxm_wm8775_select_source(sc, source) < 0) {
+				device_printf(sc->cxm_dev,
+				    "error setting wm8775 input to comp\n");
+				return ENXIO;
+			}
 			arg=CX25840_COMPOSITE0;
 			cx25840_command(sc->iicbus, VIDIOC_S_INPUT, &arg);
 		}
@@ -2880,6 +2896,11 @@ cxm_ioctl( struct dev_ioctl_args *ap )
 #ifdef CXM_PVR150
 			arg = AUDIO_EXTERN_1;
 			cx25840_command(sc->iicbus, AUDC_SET_INPUT, &arg);
+			if (cxm_wm8775_select_source(sc, source) < 0) {
+				device_printf(sc->cxm_dev,
+				    "error setting wm8775 input to svideo\n");
+				return ENXIO;
+			}
 			arg=CX25840_SVIDEO0;
 			cx25840_command(sc->iicbus, VIDIOC_S_INPUT, &arg);
 		}
diff --git a/sys/dev/video/cxm/cxm.h b/sys/dev/video/cxm/cxm.h
index 7ba2217..cd871ff 100644
--- a/sys/dev/video/cxm/cxm.h
+++ b/sys/dev/video/cxm/cxm.h
@@ -267,7 +267,7 @@ struct cxm_softc {
 
 	enum cxm_source	source;
 
-	dev_t		cxm_dev;	/* bus attachment */
+	device_t	cxm_dev;	/* bus attachment */
 	cdev_t		cxm_dev_t;	/* control device */
 	int		is_opened;
 	int		mpeg;
@@ -527,6 +527,7 @@ struct cxm_wm8775_command {
 };
 
 int cxm_wm8775_init(struct cxm_softc *sc);
+int cxm_wm8775_select_source(struct cxm_softc *sc, enum cxm_source source);
 
 /*
  * Tuner
diff --git a/sys/dev/video/cxm/cxm_wm8775.c b/sys/dev/video/cxm/cxm_wm8775.c
index 60c3440..db62856 100644
--- a/sys/dev/video/cxm/cxm_wm8775.c
+++ b/sys/dev/video/cxm/cxm_wm8775.c
@@ -70,6 +70,16 @@ static const struct cxm_wm8775_command wm8775_init = {
 	}
 };
 
+static const struct cxm_wm8775_command wm8775_select_source = {
+	4,
+	{
+		{ 0x15, { 0x00, 0xc0 } },
+		{ 0x0e, { 0x01, 0xd4 } },
+		{ 0x0f, { 0x01, 0xd4 } },
+		{ 0x15, { 0x01, 0x02 } },
+	}
+};
+
 static int
 cxm_wm8775_write(device_t iicbus, int i2c_addr, unsigned char addr,
     const char *buf, int len)
@@ -101,14 +111,33 @@ fail:
 int
 cxm_wm8775_init(struct cxm_softc *sc)
 {
-	int i;
+	unsigned int i;
+	unsigned int nsettings = wm8775_init.nsettings;
+	const struct cxm_wm8775_setting *settings = wm8775_init.settings;
+
+	for (i = 0; i < nsettings; i++)
+		if (cxm_wm8775_write(sc->iicbus, CXM_I2C_WM8775,
+			settings[i].addr, settings[i].value,
+			sizeof(settings[i].value))
+		    != sizeof(settings[i].value))
+			return -1;
+	return 0;
+}
+
+int
+cxm_wm8775_select_source(struct cxm_softc *sc, enum cxm_source source __unused)
+{
+	unsigned int i;
+	unsigned int nsettings = wm8775_select_source.nsettings;
+	const struct cxm_wm8775_setting *settings = wm8775_select_source.settings;
+
+	/* XXX anything to be done with source? */
 
-	for (i = 0; i < wm8775_init.nsettings; i++)
+	for (i = 0; i < nsettings; i++)
 		if (cxm_wm8775_write(sc->iicbus, CXM_I2C_WM8775,
-			wm8775_init.settings[i].addr,
-			wm8775_init.settings[i].value,
-			sizeof(wm8775_init.settings[i].value))
-		    != sizeof(wm8775_init.settings[i].value))
+			settings[i].addr, settings[i].value,
+			sizeof(settings[i].value))
+		    != sizeof(settings[i].value))
 			return -1;
 	return 0;
 }
