iqs269a.yaml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/input/iqs269a.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Azoteq IQS269A Capacitive Touch Controller
  7. maintainers:
  8. - Jeff LaBundy <jeff@labundy.com>
  9. allOf:
  10. - $ref: input.yaml#
  11. description: |
  12. The Azoteq IQS269A is an 8-channel capacitive touch controller that features
  13. additional Hall-effect and inductive sensing capabilities.
  14. Link to datasheet: https://www.azoteq.com/
  15. properties:
  16. compatible:
  17. enum:
  18. - azoteq,iqs269a
  19. - azoteq,iqs269a-00
  20. - azoteq,iqs269a-d0
  21. reg:
  22. maxItems: 1
  23. interrupts:
  24. maxItems: 1
  25. "#address-cells":
  26. const: 1
  27. "#size-cells":
  28. const: 0
  29. azoteq,hall-enable:
  30. type: boolean
  31. description:
  32. Enables Hall-effect sensing on channels 6 and 7. In this case, keycodes
  33. assigned to channel 6 are ignored and keycodes assigned to channel 7 are
  34. interpreted as switch codes. Refer to the datasheet for requirements im-
  35. posed on channels 6 and 7 by Hall-effect sensing.
  36. azoteq,suspend-mode:
  37. $ref: /schemas/types.yaml#/definitions/uint32
  38. enum: [0, 1, 2, 3]
  39. default: 0
  40. description: |
  41. Specifies the power mode during suspend as follows:
  42. 0: Automatic (same as normal runtime, i.e. suspend/resume disabled)
  43. 1: Low power (all sensing at a reduced reporting rate)
  44. 2: Ultra-low power (channel 0 proximity sensing)
  45. 3: Halt (no sensing)
  46. azoteq,clk-div:
  47. type: boolean
  48. description: Divides the device's core clock by a factor of 4.
  49. azoteq,ulp-update:
  50. $ref: /schemas/types.yaml#/definitions/uint32
  51. minimum: 0
  52. maximum: 7
  53. default: 3
  54. description: Specifies the ultra-low-power mode update rate.
  55. azoteq,reseed-offset:
  56. type: boolean
  57. description:
  58. Applies an 8-count offset to all long-term averages upon either ATI or
  59. reseed events.
  60. azoteq,filt-str-lp-lta:
  61. $ref: /schemas/types.yaml#/definitions/uint32
  62. enum: [0, 1, 2, 3]
  63. default: 0
  64. description:
  65. Specifies the long-term average filter strength during low-power mode.
  66. azoteq,filt-str-lp-cnt:
  67. $ref: /schemas/types.yaml#/definitions/uint32
  68. enum: [0, 1, 2, 3]
  69. default: 0
  70. description:
  71. Specifies the raw count filter strength during low-power mode.
  72. azoteq,filt-str-np-lta:
  73. $ref: /schemas/types.yaml#/definitions/uint32
  74. enum: [0, 1, 2, 3]
  75. default: 0
  76. description:
  77. Specifies the long-term average filter strength during normal-power mode.
  78. azoteq,filt-str-np-cnt:
  79. $ref: /schemas/types.yaml#/definitions/uint32
  80. enum: [0, 1, 2, 3]
  81. default: 0
  82. description:
  83. Specifies the raw count filter strength during normal-power mode.
  84. azoteq,rate-np-ms:
  85. minimum: 0
  86. maximum: 255
  87. default: 16
  88. description: Specifies the report rate (in ms) during normal-power mode.
  89. azoteq,rate-lp-ms:
  90. minimum: 0
  91. maximum: 255
  92. default: 160
  93. description: Specifies the report rate (in ms) during low-power mode.
  94. azoteq,rate-ulp-ms:
  95. multipleOf: 16
  96. minimum: 0
  97. maximum: 4080
  98. default: 160
  99. description: Specifies the report rate (in ms) during ultra-low-power mode.
  100. azoteq,timeout-pwr-ms:
  101. multipleOf: 512
  102. minimum: 0
  103. maximum: 130560
  104. default: 2560
  105. description:
  106. Specifies the length of time (in ms) to wait for an event during normal-
  107. power mode before transitioning to low-power mode.
  108. azoteq,timeout-lta-ms:
  109. multipleOf: 512
  110. minimum: 0
  111. maximum: 130560
  112. default: 32768
  113. description:
  114. Specifies the length of time (in ms) to wait before resetting the long-
  115. term average of all channels. Specify the maximum timeout to disable it
  116. altogether.
  117. azoteq,ati-band-disable:
  118. type: boolean
  119. description: Disables the ATI band check.
  120. azoteq,ati-lp-only:
  121. type: boolean
  122. description: Limits automatic ATI to low-power mode.
  123. azoteq,ati-band-tighten:
  124. type: boolean
  125. description: Tightens the ATI band from 1/8 to 1/16 of the desired target.
  126. azoteq,filt-disable:
  127. type: boolean
  128. description: Disables all raw count filtering.
  129. azoteq,gpio3-select:
  130. $ref: /schemas/types.yaml#/definitions/uint32
  131. minimum: 0
  132. maximum: 7
  133. default: 0
  134. description:
  135. Selects the channel for which the GPIO3 pin represents touch state.
  136. azoteq,dual-direction:
  137. type: boolean
  138. description:
  139. Specifies that long-term averages are to freeze in the presence of either
  140. increasing or decreasing counts, thereby permitting events to be reported
  141. in either direction.
  142. azoteq,tx-freq:
  143. $ref: /schemas/types.yaml#/definitions/uint32
  144. enum: [0, 1, 2, 3]
  145. default: 0
  146. description: |
  147. Specifies the inductive sensing excitation frequency as follows (paren-
  148. thesized numbers represent the frequency if 'azoteq,clk-div' is present):
  149. 0: 16 MHz (4 MHz)
  150. 1: 8 MHz (2 MHz)
  151. 2: 4 MHz (1 MHz)
  152. 3: 2 MHz (500 kHz)
  153. azoteq,global-cap-increase:
  154. type: boolean
  155. description: Increases the global capacitance adder from 0.5 pF to 1.5 pF.
  156. azoteq,reseed-select:
  157. $ref: /schemas/types.yaml#/definitions/uint32
  158. enum: [0, 1, 2, 3]
  159. default: 0
  160. description: |
  161. Specifies the event(s) that prompt the device to reseed (i.e. reset the
  162. long-term average) of an associated channel as follows:
  163. 0: None
  164. 1: Proximity
  165. 2: Proximity or touch
  166. 3: Proximity, touch or deep touch
  167. azoteq,tracking-enable:
  168. type: boolean
  169. description:
  170. Enables all associated channels to track their respective reference
  171. channels.
  172. azoteq,filt-str-slider:
  173. $ref: /schemas/types.yaml#/definitions/uint32
  174. enum: [0, 1, 2, 3]
  175. default: 1
  176. description: Specifies the slider coordinate filter strength.
  177. azoteq,touch-hold-ms:
  178. multipleOf: 256
  179. minimum: 256
  180. maximum: 65280
  181. default: 5120
  182. description:
  183. Specifies the length of time (in ms) for which the channel selected by
  184. 'azoteq,gpio3-select' must be held in a state of touch in order for an
  185. approximately 60-ms pulse to be asserted on the GPIO4 pin.
  186. linux,keycodes:
  187. minItems: 1
  188. maxItems: 8
  189. description: |
  190. Specifies the numeric keycodes associated with each available gesture in
  191. the following order (enter 0 for unused gestures):
  192. 0: Slider 0 tap
  193. 1: Slider 0 hold
  194. 2: Slider 0 positive flick or swipe
  195. 3: Slider 0 negative flick or swipe
  196. 4: Slider 1 tap
  197. 5: Slider 1 hold
  198. 6: Slider 1 positive flick or swipe
  199. 7: Slider 1 negative flick or swipe
  200. azoteq,gesture-swipe:
  201. type: boolean
  202. description:
  203. Directs the device to interpret axial gestures as a swipe (finger remains
  204. on slider) instead of a flick (finger leaves slider).
  205. azoteq,timeout-tap-ms:
  206. multipleOf: 16
  207. minimum: 0
  208. maximum: 4080
  209. default: 400
  210. description:
  211. Specifies the length of time (in ms) within which a slider touch must be
  212. released in order to be interpreted as a tap. Default and maximum values
  213. as well as step size are reduced by a factor of 4 with device version 2.
  214. azoteq,timeout-swipe-ms:
  215. multipleOf: 16
  216. minimum: 0
  217. maximum: 4080
  218. default: 2000
  219. description:
  220. Specifies the length of time (in ms) within which an axial gesture must be
  221. completed in order to be interpreted as a flick or swipe. Default and max-
  222. imum values as well as step size are reduced by a factor of 4 with device
  223. version 2.
  224. azoteq,thresh-swipe:
  225. $ref: /schemas/types.yaml#/definitions/uint32
  226. minimum: 0
  227. maximum: 255
  228. default: 128
  229. description:
  230. Specifies the number of points across which an axial gesture must travel
  231. in order to be interpreted as a flick or swipe.
  232. dependencies:
  233. azoteq,gesture-swipe: ["linux,keycodes"]
  234. azoteq,timeout-tap-ms: ["linux,keycodes"]
  235. azoteq,timeout-swipe-ms: ["linux,keycodes"]
  236. azoteq,thresh-swipe: ["linux,keycodes"]
  237. patternProperties:
  238. "^channel@[0-7]$":
  239. type: object
  240. description:
  241. Represents a single sensing channel. A channel is active if defined and
  242. inactive otherwise.
  243. properties:
  244. reg:
  245. minimum: 0
  246. maximum: 7
  247. description: Index of the channel.
  248. azoteq,reseed-disable:
  249. type: boolean
  250. description:
  251. Prevents the channel from being reseeded if the long-term average
  252. timeout (defined in 'azoteq,timeout-lta') expires.
  253. azoteq,blocking-enable:
  254. type: boolean
  255. description: Specifies that the channel is a blocking channel.
  256. azoteq,slider0-select:
  257. type: boolean
  258. description: Specifies that the channel participates in slider 0.
  259. azoteq,slider1-select:
  260. type: boolean
  261. description: Specifies that the channel participates in slider 1.
  262. azoteq,rx-enable:
  263. $ref: /schemas/types.yaml#/definitions/uint32-array
  264. minItems: 1
  265. maxItems: 8
  266. items:
  267. minimum: 0
  268. maximum: 7
  269. description:
  270. Specifies the CRX pin(s) associated with the channel. By default, only
  271. the CRX pin corresponding to the channel's index is enabled (e.g. CRX0
  272. for channel 0).
  273. azoteq,tx-enable:
  274. $ref: /schemas/types.yaml#/definitions/uint32-array
  275. minItems: 1
  276. maxItems: 8
  277. items:
  278. minimum: 0
  279. maximum: 7
  280. default: [0, 1, 2, 3, 4, 5, 6, 7]
  281. description: Specifies the TX pin(s) associated with the channel.
  282. azoteq,meas-cap-decrease:
  283. type: boolean
  284. description:
  285. Decreases the internal measurement capacitance from 60 pF to 15 pF.
  286. azoteq,rx-float-inactive:
  287. type: boolean
  288. description: Floats any inactive CRX pins instead of grounding them.
  289. azoteq,local-cap-size:
  290. $ref: /schemas/types.yaml#/definitions/uint32
  291. enum: [0, 1, 2]
  292. default: 0
  293. description: |
  294. Specifies the capacitance to be added to the channel as follows:
  295. 0: None
  296. 1: Global adder (based on 'azoteq,global-cap-increase')
  297. 2: Global adder + 0.5 pF
  298. azoteq,invert-enable:
  299. type: boolean
  300. description:
  301. Inverts the polarity of the states reported for proximity, touch and
  302. deep-touch events relative to their respective thresholds.
  303. azoteq,proj-bias:
  304. $ref: /schemas/types.yaml#/definitions/uint32
  305. enum: [0, 1, 2, 3]
  306. default: 2
  307. description: |
  308. Specifies the bias current applied during projected-capacitance
  309. sensing as follows:
  310. 0: 2.5 uA
  311. 1: 5 uA
  312. 2: 10 uA
  313. 3: 20 uA
  314. azoteq,sense-mode:
  315. $ref: /schemas/types.yaml#/definitions/uint32
  316. enum: [0, 1, 9, 14, 15]
  317. default: 0
  318. description: |
  319. Specifies the channel's sensing mode as follows:
  320. 0: Self capacitance
  321. 1: Projected capacitance
  322. 9: Self or mutual inductance
  323. 14: Hall effect
  324. 15: Temperature
  325. azoteq,sense-freq:
  326. $ref: /schemas/types.yaml#/definitions/uint32
  327. enum: [0, 1, 2, 3]
  328. default: 1
  329. description: |
  330. Specifies the channel's sensing frequency as follows (parenthesized
  331. numbers represent the frequency if 'azoteq,clk-div' is present):
  332. 0: 4 MHz (1 MHz)
  333. 1: 2 MHz (500 kHz)
  334. 2: 1 MHz (250 kHz)
  335. 3: 500 kHz (125 kHz)
  336. azoteq,static-enable:
  337. type: boolean
  338. description: Enables the static front-end for the channel.
  339. azoteq,ati-mode:
  340. $ref: /schemas/types.yaml#/definitions/uint32
  341. enum: [0, 1, 2, 3]
  342. default: 3
  343. description: |
  344. Specifies the channel's ATI mode as follows:
  345. 0: Disabled
  346. 1: Semi-partial
  347. 2: Partial
  348. 3: Full
  349. azoteq,ati-base:
  350. $ref: /schemas/types.yaml#/definitions/uint32
  351. enum: [75, 100, 150, 200]
  352. default: 100
  353. description: Specifies the channel's ATI base.
  354. azoteq,ati-target:
  355. $ref: /schemas/types.yaml#/definitions/uint32
  356. multipleOf: 32
  357. minimum: 0
  358. maximum: 2016
  359. default: 512
  360. description: Specifies the channel's ATI target.
  361. azoteq,assoc-select:
  362. $ref: /schemas/types.yaml#/definitions/uint32-array
  363. minItems: 1
  364. maxItems: 8
  365. items:
  366. minimum: 0
  367. maximum: 7
  368. description:
  369. Specifies the associated channels for which the channel serves as a
  370. reference channel. By default, no channels are selected.
  371. azoteq,assoc-weight:
  372. $ref: /schemas/types.yaml#/definitions/uint32
  373. minimum: 0
  374. maximum: 255
  375. default: 0
  376. description:
  377. Specifies the channel's impact weight if it acts as an associated
  378. channel (0 = 0% impact, 255 = 200% impact).
  379. patternProperties:
  380. "^event-prox(-alt)?$":
  381. type: object
  382. $ref: input.yaml#
  383. description:
  384. Represents a proximity event reported by the channel in response to
  385. a decrease in counts. Node names suffixed with '-alt' instead corre-
  386. spond to an increase in counts.
  387. By default, the long-term average tracks an increase in counts such
  388. that only events corresponding to a decrease in counts are reported
  389. (refer to the datasheet for more information).
  390. Specify 'azoteq,dual-direction' to freeze the long-term average when
  391. the counts increase or decrease such that events of either direction
  392. can be reported. Alternatively, specify 'azoteq,invert-enable' to in-
  393. vert the polarity of the states reported by the channel.
  394. Complementary events (e.g. event-touch and event-touch-alt) can both
  395. be present and specify different key or switch codes, but not differ-
  396. ent thresholds or hysteresis (if applicable).
  397. properties:
  398. azoteq,thresh:
  399. $ref: /schemas/types.yaml#/definitions/uint32
  400. minimum: 0
  401. maximum: 255
  402. default: 10
  403. description: Specifies the threshold for the event.
  404. linux,code: true
  405. additionalProperties: false
  406. "^event-touch(-alt)?$":
  407. type: object
  408. $ref: input.yaml#
  409. description: Represents a touch event reported by the channel.
  410. properties:
  411. azoteq,thresh:
  412. $ref: /schemas/types.yaml#/definitions/uint32
  413. minimum: 0
  414. maximum: 255
  415. default: 8
  416. description: Specifies the threshold for the event.
  417. azoteq,hyst:
  418. $ref: /schemas/types.yaml#/definitions/uint32
  419. minimum: 0
  420. maximum: 15
  421. default: 4
  422. description: Specifies the hysteresis for the event.
  423. linux,code: true
  424. additionalProperties: false
  425. "^event-deep(-alt)?$":
  426. type: object
  427. $ref: input.yaml#
  428. description: Represents a deep-touch event reported by the channel.
  429. properties:
  430. azoteq,thresh:
  431. $ref: /schemas/types.yaml#/definitions/uint32
  432. minimum: 0
  433. maximum: 255
  434. default: 26
  435. description: Specifies the threshold for the event.
  436. azoteq,hyst:
  437. $ref: /schemas/types.yaml#/definitions/uint32
  438. minimum: 0
  439. maximum: 15
  440. default: 0
  441. description: Specifies the hysteresis for the event.
  442. linux,code: true
  443. additionalProperties: false
  444. required:
  445. - reg
  446. additionalProperties: false
  447. if:
  448. properties:
  449. compatible:
  450. contains:
  451. enum:
  452. - azoteq,iqs269a-d0
  453. then:
  454. patternProperties:
  455. "^channel@[0-7]$":
  456. properties:
  457. azoteq,slider1-select: false
  458. else:
  459. properties:
  460. azoteq,touch-hold-ms: false
  461. required:
  462. - compatible
  463. - reg
  464. - interrupts
  465. - "#address-cells"
  466. - "#size-cells"
  467. additionalProperties: false
  468. examples:
  469. - |
  470. #include <dt-bindings/input/input.h>
  471. #include <dt-bindings/interrupt-controller/irq.h>
  472. i2c {
  473. #address-cells = <1>;
  474. #size-cells = <0>;
  475. touch@44 {
  476. #address-cells = <1>;
  477. #size-cells = <0>;
  478. compatible = "azoteq,iqs269a";
  479. reg = <0x44>;
  480. interrupt-parent = <&gpio>;
  481. interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
  482. azoteq,hall-enable;
  483. azoteq,suspend-mode = <2>;
  484. linux,keycodes = <KEY_PLAYPAUSE>,
  485. <KEY_STOPCD>,
  486. <KEY_NEXTSONG>,
  487. <KEY_PREVIOUSSONG>;
  488. azoteq,timeout-tap-ms = <400>;
  489. azoteq,timeout-swipe-ms = <800>;
  490. channel@0 {
  491. reg = <0x0>;
  492. event-prox {
  493. linux,code = <KEY_POWER>;
  494. };
  495. };
  496. channel@1 {
  497. reg = <0x1>;
  498. azoteq,slider0-select;
  499. };
  500. channel@2 {
  501. reg = <0x2>;
  502. azoteq,slider0-select;
  503. };
  504. channel@3 {
  505. reg = <0x3>;
  506. azoteq,slider0-select;
  507. };
  508. channel@4 {
  509. reg = <0x4>;
  510. azoteq,slider0-select;
  511. };
  512. channel@5 {
  513. reg = <0x5>;
  514. azoteq,slider0-select;
  515. };
  516. channel@6 {
  517. reg = <0x6>;
  518. azoteq,invert-enable;
  519. azoteq,static-enable;
  520. azoteq,reseed-disable;
  521. azoteq,rx-enable = <0>;
  522. azoteq,sense-freq = <0x0>;
  523. azoteq,sense-mode = <0xE>;
  524. azoteq,ati-mode = <0x0>;
  525. azoteq,ati-base = <200>;
  526. azoteq,ati-target = <320>;
  527. };
  528. channel@7 {
  529. reg = <0x7>;
  530. azoteq,invert-enable;
  531. azoteq,static-enable;
  532. azoteq,reseed-disable;
  533. azoteq,rx-enable = <0>, <6>;
  534. azoteq,sense-freq = <0x0>;
  535. azoteq,sense-mode = <0xE>;
  536. azoteq,ati-mode = <0x3>;
  537. azoteq,ati-base = <200>;
  538. azoteq,ati-target = <320>;
  539. event-touch {
  540. linux,code = <SW_LID>;
  541. };
  542. };
  543. };
  544. };
  545. ...