1Kernel driver w1-gpio 2===================== 3 4Author: Ville Syrjala <syrjala@sci.fi> 5 6 7Description 8----------- 9 10GPIO 1-wire bus master driver. The driver uses the GPIO API to control the 11wire and the GPIO pin can be specified using GPIO machine descriptor tables. 12It is also possible to define the master using device tree, see 13Documentation/devicetree/bindings/w1/w1-gpio.txt 14 15 16Example (mach-at91) 17------------------- 18 19#include <linux/gpio/machine.h> 20#include <linux/w1-gpio.h> 21 22static struct gpiod_lookup_table foo_w1_gpiod_table = { 23 .dev_id = "w1-gpio", 24 .table = { 25 GPIO_LOOKUP_IDX("at91-gpio", AT91_PIN_PB20, NULL, 0, 26 GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN), 27 }, 28}; 29 30static struct w1_gpio_platform_data foo_w1_gpio_pdata = { 31 .ext_pullup_enable_pin = -EINVAL, 32}; 33 34static struct platform_device foo_w1_device = { 35 .name = "w1-gpio", 36 .id = -1, 37 .dev.platform_data = &foo_w1_gpio_pdata, 38}; 39 40... 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); 45