Guest User

Untitled

a guest
Jul 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. #define DRIVER_NAME "nf4"
  2.  
  3. static struct platform_driver nf4_driver = {
  4. .driver = {
  5. .name = DRIVER_NAME,
  6. .of_match_table = of_match_ptr(nf4_of_match),
  7. .owner = THIS_MODULE,
  8. .pm = NF4_DEV_PM_OPS,
  9. },
  10. .remove = nf4_remove,
  11. .id_table = nf4_ids,
  12. };
  13.  
  14. static int __init nf4_init(void)
  15. {
  16. pr_info("%s init drivern", __func__);
  17. return platform_driver_probe(&nf4_driver, nf4_probe);
  18. }
  19. late_initcall(nf4_init);
  20.  
  21. static int __init nf4_probe(struct platform_device *pdev)
  22. {
  23. struct nf4_platform_data_t *pdata = NULL;
  24. struct nf4_platform_data_t data = { 0 };
  25. struct nf4_dev_t* nf4 = NULL;
  26. struct device *dev = NULL;
  27. struct device *device = NULL;
  28. int err = 0;
  29. int count = 0;
  30.  
  31. if(!pdev || (NULL == &pdev->dev))
  32. return -ENODEV;
  33. [...]
  34. }
  35.  
  36. if (code == 0 && list_empty(&drv->driver.p->klist_devices.k_list))
  37. retval = -ENODEV;
  38.  
  39. nf4tag {
  40. compatible = "nf4";
  41. pinctrl-names = "default";
  42. pinctrl-0 = <&pinctrl_iso7816_default>;
  43. status = "disable";
  44.  
  45. power_regulator-supply = <&nf4_regulator>;
  46.  
  47. data-gpio = <&pioA 81 GPIO_ACTIVE_HIGH>;
  48. clock-gpio = <&pioA 82 GPIO_ACTIVE_HIGH>;
  49. reset-gpio = <&pca9506 20 GPIO_ACTIVE_HIGH>;
  50.  
  51. clock-delay = <20>;
  52. tx-parity = <1>;
  53. rx-parity = <1>;
  54. };
Add Comment
Please, Sign In to add comment