4 Author: Ville Syrjala <syrjala@sci.fi>
10 GPIO 1-wire bus master driver. The driver uses the GPIO API to control the
11 wire and the GPIO pin can be specified using GPIO machine descriptor tables.
12 It is also possible to define the master using device tree, see
13 Documentation/devicetree/bindings/w1/w1-gpio.txt
19 #include <linux/gpio/machine.h>
20 #include <linux/w1-gpio.h>
22 static struct gpiod_lookup_table foo_w1_gpiod_table = {
25 GPIO_LOOKUP_IDX("at91-gpio", AT91_PIN_PB20, NULL, 0,
26 GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN),
30 static struct w1_gpio_platform_data foo_w1_gpio_pdata = {
31 .ext_pullup_enable_pin = -EINVAL,
34 static struct platform_device foo_w1_device = {
37 .dev.platform_data = &foo_w1_gpio_pdata,
41 at91_set_GPIO_periph(foo_w1_gpio_pdata.pin, 1);
42 at91_set_multi_drive(foo_w1_gpio_pdata.pin, 1);
43 gpiod_add_lookup_table(&foo_w1_gpiod_table);
44 platform_device_register(&foo_w1_device);