Lines Matching refs:gpio_restart
26 struct gpio_restart { struct
37 struct gpio_restart *gpio_restart = in gpio_restart_notify() argument
38 container_of(this, struct gpio_restart, restart_handler); in gpio_restart_notify()
41 gpiod_direction_output(gpio_restart->reset_gpio, 1); in gpio_restart_notify()
42 mdelay(gpio_restart->active_delay_ms); in gpio_restart_notify()
45 gpiod_set_value(gpio_restart->reset_gpio, 0); in gpio_restart_notify()
46 mdelay(gpio_restart->inactive_delay_ms); in gpio_restart_notify()
49 gpiod_set_value(gpio_restart->reset_gpio, 1); in gpio_restart_notify()
52 mdelay(gpio_restart->wait_delay_ms); in gpio_restart_notify()
61 struct gpio_restart *gpio_restart; in gpio_restart_probe() local
66 gpio_restart = devm_kzalloc(&pdev->dev, sizeof(*gpio_restart), in gpio_restart_probe()
68 if (!gpio_restart) in gpio_restart_probe()
73 gpio_restart->reset_gpio = devm_gpiod_get(&pdev->dev, NULL, in gpio_restart_probe()
75 if (IS_ERR(gpio_restart->reset_gpio)) { in gpio_restart_probe()
77 return PTR_ERR(gpio_restart->reset_gpio); in gpio_restart_probe()
80 gpio_restart->restart_handler.notifier_call = gpio_restart_notify; in gpio_restart_probe()
81 gpio_restart->restart_handler.priority = 129; in gpio_restart_probe()
82 gpio_restart->active_delay_ms = 100; in gpio_restart_probe()
83 gpio_restart->inactive_delay_ms = 100; in gpio_restart_probe()
84 gpio_restart->wait_delay_ms = 3000; in gpio_restart_probe()
92 gpio_restart->restart_handler.priority = property; in gpio_restart_probe()
96 &gpio_restart->active_delay_ms); in gpio_restart_probe()
98 &gpio_restart->inactive_delay_ms); in gpio_restart_probe()
100 &gpio_restart->wait_delay_ms); in gpio_restart_probe()
102 platform_set_drvdata(pdev, gpio_restart); in gpio_restart_probe()
104 ret = register_restart_handler(&gpio_restart->restart_handler); in gpio_restart_probe()
116 struct gpio_restart *gpio_restart = platform_get_drvdata(pdev); in gpio_restart_remove() local
119 ret = unregister_restart_handler(&gpio_restart->restart_handler); in gpio_restart_remove()