diff options
Diffstat (limited to 'drivers/staging/media/as102')
-rw-r--r-- | drivers/staging/media/as102/as102_drv.c | 2 | ||||
-rw-r--r-- | drivers/staging/media/as102/as102_drv.h | 2 | ||||
-rw-r--r-- | drivers/staging/media/as102/as102_fe.c | 6 | ||||
-rw-r--r-- | drivers/staging/media/as102/as102_fw.h | 2 | ||||
-rw-r--r-- | drivers/staging/media/as102/as102_usb_drv.c | 17 | ||||
-rw-r--r-- | drivers/staging/media/as102/as10x_cmd.h | 80 | ||||
-rw-r--r-- | drivers/staging/media/as102/as10x_types.h | 2 |
7 files changed, 63 insertions, 48 deletions
diff --git a/drivers/staging/media/as102/as102_drv.c b/drivers/staging/media/as102/as102_drv.c index aae0505a36c4..ea4f992de235 100644 --- a/drivers/staging/media/as102/as102_drv.c +++ b/drivers/staging/media/as102/as102_drv.c @@ -27,7 +27,7 @@ #include <linux/uaccess.h> #include <linux/usb.h> -/* header file for Usb device driver*/ +/* header file for usb device driver*/ #include "as102_drv.h" #include "as102_fw.h" #include "dvbdev.h" diff --git a/drivers/staging/media/as102/as102_drv.h b/drivers/staging/media/as102/as102_drv.h index 957f0ed0d81a..b0e5a23bd532 100644 --- a/drivers/staging/media/as102/as102_drv.h +++ b/drivers/staging/media/as102/as102_drv.h @@ -76,7 +76,7 @@ struct as102_dev_t { struct as10x_bus_adapter_t bus_adap; struct list_head device_entry; struct kref kref; - unsigned long minor; + uint8_t elna_cfg; struct dvb_adapter dvb_adap; struct dvb_frontend dvb_fe; diff --git a/drivers/staging/media/as102/as102_fe.c b/drivers/staging/media/as102/as102_fe.c index bdc5a38cddf7..5917657b9d0f 100644 --- a/drivers/staging/media/as102/as102_fe.c +++ b/drivers/staging/media/as102/as102_fe.c @@ -265,7 +265,7 @@ static int as102_fe_ts_bus_ctrl(struct dvb_frontend *fe, int acquire) if (acquire) { if (elna_enable) - as10x_cmd_set_context(&dev->bus_adap, 1010, 0xC0); + as10x_cmd_set_context(&dev->bus_adap, CONTEXT_LNA, dev->elna_cfg); ret = as10x_cmd_turn_on(&dev->bus_adap); } else { @@ -337,7 +337,7 @@ int as102_dvb_register_fe(struct as102_dev_t *as102_dev, strncpy(dvb_fe->ops.info.name, as102_dev->name, sizeof(dvb_fe->ops.info.name)); - /* register dbvb frontend */ + /* register dvb frontend */ errno = dvb_register_frontend(dvb_adap, dvb_fe); if (errno == 0) dvb_fe->tuner_priv = as102_dev; @@ -349,7 +349,7 @@ static void as10x_fe_copy_tps_parameters(struct dtv_frontend_properties *fe_tps, struct as10x_tps *as10x_tps) { - /* extract consteallation */ + /* extract constellation */ switch (as10x_tps->modulation) { case CONST_QPSK: fe_tps->modulation = QPSK; diff --git a/drivers/staging/media/as102/as102_fw.h b/drivers/staging/media/as102/as102_fw.h index bd21f0554392..4bfc6849d95a 100644 --- a/drivers/staging/media/as102/as102_fw.h +++ b/drivers/staging/media/as102/as102_fw.h @@ -29,7 +29,7 @@ struct as10x_fw_pkt_t { union { unsigned char request[2]; unsigned char length[2]; - } u; + } __packed u; struct as10x_raw_fw_pkt raw; } __packed; diff --git a/drivers/staging/media/as102/as102_usb_drv.c b/drivers/staging/media/as102/as102_usb_drv.c index d775be0173ea..0f6bfe7eccba 100644 --- a/drivers/staging/media/as102/as102_usb_drv.c +++ b/drivers/staging/media/as102/as102_usb_drv.c @@ -57,6 +57,17 @@ static const char * const as102_device_names[] = { NULL /* Terminating entry */ }; +/* eLNA configuration: devices built on the reference design work best + with 0xA0, while custom designs seem to require 0xC0 */ +static uint8_t const as102_elna_cfg[] = { + 0xA0, + 0xC0, + 0xC0, + 0xA0, + 0xA0, + 0x00 /* Terminating entry */ +}; + struct usb_driver as102_usb_driver = { .name = DRIVER_FULL_NAME, .probe = as102_usb_probe, @@ -270,6 +281,8 @@ static int as102_alloc_usb_stream_buffer(struct as102_dev_t *dev) } urb->transfer_buffer = dev->stream + (i * AS102_USB_BUF_SIZE); + urb->transfer_dma = dev->dma_addr + (i * AS102_USB_BUF_SIZE); + urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; urb->transfer_buffer_length = AS102_USB_BUF_SIZE; dev->stream_urb[i] = urb; @@ -369,8 +382,10 @@ static int as102_usb_probe(struct usb_interface *intf, /* Assign the user-friendly device name */ for (i = 0; i < (sizeof(as102_usb_id_table) / sizeof(struct usb_device_id)); i++) { - if (id == &as102_usb_id_table[i]) + if (id == &as102_usb_id_table[i]) { as102_dev->name = as102_device_names[i]; + as102_dev->elna_cfg = as102_elna_cfg[i]; + } } if (as102_dev->name == NULL) diff --git a/drivers/staging/media/as102/as10x_cmd.h b/drivers/staging/media/as102/as10x_cmd.h index 4ea249e7adab..e21ec6c702a9 100644 --- a/drivers/staging/media/as102/as10x_cmd.h +++ b/drivers/staging/media/as102/as10x_cmd.h @@ -99,14 +99,14 @@ union as10x_turn_on { struct { /* request identifier */ uint16_t proc_id; - } req; + } __packed req; /* response */ struct { /* response identifier */ uint16_t proc_id; /* error */ uint8_t error; - } rsp; + } __packed rsp; } __packed; union as10x_turn_off { @@ -114,14 +114,14 @@ union as10x_turn_off { struct { /* request identifier */ uint16_t proc_id; - } req; + } __packed req; /* response */ struct { /* response identifier */ uint16_t proc_id; /* error */ uint8_t err; - } rsp; + } __packed rsp; } __packed; union as10x_set_tune { @@ -131,14 +131,14 @@ union as10x_set_tune { uint16_t proc_id; /* tune params */ struct as10x_tune_args args; - } req; + } __packed req; /* response */ struct { /* response identifier */ uint16_t proc_id; /* response error */ uint8_t error; - } rsp; + } __packed rsp; } __packed; union as10x_get_tune_status { @@ -146,7 +146,7 @@ union as10x_get_tune_status { struct { /* request identifier */ uint16_t proc_id; - } req; + } __packed req; /* response */ struct { /* response identifier */ @@ -155,7 +155,7 @@ union as10x_get_tune_status { uint8_t error; /* tune status */ struct as10x_tune_status sts; - } rsp; + } __packed rsp; } __packed; union as10x_get_tps { @@ -163,7 +163,7 @@ union as10x_get_tps { struct { /* request identifier */ uint16_t proc_id; - } req; + } __packed req; /* response */ struct { /* response identifier */ @@ -172,7 +172,7 @@ union as10x_get_tps { uint8_t error; /* tps details */ struct as10x_tps tps; - } rsp; + } __packed rsp; } __packed; union as10x_common { @@ -180,14 +180,14 @@ union as10x_common { struct { /* request identifier */ uint16_t proc_id; - } req; + } __packed req; /* response */ struct { /* response identifier */ uint16_t proc_id; /* response error */ uint8_t error; - } rsp; + } __packed rsp; } __packed; union as10x_add_pid_filter { @@ -201,7 +201,7 @@ union as10x_add_pid_filter { uint8_t stream_type; /* PID index in filter table */ uint8_t idx; - } req; + } __packed req; /* response */ struct { /* response identifier */ @@ -210,7 +210,7 @@ union as10x_add_pid_filter { uint8_t error; /* Filter id */ uint8_t filter_id; - } rsp; + } __packed rsp; } __packed; union as10x_del_pid_filter { @@ -220,14 +220,14 @@ union as10x_del_pid_filter { uint16_t proc_id; /* PID to remove */ uint16_t pid; - } req; + } __packed req; /* response */ struct { /* response identifier */ uint16_t proc_id; /* response error */ uint8_t error; - } rsp; + } __packed rsp; } __packed; union as10x_start_streaming { @@ -235,14 +235,14 @@ union as10x_start_streaming { struct { /* request identifier */ uint16_t proc_id; - } req; + } __packed req; /* response */ struct { /* response identifier */ uint16_t proc_id; /* error */ uint8_t error; - } rsp; + } __packed rsp; } __packed; union as10x_stop_streaming { @@ -250,14 +250,14 @@ union as10x_stop_streaming { struct { /* request identifier */ uint16_t proc_id; - } req; + } __packed req; /* response */ struct { /* response identifier */ uint16_t proc_id; /* error */ uint8_t error; - } rsp; + } __packed rsp; } __packed; union as10x_get_demod_stats { @@ -265,7 +265,7 @@ union as10x_get_demod_stats { struct { /* request identifier */ uint16_t proc_id; - } req; + } __packed req; /* response */ struct { /* response identifier */ @@ -274,7 +274,7 @@ union as10x_get_demod_stats { uint8_t error; /* demod stats */ struct as10x_demod_stats stats; - } rsp; + } __packed rsp; } __packed; union as10x_get_impulse_resp { @@ -282,7 +282,7 @@ union as10x_get_impulse_resp { struct { /* request identifier */ uint16_t proc_id; - } req; + } __packed req; /* response */ struct { /* response identifier */ @@ -291,7 +291,7 @@ union as10x_get_impulse_resp { uint8_t error; /* impulse response ready */ uint8_t is_ready; - } rsp; + } __packed rsp; } __packed; union as10x_fw_context { @@ -305,7 +305,7 @@ union as10x_fw_context { uint16_t tag; /* context request type */ uint16_t type; - } req; + } __packed req; /* response */ struct { /* response identifier */ @@ -316,7 +316,7 @@ union as10x_fw_context { uint16_t type; /* error */ uint8_t error; - } rsp; + } __packed rsp; } __packed; union as10x_set_register { @@ -328,14 +328,14 @@ union as10x_set_register { struct as10x_register_addr reg_addr; /* register content */ struct as10x_register_value reg_val; - } req; + } __packed req; /* response */ struct { /* response identifier */ uint16_t proc_id; /* error */ uint8_t error; - } rsp; + } __packed rsp; } __packed; union as10x_get_register { @@ -345,7 +345,7 @@ union as10x_get_register { uint16_t proc_id; /* register description */ struct as10x_register_addr reg_addr; - } req; + } __packed req; /* response */ struct { /* response identifier */ @@ -354,7 +354,7 @@ union as10x_get_register { uint8_t error; /* register content */ struct as10x_register_value reg_val; - } rsp; + } __packed rsp; } __packed; union as10x_cfg_change_mode { @@ -364,14 +364,14 @@ union as10x_cfg_change_mode { uint16_t proc_id; /* mode */ uint8_t mode; - } req; + } __packed req; /* response */ struct { /* response identifier */ uint16_t proc_id; /* error */ uint8_t error; - } rsp; + } __packed rsp; } __packed; struct as10x_cmd_header_t { @@ -394,7 +394,7 @@ union as10x_dump_memory { struct as10x_register_addr reg_addr; /* nb blocks to read */ uint16_t num_blocks; - } req; + } __packed req; /* response */ struct { /* response identifier */ @@ -408,8 +408,8 @@ union as10x_dump_memory { uint8_t data8[DUMP_BLOCK_SIZE]; uint16_t data16[DUMP_BLOCK_SIZE / sizeof(uint16_t)]; uint32_t data32[DUMP_BLOCK_SIZE / sizeof(uint32_t)]; - } u; - } rsp; + } __packed u; + } __packed rsp; } __packed; union as10x_dumplog_memory { @@ -418,7 +418,7 @@ union as10x_dumplog_memory { uint16_t proc_id; /* dump memory type request */ uint8_t dump_req; - } req; + } __packed req; struct { /* request identifier */ uint16_t proc_id; @@ -428,7 +428,7 @@ union as10x_dumplog_memory { uint8_t dump_rsp; /* dump data */ uint8_t data[DUMP_BLOCK_SIZE]; - } rsp; + } __packed rsp; } __packed; union as10x_raw_data { @@ -437,14 +437,14 @@ union as10x_raw_data { uint16_t proc_id; uint8_t data[64 - sizeof(struct as10x_cmd_header_t) - 2 /* proc_id */]; - } req; + } __packed req; /* response */ struct { uint16_t proc_id; uint8_t error; uint8_t data[64 - sizeof(struct as10x_cmd_header_t) - 2 /* proc_id */ - 1 /* rc */]; - } rsp; + } __packed rsp; } __packed; struct as10x_cmd_t { @@ -469,7 +469,7 @@ struct as10x_cmd_t { union as10x_dump_memory dump_memory; union as10x_dumplog_memory dumplog_memory; union as10x_raw_data raw_data; - } body; + } __packed body; } __packed; struct as10x_token_cmd_t { diff --git a/drivers/staging/media/as102/as10x_types.h b/drivers/staging/media/as102/as10x_types.h index fde8140ae88b..af26e057d9a2 100644 --- a/drivers/staging/media/as102/as10x_types.h +++ b/drivers/staging/media/as102/as10x_types.h @@ -181,7 +181,7 @@ struct as10x_register_value { uint8_t value8; /* 8 bit value */ uint16_t value16; /* 16 bit value */ uint32_t value32; /* 32 bit value */ - } u; + } __packed u; } __packed; struct as10x_register_addr { |