Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b2f0795 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (11066): au0828: add support for analog functionality in bridge



Add support for the analog functionality found in the au0828 bridge

Thanks to Michael Krufky <mkrufky@linuxtv.org> and Steven Toth
<stoth@linuxtv.org> for providing sample hardware, engineering level support,
and testing.

Signed-off-by: default avatarDevin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
[mchehab@redhat.com: fix compilation by adding linux/version.h]
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 968cf782
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
au0828-objs	:= au0828-core.o au0828-i2c.o au0828-cards.o au0828-dvb.o
au0828-objs	:= au0828-core.o au0828-i2c.o au0828-cards.o au0828-dvb.o au0828-video.o


obj-$(CONFIG_VIDEO_AU0828) += au0828.o
obj-$(CONFIG_VIDEO_AU0828) += au0828.o


+37 −4
Original line number Original line Diff line number Diff line
@@ -21,6 +21,18 @@


#include "au0828.h"
#include "au0828.h"
#include "au0828-cards.h"
#include "au0828-cards.h"
#include "au8522.h"

void hvr950q_cs5340_audio(void *priv, int enable)
{
	/* Because the HVR-950q shares an i2s bus between the cs5340 and the
	   au8522, we need to hold cs5340 in reset when using the au8522 */
	struct au0828_dev *dev = priv;
	if (enable == 1)
		au0828_set(dev, REG_000, 0x10);
	else
		au0828_clear(dev, REG_000, 0x10);
}


struct au0828_board au0828_boards[] = {
struct au0828_board au0828_boards[] = {
	[AU0828_BOARD_UNKNOWN] = {
	[AU0828_BOARD_UNKNOWN] = {
@@ -31,6 +43,25 @@ struct au0828_board au0828_boards[] = {
	},
	},
	[AU0828_BOARD_HAUPPAUGE_HVR950Q] = {
	[AU0828_BOARD_HAUPPAUGE_HVR950Q] = {
		.name	= "Hauppauge HVR950Q",
		.name	= "Hauppauge HVR950Q",
		.input = {
			{
				.type = AU0828_VMUX_TELEVISION,
				.vmux = AU8522_COMPOSITE_CH4_SIF,
				.amux = AU8522_AUDIO_SIF,
			},
			{
				.type = AU0828_VMUX_COMPOSITE,
				.vmux = AU8522_COMPOSITE_CH1,
				.amux = AU8522_AUDIO_NONE,
				.audio_setup = hvr950q_cs5340_audio,
			},
			{
				.type = AU0828_VMUX_SVIDEO,
				.vmux = AU8522_SVIDEO_CH13,
				.amux = AU8522_AUDIO_NONE,
				.audio_setup = hvr950q_cs5340_audio,
			},
		},
	},
	},
	[AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL] = {
	[AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL] = {
		.name	= "Hauppauge HVR950Q rev xxF8",
		.name	= "Hauppauge HVR950Q rev xxF8",
@@ -144,21 +175,23 @@ void au0828_gpio_setup(struct au0828_dev *dev)
		 * 4 - CS5340
		 * 4 - CS5340
		 * 5 - AU8522 Demodulator
		 * 5 - AU8522 Demodulator
		 * 6 - eeprom W/P
		 * 6 - eeprom W/P
		 * 7 - power supply
		 * 9 - XC5000 Tuner
		 * 9 - XC5000 Tuner
		 */
		 */


		/* Into reset */
		/* Into reset */
		au0828_write(dev, REG_003, 0x02);
		au0828_write(dev, REG_003, 0x02);
		au0828_write(dev, REG_002, 0x88 | 0x20);
		au0828_write(dev, REG_002, 0x80 | 0x20 | 0x10);
		au0828_write(dev, REG_001, 0x0);
		au0828_write(dev, REG_001, 0x0);
		au0828_write(dev, REG_000, 0x0);
		au0828_write(dev, REG_000, 0x0);
		msleep(100);
		msleep(100);


		/* Out of reset */
		/* Out of reset (leave the cs5340 in reset until needed) */
		au0828_write(dev, REG_003, 0x02);
		au0828_write(dev, REG_003, 0x02);
		au0828_write(dev, REG_001, 0x02);
		au0828_write(dev, REG_001, 0x02);
		au0828_write(dev, REG_002, 0x88 | 0x20);
		au0828_write(dev, REG_002, 0x80 | 0x20 | 0x10);
		au0828_write(dev, REG_000, 0x88 | 0x20 | 0x40);
		au0828_write(dev, REG_000, 0x80 | 0x40 | 0x20);

		msleep(250);
		msleep(250);
		break;
		break;
	case AU0828_BOARD_DVICO_FUSIONHDTV7:
	case AU0828_BOARD_DVICO_FUSIONHDTV7:
+32 −1
Original line number Original line Diff line number Diff line
@@ -146,6 +146,8 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
	/* Digital TV */
	/* Digital TV */
	au0828_dvb_unregister(dev);
	au0828_dvb_unregister(dev);


	au0828_analog_unregister(dev);

	/* I2C */
	/* I2C */
	au0828_i2c_unregister(dev);
	au0828_i2c_unregister(dev);


@@ -162,9 +164,11 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
static int au0828_usb_probe(struct usb_interface *interface,
static int au0828_usb_probe(struct usb_interface *interface,
	const struct usb_device_id *id)
	const struct usb_device_id *id)
{
{
	int ifnum;
	int ifnum, i;
	struct au0828_dev *dev;
	struct au0828_dev *dev;
	struct usb_device *usbdev = interface_to_usbdev(interface);
	struct usb_device *usbdev = interface_to_usbdev(interface);
	struct usb_host_interface *iface_desc;
	struct usb_endpoint_descriptor *endpoint;


	ifnum = interface->altsetting->desc.bInterfaceNumber;
	ifnum = interface->altsetting->desc.bInterfaceNumber;


@@ -189,6 +193,30 @@ static int au0828_usb_probe(struct usb_interface *interface,


	usb_set_intfdata(interface, dev);
	usb_set_intfdata(interface, dev);


	/* set au0828 usb interface0 to as5 */
	usb_set_interface(usbdev,
			  interface->cur_altsetting->desc.bInterfaceNumber, 5);

	/* Figure out which endpoint has the isoc interface */
	iface_desc = interface->cur_altsetting;
	for(i = 0; i < iface_desc->desc.bNumEndpoints; i++){
		endpoint = &iface_desc->endpoint[i].desc;
		if(((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN)	&&
		   ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_ISOC)){

			/* we find our isoc in endpoint */
			u16 tmp = le16_to_cpu(endpoint->wMaxPacketSize);
			dev->max_pkt_size = (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
			dev->isoc_in_endpointaddr = endpoint->bEndpointAddress;
		}
	}
	if(!(dev->isoc_in_endpointaddr)) {
		printk("Could not locate isoc endpoint\n");
		kfree(dev);
		return -ENODEV;
	}


	/* Power Up the bridge */
	/* Power Up the bridge */
	au0828_write(dev, REG_600, 1 << 4);
	au0828_write(dev, REG_600, 1 << 4);


@@ -201,6 +229,9 @@ static int au0828_usb_probe(struct usb_interface *interface,
	/* Setup */
	/* Setup */
	au0828_card_setup(dev);
	au0828_card_setup(dev);


	/* Analog TV */
	au0828_analog_register(dev);

	/* Digital TV */
	/* Digital TV */
	au0828_dvb_register(dev);
	au0828_dvb_register(dev);


+6 −0
Original line number Original line Diff line number Diff line
@@ -27,6 +27,9 @@
#define REG_002 0x002
#define REG_002 0x002
#define REG_003 0x003
#define REG_003 0x003


#define AU0828_SENSORCTRL_100 0x100
#define AU0828_SENSORCTRL_VBI_103 0x103

#define REG_200 0x200
#define REG_200 0x200
#define REG_201 0x201
#define REG_201 0x201
#define REG_202 0x202
#define REG_202 0x202
@@ -35,4 +38,7 @@
#define REG_209 0x209
#define REG_209 0x209
#define REG_2FF 0x2ff
#define REG_2FF 0x2ff


/* Audio registers */
#define AU0828_AUDIOCTRL_50C 0x50C

#define REG_600 0x600
#define REG_600 0x600
+1677 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading