1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
From 1fcc4aabf4fa4ffe4ebfbfe4adbce3913389a0a0 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Tue, 7 Feb 2012 11:01:13 +0100
Subject: [PATCH 19/79] beaglebone: use P8_6 (gpio1_3) as w1 bus
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
arch/arm/mach-omap2/board-am335xevm.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
index 97b069f..3ba4bbc 100644
--- a/arch/arm/mach-omap2/board-am335xevm.c
+++ b/arch/arm/mach-omap2/board-am335xevm.c
@@ -39,6 +39,7 @@
#include <linux/reboot.h>
#include <linux/pwm/pwm.h>
#include <linux/opp.h>
+#include <linux/w1-gpio.h>
/* LCD controller is similar to DA850 */
#include <video/da8xx-fb.h>
@@ -617,6 +618,11 @@ static struct pinmux_config bbtoys7_pin_mux[] = {
{NULL, 0},
};
+static struct pinmux_config w1_gpio_pin_mux[] = {
+ {"gpmc_ad3.gpio1_3", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
+ {NULL, 0},
+};
+
static struct pinmux_config tsc_pin_mux[] = {
{"ain0.ain0", OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
{"ain1.ain1", OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
@@ -1040,6 +1046,19 @@ static struct pinmux_config profibus_pin_mux[] = {
{NULL, 0},
};
+#define BEAGLEBONE_W1_GPIO GPIO_TO_PIN(1, 3)
+
+static struct w1_gpio_platform_data bone_w1_gpio_pdata = {
+ .pin = BEAGLEBONE_W1_GPIO,
+ .is_open_drain = 0,
+};
+
+static struct platform_device bone_w1_device = {
+ .name = "w1-gpio",
+ .id = -1,
+ .dev.platform_data = &bone_w1_gpio_pdata,
+};
+
/* LEDS - gpio1_21 -> gpio1_24 */
#define BEAGLEBONE_USR1_LED GPIO_TO_PIN(1, 21)
@@ -1377,6 +1396,17 @@ static void dvileds_init(int evm_id, int profile )
pr_err("failed to register BeagleBone DVI cape LEDS\n");
}
+static void bonew1_gpio_init(int evm_id, int profile )
+{
+ int err;
+ setup_pin_mux(w1_gpio_pin_mux);
+ err = platform_device_register(&bone_w1_device);
+ if (err)
+ pr_err("failed to register w1-gpio\n");
+ else
+ pr_info("w1-gpio connected to P8_6\n");
+}
+
static void rgmii1_init(int evm_id, int profile)
{
setup_pin_mux(rgmii1_pin_mux);
@@ -2322,6 +2352,7 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = {
{i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL},
+ {bonew1_gpio_init, DEV_ON_BASEBOARD, PROFILE_ALL},
{NULL, 0, 0},
};
--
1.7.10
|