Staging
v0.8.1
swh:1:snp:a902887e4be9191b7c6c4406aa06b31c1ce2c7cc
Raw File
Tip revision: f22e6e847115abc3a0e2ad7bb18d243d42275af1 authored by Linus Torvalds on 06 April 2015, 22:39:45 UTC
Linux 4.0-rc7
Tip revision: f22e6e8
w1-gpio
Kernel driver w1-gpio
=====================

Author: Ville Syrjala <syrjala@sci.fi>


Description
-----------

GPIO 1-wire bus master driver. The driver uses the GPIO API to control the
wire and the GPIO pin can be specified using platform data.


Example (mach-at91)
-------------------

#include <linux/w1-gpio.h>

static struct w1_gpio_platform_data foo_w1_gpio_pdata = {
	.pin		= AT91_PIN_PB20,
	.is_open_drain	= 1,
};

static struct platform_device foo_w1_device = {
	.name			= "w1-gpio",
	.id			= -1,
	.dev.platform_data	= &foo_w1_gpio_pdata,
};

...
	at91_set_GPIO_periph(foo_w1_gpio_pdata.pin, 1);
	at91_set_multi_drive(foo_w1_gpio_pdata.pin, 1);
	platform_device_register(&foo_w1_device);
back to top