summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/firesat/firesat_1394.c
diff options
context:
space:
mode:
authorBen Backx <ben@bbackx.com>2008-06-22 16:00:53 +0200
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-02-24 14:51:25 +0100
commitf1bbb43a667067f24a729df78dc050348b1c7846 (patch)
tree8d589d5f7f5dacfc0779583d6eaeb55be7848652 /drivers/media/dvb/firesat/firesat_1394.c
parentc81c8b68b46752721b0c1addfabb828da27e1489 (diff)
downloadtalos-obmc-linux-f1bbb43a667067f24a729df78dc050348b1c7846.tar.gz
talos-obmc-linux-f1bbb43a667067f24a729df78dc050348b1c7846.zip
firesat: fix DVB-S2 device recognition
This only makes sure that a DVB-S2 device is really recognized as a S2, nothing else is added yet. It's using the string containing the model that is stored in the configuration ROM, the older version was using some hardware revision dependent part of the ROM. Signed-off-by: Ben Backx <ben@bbackx.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/media/dvb/firesat/firesat_1394.c')
-rw-r--r--drivers/media/dvb/firesat/firesat_1394.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/media/dvb/firesat/firesat_1394.c b/drivers/media/dvb/firesat/firesat_1394.c
index c7ccf633c24b..dcac70a2991e 100644
--- a/drivers/media/dvb/firesat/firesat_1394.c
+++ b/drivers/media/dvb/firesat/firesat_1394.c
@@ -263,6 +263,8 @@ static int firesat_probe(struct device *dev)
int result;
unsigned char subunitcount = 0xff, subunit;
struct firesat **firesats = kmalloc(sizeof (void*) * 2,GFP_KERNEL);
+ int kv_len;
+ char *kv_buf;
if (!firesats) {
printk("%s: couldn't allocate memory.\n", __func__);
@@ -329,6 +331,32 @@ static int firesat_probe(struct device *dev)
firesat->subunit = subunit;
+ /* Reading device model from ROM */
+ kv_len = (ud->model_name_kv->value.leaf.len - 2) *
+ sizeof(quadlet_t);
+ kv_buf = kmalloc((sizeof(quadlet_t) * kv_len), GFP_KERNEL);
+ memcpy(kv_buf,
+ CSR1212_TEXTUAL_DESCRIPTOR_LEAF_DATA(ud->model_name_kv),
+ kv_len);
+ while ((kv_buf + kv_len - 1) == '\0') kv_len--;
+ kv_buf[kv_len++] = '\0';
+
+ /* Determining the device model */
+ if (strcmp(kv_buf, "FireDTV S/CI") == 0) {
+ printk(KERN_INFO "%s: found DVB/S\n", __func__);
+ firesat->type = 1;
+ } else if (strcmp(kv_buf, "FireDTV C/CI") == 0) {
+ printk(KERN_INFO "%s: found DVB/C\n", __func__);
+ firesat->type = 2;
+ } else if (strcmp(kv_buf, "FireDTV T/CI") == 0) {
+ printk(KERN_INFO "%s: found DVB/T\n", __func__);
+ firesat->type = 3;
+ } else if (strcmp(kv_buf, "FireDTV S2 ") == 0) {
+ printk(KERN_INFO "%s: found DVB/S2\n", __func__);
+ firesat->type = 4;
+ }
+ kfree(kv_buf);
+
if (AVCIdentifySubunit(firesat, NULL, (int*)&firesat->type, &firesat->has_ci)) {
printk("%s: cannot identify subunit %d\n", __func__, subunit);
spin_lock_irqsave(&firesat_list_lock, flags);
OpenPOWER on IntegriCloud