Lines Matching refs:gpio_restart

18 struct gpio_restart {  struct
29 struct gpio_restart *gpio_restart = in gpio_restart_notify() argument
30 container_of(this, struct gpio_restart, restart_handler); in gpio_restart_notify()
33 gpiod_direction_output(gpio_restart->reset_gpio, 1); in gpio_restart_notify()
34 mdelay(gpio_restart->active_delay_ms); in gpio_restart_notify()
37 gpiod_set_value(gpio_restart->reset_gpio, 0); in gpio_restart_notify()
38 mdelay(gpio_restart->inactive_delay_ms); in gpio_restart_notify()
41 gpiod_set_value(gpio_restart->reset_gpio, 1); in gpio_restart_notify()
44 mdelay(gpio_restart->wait_delay_ms); in gpio_restart_notify()
53 struct gpio_restart *gpio_restart; in gpio_restart_probe() local
58 gpio_restart = devm_kzalloc(&pdev->dev, sizeof(*gpio_restart), in gpio_restart_probe()
60 if (!gpio_restart) in gpio_restart_probe()
65 gpio_restart->reset_gpio = devm_gpiod_get(&pdev->dev, NULL, in gpio_restart_probe()
67 ret = PTR_ERR_OR_ZERO(gpio_restart->reset_gpio); in gpio_restart_probe()
74 gpio_restart->restart_handler.notifier_call = gpio_restart_notify; in gpio_restart_probe()
75 gpio_restart->restart_handler.priority = 129; in gpio_restart_probe()
76 gpio_restart->active_delay_ms = 100; in gpio_restart_probe()
77 gpio_restart->inactive_delay_ms = 100; in gpio_restart_probe()
78 gpio_restart->wait_delay_ms = 3000; in gpio_restart_probe()
86 gpio_restart->restart_handler.priority = property; in gpio_restart_probe()
90 &gpio_restart->active_delay_ms); in gpio_restart_probe()
92 &gpio_restart->inactive_delay_ms); in gpio_restart_probe()
94 &gpio_restart->wait_delay_ms); in gpio_restart_probe()
96 platform_set_drvdata(pdev, gpio_restart); in gpio_restart_probe()
98 ret = register_restart_handler(&gpio_restart->restart_handler); in gpio_restart_probe()
110 struct gpio_restart *gpio_restart = platform_get_drvdata(pdev); in gpio_restart_remove() local
113 ret = unregister_restart_handler(&gpio_restart->restart_handler); in gpio_restart_remove()