Lines Matching +full:i2c +full:- +full:int +full:- +full:rising

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2021-2022 NVIDIA Corporation
29 * compatible = "nvidia,tegra194-hte-test";
30 * in-gpio = <&gpio_aon TEGRA194_AON_GPIO(BB, 1)>;
31 * out-gpio = <&gpio_aon TEGRA194_AON_GPIO(BB, 0)>;
34 * timestamp-names = "hte-gpio", "hte-i2c-irq";
39 * - Load test driver.
40 * - For the GPIO, at regular interval gpio_out pin toggles triggering
41 * HTE for rising edge on gpio_in pin.
43 * - For the LIC IRQ line, it uses 0x19 interrupt which is i2c controller 1.
44 * - Run i2cdetect -y 1 1>/dev/null, this command will generate i2c bus
46 * - It prints below message for both the lines.
48 * - Unloading the driver disables and deallocate the HTE.
52 int gpio_in_irq;
69 if (ts->raw_level < 0) in process_hw_ts()
73 desc->attr.line_id, ts->seq, ts->tsc, in process_hw_ts()
74 (ts->raw_level >= 0) ? ((ts->raw_level == 0) ? in process_hw_ts()
75 "falling" : "rising") : edge); in process_hw_ts()
88 static irqreturn_t tegra_hte_test_gpio_isr(int irq, void *data) in tegra_hte_test_gpio_isr()
97 { .compatible = "nvidia,tegra194-hte-test"},
102 static int tegra_hte_test_probe(struct platform_device *pdev) in tegra_hte_test_probe()
104 int ret = 0; in tegra_hte_test_probe()
105 int i, cnt; in tegra_hte_test_probe()
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()
112 dev_err(&pdev->dev, "failed to get gpio out\n"); in tegra_hte_test_probe()
113 ret = -EINVAL; in tegra_hte_test_probe()
117 hte.gpio_in = gpiod_get(&pdev->dev, "in", 0); in tegra_hte_test_probe()
119 dev_err(&pdev->dev, "failed to get gpio in\n"); in tegra_hte_test_probe()
120 ret = -EINVAL; in tegra_hte_test_probe()
126 dev_err(&pdev->dev, "failed to set output\n"); in tegra_hte_test_probe()
127 ret = -EINVAL; in tegra_hte_test_probe()
133 dev_err(&pdev->dev, "failed to set input\n"); in tegra_hte_test_probe()
134 ret = -EINVAL; in tegra_hte_test_probe()
140 dev_err(&pdev->dev, "failed to map GPIO to IRQ: %d\n", ret); in tegra_hte_test_probe()
141 ret = -ENXIO; in tegra_hte_test_probe()
150 dev_err(&pdev->dev, "failed to acquire IRQ\n"); in tegra_hte_test_probe()
151 ret = -ENXIO; in tegra_hte_test_probe()
161 dev_info(&pdev->dev, "Total requested lines:%d\n", cnt); in tegra_hte_test_probe()
165 ret = -ENOMEM; in tegra_hte_test_probe()