2 * Set up eQEP in a way that does not conflict with HDMI.
4 * Copyright (C) 2013 Nathaniel R. Lewis - http://nathanielrlewis.com/
5 * Copyright (C) 2018 Antonio Ospite <ao2@ao2.it>
7 * This program is free softwarejc you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #include <dt-bindings/board/am335x-bbw-bbb-base.h>
25 #include <dt-bindings/gpio/gpio.h>
26 #include <dt-bindings/pinctrl/am33xx.h>
29 compatible = "ti,beaglebone", "ti,beaglebone-black";
32 part-number = "bbb-eqep2b-ao2";
35 // Resources this cape uses.
39 "P8.16", // EQEP2_index
40 "P8.15", // EQEP2_strobe
42 "eqep2"; // hardware ip used
45 target = <&am33xx_pinmux>;
47 pinctrl_eqep2: pinctrl_eqep2_pins {
48 pinctrl-single,pins = <
49 BONE_P8_12 (PIN_INPUT | MUX_MODE4) // GPIO1_12 = EQEP2A_in
50 BONE_P8_11 (PIN_INPUT | MUX_MODE4) // GPIO1_13 = EQEP2B_in
51 BONE_P8_16 (PIN_INPUT | MUX_MODE4) // GPIO1_14 = EQEP2_index
52 BONE_P8_15 (PIN_INPUT | MUX_MODE4) // GPIO1_15 = EQEP2_strobe
53 // From: https://groups.google.com/forum/#!searchin/beagleboard/eQep/beagleboard/Orp3tFcNgCc/mYacP_GkCQQJ
69 pinctrl-names = "default";
70 pinctrl-0 = <&pinctrl_eqep2>;
72 count_mode = <0>; // count_mode is not userspace op_mode
73 // 0 -> Quadrature mode, normal 90 phase offset cha & chb.
74 // 1 -> Direction mode. cha input = clock, chb input = direction
75 // 2 -> UP count mode for frequency measurement QDIR=1, ignore direction input
76 // 3 -> DOWN count mode for frequency measurement QDIR=0, ignore direction input
78 swap_inputs = <0>; // swap channel A and B? (0 - no, 1 - yes)
79 invert_qa = <1>; // invert channel A input?
80 invert_qb = <1>; // invert channel B input?
81 invert_qi = <0>; // invert index input?
82 invert_qs = <0>; // invert strobe input?
83 omit_interrupt = <0>; // 1 -> do not install interrupt handler, 0 -> do install