2014-09-27 19:10:51 +00:00
|
|
|
From b0ffe239799004245e53a998216d361f6ab67f96 Mon Sep 17 00:00:00 2001
|
2014-02-28 20:30:08 +00:00
|
|
|
From: popcornmix <popcornmix@gmail.com>
|
|
|
|
Date: Wed, 8 May 2013 11:46:50 +0100
|
2014-09-27 19:10:51 +00:00
|
|
|
Subject: [PATCH 025/196] enabling the realtime clock 1-wire chip DS1307 and
|
2014-02-28 20:30:08 +00:00
|
|
|
1-wire on GPIO4 (as a module)
|
|
|
|
|
|
|
|
---
|
|
|
|
arch/arm/mach-bcm2708/bcm2708.c | 20 ++++++++++++++++++++
|
|
|
|
1 file changed, 20 insertions(+)
|
|
|
|
|
2014-09-27 19:10:51 +00:00
|
|
|
diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c
|
|
|
|
index 03b8ec5..18f7ede 100644
|
2014-02-28 20:30:08 +00:00
|
|
|
--- a/arch/arm/mach-bcm2708/bcm2708.c
|
|
|
|
+++ b/arch/arm/mach-bcm2708/bcm2708.c
|
|
|
|
@@ -32,6 +32,7 @@
|
|
|
|
#include <linux/io.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/spi/spi.h>
|
|
|
|
+#include <linux/w1-gpio.h>
|
|
|
|
|
|
|
|
#include <linux/version.h>
|
|
|
|
#include <linux/clkdev.h>
|
|
|
|
@@ -71,6 +72,9 @@
|
|
|
|
*/
|
|
|
|
#define DMA_MASK_BITS_COMMON 32
|
|
|
|
|
|
|
|
+// use GPIO 4 for the one-wire GPIO pin, if enabled
|
|
|
|
+#define W1_GPIO 4
|
|
|
|
+
|
|
|
|
/* command line parameters */
|
|
|
|
static unsigned boardrev, serial;
|
|
|
|
static unsigned uart_clock;
|
2014-09-27 19:10:51 +00:00
|
|
|
@@ -251,6 +255,19 @@ static struct platform_device bcm2708_dmaman_device = {
|
2014-02-28 20:30:08 +00:00
|
|
|
.num_resources = ARRAY_SIZE(bcm2708_dmaman_resources),
|
|
|
|
};
|
|
|
|
|
|
|
|
+#if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE)
|
|
|
|
+static struct w1_gpio_platform_data w1_gpio_pdata = {
|
|
|
|
+ .pin = W1_GPIO,
|
|
|
|
+ .is_open_drain = 0,
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static struct platform_device w1_device = {
|
|
|
|
+ .name = "w1-gpio",
|
|
|
|
+ .id = -1,
|
|
|
|
+ .dev.platform_data = &w1_gpio_pdata,
|
|
|
|
+};
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
static u64 fb_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
|
|
|
|
|
|
|
|
static struct platform_device bcm2708_fb_device = {
|
|
|
|
@@ -620,6 +637,9 @@ void __init bcm2708_init(void)
|
|
|
|
#ifdef CONFIG_BCM2708_GPIO
|
|
|
|
bcm_register_device(&bcm2708_gpio_device);
|
|
|
|
#endif
|
|
|
|
+#if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE)
|
|
|
|
+ platform_device_register(&w1_device);
|
|
|
|
+#endif
|
|
|
|
bcm_register_device(&bcm2708_systemtimer_device);
|
|
|
|
bcm_register_device(&bcm2708_fb_device);
|
|
|
|
bcm_register_device(&bcm2708_usb_device);
|
2014-09-27 19:10:51 +00:00
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|