1 From b0ffe239799004245e53a998216d361f6ab67f96 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Wed, 8 May 2013 11:46:50 +0100
4 Subject: [PATCH 025/196] enabling the realtime clock 1-wire chip DS1307 and
5 1-wire on GPIO4 (as a module)
8 arch/arm/mach-bcm2708/bcm2708.c | 20 ++++++++++++++++++++
9 1 file changed, 20 insertions(+)
11 diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c
12 index 03b8ec5..18f7ede 100644
13 --- a/arch/arm/mach-bcm2708/bcm2708.c
14 +++ b/arch/arm/mach-bcm2708/bcm2708.c
17 #include <linux/module.h>
18 #include <linux/spi/spi.h>
19 +#include <linux/w1-gpio.h>
21 #include <linux/version.h>
22 #include <linux/clkdev.h>
25 #define DMA_MASK_BITS_COMMON 32
27 +// use GPIO 4 for the one-wire GPIO pin, if enabled
30 /* command line parameters */
31 static unsigned boardrev, serial;
32 static unsigned uart_clock;
33 @@ -251,6 +255,19 @@ static struct platform_device bcm2708_dmaman_device = {
34 .num_resources = ARRAY_SIZE(bcm2708_dmaman_resources),
37 +#if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE)
38 +static struct w1_gpio_platform_data w1_gpio_pdata = {
43 +static struct platform_device w1_device = {
46 + .dev.platform_data = &w1_gpio_pdata,
50 static u64 fb_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
52 static struct platform_device bcm2708_fb_device = {
53 @@ -620,6 +637,9 @@ void __init bcm2708_init(void)
54 #ifdef CONFIG_BCM2708_GPIO
55 bcm_register_device(&bcm2708_gpio_device);
57 +#if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE)
58 + platform_device_register(&w1_device);
60 bcm_register_device(&bcm2708_systemtimer_device);
61 bcm_register_device(&bcm2708_fb_device);
62 bcm_register_device(&bcm2708_usb_device);