or51132.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Support for OR51132 (pcHDTV HD-3000) - VSB/QAM
  4. *
  5. * Copyright (C) 2007 Trent Piepho <[email protected]>
  6. *
  7. * Copyright (C) 2005 Kirk Lapray <[email protected]>
  8. *
  9. * Based on code from Jack Kelliher ([email protected])
  10. * Copyright (C) 2002 & pcHDTV, inc.
  11. */
  12. /*
  13. * This driver needs two external firmware files. Please copy
  14. * "dvb-fe-or51132-vsb.fw" and "dvb-fe-or51132-qam.fw" to
  15. * /usr/lib/hotplug/firmware/ or /lib/firmware/
  16. * (depending on configuration of firmware hotplug).
  17. */
  18. #define OR51132_VSB_FIRMWARE "dvb-fe-or51132-vsb.fw"
  19. #define OR51132_QAM_FIRMWARE "dvb-fe-or51132-qam.fw"
  20. #include <linux/kernel.h>
  21. #include <linux/module.h>
  22. #include <linux/init.h>
  23. #include <linux/delay.h>
  24. #include <linux/string.h>
  25. #include <linux/slab.h>
  26. #include <asm/byteorder.h>
  27. #include <media/dvb_math.h>
  28. #include <media/dvb_frontend.h>
  29. #include "or51132.h"
  30. static int debug;
  31. #define dprintk(args...) \
  32. do { \
  33. if (debug) printk(KERN_DEBUG "or51132: " args); \
  34. } while (0)
  35. struct or51132_state
  36. {
  37. struct i2c_adapter* i2c;
  38. /* Configuration settings */
  39. const struct or51132_config* config;
  40. struct dvb_frontend frontend;
  41. /* Demodulator private data */
  42. enum fe_modulation current_modulation;
  43. u32 snr; /* Result of last SNR calculation */
  44. /* Tuner private data */
  45. u32 current_frequency;
  46. };
  47. /* Write buffer to demod */
  48. static int or51132_writebuf(struct or51132_state *state, const u8 *buf, int len)
  49. {
  50. int err;
  51. struct i2c_msg msg = { .addr = state->config->demod_address,
  52. .flags = 0, .buf = (u8*)buf, .len = len };
  53. /* msleep(20); */ /* doesn't appear to be necessary */
  54. if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
  55. printk(KERN_WARNING "or51132: I2C write (addr 0x%02x len %d) error: %d\n",
  56. msg.addr, msg.len, err);
  57. return -EREMOTEIO;
  58. }
  59. return 0;
  60. }
  61. /* Write constant bytes, e.g. or51132_writebytes(state, 0x04, 0x42, 0x00);
  62. Less code and more efficient that loading a buffer on the stack with
  63. the bytes to send and then calling or51132_writebuf() on that. */
  64. #define or51132_writebytes(state, data...) \
  65. ({ static const u8 _data[] = {data}; \
  66. or51132_writebuf(state, _data, sizeof(_data)); })
  67. /* Read data from demod into buffer. Returns 0 on success. */
  68. static int or51132_readbuf(struct or51132_state *state, u8 *buf, int len)
  69. {
  70. int err;
  71. struct i2c_msg msg = { .addr = state->config->demod_address,
  72. .flags = I2C_M_RD, .buf = buf, .len = len };
  73. /* msleep(20); */ /* doesn't appear to be necessary */
  74. if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
  75. printk(KERN_WARNING "or51132: I2C read (addr 0x%02x len %d) error: %d\n",
  76. msg.addr, msg.len, err);
  77. return -EREMOTEIO;
  78. }
  79. return 0;
  80. }
  81. /* Reads a 16-bit demod register. Returns <0 on error. */
  82. static int or51132_readreg(struct or51132_state *state, u8 reg)
  83. {
  84. u8 buf[2] = { 0x04, reg };
  85. struct i2c_msg msg[2] = {
  86. {.addr = state->config->demod_address, .flags = 0,
  87. .buf = buf, .len = 2 },
  88. {.addr = state->config->demod_address, .flags = I2C_M_RD,
  89. .buf = buf, .len = 2 }};
  90. int err;
  91. if ((err = i2c_transfer(state->i2c, msg, 2)) != 2) {
  92. printk(KERN_WARNING "or51132: I2C error reading register %d: %d\n",
  93. reg, err);
  94. return -EREMOTEIO;
  95. }
  96. return buf[0] | (buf[1] << 8);
  97. }
  98. static int or51132_load_firmware (struct dvb_frontend* fe, const struct firmware *fw)
  99. {
  100. struct or51132_state* state = fe->demodulator_priv;
  101. static const u8 run_buf[] = {0x7F,0x01};
  102. u8 rec_buf[8];
  103. u32 firmwareAsize, firmwareBsize;
  104. int i,ret;
  105. dprintk("Firmware is %zd bytes\n",fw->size);
  106. /* Get size of firmware A and B */
  107. firmwareAsize = le32_to_cpu(*((__le32*)fw->data));
  108. dprintk("FirmwareA is %i bytes\n",firmwareAsize);
  109. firmwareBsize = le32_to_cpu(*((__le32*)(fw->data+4)));
  110. dprintk("FirmwareB is %i bytes\n",firmwareBsize);
  111. /* Upload firmware */
  112. if ((ret = or51132_writebuf(state, &fw->data[8], firmwareAsize))) {
  113. printk(KERN_WARNING "or51132: load_firmware error 1\n");
  114. return ret;
  115. }
  116. if ((ret = or51132_writebuf(state, &fw->data[8+firmwareAsize],
  117. firmwareBsize))) {
  118. printk(KERN_WARNING "or51132: load_firmware error 2\n");
  119. return ret;
  120. }
  121. if ((ret = or51132_writebuf(state, run_buf, 2))) {
  122. printk(KERN_WARNING "or51132: load_firmware error 3\n");
  123. return ret;
  124. }
  125. if ((ret = or51132_writebuf(state, run_buf, 2))) {
  126. printk(KERN_WARNING "or51132: load_firmware error 4\n");
  127. return ret;
  128. }
  129. /* 50ms for operation to begin */
  130. msleep(50);
  131. /* Read back ucode version to besure we loaded correctly and are really up and running */
  132. /* Get uCode version */
  133. if ((ret = or51132_writebytes(state, 0x10, 0x10, 0x00))) {
  134. printk(KERN_WARNING "or51132: load_firmware error a\n");
  135. return ret;
  136. }
  137. if ((ret = or51132_writebytes(state, 0x04, 0x17))) {
  138. printk(KERN_WARNING "or51132: load_firmware error b\n");
  139. return ret;
  140. }
  141. if ((ret = or51132_writebytes(state, 0x00, 0x00))) {
  142. printk(KERN_WARNING "or51132: load_firmware error c\n");
  143. return ret;
  144. }
  145. for (i=0;i<4;i++) {
  146. /* Once upon a time, this command might have had something
  147. to do with getting the firmware version, but it's
  148. not used anymore:
  149. {0x04,0x00,0x30,0x00,i+1} */
  150. /* Read 8 bytes, two bytes at a time */
  151. if ((ret = or51132_readbuf(state, &rec_buf[i*2], 2))) {
  152. printk(KERN_WARNING
  153. "or51132: load_firmware error d - %d\n",i);
  154. return ret;
  155. }
  156. }
  157. printk(KERN_WARNING
  158. "or51132: Version: %02X%02X%02X%02X-%02X%02X%02X%02X (%02X%01X-%01X-%02X%01X-%01X)\n",
  159. rec_buf[1],rec_buf[0],rec_buf[3],rec_buf[2],
  160. rec_buf[5],rec_buf[4],rec_buf[7],rec_buf[6],
  161. rec_buf[3],rec_buf[2]>>4,rec_buf[2]&0x0f,
  162. rec_buf[5],rec_buf[4]>>4,rec_buf[4]&0x0f);
  163. if ((ret = or51132_writebytes(state, 0x10, 0x00, 0x00))) {
  164. printk(KERN_WARNING "or51132: load_firmware error e\n");
  165. return ret;
  166. }
  167. return 0;
  168. };
  169. static int or51132_init(struct dvb_frontend* fe)
  170. {
  171. return 0;
  172. }
  173. static int or51132_read_ber(struct dvb_frontend* fe, u32* ber)
  174. {
  175. *ber = 0;
  176. return 0;
  177. }
  178. static int or51132_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
  179. {
  180. *ucblocks = 0;
  181. return 0;
  182. }
  183. static int or51132_sleep(struct dvb_frontend* fe)
  184. {
  185. return 0;
  186. }
  187. static int or51132_setmode(struct dvb_frontend* fe)
  188. {
  189. struct or51132_state* state = fe->demodulator_priv;
  190. u8 cmd_buf1[3] = {0x04, 0x01, 0x5f};
  191. u8 cmd_buf2[3] = {0x1c, 0x00, 0 };
  192. dprintk("setmode %d\n",(int)state->current_modulation);
  193. switch (state->current_modulation) {
  194. case VSB_8:
  195. /* Auto CH, Auto NTSC rej, MPEGser, MPEG2tr, phase noise-high */
  196. cmd_buf1[2] = 0x50;
  197. /* REC MODE inv IF spectrum, Normal */
  198. cmd_buf2[1] = 0x03;
  199. /* Channel MODE ATSC/VSB8 */
  200. cmd_buf2[2] = 0x06;
  201. break;
  202. /* All QAM modes are:
  203. Auto-deinterleave; MPEGser, MPEG2tr, phase noise-high
  204. REC MODE Normal Carrier Lock */
  205. case QAM_AUTO:
  206. /* Channel MODE Auto QAM64/256 */
  207. cmd_buf2[2] = 0x4f;
  208. break;
  209. case QAM_256:
  210. /* Channel MODE QAM256 */
  211. cmd_buf2[2] = 0x45;
  212. break;
  213. case QAM_64:
  214. /* Channel MODE QAM64 */
  215. cmd_buf2[2] = 0x43;
  216. break;
  217. default:
  218. printk(KERN_WARNING
  219. "or51132: setmode: Modulation set to unsupported value (%d)\n",
  220. state->current_modulation);
  221. return -EINVAL;
  222. }
  223. /* Set Receiver 1 register */
  224. if (or51132_writebuf(state, cmd_buf1, 3)) {
  225. printk(KERN_WARNING "or51132: set_mode error 1\n");
  226. return -EREMOTEIO;
  227. }
  228. dprintk("set #1 to %02x\n", cmd_buf1[2]);
  229. /* Set operation mode in Receiver 6 register */
  230. if (or51132_writebuf(state, cmd_buf2, 3)) {
  231. printk(KERN_WARNING "or51132: set_mode error 2\n");
  232. return -EREMOTEIO;
  233. }
  234. dprintk("set #6 to 0x%02x%02x\n", cmd_buf2[1], cmd_buf2[2]);
  235. return 0;
  236. }
  237. /* Some modulations use the same firmware. This classifies modulations
  238. by the firmware they use. */
  239. #define MOD_FWCLASS_UNKNOWN 0
  240. #define MOD_FWCLASS_VSB 1
  241. #define MOD_FWCLASS_QAM 2
  242. static int modulation_fw_class(enum fe_modulation modulation)
  243. {
  244. switch(modulation) {
  245. case VSB_8:
  246. return MOD_FWCLASS_VSB;
  247. case QAM_AUTO:
  248. case QAM_64:
  249. case QAM_256:
  250. return MOD_FWCLASS_QAM;
  251. default:
  252. return MOD_FWCLASS_UNKNOWN;
  253. }
  254. }
  255. static int or51132_set_parameters(struct dvb_frontend *fe)
  256. {
  257. struct dtv_frontend_properties *p = &fe->dtv_property_cache;
  258. int ret;
  259. struct or51132_state* state = fe->demodulator_priv;
  260. const struct firmware *fw;
  261. const char *fwname;
  262. int clock_mode;
  263. /* Upload new firmware only if we need a different one */
  264. if (modulation_fw_class(state->current_modulation) !=
  265. modulation_fw_class(p->modulation)) {
  266. switch (modulation_fw_class(p->modulation)) {
  267. case MOD_FWCLASS_VSB:
  268. dprintk("set_parameters VSB MODE\n");
  269. fwname = OR51132_VSB_FIRMWARE;
  270. /* Set non-punctured clock for VSB */
  271. clock_mode = 0;
  272. break;
  273. case MOD_FWCLASS_QAM:
  274. dprintk("set_parameters QAM MODE\n");
  275. fwname = OR51132_QAM_FIRMWARE;
  276. /* Set punctured clock for QAM */
  277. clock_mode = 1;
  278. break;
  279. default:
  280. printk("or51132: Modulation type(%d) UNSUPPORTED\n",
  281. p->modulation);
  282. return -1;
  283. }
  284. printk("or51132: Waiting for firmware upload(%s)...\n",
  285. fwname);
  286. ret = request_firmware(&fw, fwname, state->i2c->dev.parent);
  287. if (ret) {
  288. printk(KERN_WARNING "or51132: No firmware uploaded(timeout or file not found?)\n");
  289. return ret;
  290. }
  291. ret = or51132_load_firmware(fe, fw);
  292. release_firmware(fw);
  293. if (ret) {
  294. printk(KERN_WARNING "or51132: Writing firmware to device failed!\n");
  295. return ret;
  296. }
  297. printk("or51132: Firmware upload complete.\n");
  298. state->config->set_ts_params(fe, clock_mode);
  299. }
  300. /* Change only if we are actually changing the modulation */
  301. if (state->current_modulation != p->modulation) {
  302. state->current_modulation = p->modulation;
  303. or51132_setmode(fe);
  304. }
  305. if (fe->ops.tuner_ops.set_params) {
  306. fe->ops.tuner_ops.set_params(fe);
  307. if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
  308. }
  309. /* Set to current mode */
  310. or51132_setmode(fe);
  311. /* Update current frequency */
  312. state->current_frequency = p->frequency;
  313. return 0;
  314. }
  315. static int or51132_get_parameters(struct dvb_frontend* fe,
  316. struct dtv_frontend_properties *p)
  317. {
  318. struct or51132_state* state = fe->demodulator_priv;
  319. int status;
  320. int retry = 1;
  321. start:
  322. /* Receiver Status */
  323. if ((status = or51132_readreg(state, 0x00)) < 0) {
  324. printk(KERN_WARNING "or51132: get_parameters: error reading receiver status\n");
  325. return -EREMOTEIO;
  326. }
  327. switch(status&0xff) {
  328. case 0x06:
  329. p->modulation = VSB_8;
  330. break;
  331. case 0x43:
  332. p->modulation = QAM_64;
  333. break;
  334. case 0x45:
  335. p->modulation = QAM_256;
  336. break;
  337. default:
  338. if (retry--)
  339. goto start;
  340. printk(KERN_WARNING "or51132: unknown status 0x%02x\n",
  341. status&0xff);
  342. return -EREMOTEIO;
  343. }
  344. /* FIXME: Read frequency from frontend, take AFC into account */
  345. p->frequency = state->current_frequency;
  346. /* FIXME: How to read inversion setting? Receiver 6 register? */
  347. p->inversion = INVERSION_AUTO;
  348. return 0;
  349. }
  350. static int or51132_read_status(struct dvb_frontend *fe, enum fe_status *status)
  351. {
  352. struct or51132_state* state = fe->demodulator_priv;
  353. int reg;
  354. /* Receiver Status */
  355. if ((reg = or51132_readreg(state, 0x00)) < 0) {
  356. printk(KERN_WARNING "or51132: read_status: error reading receiver status: %d\n", reg);
  357. *status = 0;
  358. return -EREMOTEIO;
  359. }
  360. dprintk("%s: read_status %04x\n", __func__, reg);
  361. if (reg & 0x0100) /* Receiver Lock */
  362. *status = FE_HAS_SIGNAL|FE_HAS_CARRIER|FE_HAS_VITERBI|
  363. FE_HAS_SYNC|FE_HAS_LOCK;
  364. else
  365. *status = 0;
  366. return 0;
  367. }
  368. /* Calculate SNR estimation (scaled by 2^24)
  369. 8-VSB SNR and QAM equations from Oren datasheets
  370. For 8-VSB:
  371. SNR[dB] = 10 * log10(897152044.8282 / MSE^2 ) - K
  372. Where K = 0 if NTSC rejection filter is OFF; and
  373. K = 3 if NTSC rejection filter is ON
  374. For QAM64:
  375. SNR[dB] = 10 * log10(897152044.8282 / MSE^2 )
  376. For QAM256:
  377. SNR[dB] = 10 * log10(907832426.314266 / MSE^2 )
  378. We re-write the snr equation as:
  379. SNR * 2^24 = 10*(c - 2*intlog10(MSE))
  380. Where for QAM256, c = log10(907832426.314266) * 2^24
  381. and for 8-VSB and QAM64, c = log10(897152044.8282) * 2^24 */
  382. static u32 calculate_snr(u32 mse, u32 c)
  383. {
  384. if (mse == 0) /* No signal */
  385. return 0;
  386. mse = 2*intlog10(mse);
  387. if (mse > c) {
  388. /* Negative SNR, which is possible, but realisticly the
  389. demod will lose lock before the signal gets this bad. The
  390. API only allows for unsigned values, so just return 0 */
  391. return 0;
  392. }
  393. return 10*(c - mse);
  394. }
  395. static int or51132_read_snr(struct dvb_frontend* fe, u16* snr)
  396. {
  397. struct or51132_state* state = fe->demodulator_priv;
  398. int noise, reg;
  399. u32 c, usK = 0;
  400. int retry = 1;
  401. start:
  402. /* SNR after Equalizer */
  403. noise = or51132_readreg(state, 0x02);
  404. if (noise < 0) {
  405. printk(KERN_WARNING "or51132: read_snr: error reading equalizer\n");
  406. return -EREMOTEIO;
  407. }
  408. dprintk("read_snr noise (%d)\n", noise);
  409. /* Read status, contains modulation type for QAM_AUTO and
  410. NTSC filter for VSB */
  411. reg = or51132_readreg(state, 0x00);
  412. if (reg < 0) {
  413. printk(KERN_WARNING "or51132: read_snr: error reading receiver status\n");
  414. return -EREMOTEIO;
  415. }
  416. switch (reg&0xff) {
  417. case 0x06:
  418. if (reg & 0x1000) usK = 3 << 24;
  419. fallthrough;
  420. case 0x43: /* QAM64 */
  421. c = 150204167;
  422. break;
  423. case 0x45:
  424. c = 150290396;
  425. break;
  426. default:
  427. printk(KERN_WARNING "or51132: unknown status 0x%02x\n", reg&0xff);
  428. if (retry--) goto start;
  429. return -EREMOTEIO;
  430. }
  431. dprintk("%s: modulation %02x, NTSC rej O%s\n", __func__,
  432. reg&0xff, reg&0x1000?"n":"ff");
  433. /* Calculate SNR using noise, c, and NTSC rejection correction */
  434. state->snr = calculate_snr(noise, c) - usK;
  435. *snr = (state->snr) >> 16;
  436. dprintk("%s: noise = 0x%08x, snr = %d.%02d dB\n", __func__, noise,
  437. state->snr >> 24, (((state->snr>>8) & 0xffff) * 100) >> 16);
  438. return 0;
  439. }
  440. static int or51132_read_signal_strength(struct dvb_frontend* fe, u16* strength)
  441. {
  442. /* Calculate Strength from SNR up to 35dB */
  443. /* Even though the SNR can go higher than 35dB, there is some comfort */
  444. /* factor in having a range of strong signals that can show at 100% */
  445. struct or51132_state* state = (struct or51132_state*) fe->demodulator_priv;
  446. u16 snr;
  447. int ret;
  448. ret = fe->ops.read_snr(fe, &snr);
  449. if (ret != 0)
  450. return ret;
  451. /* Rather than use the 8.8 value snr, use state->snr which is 8.24 */
  452. /* scale the range 0 - 35*2^24 into 0 - 65535 */
  453. if (state->snr >= 8960 * 0x10000)
  454. *strength = 0xffff;
  455. else
  456. *strength = state->snr / 8960;
  457. return 0;
  458. }
  459. static int or51132_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fe_tune_settings)
  460. {
  461. fe_tune_settings->min_delay_ms = 500;
  462. fe_tune_settings->step_size = 0;
  463. fe_tune_settings->max_drift = 0;
  464. return 0;
  465. }
  466. static void or51132_release(struct dvb_frontend* fe)
  467. {
  468. struct or51132_state* state = fe->demodulator_priv;
  469. kfree(state);
  470. }
  471. static const struct dvb_frontend_ops or51132_ops;
  472. struct dvb_frontend* or51132_attach(const struct or51132_config* config,
  473. struct i2c_adapter* i2c)
  474. {
  475. struct or51132_state* state = NULL;
  476. /* Allocate memory for the internal state */
  477. state = kzalloc(sizeof(struct or51132_state), GFP_KERNEL);
  478. if (state == NULL)
  479. return NULL;
  480. /* Setup the state */
  481. state->config = config;
  482. state->i2c = i2c;
  483. state->current_frequency = -1;
  484. state->current_modulation = -1;
  485. /* Create dvb_frontend */
  486. memcpy(&state->frontend.ops, &or51132_ops, sizeof(struct dvb_frontend_ops));
  487. state->frontend.demodulator_priv = state;
  488. return &state->frontend;
  489. }
  490. static const struct dvb_frontend_ops or51132_ops = {
  491. .delsys = { SYS_ATSC, SYS_DVBC_ANNEX_B },
  492. .info = {
  493. .name = "Oren OR51132 VSB/QAM Frontend",
  494. .frequency_min_hz = 44 * MHz,
  495. .frequency_max_hz = 958 * MHz,
  496. .frequency_stepsize_hz = 166666,
  497. .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
  498. FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
  499. FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_QAM_AUTO |
  500. FE_CAN_8VSB
  501. },
  502. .release = or51132_release,
  503. .init = or51132_init,
  504. .sleep = or51132_sleep,
  505. .set_frontend = or51132_set_parameters,
  506. .get_frontend = or51132_get_parameters,
  507. .get_tune_settings = or51132_get_tune_settings,
  508. .read_status = or51132_read_status,
  509. .read_ber = or51132_read_ber,
  510. .read_signal_strength = or51132_read_signal_strength,
  511. .read_snr = or51132_read_snr,
  512. .read_ucblocks = or51132_read_ucblocks,
  513. };
  514. module_param(debug, int, 0644);
  515. MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
  516. MODULE_DESCRIPTION("OR51132 ATSC [pcHDTV HD-3000] (8VSB & ITU J83 AnnexB FEC QAM64/256) Demodulator Driver");
  517. MODULE_AUTHOR("Kirk Lapray");
  518. MODULE_AUTHOR("Trent Piepho");
  519. MODULE_LICENSE("GPL");
  520. EXPORT_SYMBOL_GPL(or51132_attach);