mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
w1-gpio: add GPIO w1 bus master driver
Add a GPIO 1-wire bus master driver. The driver used the GPIO API to control the wire and the GPIO pin can be specified using platform data similar to i2c-gpio. The driver was tested with AT91SAM9260 + DS2401. Signed-off-by: Ville Syrjala <[email protected]> Cc: Evgeniy Polyakov <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
4cdf854f7d
commit
ad8dc96e3b
6 changed files with 193 additions and 0 deletions
|
|
@ -4,3 +4,5 @@ ds2482
|
|||
- The Maxim/Dallas Semiconductor DS2482 provides 1-wire busses.
|
||||
ds2490
|
||||
- The Maxim/Dallas Semiconductor DS2490 builds USB <-> W1 bridges.
|
||||
w1-gpio
|
||||
- GPIO 1-wire bus master driver.
|
||||
|
|
|
|||
33
Documentation/w1/masters/w1-gpio
Normal file
33
Documentation/w1/masters/w1-gpio
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
Kernel driver w1-gpio
|
||||
=====================
|
||||
|
||||
Author: Ville Syrjala <[email protected]>
|
||||
|
||||
|
||||
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);
|
||||
Loading…
Reference in a new issue