mirror of
https://github.com/torvalds/linux.git
synced 2024-11-30 16:11:38 +00:00
bb66720540
Changesetdd2c898bc2
("dt-bindings: w1: Convert 1-Wire GPIO binding to a schema") renamed: Documentation/devicetree/bindings/w1/w1-gpio.txt to: Documentation/devicetree/bindings/w1/w1-gpio.yaml. Update its cross-reference accordingly. Fixes:dd2c898bc2
("dt-bindings: w1: Convert 1-Wire GPIO binding to a schema") Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/0b415b5e05bcf9d593cb421c96996d914528e732.1631785820.git.mchehab+huawei@kernel.org
48 lines
1.1 KiB
ReStructuredText
48 lines
1.1 KiB
ReStructuredText
=====================
|
|
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 GPIO machine descriptor tables.
|
|
It is also possible to define the master using device tree, see
|
|
Documentation/devicetree/bindings/w1/w1-gpio.yaml
|
|
|
|
|
|
Example (mach-at91)
|
|
-------------------
|
|
|
|
::
|
|
|
|
#include <linux/gpio/machine.h>
|
|
#include <linux/w1-gpio.h>
|
|
|
|
static struct gpiod_lookup_table foo_w1_gpiod_table = {
|
|
.dev_id = "w1-gpio",
|
|
.table = {
|
|
GPIO_LOOKUP_IDX("at91-gpio", AT91_PIN_PB20, NULL, 0,
|
|
GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN),
|
|
},
|
|
};
|
|
|
|
static struct w1_gpio_platform_data foo_w1_gpio_pdata = {
|
|
.ext_pullup_enable_pin = -EINVAL,
|
|
};
|
|
|
|
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);
|
|
gpiod_add_lookup_table(&foo_w1_gpiod_table);
|
|
platform_device_register(&foo_w1_device);
|