lgdt3306a.c (534f4364f9baa14c8c1431c0584cf5a291d09d3c) lgdt3306a.c (95f22c5aaed3415ff4a2df6a1ff76b3127123430)
1/*
2 * Support for LGDT3306A - 8VSB/QAM-B
3 *
4 * Copyright (C) 2013 Fred Richter <frichter@hauppauge.com>
5 * - driver structure based on lgdt3305.[ch] by Michael Krufky
6 * - code based on LG3306_V0.35 API by LG Electronics Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 53 unchanged lines hidden (view full) ---

62
63 struct dvb_frontend frontend;
64
65 fe_modulation_t current_modulation;
66 u32 current_frequency;
67 u32 snr;
68};
69
1/*
2 * Support for LGDT3306A - 8VSB/QAM-B
3 *
4 * Copyright (C) 2013 Fred Richter <frichter@hauppauge.com>
5 * - driver structure based on lgdt3305.[ch] by Michael Krufky
6 * - code based on LG3306_V0.35 API by LG Electronics Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 53 unchanged lines hidden (view full) ---

62
63 struct dvb_frontend frontend;
64
65 fe_modulation_t current_modulation;
66 u32 current_frequency;
67 u32 snr;
68};
69
70/* -----------------------------------------------
71 LG3306A Register Usage
72 (LG does not really name the registers, so this code does not either)
73 0000 -> 00FF Common control and status
74 1000 -> 10FF Synchronizer control and status
75 1F00 -> 1FFF Smart Antenna control and status
76 2100 -> 21FF VSB Equalizer control and status
77 2800 -> 28FF QAM Equalizer control and status
78 3000 -> 30FF FEC control and status
79 ---------------------------------------------- */
70/*
71 * LG3306A Register Usage
72 * (LG does not really name the registers, so this code does not either)
73 *
74 * 0000 -> 00FF Common control and status
75 * 1000 -> 10FF Synchronizer control and status
76 * 1F00 -> 1FFF Smart Antenna control and status
77 * 2100 -> 21FF VSB Equalizer control and status
78 * 2800 -> 28FF QAM Equalizer control and status
79 * 3000 -> 30FF FEC control and status
80 */
80
81enum lgdt3306a_lock_status {
82 LG3306_UNLOCK = 0x00,
83 LG3306_LOCK = 0x01,
84 LG3306_UNKNOWN_LOCK = 0xff
85};
86
87enum lgdt3306a_neverlock_status {

--- 1338 unchanged lines hidden (view full) ---

1426
1427 return val;
1428}
1429
1430static const u32 valx_x10[] = {
1431 10, 11, 13, 15, 17, 20, 25, 33, 41, 50, 59, 73, 87, 100
1432};
1433static const u32 log10x_x1000[] = {
81
82enum lgdt3306a_lock_status {
83 LG3306_UNLOCK = 0x00,
84 LG3306_LOCK = 0x01,
85 LG3306_UNKNOWN_LOCK = 0xff
86};
87
88enum lgdt3306a_neverlock_status {

--- 1338 unchanged lines hidden (view full) ---

1427
1428 return val;
1429}
1430
1431static const u32 valx_x10[] = {
1432 10, 11, 13, 15, 17, 20, 25, 33, 41, 50, 59, 73, 87, 100
1433};
1434static const u32 log10x_x1000[] = {
1434 0, 41, 114, 176, 230, 301, 398, 518, 613, 699, 771, 863, 939, 1000
1435 0, 41, 114, 176, 230, 301, 398, 518, 613, 699, 771, 863, 939, 1000
1435};
1436
1437static u32 log10_x1000(u32 x)
1438{
1439 u32 diff_val, step_val, step_log10;
1440 u32 log_val = 0;
1441 u32 i;
1442

--- 665 unchanged lines hidden (view full) ---

2108#endif /* DBG_DUMP */
2109
2110
2111
2112static struct dvb_frontend_ops lgdt3306a_ops = {
2113 .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
2114 .info = {
2115 .name = "LG Electronics LGDT3306A VSB/QAM Frontend",
1436};
1437
1438static u32 log10_x1000(u32 x)
1439{
1440 u32 diff_val, step_val, step_log10;
1441 u32 log_val = 0;
1442 u32 i;
1443

--- 665 unchanged lines hidden (view full) ---

2109#endif /* DBG_DUMP */
2110
2111
2112
2113static struct dvb_frontend_ops lgdt3306a_ops = {
2114 .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
2115 .info = {
2116 .name = "LG Electronics LGDT3306A VSB/QAM Frontend",
2116#if 0
2117 .type = FE_ATSC,
2118#endif
2119 .frequency_min = 54000000,
2120 .frequency_max = 858000000,
2121 .frequency_stepsize = 62500,
2122 .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
2123 },
2124 .i2c_gate_ctrl = lgdt3306a_i2c_gate_ctrl,
2125 .init = lgdt3306a_init,
2126 .sleep = lgdt3306a_fe_sleep,

--- 12 unchanged lines hidden (view full) ---

2139 .ts_bus_ctrl = lgdt3306a_ts_bus_ctrl,
2140 .search = lgdt3306a_search,
2141};
2142
2143MODULE_DESCRIPTION("LG Electronics LGDT3306A ATSC/QAM-B Demodulator Driver");
2144MODULE_AUTHOR("Fred Richter <frichter@hauppauge.com>");
2145MODULE_LICENSE("GPL");
2146MODULE_VERSION("0.2");
2117 .frequency_min = 54000000,
2118 .frequency_max = 858000000,
2119 .frequency_stepsize = 62500,
2120 .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
2121 },
2122 .i2c_gate_ctrl = lgdt3306a_i2c_gate_ctrl,
2123 .init = lgdt3306a_init,
2124 .sleep = lgdt3306a_fe_sleep,

--- 12 unchanged lines hidden (view full) ---

2137 .ts_bus_ctrl = lgdt3306a_ts_bus_ctrl,
2138 .search = lgdt3306a_search,
2139};
2140
2141MODULE_DESCRIPTION("LG Electronics LGDT3306A ATSC/QAM-B Demodulator Driver");
2142MODULE_AUTHOR("Fred Richter <frichter@hauppauge.com>");
2143MODULE_LICENSE("GPL");
2144MODULE_VERSION("0.2");
2147
2148/*
2149 * Local variables:
2150 * c-basic-offset: 8
2151 * End:
2152 */