Lines Matching full:hte
16 #include <linux/hte.h>
19 * This sample HTE GPIO test driver demonstrates HTE API usage by enabling
29 * compatible = "nvidia,tegra194-hte-test";
34 * timestamp-names = "hte-gpio", "hte-i2c-irq";
41 * HTE for rising edge on gpio_in pin.
48 * - Unloading the driver disables and deallocate the HTE.
59 } hte; variable
84 gpiod_set_value(hte.gpio_out, !gpiod_get_value(hte.gpio_out)); in gpio_timer_cb()
85 mod_timer(&hte.timer, jiffies + msecs_to_jiffies(8000)); in gpio_timer_cb()
97 { .compatible = "nvidia,tegra194-hte-test"},
107 dev_set_drvdata(&pdev->dev, &hte); in tegra_hte_test_probe()
108 hte.pdev = &pdev->dev; in tegra_hte_test_probe()
110 hte.gpio_out = gpiod_get(&pdev->dev, "out", 0); in tegra_hte_test_probe()
111 if (IS_ERR(hte.gpio_out)) { in tegra_hte_test_probe()
117 hte.gpio_in = gpiod_get(&pdev->dev, "in", 0); in tegra_hte_test_probe()
118 if (IS_ERR(hte.gpio_in)) { in tegra_hte_test_probe()
124 ret = gpiod_direction_output(hte.gpio_out, 0); in tegra_hte_test_probe()
131 ret = gpiod_direction_input(hte.gpio_in); in tegra_hte_test_probe()
138 ret = gpiod_to_irq(hte.gpio_in); in tegra_hte_test_probe()
145 hte.gpio_in_irq = ret; in tegra_hte_test_probe()
148 "tegra_hte_gpio_test_isr", &hte); in tegra_hte_test_probe()
155 cnt = of_hte_req_count(hte.pdev); in tegra_hte_test_probe()
161 hte.desc = devm_kzalloc(hte.pdev, sizeof(*hte.desc) * cnt, GFP_KERNEL); in tegra_hte_test_probe()
162 if (!hte.desc) { in tegra_hte_test_probe()
170 * GPIO hte init, line_id and name will be parsed from in tegra_hte_test_probe()
175 hte_init_line_attr(&hte.desc[i], 0, 0, NULL, in tegra_hte_test_probe()
176 hte.gpio_in); in tegra_hte_test_probe()
182 hte_init_line_attr(&hte.desc[i], 0, 0, NULL, NULL); in tegra_hte_test_probe()
184 ret = hte_ts_get(hte.pdev, &hte.desc[i], i); in tegra_hte_test_probe()
188 ret = devm_hte_request_ts_ns(hte.pdev, &hte.desc[i], in tegra_hte_test_probe()
190 &hte.desc[i]); in tegra_hte_test_probe()
195 timer_setup(&hte.timer, gpio_timer_cb, 0); in tegra_hte_test_probe()
196 mod_timer(&hte.timer, jiffies + msecs_to_jiffies(5000)); in tegra_hte_test_probe()
203 hte_ts_put(&hte.desc[i]); in tegra_hte_test_probe()
205 free_irq(hte.gpio_in_irq, &hte); in tegra_hte_test_probe()
207 gpiod_put(hte.gpio_in); in tegra_hte_test_probe()
209 gpiod_put(hte.gpio_out); in tegra_hte_test_probe()
219 free_irq(hte.gpio_in_irq, &hte); in tegra_hte_test_remove()
220 gpiod_put(hte.gpio_in); in tegra_hte_test_remove()
221 gpiod_put(hte.gpio_out); in tegra_hte_test_remove()
222 del_timer_sync(&hte.timer); in tegra_hte_test_remove()