cxd2880-spi.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * cxd2880-spi.c
  4. * Sony CXD2880 DVB-T2/T tuner + demodulator driver
  5. * SPI adapter
  6. *
  7. * Copyright (C) 2016, 2017, 2018 Sony Semiconductor Solutions Corporation
  8. */
  9. #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
  10. #include <linux/spi/spi.h>
  11. #include <linux/regulator/consumer.h>
  12. #include <linux/ktime.h>
  13. #include <media/dvb_demux.h>
  14. #include <media/dmxdev.h>
  15. #include <media/dvb_frontend.h>
  16. #include "cxd2880.h"
  17. #define CXD2880_MAX_FILTER_SIZE 32
  18. #define BURST_WRITE_MAX 128
  19. #define MAX_TRANS_PKT 300
  20. struct cxd2880_ts_buf_info {
  21. u8 read_ready:1;
  22. u8 almost_full:1;
  23. u8 almost_empty:1;
  24. u8 overflow:1;
  25. u8 underflow:1;
  26. u16 pkt_num;
  27. };
  28. struct cxd2880_pid_config {
  29. u8 is_enable;
  30. u16 pid;
  31. };
  32. struct cxd2880_pid_filter_config {
  33. u8 is_negative;
  34. struct cxd2880_pid_config pid_config[CXD2880_MAX_FILTER_SIZE];
  35. };
  36. struct cxd2880_dvb_spi {
  37. struct dvb_frontend dvb_fe;
  38. struct dvb_adapter adapter;
  39. struct dvb_demux demux;
  40. struct dmxdev dmxdev;
  41. struct dmx_frontend dmx_fe;
  42. struct task_struct *cxd2880_ts_read_thread;
  43. struct spi_device *spi;
  44. struct mutex spi_mutex; /* For SPI access exclusive control */
  45. int feed_count;
  46. int all_pid_feed_count;
  47. struct regulator *vcc_supply;
  48. u8 *ts_buf;
  49. struct cxd2880_pid_filter_config filter_config;
  50. };
  51. DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
  52. static int cxd2880_write_spi(struct spi_device *spi, u8 *data, u32 size)
  53. {
  54. struct spi_message msg;
  55. struct spi_transfer tx = {};
  56. if (!spi || !data) {
  57. pr_err("invalid arg\n");
  58. return -EINVAL;
  59. }
  60. tx.tx_buf = data;
  61. tx.len = size;
  62. spi_message_init(&msg);
  63. spi_message_add_tail(&tx, &msg);
  64. return spi_sync(spi, &msg);
  65. }
  66. static int cxd2880_write_reg(struct spi_device *spi,
  67. u8 sub_address, const u8 *data, u32 size)
  68. {
  69. u8 send_data[BURST_WRITE_MAX + 4];
  70. const u8 *write_data_top = NULL;
  71. int ret = 0;
  72. if (!spi || !data) {
  73. pr_err("invalid arg\n");
  74. return -EINVAL;
  75. }
  76. if (size > BURST_WRITE_MAX || size > U8_MAX) {
  77. pr_err("data size > WRITE_MAX\n");
  78. return -EINVAL;
  79. }
  80. if (sub_address + size > 0x100) {
  81. pr_err("out of range\n");
  82. return -EINVAL;
  83. }
  84. send_data[0] = 0x0e;
  85. write_data_top = data;
  86. send_data[1] = sub_address;
  87. send_data[2] = (u8)size;
  88. memcpy(&send_data[3], write_data_top, send_data[2]);
  89. ret = cxd2880_write_spi(spi, send_data, send_data[2] + 3);
  90. if (ret)
  91. pr_err("write spi failed %d\n", ret);
  92. return ret;
  93. }
  94. static int cxd2880_spi_read_ts(struct spi_device *spi,
  95. u8 *read_data,
  96. u32 packet_num)
  97. {
  98. int ret;
  99. u8 data[3];
  100. struct spi_message message;
  101. struct spi_transfer transfer[2] = {};
  102. if (!spi || !read_data || !packet_num) {
  103. pr_err("invalid arg\n");
  104. return -EINVAL;
  105. }
  106. if (packet_num > 0xffff) {
  107. pr_err("packet num > 0xffff\n");
  108. return -EINVAL;
  109. }
  110. data[0] = 0x10;
  111. data[1] = packet_num >> 8;
  112. data[2] = packet_num;
  113. spi_message_init(&message);
  114. transfer[0].len = 3;
  115. transfer[0].tx_buf = data;
  116. spi_message_add_tail(&transfer[0], &message);
  117. transfer[1].len = packet_num * 188;
  118. transfer[1].rx_buf = read_data;
  119. spi_message_add_tail(&transfer[1], &message);
  120. ret = spi_sync(spi, &message);
  121. if (ret)
  122. pr_err("spi_sync failed\n");
  123. return ret;
  124. }
  125. static int cxd2880_spi_read_ts_buffer_info(struct spi_device *spi,
  126. struct cxd2880_ts_buf_info *info)
  127. {
  128. u8 send_data = 0x20;
  129. u8 recv_data[2];
  130. int ret;
  131. if (!spi || !info) {
  132. pr_err("invalid arg\n");
  133. return -EINVAL;
  134. }
  135. ret = spi_write_then_read(spi, &send_data, 1,
  136. recv_data, sizeof(recv_data));
  137. if (ret)
  138. pr_err("spi_write_then_read failed\n");
  139. info->read_ready = (recv_data[0] & 0x80) ? 1 : 0;
  140. info->almost_full = (recv_data[0] & 0x40) ? 1 : 0;
  141. info->almost_empty = (recv_data[0] & 0x20) ? 1 : 0;
  142. info->overflow = (recv_data[0] & 0x10) ? 1 : 0;
  143. info->underflow = (recv_data[0] & 0x08) ? 1 : 0;
  144. info->pkt_num = ((recv_data[0] & 0x07) << 8) | recv_data[1];
  145. return ret;
  146. }
  147. static int cxd2880_spi_clear_ts_buffer(struct spi_device *spi)
  148. {
  149. u8 data = 0x03;
  150. int ret;
  151. ret = cxd2880_write_spi(spi, &data, 1);
  152. if (ret)
  153. pr_err("write spi failed\n");
  154. return ret;
  155. }
  156. static int cxd2880_set_pid_filter(struct spi_device *spi,
  157. struct cxd2880_pid_filter_config *cfg)
  158. {
  159. u8 data[65];
  160. int i;
  161. u16 pid = 0;
  162. int ret;
  163. if (!spi) {
  164. pr_err("invalid arg\n");
  165. return -EINVAL;
  166. }
  167. data[0] = 0x00;
  168. ret = cxd2880_write_reg(spi, 0x00, &data[0], 1);
  169. if (ret)
  170. return ret;
  171. if (!cfg) {
  172. data[0] = 0x02;
  173. ret = cxd2880_write_reg(spi, 0x50, &data[0], 1);
  174. } else {
  175. data[0] = cfg->is_negative ? 0x01 : 0x00;
  176. for (i = 0; i < CXD2880_MAX_FILTER_SIZE; i++) {
  177. pid = cfg->pid_config[i].pid;
  178. if (cfg->pid_config[i].is_enable) {
  179. data[1 + (i * 2)] = (pid >> 8) | 0x20;
  180. data[2 + (i * 2)] = pid & 0xff;
  181. } else {
  182. data[1 + (i * 2)] = 0x00;
  183. data[2 + (i * 2)] = 0x00;
  184. }
  185. }
  186. ret = cxd2880_write_reg(spi, 0x50, data, 65);
  187. }
  188. return ret;
  189. }
  190. static int cxd2880_update_pid_filter(struct cxd2880_dvb_spi *dvb_spi,
  191. struct cxd2880_pid_filter_config *cfg,
  192. bool is_all_pid_filter)
  193. {
  194. int ret;
  195. if (!dvb_spi || !cfg) {
  196. pr_err("invalid arg.\n");
  197. return -EINVAL;
  198. }
  199. mutex_lock(&dvb_spi->spi_mutex);
  200. if (is_all_pid_filter) {
  201. struct cxd2880_pid_filter_config tmpcfg;
  202. memset(&tmpcfg, 0, sizeof(tmpcfg));
  203. tmpcfg.is_negative = 1;
  204. tmpcfg.pid_config[0].is_enable = 1;
  205. tmpcfg.pid_config[0].pid = 0x1fff;
  206. ret = cxd2880_set_pid_filter(dvb_spi->spi, &tmpcfg);
  207. } else {
  208. ret = cxd2880_set_pid_filter(dvb_spi->spi, cfg);
  209. }
  210. mutex_unlock(&dvb_spi->spi_mutex);
  211. if (ret)
  212. pr_err("set_pid_filter failed\n");
  213. return ret;
  214. }
  215. static int cxd2880_ts_read(void *arg)
  216. {
  217. struct cxd2880_dvb_spi *dvb_spi = NULL;
  218. struct cxd2880_ts_buf_info info;
  219. ktime_t start;
  220. u32 i;
  221. int ret;
  222. dvb_spi = arg;
  223. if (!dvb_spi) {
  224. pr_err("invalid arg\n");
  225. return -EINVAL;
  226. }
  227. ret = cxd2880_spi_clear_ts_buffer(dvb_spi->spi);
  228. if (ret) {
  229. pr_err("set_clear_ts_buffer failed\n");
  230. return ret;
  231. }
  232. start = ktime_get();
  233. while (!kthread_should_stop()) {
  234. ret = cxd2880_spi_read_ts_buffer_info(dvb_spi->spi,
  235. &info);
  236. if (ret) {
  237. pr_err("spi_read_ts_buffer_info error\n");
  238. return ret;
  239. }
  240. if (info.pkt_num > MAX_TRANS_PKT) {
  241. for (i = 0; i < info.pkt_num / MAX_TRANS_PKT; i++) {
  242. cxd2880_spi_read_ts(dvb_spi->spi,
  243. dvb_spi->ts_buf,
  244. MAX_TRANS_PKT);
  245. dvb_dmx_swfilter(&dvb_spi->demux,
  246. dvb_spi->ts_buf,
  247. MAX_TRANS_PKT * 188);
  248. }
  249. start = ktime_get();
  250. } else if ((info.pkt_num > 0) &&
  251. (ktime_to_ms(ktime_sub(ktime_get(), start)) >= 500)) {
  252. cxd2880_spi_read_ts(dvb_spi->spi,
  253. dvb_spi->ts_buf,
  254. info.pkt_num);
  255. dvb_dmx_swfilter(&dvb_spi->demux,
  256. dvb_spi->ts_buf,
  257. info.pkt_num * 188);
  258. start = ktime_get();
  259. } else {
  260. usleep_range(10000, 11000);
  261. }
  262. }
  263. return 0;
  264. }
  265. static int cxd2880_start_feed(struct dvb_demux_feed *feed)
  266. {
  267. int ret = 0;
  268. int i = 0;
  269. struct dvb_demux *demux = NULL;
  270. struct cxd2880_dvb_spi *dvb_spi = NULL;
  271. if (!feed) {
  272. pr_err("invalid arg\n");
  273. return -EINVAL;
  274. }
  275. demux = feed->demux;
  276. if (!demux) {
  277. pr_err("feed->demux is NULL\n");
  278. return -EINVAL;
  279. }
  280. dvb_spi = demux->priv;
  281. if (dvb_spi->feed_count == CXD2880_MAX_FILTER_SIZE) {
  282. pr_err("Exceeded maximum PID count (32).");
  283. pr_err("Selected PID cannot be enabled.\n");
  284. return -EINVAL;
  285. }
  286. if (feed->pid == 0x2000) {
  287. if (dvb_spi->all_pid_feed_count == 0) {
  288. ret = cxd2880_update_pid_filter(dvb_spi,
  289. &dvb_spi->filter_config,
  290. true);
  291. if (ret) {
  292. pr_err("update pid filter failed\n");
  293. return ret;
  294. }
  295. }
  296. dvb_spi->all_pid_feed_count++;
  297. pr_debug("all PID feed (count = %d)\n",
  298. dvb_spi->all_pid_feed_count);
  299. } else {
  300. struct cxd2880_pid_filter_config cfgtmp;
  301. cfgtmp = dvb_spi->filter_config;
  302. for (i = 0; i < CXD2880_MAX_FILTER_SIZE; i++) {
  303. if (cfgtmp.pid_config[i].is_enable == 0) {
  304. cfgtmp.pid_config[i].is_enable = 1;
  305. cfgtmp.pid_config[i].pid = feed->pid;
  306. pr_debug("store PID %d to #%d\n",
  307. feed->pid, i);
  308. break;
  309. }
  310. }
  311. if (i == CXD2880_MAX_FILTER_SIZE) {
  312. pr_err("PID filter is full.\n");
  313. return -EINVAL;
  314. }
  315. if (!dvb_spi->all_pid_feed_count)
  316. ret = cxd2880_update_pid_filter(dvb_spi,
  317. &cfgtmp,
  318. false);
  319. if (ret)
  320. return ret;
  321. dvb_spi->filter_config = cfgtmp;
  322. }
  323. if (dvb_spi->feed_count == 0) {
  324. dvb_spi->ts_buf =
  325. kmalloc(MAX_TRANS_PKT * 188,
  326. GFP_KERNEL | GFP_DMA);
  327. if (!dvb_spi->ts_buf) {
  328. pr_err("ts buffer allocate failed\n");
  329. memset(&dvb_spi->filter_config, 0,
  330. sizeof(dvb_spi->filter_config));
  331. dvb_spi->all_pid_feed_count = 0;
  332. return -ENOMEM;
  333. }
  334. dvb_spi->cxd2880_ts_read_thread = kthread_run(cxd2880_ts_read,
  335. dvb_spi,
  336. "cxd2880_ts_read");
  337. if (IS_ERR(dvb_spi->cxd2880_ts_read_thread)) {
  338. pr_err("kthread_run failed\n");
  339. kfree(dvb_spi->ts_buf);
  340. dvb_spi->ts_buf = NULL;
  341. memset(&dvb_spi->filter_config, 0,
  342. sizeof(dvb_spi->filter_config));
  343. dvb_spi->all_pid_feed_count = 0;
  344. return PTR_ERR(dvb_spi->cxd2880_ts_read_thread);
  345. }
  346. }
  347. dvb_spi->feed_count++;
  348. pr_debug("start feed (count %d)\n", dvb_spi->feed_count);
  349. return 0;
  350. }
  351. static int cxd2880_stop_feed(struct dvb_demux_feed *feed)
  352. {
  353. int i = 0;
  354. int ret;
  355. struct dvb_demux *demux = NULL;
  356. struct cxd2880_dvb_spi *dvb_spi = NULL;
  357. if (!feed) {
  358. pr_err("invalid arg\n");
  359. return -EINVAL;
  360. }
  361. demux = feed->demux;
  362. if (!demux) {
  363. pr_err("feed->demux is NULL\n");
  364. return -EINVAL;
  365. }
  366. dvb_spi = demux->priv;
  367. if (!dvb_spi->feed_count) {
  368. pr_err("no feed is started\n");
  369. return -EINVAL;
  370. }
  371. if (feed->pid == 0x2000) {
  372. /*
  373. * Special PID case.
  374. * Number of 0x2000 feed request was stored
  375. * in dvb_spi->all_pid_feed_count.
  376. */
  377. if (dvb_spi->all_pid_feed_count <= 0) {
  378. pr_err("PID %d not found\n", feed->pid);
  379. return -EINVAL;
  380. }
  381. dvb_spi->all_pid_feed_count--;
  382. } else {
  383. struct cxd2880_pid_filter_config cfgtmp;
  384. cfgtmp = dvb_spi->filter_config;
  385. for (i = 0; i < CXD2880_MAX_FILTER_SIZE; i++) {
  386. if (feed->pid == cfgtmp.pid_config[i].pid &&
  387. cfgtmp.pid_config[i].is_enable != 0) {
  388. cfgtmp.pid_config[i].is_enable = 0;
  389. cfgtmp.pid_config[i].pid = 0;
  390. pr_debug("removed PID %d from #%d\n",
  391. feed->pid, i);
  392. break;
  393. }
  394. }
  395. dvb_spi->filter_config = cfgtmp;
  396. if (i == CXD2880_MAX_FILTER_SIZE) {
  397. pr_err("PID %d not found\n", feed->pid);
  398. return -EINVAL;
  399. }
  400. }
  401. ret = cxd2880_update_pid_filter(dvb_spi,
  402. &dvb_spi->filter_config,
  403. dvb_spi->all_pid_feed_count > 0);
  404. dvb_spi->feed_count--;
  405. if (dvb_spi->feed_count == 0) {
  406. int ret_stop = 0;
  407. ret_stop = kthread_stop(dvb_spi->cxd2880_ts_read_thread);
  408. if (ret_stop) {
  409. pr_err("kthread_stop failed. (%d)\n", ret_stop);
  410. ret = ret_stop;
  411. }
  412. kfree(dvb_spi->ts_buf);
  413. dvb_spi->ts_buf = NULL;
  414. }
  415. pr_debug("stop feed ok.(count %d)\n", dvb_spi->feed_count);
  416. return ret;
  417. }
  418. static const struct of_device_id cxd2880_spi_of_match[] = {
  419. { .compatible = "sony,cxd2880" },
  420. { /* sentinel */ }
  421. };
  422. MODULE_DEVICE_TABLE(of, cxd2880_spi_of_match);
  423. static int
  424. cxd2880_spi_probe(struct spi_device *spi)
  425. {
  426. int ret;
  427. struct cxd2880_dvb_spi *dvb_spi = NULL;
  428. struct cxd2880_config config;
  429. if (!spi) {
  430. pr_err("invalid arg\n");
  431. return -EINVAL;
  432. }
  433. dvb_spi = kzalloc(sizeof(struct cxd2880_dvb_spi), GFP_KERNEL);
  434. if (!dvb_spi)
  435. return -ENOMEM;
  436. dvb_spi->vcc_supply = devm_regulator_get_optional(&spi->dev, "vcc");
  437. if (IS_ERR(dvb_spi->vcc_supply)) {
  438. if (PTR_ERR(dvb_spi->vcc_supply) == -EPROBE_DEFER) {
  439. ret = -EPROBE_DEFER;
  440. goto fail_regulator;
  441. }
  442. dvb_spi->vcc_supply = NULL;
  443. } else {
  444. ret = regulator_enable(dvb_spi->vcc_supply);
  445. if (ret)
  446. goto fail_regulator;
  447. }
  448. dvb_spi->spi = spi;
  449. mutex_init(&dvb_spi->spi_mutex);
  450. spi_set_drvdata(spi, dvb_spi);
  451. config.spi = spi;
  452. config.spi_mutex = &dvb_spi->spi_mutex;
  453. ret = dvb_register_adapter(&dvb_spi->adapter,
  454. "CXD2880",
  455. THIS_MODULE,
  456. &spi->dev,
  457. adapter_nr);
  458. if (ret < 0) {
  459. pr_err("dvb_register_adapter() failed\n");
  460. goto fail_adapter;
  461. }
  462. if (!dvb_attach(cxd2880_attach, &dvb_spi->dvb_fe, &config)) {
  463. pr_err("cxd2880_attach failed\n");
  464. ret = -ENODEV;
  465. goto fail_attach;
  466. }
  467. ret = dvb_register_frontend(&dvb_spi->adapter,
  468. &dvb_spi->dvb_fe);
  469. if (ret < 0) {
  470. pr_err("dvb_register_frontend() failed\n");
  471. goto fail_frontend;
  472. }
  473. dvb_spi->demux.dmx.capabilities = DMX_TS_FILTERING;
  474. dvb_spi->demux.priv = dvb_spi;
  475. dvb_spi->demux.filternum = CXD2880_MAX_FILTER_SIZE;
  476. dvb_spi->demux.feednum = CXD2880_MAX_FILTER_SIZE;
  477. dvb_spi->demux.start_feed = cxd2880_start_feed;
  478. dvb_spi->demux.stop_feed = cxd2880_stop_feed;
  479. ret = dvb_dmx_init(&dvb_spi->demux);
  480. if (ret < 0) {
  481. pr_err("dvb_dmx_init() failed\n");
  482. goto fail_dmx;
  483. }
  484. dvb_spi->dmxdev.filternum = CXD2880_MAX_FILTER_SIZE;
  485. dvb_spi->dmxdev.demux = &dvb_spi->demux.dmx;
  486. dvb_spi->dmxdev.capabilities = 0;
  487. ret = dvb_dmxdev_init(&dvb_spi->dmxdev,
  488. &dvb_spi->adapter);
  489. if (ret < 0) {
  490. pr_err("dvb_dmxdev_init() failed\n");
  491. goto fail_dmxdev;
  492. }
  493. dvb_spi->dmx_fe.source = DMX_FRONTEND_0;
  494. ret = dvb_spi->demux.dmx.add_frontend(&dvb_spi->demux.dmx,
  495. &dvb_spi->dmx_fe);
  496. if (ret < 0) {
  497. pr_err("add_frontend() failed\n");
  498. goto fail_dmx_fe;
  499. }
  500. ret = dvb_spi->demux.dmx.connect_frontend(&dvb_spi->demux.dmx,
  501. &dvb_spi->dmx_fe);
  502. if (ret < 0) {
  503. pr_err("connect_frontend() failed\n");
  504. goto fail_fe_conn;
  505. }
  506. pr_info("Sony CXD2880 has successfully attached.\n");
  507. return 0;
  508. fail_fe_conn:
  509. dvb_spi->demux.dmx.remove_frontend(&dvb_spi->demux.dmx,
  510. &dvb_spi->dmx_fe);
  511. fail_dmx_fe:
  512. dvb_dmxdev_release(&dvb_spi->dmxdev);
  513. fail_dmxdev:
  514. dvb_dmx_release(&dvb_spi->demux);
  515. fail_dmx:
  516. dvb_unregister_frontend(&dvb_spi->dvb_fe);
  517. fail_frontend:
  518. dvb_frontend_detach(&dvb_spi->dvb_fe);
  519. fail_attach:
  520. dvb_unregister_adapter(&dvb_spi->adapter);
  521. fail_adapter:
  522. if (dvb_spi->vcc_supply)
  523. regulator_disable(dvb_spi->vcc_supply);
  524. fail_regulator:
  525. kfree(dvb_spi);
  526. return ret;
  527. }
  528. static void
  529. cxd2880_spi_remove(struct spi_device *spi)
  530. {
  531. struct cxd2880_dvb_spi *dvb_spi = spi_get_drvdata(spi);
  532. dvb_spi->demux.dmx.remove_frontend(&dvb_spi->demux.dmx,
  533. &dvb_spi->dmx_fe);
  534. dvb_dmxdev_release(&dvb_spi->dmxdev);
  535. dvb_dmx_release(&dvb_spi->demux);
  536. dvb_unregister_frontend(&dvb_spi->dvb_fe);
  537. dvb_frontend_detach(&dvb_spi->dvb_fe);
  538. dvb_unregister_adapter(&dvb_spi->adapter);
  539. if (dvb_spi->vcc_supply)
  540. regulator_disable(dvb_spi->vcc_supply);
  541. kfree(dvb_spi);
  542. pr_info("cxd2880_spi remove ok.\n");
  543. }
  544. static const struct spi_device_id cxd2880_spi_id[] = {
  545. { "cxd2880", 0 },
  546. { /* sentinel */ }
  547. };
  548. MODULE_DEVICE_TABLE(spi, cxd2880_spi_id);
  549. static struct spi_driver cxd2880_spi_driver = {
  550. .driver = {
  551. .name = "cxd2880",
  552. .of_match_table = cxd2880_spi_of_match,
  553. },
  554. .id_table = cxd2880_spi_id,
  555. .probe = cxd2880_spi_probe,
  556. .remove = cxd2880_spi_remove,
  557. };
  558. module_spi_driver(cxd2880_spi_driver);
  559. MODULE_DESCRIPTION("Sony CXD2880 DVB-T2/T tuner + demod driver SPI adapter");
  560. MODULE_AUTHOR("Sony Semiconductor Solutions Corporation");
  561. MODULE_LICENSE("GPL v2");