Skip to content

Commit

Permalink
Merge pull request #92 from FrankBuss/rpi-3.2.27
Browse files Browse the repository at this point in the history
enabling the realtime clock 1-wire chip DS1307 and 1-wire on GPIO4
  • Loading branch information
popcornmix committed Aug 23, 2012
2 parents 091073b + a915a4f commit 2663f76
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,8 @@ CONFIG_LEDS_GPIO=y
CONFIG_LEDS_TRIGGER_TIMER=m
CONFIG_LEDS_TRIGGER_HEARTBEAT=m
CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_DS1307=m
CONFIG_UIO=m
CONFIG_UIO_PDRV=m
CONFIG_UIO_PDRV_GENIRQ=m
Expand Down
20 changes: 20 additions & 0 deletions arch/arm/mach-bcm2708/bcm2708.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -69,6 +70,9 @@
*/
#define DMA_MASK_BITS_COMMON 32

// use GPIO 4 for the one-wire GPIO pin, if enabled
#define W1_GPIO 4

static DEFINE_CLOCK_DATA(cd);

/* command line parameters */
Expand Down Expand Up @@ -291,6 +295,19 @@ static struct platform_device bcm2708_mci_device = {
};
#endif /* CONFIG_MMC_BCM2708 */

#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 = {
Expand Down Expand Up @@ -591,6 +608,9 @@ void __init bcm2708_init(void)
bcm_register_device(&bcm2708_vcio_device);
#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);
#ifdef CONFIG_MMC_BCM2708
Expand Down

0 comments on commit 2663f76

Please sign in to comment.