Advertisement
Guest User

x210 ec_sys patch

a guest
Sep 1st, 2019
353
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- a/drivers/acpi/ec_sys.c 2019-03-04 02:21:29.000000000 +0300
  2. +++ b/drivers/acpi/ec_sys.c 2019-09-01 01:04:13.527773200 +0300
  3. @@ -13,6 +13,7 @@
  4. #include <linux/debugfs.h>
  5. #include <linux/module.h>
  6. #include <linux/uaccess.h>
  7. +#include <linux/delay.h>
  8. #include "internal.h"
  9.  
  10. MODULE_AUTHOR("Thomas Renninger <trenn@suse.de>");
  11. @@ -108,6 +109,712 @@
  12. .llseek = default_llseek,
  13. };
  14.  
  15. +
  16. +#define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */
  17. +#define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */
  18. +#define ACPI_EC_FLAG_CMD 0x08 /* Input buffer contains a command */
  19. +#define ACPI_EC_FLAG_BURST 0x10 /* burst mode */
  20. +#define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */
  21. +
  22. +int ec_wr_cmd(struct acpi_ec *ec,u8 cmd,u8 * st)
  23. +{
  24. + u8 s=0;
  25. + u32 k;
  26. +
  27. + for(k=0;k<65535;k++)
  28. + {
  29. + s = inb(ec->command_addr);
  30. + if(!(s&ACPI_EC_FLAG_IBF))
  31. + {
  32. + outb(cmd, ec->command_addr);
  33. + if(st != NULL)
  34. + *st=s;
  35. +// printk("ec cmd=%02x k=%d ps=%02x s=%02x\n",cmd,k,s,inb(ec->command_addr));
  36. + return 0;
  37. + }
  38. + usleep_range(1,5);
  39. + }
  40. + if(st != NULL)
  41. + *st=s;
  42. + printk("!ec cmd=%02x\n",cmd);
  43. + return -ETIME;
  44. +
  45. +
  46. +}
  47. +
  48. +int ec_wr_data(struct acpi_ec *ec,u8 data, u8 * st)
  49. +{
  50. + u8 s=0;
  51. + u32 k;
  52. +
  53. + for(k=0;k<65535;k++)
  54. + {
  55. + s = inb(ec->command_addr);
  56. + if(!(s&ACPI_EC_FLAG_IBF))
  57. + {
  58. + outb(data, ec->data_addr);
  59. + if(st != NULL)
  60. + *st=s;
  61. +// printk("ec out=%02x k=%d ps=%02x s=%02x\n",data,k,s,inb(ec->command_addr));
  62. + return 0;
  63. + }
  64. + usleep_range(1,5);
  65. + }
  66. + if(st != NULL)
  67. + *st=s;
  68. + printk("!ec out=%02x\n",data);
  69. + return -ETIME;
  70. +
  71. +
  72. +}
  73. +
  74. +int ec_rd_data(struct acpi_ec *ec,u8 * data, u8 *st)
  75. +{
  76. + u8 s=0,os=0;
  77. + u32 k;
  78. + if(data != NULL)
  79. + {
  80. + for(k=0;k<65536;k++)
  81. + {
  82. + s = inb(ec->command_addr);
  83. + if(os!=s)
  84. + {
  85. +// printk("s=%02x=>%02x\n",os,s);
  86. + os=s;
  87. + }
  88. + if(st != NULL)
  89. + *st=s;
  90. + if(s&ACPI_EC_FLAG_IBF)
  91. + {
  92. + usleep_range(1,5);
  93. + continue;
  94. + }
  95. + if(s&ACPI_EC_FLAG_OBF)
  96. + {
  97. + *data=inb(ec->data_addr);
  98. + return 0;
  99. + }
  100. + usleep_range(1,5);
  101. + }
  102. + printk("RDDATA TIMEO s=%02x\n",s);
  103. + *data=inb(ec->data_addr);
  104. + if(st != NULL)
  105. + *st=s;
  106. + }
  107. + return 0;
  108. + return -ETIME;
  109. +
  110. +
  111. +}
  112. +
  113. +int ec_flush(struct acpi_ec *ec)
  114. +{
  115. + u8 s=0;
  116. + u32 k;
  117. + u8 err=0;
  118. + for(k=0;k<65535;k++)
  119. + {
  120. + s = inb(ec->command_addr);
  121. + if(!(s&ACPI_EC_FLAG_SCI))
  122. + {
  123. + return 0;
  124. + }
  125. + if(!err)
  126. + err=ec_wr_cmd(ec,0x84,NULL);
  127. + if(!err)
  128. + err=ec_rd_data(ec,&s,NULL);
  129. + if(err)
  130. + return err;
  131. +// printk("GPE=%02x\n",s);
  132. + }
  133. + return -ETIME;
  134. +}
  135. +
  136. +int ec_get_sci(struct acpi_ec *ec)
  137. +{
  138. + u8 s=0;
  139. + u32 k;
  140. + u8 err=0;
  141. + for(k=0;k<65535;k++)
  142. + {
  143. + s = inb(ec->command_addr);
  144. + if(s&ACPI_EC_FLAG_SCI)
  145. + {
  146. + if(!err)
  147. + err=ec_wr_cmd(ec,0x84,NULL);
  148. + if(!err)
  149. + err=ec_rd_data(ec,&s,NULL);
  150. + if(err)
  151. + return err;
  152. + return s;
  153. +// printk("GPE=%02x\n",s);
  154. + }
  155. + usleep_range(10,50);
  156. + }
  157. + return -ETIME;
  158. +}
  159. +
  160. +
  161. +#define EC_RAM_SIZE 0x01000000
  162. +#define EC_GPIO_SIZE 0x0100
  163. +
  164. +
  165. +
  166. +int ec_read_gpio(u32 addr, u8 *val)
  167. +{
  168. + int err=0;
  169. + u8 ob;
  170. + u8 stat,d;
  171. + struct acpi_ec *ec=first_ec;
  172. +
  173. + ob=(addr)&0xff;
  174. +
  175. +
  176. + mutex_lock(&ec->mutex);
  177. + if(!err)
  178. + err=ec_wr_cmd(ec,0x82,&stat);
  179. + if(!err)
  180. + err=ec_rd_data(ec,&d,&stat);
  181. +// printk("v=%02x\n",d);
  182. + if(!err)
  183. + err=ec_flush(ec);
  184. +
  185. +
  186. + if(!err)
  187. + err=ec_wr_cmd(ec,0xba,&stat);
  188. + if(!err)
  189. + err=ec_wr_data(ec,ob,&stat);
  190. + if(!err)
  191. + err=ec_rd_data(ec,val,&stat);
  192. +
  193. +
  194. +// printk("s=%02x\n",stat);
  195. + if(!err)
  196. + err=ec_wr_cmd(ec,0x83,&stat);
  197. +
  198. + mutex_unlock(&ec->mutex);
  199. +
  200. + return err;
  201. +}
  202. +
  203. +int ec_write_gpio(u32 addr, u8 val)
  204. +{
  205. + int err=0;
  206. + u8 ob;
  207. + u8 stat,d;
  208. + struct acpi_ec *ec=first_ec;
  209. +
  210. + ob=(addr)&0xff;
  211. + if (!write_support)
  212. + return -EINVAL;
  213. +
  214. +
  215. + mutex_lock(&ec->mutex);
  216. + if(!err)
  217. + err=ec_wr_cmd(ec,0x82,&stat);
  218. + if(!err)
  219. + err=ec_rd_data(ec,&d,&stat);
  220. +// printk("v=%02x\n",d);
  221. + if(!err)
  222. + err=ec_flush(ec);
  223. +
  224. +
  225. + if(!err)
  226. + err=ec_wr_cmd(ec,0xb9,&stat);
  227. + if(!err)
  228. + err=ec_wr_data(ec,val,&stat);
  229. +
  230. +
  231. +// printk("s=%02x\n",stat);
  232. + if(!err)
  233. + err=ec_wr_cmd(ec,0x83,&stat);
  234. +
  235. + mutex_unlock(&ec->mutex);
  236. +
  237. + return err;
  238. +}
  239. +
  240. +int ec_read_ram(u32 addr, u8 *val)
  241. +{
  242. + int err=0;
  243. + u8 ob[4];
  244. + u8 stat,d;
  245. + struct acpi_ec *ec=first_ec;
  246. +
  247. + ob[0]=(addr >>16)&0xff;
  248. + ob[1]=(addr >>8)&0xff;
  249. + ob[2]=(addr)&0xff;
  250. + ob[3]=0;
  251. +
  252. +
  253. + mutex_lock(&ec->mutex);
  254. +
  255. +
  256. + if(!err)
  257. + err=ec_wr_cmd(ec,0x82,&stat);
  258. + if(!err)
  259. + err=ec_rd_data(ec,&d,&stat);
  260. +// printk("v=%02x\n",d);
  261. + if(!err)
  262. + err=ec_flush(ec);
  263. +
  264. +
  265. + if(!err)
  266. + err=ec_wr_cmd(ec,0xbf,&stat);
  267. + if(!err)
  268. + err=ec_wr_data(ec,ob[0],&stat);
  269. + if(!err)
  270. + err=ec_wr_data(ec,ob[1],&stat);
  271. + if(!err)
  272. + err=ec_wr_data(ec,ob[2],&stat);
  273. + if(!err)
  274. + err=ec_rd_data(ec,val,&stat);
  275. +
  276. +
  277. +// printk("s=%02x\n",stat);
  278. + if(!err)
  279. + err=ec_wr_cmd(ec,0x83,&stat);
  280. +
  281. + mutex_unlock(&ec->mutex);
  282. +
  283. + return err;
  284. +}
  285. +
  286. +static int ec_write_ram(u32 addr, u8 val)
  287. +{
  288. + int err=0;
  289. + u8 ob[4];
  290. + u8 stat,d;
  291. + struct acpi_ec *ec=first_ec;
  292. + if (!write_support)
  293. + return -EINVAL;
  294. +
  295. + ob[0]=(addr >>16)&0xff;
  296. + ob[1]=(addr >>8)&0xff;
  297. + ob[2]=(addr)&0xff;
  298. + ob[3]=val;
  299. +
  300. + if(!err)
  301. + err=ec_wr_cmd(ec,0x82,&stat);
  302. + if(!err)
  303. + err=ec_rd_data(ec,&d,&stat);
  304. +// printk("v=%02x\n",d);
  305. + if(!err)
  306. + err=ec_flush(ec);
  307. +
  308. +
  309. + if(!err)
  310. + err=ec_wr_cmd(ec,0xbe,&stat);
  311. + if(!err)
  312. + err=ec_wr_data(ec,ob[0],&stat);
  313. + if(!err)
  314. + err=ec_wr_data(ec,ob[1],&stat);
  315. + if(!err)
  316. + err=ec_wr_data(ec,ob[2],&stat);
  317. + if(!err)
  318. + err=ec_wr_data(ec,ob[3],&stat);
  319. +
  320. +
  321. +// printk("s=%02x\n",stat);
  322. + if(!err)
  323. + err=ec_wr_cmd(ec,0x83,&stat);
  324. +
  325. + mutex_unlock(&ec->mutex);
  326. +
  327. + return err;
  328. +}
  329. +
  330. +int ec_read_ram_word(u32 addr, u8 *val)
  331. +{
  332. + int err=0;
  333. + u8 ob[4];
  334. + u8 stat,d;
  335. + struct acpi_ec *ec=first_ec;
  336. + if(addr&1)
  337. + return -EINVAL;
  338. + ob[0]=(addr >>16)&0xff;
  339. + ob[1]=(addr >>8)&0xff;
  340. + ob[2]=(addr)&0xff;
  341. + ob[3]=0;
  342. +
  343. +
  344. + mutex_lock(&ec->mutex);
  345. +
  346. +
  347. + if(!err)
  348. + err=ec_wr_cmd(ec,0x82,&stat);
  349. + if(!err)
  350. + err=ec_rd_data(ec,&d,&stat);
  351. +// printk("v=%02x\n",d);
  352. + if(!err)
  353. + err=ec_flush(ec);
  354. +
  355. +
  356. + if(!err)
  357. + err=ec_wr_cmd(ec,0xb8,&stat);
  358. + if(!err)
  359. + err=ec_wr_data(ec,ob[0],&stat);
  360. + if(!err)
  361. + err=ec_wr_data(ec,ob[1],&stat);
  362. + if(!err)
  363. + err=ec_wr_data(ec,ob[2],&stat);
  364. + if(!err)
  365. + err=ec_wr_data(ec,ob[3],&stat);
  366. + if(!err)
  367. + err=ec_rd_data(ec,val,&stat);
  368. +
  369. + ob[3]=2;
  370. + if(!err)
  371. + err=ec_wr_cmd(ec,0xb8,&stat);
  372. + if(!err)
  373. + err=ec_wr_data(ec,ob[0],&stat);
  374. + if(!err)
  375. + err=ec_wr_data(ec,ob[1],&stat);
  376. + if(!err)
  377. + err=ec_wr_data(ec,ob[2],&stat);
  378. + if(!err)
  379. + err=ec_wr_data(ec,ob[3],&stat);
  380. + if(!err)
  381. + err=ec_rd_data(ec,&val[1],&stat);
  382. +
  383. +// printk("s=%02x\n",stat);
  384. + if(!err)
  385. + err=ec_wr_cmd(ec,0x83,&stat);
  386. +
  387. + mutex_unlock(&ec->mutex);
  388. +
  389. + return err;
  390. +}
  391. +
  392. +static int ec_write_ram_word(u32 addr, u16 val)
  393. +{
  394. + int err=0;
  395. + u8 ob[5];
  396. + u8 stat,d;
  397. + struct acpi_ec *ec=first_ec;
  398. + if (!write_support)
  399. + return -EINVAL;
  400. + if(addr&1)
  401. + return -EINVAL;
  402. +
  403. + ob[0]=(addr >>16)&0xff;
  404. + ob[1]=(addr >>8)&0xff;
  405. + ob[2]=(addr)&0xff;
  406. + ob[3]=val&0xff;
  407. + ob[4]=val>>8;
  408. +
  409. + if(!err)
  410. + err=ec_wr_cmd(ec,0x82,&stat);
  411. + if(!err)
  412. + err=ec_rd_data(ec,&d,&stat);
  413. +// printk("v=%02x\n",d);
  414. + if(!err)
  415. + err=ec_flush(ec);
  416. +
  417. +
  418. + if(!err)
  419. + err=ec_wr_cmd(ec,0xb7,&stat);
  420. + if(!err)
  421. + err=ec_wr_data(ec,ob[0],&stat);
  422. + if(!err)
  423. + err=ec_wr_data(ec,ob[1],&stat);
  424. + if(!err)
  425. + err=ec_wr_data(ec,ob[2],&stat);
  426. + if(!err)
  427. + err=ec_wr_data(ec,ob[3],&stat);
  428. + if(!err)
  429. + err=ec_wr_data(ec,ob[4],&stat);
  430. +
  431. +
  432. +// printk("s=%02x\n",stat);
  433. + if(!err)
  434. + err=ec_wr_cmd(ec,0x83,&stat);
  435. +
  436. + mutex_unlock(&ec->mutex);
  437. +
  438. + return err;
  439. +}
  440. +
  441. +static ssize_t acpi_ec_read_ram(struct file *f, char __user *buf,
  442. + size_t count, loff_t *off)
  443. +{
  444. + /* Use this if support reading/writing multiple ECs exists in ec.c:
  445. + * struct acpi_ec *ec = ((struct seq_file *)f->private_data)->private;
  446. + */
  447. + unsigned int size = EC_RAM_SIZE;
  448. + loff_t init_off = *off;
  449. + int err = 0;
  450. + u8 byte_read[2];
  451. +
  452. + if (*off >= size)
  453. + return 0;
  454. + if (*off + count >= size) {
  455. + size -= *off;
  456. + count = size;
  457. + } else
  458. + size = count;
  459. + if((*off & 1)||(size&1))
  460. + while (size) {
  461. + err = ec_read_ram(*off, byte_read);
  462. + if (err)
  463. + return err;
  464. + if (put_user(byte_read[0], buf + *off - init_off)) {
  465. + if (*off - init_off)
  466. + return *off - init_off; /* partial read */
  467. + return -EFAULT;
  468. + }
  469. + *off += 1;
  470. + size--;
  471. + }
  472. + else
  473. + while (size) {
  474. + err = ec_read_ram_word(*off, byte_read);
  475. + if (err)
  476. + return err;
  477. + if (put_user(byte_read[0], buf + *off - init_off)) {
  478. + if (*off - init_off)
  479. + return *off - init_off; // partial read
  480. + return -EFAULT;
  481. + }
  482. + *off += 1;
  483. + size--;
  484. + if (put_user(byte_read[1], buf + *off - init_off)) {
  485. + if (*off - init_off)
  486. + return *off - init_off; // partial read
  487. + return -EFAULT;
  488. + }
  489. + *off += 1;
  490. + size--;
  491. + }
  492. +
  493. + return count;
  494. +}
  495. +
  496. +static ssize_t acpi_ec_write_ram(struct file *f, const char __user *buf,
  497. + size_t count, loff_t *off)
  498. +{
  499. + /* Use this if support reading/writing multiple ECs exists in ec.c:
  500. + * struct acpi_ec *ec = ((struct seq_file *)f->private_data)->private;
  501. + */
  502. +
  503. + unsigned int size = count;
  504. + loff_t init_off = *off;
  505. + int err = 0;
  506. +
  507. + if (!write_support)
  508. + return -EINVAL;
  509. +
  510. + if (*off >= EC_RAM_SIZE)
  511. + return 0;
  512. + if (*off + count >= EC_RAM_SIZE) {
  513. + size = EC_RAM_SIZE - *off;
  514. + count = size;
  515. + }
  516. +
  517. + if((*off & 1)||(size&1))
  518. + while (size) {
  519. + u8 byte_write;
  520. + if (get_user(byte_write, buf + *off - init_off)) {
  521. + if (*off - init_off)
  522. + return *off - init_off; /* partial write */
  523. + return -EFAULT;
  524. + }
  525. + err = ec_write_ram(*off, byte_write);
  526. + err=0;
  527. + if (err)
  528. + return err;
  529. +
  530. + *off += 1;
  531. + size--;
  532. + }
  533. + else
  534. + while (size) {
  535. + u8 byte_write[2];
  536. + if (get_user(byte_write[0], buf + *off - init_off)) {
  537. + if (*off - init_off)
  538. + return *off - init_off; /* partial write */
  539. + return -EFAULT;
  540. + }
  541. + if (get_user(byte_write[1], buf + *off - init_off+1)) {
  542. + if (*off - init_off)
  543. + return *off - init_off; /* partial write */
  544. + return -EFAULT;
  545. + }
  546. + err = ec_write_ram_word(*off, *(u16*)byte_write);
  547. + err=0;
  548. + if (err)
  549. + return err;
  550. +
  551. + *off += 2;
  552. + size-=2;
  553. + }
  554. + return count;
  555. +}
  556. +
  557. +static ssize_t acpi_ec_read_gpio(struct file *f, char __user *buf,
  558. + size_t count, loff_t *off)
  559. +{
  560. + /* Use this if support reading/writing multiple ECs exists in ec.c:
  561. + * struct acpi_ec *ec = ((struct seq_file *)f->private_data)->private;
  562. + */
  563. + unsigned int size = EC_GPIO_SIZE;
  564. + loff_t init_off = *off;
  565. + int err = 0;
  566. +
  567. + if (*off >= size)
  568. + return 0;
  569. + if (*off + count >= size) {
  570. + size -= *off;
  571. + count = size;
  572. + } else
  573. + size = count;
  574. +
  575. + while (size) {
  576. + u8 byte_read;
  577. + err = ec_read_gpio(*off, &byte_read);
  578. + if (err)
  579. + return err;
  580. + if (put_user(byte_read, buf + *off - init_off)) {
  581. + if (*off - init_off)
  582. + return *off - init_off; /* partial read */
  583. + return -EFAULT;
  584. + }
  585. + *off += 1;
  586. + size--;
  587. + }
  588. + return count;
  589. +}
  590. +
  591. +static ssize_t acpi_ec_write_gpio(struct file *f, const char __user *buf,
  592. + size_t count, loff_t *off)
  593. +{
  594. + /* Use this if support reading/writing multiple ECs exists in ec.c:
  595. + * struct acpi_ec *ec = ((struct seq_file *)f->private_data)->private;
  596. + */
  597. +
  598. + unsigned int size = count;
  599. + loff_t init_off = *off;
  600. + int err = 0;
  601. +
  602. + if (!write_support)
  603. + return -EINVAL;
  604. +
  605. + if (*off >= EC_GPIO_SIZE)
  606. + return 0;
  607. + if (*off + count >= EC_GPIO_SIZE) {
  608. + size = EC_GPIO_SIZE - *off;
  609. + count = size;
  610. + }
  611. +
  612. + while (size) {
  613. + u8 byte_write;
  614. + if (get_user(byte_write, buf + *off - init_off)) {
  615. + if (*off - init_off)
  616. + return *off - init_off; /* partial write */
  617. + return -EFAULT;
  618. + }
  619. + err = ec_write_gpio(*off, byte_write);
  620. + err=0;
  621. + if (err)
  622. + return err;
  623. +
  624. + *off += 1;
  625. + size--;
  626. + }
  627. + return count;
  628. +}
  629. +
  630. +static const struct file_operations acpi_ec_ram_ops = {
  631. + .owner = THIS_MODULE,
  632. + .open = simple_open,
  633. + .read = acpi_ec_read_ram,
  634. + .write = acpi_ec_write_ram,
  635. + .llseek = default_llseek,
  636. +};
  637. +
  638. +static const struct file_operations acpi_ec_gpio_ops = {
  639. + .owner = THIS_MODULE,
  640. + .open = simple_open,
  641. + .read = acpi_ec_read_gpio,
  642. + .write = acpi_ec_write_gpio,
  643. + .llseek = default_llseek,
  644. +};
  645. +
  646. +
  647. +
  648. +
  649. +static ssize_t acpi_ec_read_sci(struct file *f, char __user *buf,
  650. + size_t count, loff_t *off)
  651. +{
  652. + /* Use this if support reading/writing multiple ECs exists in ec.c:
  653. + * struct acpi_ec *ec = ((struct seq_file *)f->private_data)->private;
  654. + */
  655. + unsigned int size = count;
  656. + loff_t init_off = *off;
  657. + int err=0;
  658. + struct acpi_ec *ec=first_ec;
  659. +
  660. + mutex_lock(&ec->mutex);
  661. +/* if(!err)
  662. + err=ec_wr_cmd(ec,0x82,&stat);
  663. + if(!err)
  664. + err=ec_rd_data(ec,&d,&stat);*/
  665. +
  666. + while (size) {
  667. + err = ec_get_sci(ec);
  668. + if (err<0)
  669. + {
  670. + mutex_unlock(&ec->mutex);
  671. + return err;
  672. + }
  673. + if (put_user(err, buf + *off - init_off)) {
  674. + mutex_unlock(&ec->mutex);
  675. + if (*off - init_off)
  676. + return *off - init_off; /* partial read */
  677. + return -EFAULT;
  678. + }
  679. + *off += 1;
  680. + size--;
  681. + }
  682. +
  683. +/* if(!err)
  684. + err=ec_wr_cmd(ec,0x83,&stat);*/
  685. +
  686. + mutex_unlock(&ec->mutex);
  687. +
  688. + return count;
  689. +}
  690. +
  691. +static ssize_t acpi_ec_write_sci(struct file *f, const char __user *buf,
  692. + size_t count, loff_t *off)
  693. +{
  694. + /* Use this if support reading/writing multiple ECs exists in ec.c:
  695. + * struct acpi_ec *ec = ((struct seq_file *)f->private_data)->private;
  696. + */
  697. +
  698. + return -EINVAL;
  699. +
  700. +}
  701. +
  702. +
  703. +static const struct file_operations acpi_ec_sci_ops = {
  704. + .owner = THIS_MODULE,
  705. + .open = simple_open,
  706. + .read = acpi_ec_read_sci,
  707. + .write = acpi_ec_write_sci,
  708. + .llseek = default_llseek,
  709. +};
  710. +
  711. +
  712. +
  713. +
  714. +
  715. +
  716. +
  717. +
  718. +
  719. +
  720. +
  721. static int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count)
  722. {
  723. struct dentry *dev_dir;
  724. @@ -136,7 +843,13 @@
  725.  
  726. if (write_support)
  727. mode = 0600;
  728. - if (!debugfs_create_file("io", mode, dev_dir, ec, &acpi_ec_io_ops))
  729. + if (!debugfs_create_file_size("io", mode, dev_dir, ec, &acpi_ec_io_ops,EC_SPACE_SIZE))
  730. + goto error;
  731. + if (!debugfs_create_file("sci", mode, dev_dir, ec, &acpi_ec_sci_ops))
  732. + goto error;
  733. + if (!debugfs_create_file_size("ram", mode, dev_dir, ec, &acpi_ec_ram_ops,EC_RAM_SIZE))
  734. + goto error;
  735. + if (!debugfs_create_file_size("gpio", mode, dev_dir, ec, &acpi_ec_gpio_ops,EC_GPIO_SIZE))
  736. goto error;
  737.  
  738. return 0;
Advertisement
RAW Paste Data Copied
Advertisement