diff options
-rw-r--r-- | linux/drivers/media/dvb/frontends/mt312.c | 13 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/mt312.h | 5 |
2 files changed, 13 insertions, 5 deletions
diff --git a/linux/drivers/media/dvb/frontends/mt312.c b/linux/drivers/media/dvb/frontends/mt312.c index 9f9b6736e..9ea6c2ccd 100644 --- a/linux/drivers/media/dvb/frontends/mt312.c +++ b/linux/drivers/media/dvb/frontends/mt312.c @@ -149,8 +149,8 @@ int mt312_pll_write(struct dvb_i2c_bus *i2c, const u8 addr, u8 *buf, const u8 le msg.addr = addr; msg.flags = 0; - msg.buf = buf; - msg.len = len; + msg.buf = buf; + msg.len = len; if ((ret = mt312_writereg(i2c, GPP_CTRL, 0x40)) < 0) return ret; @@ -613,7 +613,10 @@ int mt312_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg) return mt312_send_master_cmd(i2c, arg); case FE_DISEQC_RECV_SLAVE_REPLY: - return mt312_recv_slave_reply(i2c, arg); + if ((long)fe->data == ID_MT312) + return mt312_recv_slave_reply(i2c, arg); + else + return -EOPNOTSUPP; case FE_DISEQC_SEND_BURST: return mt312_send_burst(i2c, (fe_sec_mini_cmd_t) arg); @@ -676,10 +679,10 @@ int mt312_attach(struct dvb_i2c_bus *i2c) if ((ret = mt312_readreg(i2c, ID, &id)) < 0) return ret; - if (id != 0x03) + if ((id != ID_VP310) && (id != ID_MT312)) return -ENODEV; - return dvb_register_frontend(mt312_ioctl, i2c, NULL, &mt312_info); + return dvb_register_frontend(mt312_ioctl, i2c, (void *)(long)id, &mt312_info); } static diff --git a/linux/drivers/media/dvb/frontends/mt312.h b/linux/drivers/media/dvb/frontends/mt312.h index d39bcecd3..46e8c501d 100644 --- a/linux/drivers/media/dvb/frontends/mt312.h +++ b/linux/drivers/media/dvb/frontends/mt312.h @@ -154,4 +154,9 @@ typedef enum mt312_reg_addr { CONFIG = 127 } mt312_reg_addr_t; +enum mt312_model_id { + ID_VP310 = 1, + ID_MT312 = 3 +}; + #endif /* DVB_FRONTENDS_MT312 */ |