指纹调试日志

2017年06月28日 15:50:41

阅读数:212

 
  1. 参考 chipsailing_MTK_6.0_2.0_移植包 里面的文档

  2.  
  3. 一、将MTK_6.0_2.0_移植包\kernel-3.18\drivers\input\chipsailing的驱动文件

  4. 拷贝到kernel-3.18\drivers\input \目录下(具体的存放路径可以自定义);

  5. 并修改驱动的文件夹所在的Makefile文件,

  6. 在其中加入:obj-y += chipsailing/ ;

  7. 使得编译能编译到驱动代码;

  8.  
  9. 二、参考MTK_6.0_2.0_移植包\kernel-3.18\arch\arm\boot\dt\len6735_66_m0.dts文件,

  10. 在调试实际的项目.dts文件中添加如下的内容:请注意加入内容的位置,不然会编译错误。

  11. 以下的步骤都可以通过搜索“chipsailing”关键字搜索到所需要添加的内容。

  12. 每一段内容都是以“add by chipsailing start”开头,以” add by chipsailing end”为结束,

  13. 即所需加入的代码。

  14.  
  15. 1.将MTK_6.0_2.0_移植包\kernel-3.18\arch\arm\boot\dt\len6735_66_m0.dts文件的第8行到第18行的如下代码加到 具体实际项目的.dts文件中根节点 ”/{ “ 前添加:

  16. /*add by chipsailing start FINGERPRINT GPIO standardization*/

  17. #define __CS_FINGERPRINT_EINT_EN_PIN_NUM__ 61 // 这些引脚需要查看硬件原理图

  18. #define __CS_FINGERPRINT_EINT_PIN__ PINMUX_GPIO61__FUNC_GPIO61

  19. #define __CS_FINGERPRINT_RESET_PIN__ PINMUX_GPIO64__FUNC_GPIO64

  20.  
  21. #define __CS_FINGERPRINT_MO_PIN__ PINMUX_GPIO68__FUNC_SPI_MOA

  22. #define __CS_FINGERPRINT_MI_PIN__ PINMUX_GPIO67__FUNC_SPI_MIA

  23. #define __CS_FINGERPRINT_CLK_PIN__ PINMUX_GPIO66__FUNC_SPI_CKA

  24. #define __CS_FINGERPRINT_CS_PIN__ PINMUX_GPIO65__FUNC_SPI_CSA

  25.  
  26. /*add by chipsailing end */

  27. 这些内容是添加实际的GIPO配置管脚信息。

  28.  
  29. 2. 将MTK_6.0_2.0_移植包\kernel-3.18\arch\arm\boot\dt\len6735_66_m0.dts文件的第40行到第68行的如下代码加到 具体实际项目的.dts文件中,注意它的位置是在跟目录里面。

  30. /*add by chipsailing start sunwei for v7 prj*/

  31. cs_finger:cs_finger {

  32. compatible = "mediatek,cs_finger";

  33. pinctrl-names="cs_finger_pins_default", "cs_finger_reset_en0","cs_finger_reset_en1","cs_finger_spi0_mi_as_spi0_mi","cs_finger_spi0_mi_as_gpio", "cs_finger_spi0_mo_as_spi0_mo","cs_finger_spi0_mo_as_gpio","cs_finger_spi0_clk_as_spi0_clk","cs_finger_spi0_clk_as_gpio","cs_finger_spi0_cs_as_spi0_cs",

  34. "cs_finger_spi0_cs_as_gpio","cs_finger_int_as_int","cs_finger_eint_pull_down","cs_finger_eint_pull_disable","cs_finger_pwr_off", "cs_finger_pwr_on";

  35. pinctrl-0 = <&cs_finger_pins_default>;

  36. pinctrl-1 = <&cs_finger_reset_en0>;

  37. pinctrl-2 = <&cs_finger_reset_en1>;

  38. pinctrl-3 = <&cs_finger_spi0_mi_as_spi0_mi>;

  39. pinctrl-4 = <&cs_finger_spi0_mi_as_gpio>;

  40. pinctrl-5 = <&cs_finger_spi0_mo_as_spi0_mo>;

  41. pinctrl-6 = <&cs_finger_spi0_mo_as_gpio>;

  42. pinctrl-7 = <&cs_finger_spi0_clk_as_spi0_clk>;

  43. pinctrl-8= <&cs_finger_spi0_clk_as_gpio>;

  44. pinctrl-9= <&cs_finger_spi0_cs_as_spi0_cs>;

  45. pinctrl-10= <&cs_finger_spi0_cs_as_gpio>;

  46. pinctrl-11= <&cs_finger_int_as_int>;

  47. pinctrl-12= <&cs_finger_eint_pull_down>;

  48. pinctrl-13= <&cs_finger_eint_pull_disable>;

  49. pinctrl-14= <&cs_finger_pwr_off>;

  50. pinctrl-15= <&cs_finger_pwr_on>;

  51.  
  52. //gpios = <&pio 125 0>;

  53. interrupt-parent = <&eintc>;

  54. interrupts = <__CS_FINGERPRINT_EINT_EN_PIN_NUM__ IRQ_TYPE_EDGE_RISING>;

  55. debounce = <__CS_FINGERPRINT_EINT_EN_PIN_NUM__ 0>;

  56. };

  57. // add by chipsailing end

  58. 这些内容是GPIO的一些初始化配置。

  59.  
  60. 3. 将MTK_6.0_2.0_移植包kernel-3.18\arch\arm\boot\dt\len6735_66_m0.dts文件的第173行到第318行的如下代码加到 具体实际项目的.dts文件中,注意它的位置跟其他的&pio是并行的。

  61. /* add by chipsailing start GPIO standardization */

  62. &pio {

  63. cs_finger_pwr_off: cs_finger_pwr_off {

  64. pins_cmd_dat {

  65. pins = <PINMUX_GPIO78__FUNC_GPIO78>;

  66. slew-rate = <1>;

  67. output-low;

  68. };

  69. };

  70. cs_finger_pwr_on: cs_finger_pwr_on {

  71. pins_cmd_dat {

  72. pins = <PINMUX_GPIO78__FUNC_GPIO78>;

  73. slew-rate = <1>;

  74. output-high;

  75. };

  76. };

  77.  
  78. cs_finger_pins_default:cs_finger_pins_default{

  79.  
  80. pins_cmd_dat {

  81. pins = <PINMUX_GPIO65__FUNC_SPI_CSA>;

  82. };

  83. pins_cmd2_dat {

  84. pins = <PINMUX_GPIO66__FUNC_SPI_CKA>;

  85. };

  86. pins_cmd3_dat {

  87. pins = <PINMUX_GPIO67__FUNC_SPI_MIA>;

  88. };

  89. pins_cmd4_dat {

  90. pins = <PINMUX_GPIO68__FUNC_SPI_MOA>;

  91. };

  92.  
  93.  
  94. };

  95.  
  96. cs_finger_reset_en0:cs_finger_reset_en@0{

  97. pins_cmd_dat {

  98. pins = <__CS_FINGERPRINT_RESET_PIN__>;

  99. slew-rate = <1>;

  100. output-low;

  101. };

  102. };

  103. cs_finger_reset_en1:cs_finger_reset_en@1{

  104. pins_cmd_dat {

  105. pins = <__CS_FINGERPRINT_RESET_PIN__>;

  106. slew-rate = <1>;

  107. output-high;

  108. };

  109. };

  110. cs_finger_spi0_mi_as_spi0_mi:cs_finger_spi0_mi_as_spi0_mi@0{

  111. pins_cmd_dat {

  112. pins = <__CS_FINGERPRINT_MI_PIN__>;

  113. slew-rate = <0>;

  114. bias-disable;

  115. output-low;

  116. input-schmitt-enable = <0>;

  117. };

  118. };

  119.  
  120. cs_finger_spi0_mi_as_gpio:cs_finger_spi0_mi_as_gpio@0{

  121. pins_cmd_dat {

  122. pins = <__CS_FINGERPRINT_MI_PIN__>;

  123. slew-rate = <0>;

  124. output-low;

  125. input-schmitt-enable = <0>;

  126. };

  127. };

  128.  
  129.  
  130. cs_finger_spi0_mo_as_spi0_mo:cs_finger_spi0_mo_as_spi0_mo@0{

  131. pins_cmd_dat {

  132. pins = <__CS_FINGERPRINT_MO_PIN__>;

  133. slew-rate = <1>;

  134. bias-disable;

  135. output-low;

  136. input-schmitt-enable = <0>;

  137. };

  138. };

  139.  
  140. cs_finger_spi0_mo_as_gpio:cs_finger_spi0_mo_as_gpio@0{

  141. pins_cmd_dat {

  142. pins = <__CS_FINGERPRINT_MO_PIN__>;

  143. slew-rate = <1>;

  144. output-low;

  145. input-schmitt-enable = <0>;

  146. };

  147. };

  148. cs_finger_spi0_clk_as_spi0_clk:cs_finger_spi0_clk_as_spi0_clk@0{

  149. pins_cmd_dat {

  150. pins = <__CS_FINGERPRINT_CLK_PIN__>;

  151. slew-rate = <1>;

  152. bias-disable;

  153. output-low;

  154. input-schmitt-enable = <0>;

  155. };

  156. };

  157. cs_finger_spi0_clk_as_gpio:cs_finger_spi0_clk_as_gpio@0{

  158. pins_cmd_dat {

  159. pins = <__CS_FINGERPRINT_CLK_PIN__>;

  160. slew-rate = <1>;

  161. output-low;

  162. input-schmitt-enable = <0>;

  163. };

  164. };

  165. cs_finger_spi0_cs_as_spi0_cs:cs_finger_spi0_cs_as_spi0_cs@0{

  166. pins_cmd_dat {

  167. pins = <__CS_FINGERPRINT_CS_PIN__>;

  168. slew-rate = <1>;

  169. bias-disable;

  170. output-low;

  171. input-schmitt-enable = <0>;

  172. };

  173. };

  174. cs_finger_spi0_cs_as_gpio:cs_finger_spi0_cs_as_gpio@0{

  175. pins_cmd_dat {

  176. pins = <__CS_FINGERPRINT_CS_PIN__>;

  177. slew-rate = <1>;

  178. output-low;

  179. input-schmitt-enable = <0>;

  180. };

  181. };

  182. cs_finger_int_as_int: cs_finger_int_as_int@0{

  183. pins_cmd_dat {

  184. pins = <__CS_FINGERPRINT_EINT_PIN__>;

  185. slew-rate = <0>;

  186. bias-pull-up = <00>;

  187. };

  188. };

  189.  
  190. cs_finger_eint_pull_down: cs_finger_eint_pull_down {

  191. pins_cmd_dat {

  192. pins = <__CS_FINGERPRINT_EINT_PIN__>;

  193. slew-rate = <0>;

  194. bias-pull-down = <00>;

  195. };

  196. };

  197.  
  198. cs_finger_eint_pull_disable: cs_finger_eint_pull_disable {

  199. pins_cmd_dat {

  200. pins = <__CS_FINGERPRINT_EINT_PIN__>;

  201. slew-rate = <0>;

  202. bias-disable;

  203. };

  204. };

  205. };

  206. /*******************add by chipsailing end****************/

  207.  
  208. 三、添加权限

  209. 1.添加字符节点权限:

  210. 参考MTK_6.0_2.0_移植包\device\lentek\len6735_66_m0\init.project.rc文件,在实际调试的项目文件

  211. device\lentek\len6737m_35_m0\init.project.rc中添加节点权限:

  212. 注意: 加在on init 之前

  213.  
  214. #[chipsailing fingerprint begin]

  215. # fingerprint

  216. chown system system /dev/cs_spi

  217. chmod 0777 /dev/cs_spi

  218. #[chipsailing fingerprint end]

  219.  
  220. 2.参考MTK_6.0_2.0_移植包\device\mediatek\common\sepolicy\目录下面的文件,对应在实际调试的项目对应的文件

  221. device\mediatek\common\sepolicy中添加内容,添加的内容一一如下:

  222. 注意: 加在末尾

  223.  
  224. 1.device.te文件添加:

  225. # For CHIPSAILING fingerprint

  226. type csfinger_device, dev_type;

  227.  
  228. 2. file_contexts文件添加:

  229. #For CHIPSAILING FP

  230. /dev/cs_spi u:object_r:csfinger_device:s0

  231.  
  232. 3. fingerprintd.te文件:

  233. 直接把此文件复制到\device\mediatek\common\sepolicy\目录下面(路径以实际为准)。

  234.  
  235. 4. system_app.te文件添加:

  236. #For CHIPSAILING FP

  237. allow system_app csfinger_device:file rw_file_perms;

  238.  
  239. 5. system_server.te文件添加:

  240. #For CHIPSAILING FP

  241. allow system_server csfinger_device:file rw_file_perms;

  242. allow system_server csfinger_device:chr_file{read write open};

  243.  
  244. 6. untrusted_app.te文件添加:

  245. # For CHIPSAILING FP

  246. allow untrusted_app csfinger_device:chr_file{read write ioctl open};

  247.  
  248. 3.参考MTK_6.0_2.0_移植包\system\core\rootdir\init.rc, 对应在实际调试的项目对应的文件

  249. system\core\rootdir\init.rc中添加内容,添加的内容一一如下:

  250. 注意: 加在末尾

  251.  
  252. # add by chipsailing start

  253. service fingerprintd /system/bin/fingerprintd

  254. class late_start

  255. user system

  256. # add by chipsailing end

  257. 这是添加指纹服务启动的代码

  258.  
  259.  
  260. 四、系统适配部分:

  261. 1.添加so库

  262. 参考MTK_6.0_2.0_移植包\vendor\cs_fp_so\,把cs_finger_so文件夹复制到客户vendor目录下,

  263. cs_fp_so文件夹下面有32位和64位的库,根据系统的实际位数选择库,复制之后,

  264. 参考MTK_6.0_2.0_移植包\device\mediatek\mt6735\device.mk文件,在实际调试的项目的device.mk文件

  265. device\mediatek\mt6735\device.mk中添加:

  266. 注意: 加在末尾

  267. # add by cipsailing start

  268. PRODUCT_PACKAGES += fingerprintd

  269. PRODUCT_COPY_FILES+= vendor/cs_fp_so/32bit/fingerprint.default.so:system/lib/hw/fingerprint.default.so

  270. PRODUCT_COPY_FILES += vendor/cs_fp_so/32bit/libCSAlgDll.so:system/lib/libCSAlgDll.so

  271. # add by cipsailing end

  272.  
  273. 注意:上面的标有红色的部分是实际的so所存放的实际路径(只做一个参考);

  274. 说明:

  275. 1.libCSAlgDll.so是算法库;

  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值