intel_scu_ipc.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. /*
  2. * intel_scu_ipc.c: Driver for the Intel SCU IPC mechanism
  3. *
  4. * (C) Copyright 2008-2010 Intel Corporation
  5. * Author: Sreedhara DS (sreedhara.ds@intel.com)
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; version 2
  10. * of the License.
  11. *
  12. * SCU running in ARC processor communicates with other entity running in IA
  13. * core through IPC mechanism which in turn messaging between IA core ad SCU.
  14. * SCU has two IPC mechanism IPC-1 and IPC-2. IPC-1 is used between IA32 and
  15. * SCU where IPC-2 is used between P-Unit and SCU. This driver delas with
  16. * IPC-1 Driver provides an API for power control unit registers (e.g. MSIC)
  17. * along with other APIs.
  18. */
  19. #include <linux/delay.h>
  20. #include <linux/errno.h>
  21. #include <linux/init.h>
  22. #include <linux/device.h>
  23. #include <linux/pm.h>
  24. #include <linux/pci.h>
  25. #include <linux/interrupt.h>
  26. #include <linux/sfi.h>
  27. #include <linux/module.h>
  28. #include <asm/intel-mid.h>
  29. #include <asm/intel_scu_ipc.h>
  30. /* IPC defines the following message types */
  31. #define IPCMSG_WATCHDOG_TIMER 0xF8 /* Set Kernel Watchdog Threshold */
  32. #define IPCMSG_BATTERY 0xEF /* Coulomb Counter Accumulator */
  33. #define IPCMSG_FW_UPDATE 0xFE /* Firmware update */
  34. #define IPCMSG_PCNTRL 0xFF /* Power controller unit read/write */
  35. #define IPCMSG_FW_REVISION 0xF4 /* Get firmware revision */
  36. /* Command id associated with message IPCMSG_PCNTRL */
  37. #define IPC_CMD_PCNTRL_W 0 /* Register write */
  38. #define IPC_CMD_PCNTRL_R 1 /* Register read */
  39. #define IPC_CMD_PCNTRL_M 2 /* Register read-modify-write */
  40. /*
  41. * IPC register summary
  42. *
  43. * IPC register blocks are memory mapped at fixed address of 0xFF11C000
  44. * To read or write information to the SCU, driver writes to IPC-1 memory
  45. * mapped registers (base address 0xFF11C000). The following is the IPC
  46. * mechanism
  47. *
  48. * 1. IA core cDMI interface claims this transaction and converts it to a
  49. * Transaction Layer Packet (TLP) message which is sent across the cDMI.
  50. *
  51. * 2. South Complex cDMI block receives this message and writes it to
  52. * the IPC-1 register block, causing an interrupt to the SCU
  53. *
  54. * 3. SCU firmware decodes this interrupt and IPC message and the appropriate
  55. * message handler is called within firmware.
  56. */
  57. #define IPC_WWBUF_SIZE 20 /* IPC Write buffer Size */
  58. #define IPC_RWBUF_SIZE 20 /* IPC Read buffer Size */
  59. enum {
  60. SCU_IPC_LINCROFT,
  61. };
  62. /* intel scu ipc driver data*/
  63. struct intel_scu_ipc_pdata_t {
  64. u32 ipc_base;
  65. u32 i2c_base;
  66. u32 ipc_len;
  67. u32 i2c_len;
  68. };
  69. static struct intel_scu_ipc_pdata_t intel_scu_ipc_pdata[] = {
  70. [SCU_IPC_LINCROFT] = {
  71. .ipc_base = 0xff11c000,
  72. .i2c_base = 0xff12b000,
  73. .ipc_len = 0x100,
  74. .i2c_len = 0x10,
  75. },
  76. };
  77. static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id);
  78. static void ipc_remove(struct pci_dev *pdev);
  79. struct intel_scu_ipc_dev {
  80. struct pci_dev *pdev;
  81. void __iomem *ipc_base;
  82. void __iomem *i2c_base;
  83. };
  84. static struct intel_scu_ipc_dev ipcdev; /* Only one for now */
  85. static int platform; /* Platform type */
  86. /*
  87. * IPC Read Buffer (Read Only):
  88. * 16 byte buffer for receiving data from SCU, if IPC command
  89. * processing results in response data
  90. */
  91. #define IPC_READ_BUFFER 0x90
  92. #define IPC_I2C_CNTRL_ADDR 0
  93. #define I2C_DATA_ADDR 0x04
  94. static DEFINE_MUTEX(ipclock); /* lock used to prevent multiple call to SCU */
  95. /*
  96. * Command Register (Write Only):
  97. * A write to this register results in an interrupt to the SCU core processor
  98. * Format:
  99. * |rfu2(8) | size(8) | command id(4) | rfu1(3) | ioc(1) | command(8)|
  100. */
  101. static inline void ipc_command(u32 cmd) /* Send ipc command */
  102. {
  103. writel(cmd, ipcdev.ipc_base);
  104. }
  105. /*
  106. * IPC Write Buffer (Write Only):
  107. * 16-byte buffer for sending data associated with IPC command to
  108. * SCU. Size of the data is specified in the IPC_COMMAND_REG register
  109. */
  110. static inline void ipc_data_writel(u32 data, u32 offset) /* Write ipc data */
  111. {
  112. writel(data, ipcdev.ipc_base + 0x80 + offset);
  113. }
  114. /*
  115. * Status Register (Read Only):
  116. * Driver will read this register to get the ready/busy status of the IPC
  117. * block and error status of the IPC command that was just processed by SCU
  118. * Format:
  119. * |rfu3(8)|error code(8)|initiator id(8)|cmd id(4)|rfu1(2)|error(1)|busy(1)|
  120. */
  121. static inline u8 ipc_read_status(void)
  122. {
  123. return __raw_readl(ipcdev.ipc_base + 0x04);
  124. }
  125. static inline u8 ipc_data_readb(u32 offset) /* Read ipc byte data */
  126. {
  127. return readb(ipcdev.ipc_base + IPC_READ_BUFFER + offset);
  128. }
  129. static inline u32 ipc_data_readl(u32 offset) /* Read ipc u32 data */
  130. {
  131. return readl(ipcdev.ipc_base + IPC_READ_BUFFER + offset);
  132. }
  133. static inline int busy_loop(void) /* Wait till scu status is busy */
  134. {
  135. u32 status = 0;
  136. u32 loop_count = 0;
  137. status = ipc_read_status();
  138. while (status & 1) {
  139. udelay(1); /* scu processing time is in few u secods */
  140. status = ipc_read_status();
  141. loop_count++;
  142. /* break if scu doesn't reset busy bit after huge retry */
  143. if (loop_count > 100000) {
  144. dev_err(&ipcdev.pdev->dev, "IPC timed out");
  145. return -ETIMEDOUT;
  146. }
  147. }
  148. if ((status >> 1) & 1)
  149. return -EIO;
  150. return 0;
  151. }
  152. /* Read/Write power control(PMIC in Langwell, MSIC in PenWell) registers */
  153. static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
  154. {
  155. int nc;
  156. u32 offset = 0;
  157. int err;
  158. u8 cbuf[IPC_WWBUF_SIZE] = { };
  159. u32 *wbuf = (u32 *)&cbuf;
  160. mutex_lock(&ipclock);
  161. memset(cbuf, 0, sizeof(cbuf));
  162. if (ipcdev.pdev == NULL) {
  163. mutex_unlock(&ipclock);
  164. return -ENODEV;
  165. }
  166. for (nc = 0; nc < count; nc++, offset += 2) {
  167. cbuf[offset] = addr[nc];
  168. cbuf[offset + 1] = addr[nc] >> 8;
  169. }
  170. if (id == IPC_CMD_PCNTRL_R) {
  171. for (nc = 0, offset = 0; nc < count; nc++, offset += 4)
  172. ipc_data_writel(wbuf[nc], offset);
  173. ipc_command((count*2) << 16 | id << 12 | 0 << 8 | op);
  174. } else if (id == IPC_CMD_PCNTRL_W) {
  175. for (nc = 0; nc < count; nc++, offset += 1)
  176. cbuf[offset] = data[nc];
  177. for (nc = 0, offset = 0; nc < count; nc++, offset += 4)
  178. ipc_data_writel(wbuf[nc], offset);
  179. ipc_command((count*3) << 16 | id << 12 | 0 << 8 | op);
  180. } else if (id == IPC_CMD_PCNTRL_M) {
  181. cbuf[offset] = data[0];
  182. cbuf[offset + 1] = data[1];
  183. ipc_data_writel(wbuf[0], 0); /* Write wbuff */
  184. ipc_command(4 << 16 | id << 12 | 0 << 8 | op);
  185. }
  186. err = busy_loop();
  187. if (id == IPC_CMD_PCNTRL_R) { /* Read rbuf */
  188. /* Workaround: values are read as 0 without memcpy_fromio */
  189. memcpy_fromio(cbuf, ipcdev.ipc_base + 0x90, 16);
  190. for (nc = 0; nc < count; nc++)
  191. data[nc] = ipc_data_readb(nc);
  192. }
  193. mutex_unlock(&ipclock);
  194. return err;
  195. }
  196. /**
  197. * intel_scu_ipc_ioread8 - read a word via the SCU
  198. * @addr: register on SCU
  199. * @data: return pointer for read byte
  200. *
  201. * Read a single register. Returns 0 on success or an error code. All
  202. * locking between SCU accesses is handled for the caller.
  203. *
  204. * This function may sleep.
  205. */
  206. int intel_scu_ipc_ioread8(u16 addr, u8 *data)
  207. {
  208. return pwr_reg_rdwr(&addr, data, 1, IPCMSG_PCNTRL, IPC_CMD_PCNTRL_R);
  209. }
  210. EXPORT_SYMBOL(intel_scu_ipc_ioread8);
  211. /**
  212. * intel_scu_ipc_ioread16 - read a word via the SCU
  213. * @addr: register on SCU
  214. * @data: return pointer for read word
  215. *
  216. * Read a register pair. Returns 0 on success or an error code. All
  217. * locking between SCU accesses is handled for the caller.
  218. *
  219. * This function may sleep.
  220. */
  221. int intel_scu_ipc_ioread16(u16 addr, u16 *data)
  222. {
  223. u16 x[2] = {addr, addr + 1 };
  224. return pwr_reg_rdwr(x, (u8 *)data, 2, IPCMSG_PCNTRL, IPC_CMD_PCNTRL_R);
  225. }
  226. EXPORT_SYMBOL(intel_scu_ipc_ioread16);
  227. /**
  228. * intel_scu_ipc_ioread32 - read a dword via the SCU
  229. * @addr: register on SCU
  230. * @data: return pointer for read dword
  231. *
  232. * Read four registers. Returns 0 on success or an error code. All
  233. * locking between SCU accesses is handled for the caller.
  234. *
  235. * This function may sleep.
  236. */
  237. int intel_scu_ipc_ioread32(u16 addr, u32 *data)
  238. {
  239. u16 x[4] = {addr, addr + 1, addr + 2, addr + 3};
  240. return pwr_reg_rdwr(x, (u8 *)data, 4, IPCMSG_PCNTRL, IPC_CMD_PCNTRL_R);
  241. }
  242. EXPORT_SYMBOL(intel_scu_ipc_ioread32);
  243. /**
  244. * intel_scu_ipc_iowrite8 - write a byte via the SCU
  245. * @addr: register on SCU
  246. * @data: byte to write
  247. *
  248. * Write a single register. Returns 0 on success or an error code. All
  249. * locking between SCU accesses is handled for the caller.
  250. *
  251. * This function may sleep.
  252. */
  253. int intel_scu_ipc_iowrite8(u16 addr, u8 data)
  254. {
  255. return pwr_reg_rdwr(&addr, &data, 1, IPCMSG_PCNTRL, IPC_CMD_PCNTRL_W);
  256. }
  257. EXPORT_SYMBOL(intel_scu_ipc_iowrite8);
  258. /**
  259. * intel_scu_ipc_iowrite16 - write a word via the SCU
  260. * @addr: register on SCU
  261. * @data: word to write
  262. *
  263. * Write two registers. Returns 0 on success or an error code. All
  264. * locking between SCU accesses is handled for the caller.
  265. *
  266. * This function may sleep.
  267. */
  268. int intel_scu_ipc_iowrite16(u16 addr, u16 data)
  269. {
  270. u16 x[2] = {addr, addr + 1 };
  271. return pwr_reg_rdwr(x, (u8 *)&data, 2, IPCMSG_PCNTRL, IPC_CMD_PCNTRL_W);
  272. }
  273. EXPORT_SYMBOL(intel_scu_ipc_iowrite16);
  274. /**
  275. * intel_scu_ipc_iowrite32 - write a dword via the SCU
  276. * @addr: register on SCU
  277. * @data: dword to write
  278. *
  279. * Write four registers. Returns 0 on success or an error code. All
  280. * locking between SCU accesses is handled for the caller.
  281. *
  282. * This function may sleep.
  283. */
  284. int intel_scu_ipc_iowrite32(u16 addr, u32 data)
  285. {
  286. u16 x[4] = {addr, addr + 1, addr + 2, addr + 3};
  287. return pwr_reg_rdwr(x, (u8 *)&data, 4, IPCMSG_PCNTRL, IPC_CMD_PCNTRL_W);
  288. }
  289. EXPORT_SYMBOL(intel_scu_ipc_iowrite32);
  290. /**
  291. * intel_scu_ipc_readvv - read a set of registers
  292. * @addr: register list
  293. * @data: bytes to return
  294. * @len: length of array
  295. *
  296. * Read registers. Returns 0 on success or an error code. All
  297. * locking between SCU accesses is handled for the caller.
  298. *
  299. * The largest array length permitted by the hardware is 5 items.
  300. *
  301. * This function may sleep.
  302. */
  303. int intel_scu_ipc_readv(u16 *addr, u8 *data, int len)
  304. {
  305. return pwr_reg_rdwr(addr, data, len, IPCMSG_PCNTRL, IPC_CMD_PCNTRL_R);
  306. }
  307. EXPORT_SYMBOL(intel_scu_ipc_readv);
  308. /**
  309. * intel_scu_ipc_writev - write a set of registers
  310. * @addr: register list
  311. * @data: bytes to write
  312. * @len: length of array
  313. *
  314. * Write registers. Returns 0 on success or an error code. All
  315. * locking between SCU accesses is handled for the caller.
  316. *
  317. * The largest array length permitted by the hardware is 5 items.
  318. *
  319. * This function may sleep.
  320. *
  321. */
  322. int intel_scu_ipc_writev(u16 *addr, u8 *data, int len)
  323. {
  324. return pwr_reg_rdwr(addr, data, len, IPCMSG_PCNTRL, IPC_CMD_PCNTRL_W);
  325. }
  326. EXPORT_SYMBOL(intel_scu_ipc_writev);
  327. /**
  328. * intel_scu_ipc_update_register - r/m/w a register
  329. * @addr: register address
  330. * @bits: bits to update
  331. * @mask: mask of bits to update
  332. *
  333. * Read-modify-write power control unit register. The first data argument
  334. * must be register value and second is mask value
  335. * mask is a bitmap that indicates which bits to update.
  336. * 0 = masked. Don't modify this bit, 1 = modify this bit.
  337. * returns 0 on success or an error code.
  338. *
  339. * This function may sleep. Locking between SCU accesses is handled
  340. * for the caller.
  341. */
  342. int intel_scu_ipc_update_register(u16 addr, u8 bits, u8 mask)
  343. {
  344. u8 data[2] = { bits, mask };
  345. return pwr_reg_rdwr(&addr, data, 1, IPCMSG_PCNTRL, IPC_CMD_PCNTRL_M);
  346. }
  347. EXPORT_SYMBOL(intel_scu_ipc_update_register);
  348. /**
  349. * intel_scu_ipc_simple_command - send a simple command
  350. * @cmd: command
  351. * @sub: sub type
  352. *
  353. * Issue a simple command to the SCU. Do not use this interface if
  354. * you must then access data as any data values may be overwritten
  355. * by another SCU access by the time this function returns.
  356. *
  357. * This function may sleep. Locking for SCU accesses is handled for
  358. * the caller.
  359. */
  360. int intel_scu_ipc_simple_command(int cmd, int sub)
  361. {
  362. int err;
  363. mutex_lock(&ipclock);
  364. if (ipcdev.pdev == NULL) {
  365. mutex_unlock(&ipclock);
  366. return -ENODEV;
  367. }
  368. ipc_command(sub << 12 | cmd);
  369. err = busy_loop();
  370. mutex_unlock(&ipclock);
  371. return err;
  372. }
  373. EXPORT_SYMBOL(intel_scu_ipc_simple_command);
  374. /**
  375. * intel_scu_ipc_command - command with data
  376. * @cmd: command
  377. * @sub: sub type
  378. * @in: input data
  379. * @inlen: input length in dwords
  380. * @out: output data
  381. * @outlein: output length in dwords
  382. *
  383. * Issue a command to the SCU which involves data transfers. Do the
  384. * data copies under the lock but leave it for the caller to interpret
  385. */
  386. int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen,
  387. u32 *out, int outlen)
  388. {
  389. int i, err;
  390. mutex_lock(&ipclock);
  391. if (ipcdev.pdev == NULL) {
  392. mutex_unlock(&ipclock);
  393. return -ENODEV;
  394. }
  395. for (i = 0; i < inlen; i++)
  396. ipc_data_writel(*in++, 4 * i);
  397. ipc_command((inlen << 16) | (sub << 12) | cmd);
  398. err = busy_loop();
  399. for (i = 0; i < outlen; i++)
  400. *out++ = ipc_data_readl(4 * i);
  401. mutex_unlock(&ipclock);
  402. return err;
  403. }
  404. EXPORT_SYMBOL(intel_scu_ipc_command);
  405. /*I2C commands */
  406. #define IPC_I2C_WRITE 1 /* I2C Write command */
  407. #define IPC_I2C_READ 2 /* I2C Read command */
  408. /**
  409. * intel_scu_ipc_i2c_cntrl - I2C read/write operations
  410. * @addr: I2C address + command bits
  411. * @data: data to read/write
  412. *
  413. * Perform an an I2C read/write operation via the SCU. All locking is
  414. * handled for the caller. This function may sleep.
  415. *
  416. * Returns an error code or 0 on success.
  417. *
  418. * This has to be in the IPC driver for the locking.
  419. */
  420. int intel_scu_ipc_i2c_cntrl(u32 addr, u32 *data)
  421. {
  422. u32 cmd = 0;
  423. mutex_lock(&ipclock);
  424. if (ipcdev.pdev == NULL) {
  425. mutex_unlock(&ipclock);
  426. return -ENODEV;
  427. }
  428. cmd = (addr >> 24) & 0xFF;
  429. if (cmd == IPC_I2C_READ) {
  430. writel(addr, ipcdev.i2c_base + IPC_I2C_CNTRL_ADDR);
  431. /* Write not getting updated without delay */
  432. mdelay(1);
  433. *data = readl(ipcdev.i2c_base + I2C_DATA_ADDR);
  434. } else if (cmd == IPC_I2C_WRITE) {
  435. writel(*data, ipcdev.i2c_base + I2C_DATA_ADDR);
  436. mdelay(1);
  437. writel(addr, ipcdev.i2c_base + IPC_I2C_CNTRL_ADDR);
  438. } else {
  439. dev_err(&ipcdev.pdev->dev,
  440. "intel_scu_ipc: I2C INVALID_CMD = 0x%x\n", cmd);
  441. mutex_unlock(&ipclock);
  442. return -EIO;
  443. }
  444. mutex_unlock(&ipclock);
  445. return 0;
  446. }
  447. EXPORT_SYMBOL(intel_scu_ipc_i2c_cntrl);
  448. /*
  449. * Interrupt handler gets called when ioc bit of IPC_COMMAND_REG set to 1
  450. * When ioc bit is set to 1, caller api must wait for interrupt handler called
  451. * which in turn unlocks the caller api. Currently this is not used
  452. *
  453. * This is edge triggered so we need take no action to clear anything
  454. */
  455. static irqreturn_t ioc(int irq, void *dev_id)
  456. {
  457. return IRQ_HANDLED;
  458. }
  459. /**
  460. * ipc_probe - probe an Intel SCU IPC
  461. * @dev: the PCI device matching
  462. * @id: entry in the match table
  463. *
  464. * Enable and install an intel SCU IPC. This appears in the PCI space
  465. * but uses some hard coded addresses as well.
  466. */
  467. static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id)
  468. {
  469. int err, pid;
  470. struct intel_scu_ipc_pdata_t *pdata;
  471. resource_size_t pci_resource;
  472. if (ipcdev.pdev) /* We support only one SCU */
  473. return -EBUSY;
  474. pid = id->driver_data;
  475. pdata = &intel_scu_ipc_pdata[pid];
  476. ipcdev.pdev = pci_dev_get(dev);
  477. err = pci_enable_device(dev);
  478. if (err)
  479. return err;
  480. err = pci_request_regions(dev, "intel_scu_ipc");
  481. if (err)
  482. return err;
  483. pci_resource = pci_resource_start(dev, 0);
  484. if (!pci_resource)
  485. return -ENOMEM;
  486. if (request_irq(dev->irq, ioc, 0, "intel_scu_ipc", &ipcdev))
  487. return -EBUSY;
  488. ipcdev.ipc_base = ioremap_nocache(pdata->ipc_base, pdata->ipc_len);
  489. if (!ipcdev.ipc_base)
  490. return -ENOMEM;
  491. ipcdev.i2c_base = ioremap_nocache(pdata->i2c_base, pdata->i2c_len);
  492. if (!ipcdev.i2c_base) {
  493. iounmap(ipcdev.ipc_base);
  494. return -ENOMEM;
  495. }
  496. intel_scu_devices_create();
  497. return 0;
  498. }
  499. /**
  500. * ipc_remove - remove a bound IPC device
  501. * @pdev: PCI device
  502. *
  503. * In practice the SCU is not removable but this function is also
  504. * called for each device on a module unload or cleanup which is the
  505. * path that will get used.
  506. *
  507. * Free up the mappings and release the PCI resources
  508. */
  509. static void ipc_remove(struct pci_dev *pdev)
  510. {
  511. free_irq(pdev->irq, &ipcdev);
  512. pci_release_regions(pdev);
  513. pci_dev_put(ipcdev.pdev);
  514. iounmap(ipcdev.ipc_base);
  515. iounmap(ipcdev.i2c_base);
  516. ipcdev.pdev = NULL;
  517. intel_scu_devices_destroy();
  518. }
  519. static DEFINE_PCI_DEVICE_TABLE(pci_ids) = {
  520. {PCI_VDEVICE(INTEL, 0x082a), SCU_IPC_LINCROFT},
  521. { 0,}
  522. };
  523. MODULE_DEVICE_TABLE(pci, pci_ids);
  524. static struct pci_driver ipc_driver = {
  525. .name = "intel_scu_ipc",
  526. .id_table = pci_ids,
  527. .probe = ipc_probe,
  528. .remove = ipc_remove,
  529. };
  530. static int __init intel_scu_ipc_init(void)
  531. {
  532. platform = intel_mid_identify_cpu();
  533. if (platform == 0)
  534. return -ENODEV;
  535. return pci_register_driver(&ipc_driver);
  536. }
  537. static void __exit intel_scu_ipc_exit(void)
  538. {
  539. pci_unregister_driver(&ipc_driver);
  540. }
  541. MODULE_AUTHOR("Sreedhara DS <sreedhara.ds@intel.com>");
  542. MODULE_DESCRIPTION("Intel SCU IPC driver");
  543. MODULE_LICENSE("GPL");
  544. module_init(intel_scu_ipc_init);
  545. module_exit(intel_scu_ipc_exit);