diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2022-01-12 13:01:06 +0530 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2022-01-12 13:01:06 +0530 |
commit | 2945097237c22f2d0f2d8c743c45cabddaaec054 (patch) | |
tree | d447089e26e35b6ff5e410817d4e419e23d59ff1 | |
parent | efe5aed09c5d90ef75b60c7710105ba1aab7f96d (diff) |
updates
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rw-r--r-- | gpio-mock.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gpio-mock.c b/gpio-mock.c index 9419aaf..6c568c7 100644 --- a/gpio-mock.c +++ b/gpio-mock.c @@ -50,6 +50,9 @@ static const char *gpio_line_names[NGPIO] = { "gpio12", }; +static void mock_gpio_irq(struct work_struct *work); +static DECLARE_WORK(work, mock_gpio_irq); + static int mock_gpio_get(struct gpio_chip *gc, unsigned offset) { struct mock_gpio_chip *mock_gc = gpiochip_get_data(gc); @@ -97,6 +100,9 @@ static int mock_gpio_direction_output(struct gpio_chip *gc, static void mock_gpio_irq_enable(struct irq_data *d) { pr_info("%s: %d: %lu\n", __func__, __LINE__, d->hwirq); + + irq_offset = d->hwirq; + schedule_work(&work); } static void mock_gpio_irq_disable(struct irq_data *d) @@ -137,12 +143,11 @@ static void mock_gpio_irq(struct work_struct *work) // local_irq_disable(); handle_nested_irq(irq); + pr_info("%s: %d: %u\n", __func__, __LINE__, irq_offset); // local_irq_enable(); } -static DECLARE_WORK(work, mock_gpio_irq); - static int mock_gpio_debugfs(void *data, u64 val) { if (val >= NGPIO) { |