#include <linux/pci.h>
#include <linux/vmalloc.h>
#include <linux/firmware.h>
+#include <linux/video_decoder.h>
#include <asm/io.h>
static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
+static void sweetspot_muxsel(struct bttv *btv, unsigned int input);
+static void sweetspot_chan_name(struct video_channel *v);
+static void sweetspot_init(struct bttv *btv);
+
static int terratec_active_radio_upgrade(struct bttv *btv);
static int tea5757_read(struct bttv *btv);
static int tea5757_write(struct bttv *btv, int value);
.has_radio = 1,
.has_remote = 1,
},
+ [BTTV_BOARD_SWEETSPOT] = {
+ /* David Woodhouse <dwmw2@infradead.org> */
+ /* http://www.pluggedin.tv/sweetspot/ */
+ .name = "Sweetspot / PMS Video Deluxe",
+ .video_inputs = 12,
+ .audio_inputs = 0,
+ .tuner = -1,
+ .tuner_type = -1,
+ .svhs = -1,
+ .muxsel = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
+ .digital_mode = DIGITAL_MODE_VIDEO,
+ .pll = PLL_28,
+ .no_msp34xx = 1,
+ .no_tda7432 = 1,
+ .no_tda9875 = 1,
+ .muxsel_hook = sweetspot_muxsel,
+ .channel_name = sweetspot_chan_name,
+ },
};
static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
bttv_readee(btv,eeprom_data,0xa0);
identify_by_eeprom(btv,eeprom_data);
}
+ if (BTTV_BOARD_UNKNOWN == btv->c.type &&
+ bttv_I2CRead(btv, I2C_ADDR_SAA7118, "SAA7118") >= 0) {
+ btv->c.type = BTTV_BOARD_SWEETSPOT;
+ }
switch (btv->c.type) {
case BTTV_BOARD_MIRO:
case BTTV_BOARD_KODICOM_4400R:
kodicom4400r_init(btv);
break;
+ case BTTV_BOARD_SWEETSPOT:
+ sweetspot_init(btv);
}
/* pll configuration */
return 0;
}
+static const char *sweetspot_chan_names[] = {
+ "Component",
+ "S-Video 1",
+ "S-Video 2",
+ "Composite 1 (Red)",
+ "Composite 2 (Green)",
+ "Composite 3 (Blue)",
+ "PDI",
+ "Composite 1 over S-video 1",
+ "Composite 2 over S-video 1",
+ "Composite 1 over S-video 2",
+ "Composite 2 over S-video 2",
+ "RGBS / RGsB",
+};
+
+static void sweetspot_muxsel(struct bttv *btv, unsigned int input)
+{
+ dprintk("SweetSpot muxsel: %d (%s)\n", input, sweetspot_chan_names[input]);
+ bttv_call_i2c_clients(btv, DECODER_SET_INPUT, &input);
+}
+static void sweetspot_chan_name(struct video_channel *v)
+{
+ strlcpy(v->name, sweetspot_chan_names[v->channel], sizeof(v->name));
+}
+
+static void sweetspot_init(struct bttv *btv)
+{
+ gpio_inout(0xffffff, 0);
+ request_module("saa7118");
+}
+
+void sweetspot_setnorm(struct bttv *btv, int norm)
+{
+ int decoder_norm;
+
+ dprintk("Sweetspot_setnorm %d\n", norm);
+
+ switch (bttv_tvnorms[norm].v4l2_id) {
+ case V4L2_STD_PAL:
+ decoder_norm = VIDEO_MODE_PAL;
+ break;
+ case V4L2_STD_NTSC:
+ decoder_norm = VIDEO_MODE_NTSC;
+ break;
+ case V4L2_STD_SECAM:
+ decoder_norm = VIDEO_MODE_SECAM;
+ break;
+ default:
+ printk(KERN_INFO "Decoder API doesn't allow setting tvnorm %s\n", bttv_tvnorms[norm].name);
+ return /* -EINVAL */;
+ }
+
+ bttv_call_i2c_clients(btv, DECODER_SET_NORM, &decoder_norm);
+}
+
+void sweetspot_set_picture(struct bttv *btv)
+{
+ struct video_picture pic;
+
+ pic.contrast = btv->contrast;
+ pic.brightness = btv->bright;
+ pic.hue = btv->hue;
+ pic.colour = btv->saturation;
+
+ bttv_call_i2c_clients(btv, DECODER_SET_PICTURE, &pic);
+}
/*
* Local variables:
* c-basic-offset: 8
/* We want -128 to 127 we get 0-65535 */
value = (bright >> 8) - 128;
+ if (btv->c.type == BTTV_BOARD_SWEETSPOT) {
+ sweetspot_set_picture(btv);
+ value = 0x00;
+ }
btwrite(value & 0xff, BT848_BRIGHT);
}
btv->hue = hue;
+ if (btv->c.type == BTTV_BOARD_SWEETSPOT)
+ sweetspot_set_picture(btv);
+
/* -128 to 127 */
value = (hue >> 8) - 128;
btwrite(value & 0xff, BT848_HUE);
/* 0-511 */
value = (cont >> 7);
+
+ if (btv->c.type == BTTV_BOARD_SWEETSPOT) {
+ sweetspot_set_picture(btv);
+ value = 0x80;
+ }
+
hibit = (value >> 6) & 4;
btwrite(value & 0xff, BT848_CONTRAST_LO);
btaor(hibit, ~4, BT848_E_CONTROL);
/* 0-511 for the color */
val_u = ((color * btv->opt_uv_ratio) / 50) >> 7;
val_v = (((color * (100 - btv->opt_uv_ratio) / 50) >>7)*180L)/254;
+
+ if (btv->c.type == BTTV_BOARD_SWEETSPOT) {
+ sweetspot_set_picture(btv);
+ val_u = val_v = 0x80;
+ }
+
hibits = (val_u >> 7) & 2;
hibits |= (val_v >> 8) & 1;
btwrite(val_u & 0xff, BT848_SAT_U_LO);
bttv_call_i2c_clients(btv, VIDIOC_S_STD, &std);
if (btv->c.type == BTTV_BOARD_VOODOOTV_FM)
bttv_tda9880_setnorm(btv,btv->tvnorm);
+ else if (btv->c.type == BTTV_BOARD_SWEETSPOT)
+ sweetspot_setnorm(btv,btv->tvnorm);
}
static int
case BTTV_BOARD_VOODOOTV_FM:
bttv_tda9880_setnorm(btv,norm);
break;
+ case BTTV_BOARD_SWEETSPOT:
+ sweetspot_setnorm(btv, norm);
+ break;
}
return 0;
}
v->flags = VIDEO_VC_AUDIO;
v->type = VIDEO_TYPE_CAMERA;
v->norm = btv->tvnorm;
- if (channel == bttv_tvcards[btv->c.type].tuner) {
+ if (bttv_tvcards[btv->c.type].channel_name) {
+ bttv_tvcards[btv->c.type].channel_name(v);
+ } else if (channel == bttv_tvcards[btv->c.type].tuner) {
strcpy(v->name,"Television");
v->flags|=VIDEO_VC_TUNER;
v->type=VIDEO_TYPE_TV;
#define BTTV_BOARD_SABRENT_TVFM 0x8e
#define BTTV_BOARD_HAUPPAUGE_IMPACTVCB 0x8f
#define BTTV_BOARD_MACHTV_MAGICTV 0x90
+#define BTTV_BOARD_SWEETSPOT 0x91
/* more card-specific defines */
#define PT2254_L_CHANNEL 0x10
unsigned int has_radio;
void (*audio_hook)(struct bttv *btv, struct video_audio *v, int set);
void (*muxsel_hook)(struct bttv *btv, unsigned int input);
+ void (*channel_name)(struct video_channel *v);
};
extern struct tvcard bttv_tvcards[];
/* card-specific funtions */
extern void tea5757_set_freq(struct bttv *btv, unsigned short freq);
extern void bttv_tda9880_setnorm(struct bttv *btv, int norm);
+extern void sweetspot_setnorm(struct bttv *btv, int norm);
+extern void sweetspot_set_picture(struct bttv *btv);
/* extra tweaks for some chipsets */
extern void bttv_check_chipset(void);