]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/0021-beaglebone-use-P8_6-gpio1_3-as-w1-bus.patch
linux-ti33x-psp 3.2: add support for Towertech TT3201 CAN cape
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 0021-beaglebone-use-P8_6-gpio1_3-as-w1-bus.patch
1 From 4428744c852ed5f9d5a7dfa9c5d0a783e6134582 Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Tue, 7 Feb 2012 11:01:13 +0100
4 Subject: [PATCH 21/21] beaglebone: use P8_6 (gpio1_3) as w1 bus
6 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
7 ---
8  arch/arm/mach-omap2/board-am335xevm.c |   31 +++++++++++++++++++++++++++++++
9  1 files changed, 31 insertions(+), 0 deletions(-)
11 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
12 index c31c0aa..538466d 100644
13 --- a/arch/arm/mach-omap2/board-am335xevm.c
14 +++ b/arch/arm/mach-omap2/board-am335xevm.c
15 @@ -37,6 +37,7 @@
16  #include <linux/mfd/tps65217.h>
17  #include <linux/pwm_backlight.h>
18  #include <linux/pwm/pwm.h>
19 +#include <linux/w1-gpio.h>
20  
21  /* LCD controller is similar to DA850 */
22  #include <video/da8xx-fb.h>
23 @@ -603,6 +604,11 @@ static struct pinmux_config bbtoys7_pin_mux[] = {
24         {NULL, 0},
25  };
26  
27 +static struct pinmux_config w1_gpio_pin_mux[] = {
28 +       {"gpmc_ad3.gpio1_3",    OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
29 +       {NULL, 0},
30 +};
31 +
32  static struct pinmux_config tsc_pin_mux[] = {
33         {"ain0.ain0",           OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
34         {"ain1.ain1",           OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
35 @@ -1026,6 +1032,19 @@ static struct pinmux_config profibus_pin_mux[] = {
36         {NULL, 0},
37  };
38  
39 +#define BEAGLEBONE_W1_GPIO GPIO_TO_PIN(1, 3)
40 +
41 +static struct w1_gpio_platform_data bone_w1_gpio_pdata = {
42 +       .pin            = BEAGLEBONE_W1_GPIO,
43 +       .is_open_drain  = 0,
44 +};
45 +
46 +static struct platform_device bone_w1_device = {
47 +       .name                   = "w1-gpio",
48 +       .id                     = -1,
49 +       .dev.platform_data      = &bone_w1_gpio_pdata,
50 +};
51 +
52  /* LEDS - gpio1_21 -> gpio1_24 */
53  
54  #define BEAGLEBONE_USR1_LED  GPIO_TO_PIN(1, 21)
55 @@ -1349,6 +1368,17 @@ static void dvileds_init(int evm_id, int profile )
56                 pr_err("failed to register BeagleBone DVI cape LEDS\n");
57  }
58  
59 +static void bonew1_gpio_init(int evm_id, int profile )
60 +{
61 +       int err;
62 +       setup_pin_mux(w1_gpio_pin_mux);
63 +       err = platform_device_register(&bone_w1_device);
64 +       if (err)
65 +               pr_err("failed to register w1-gpio\n");
66 +       else
67 +               pr_info("w1-gpio connected to P8_6\n");
68 +}
69 +
70  static void rgmii1_init(int evm_id, int profile)
71  {
72         setup_pin_mux(rgmii1_pin_mux);
73 @@ -2228,6 +2258,7 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = {
74         {i2c2_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
75         {mmc0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
76         {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL},
77 +       {bonew1_gpio_init, DEV_ON_BASEBOARD, PROFILE_ALL},
78         {NULL, 0, 0},
79  };
80  
81 -- 
82 1.7.2.5