|
32 | 32 | #include <linux/io.h>
|
33 | 33 | #include <linux/module.h>
|
34 | 34 | #include <linux/spi/spi.h>
|
| 35 | +#include <linux/w1-gpio.h> |
35 | 36 |
|
36 | 37 | #include <linux/version.h>
|
37 | 38 | #include <linux/clkdev.h>
|
|
69 | 70 | */
|
70 | 71 | #define DMA_MASK_BITS_COMMON 32
|
71 | 72 |
|
| 73 | +// use GPIO 4 for the one-wire GPIO pin, if enabled |
| 74 | +#define W1_GPIO 4 |
| 75 | + |
72 | 76 | static DEFINE_CLOCK_DATA(cd);
|
73 | 77 |
|
74 | 78 | /* command line parameters */
|
@@ -291,6 +295,19 @@ static struct platform_device bcm2708_mci_device = {
|
291 | 295 | };
|
292 | 296 | #endif /* CONFIG_MMC_BCM2708 */
|
293 | 297 |
|
| 298 | +#if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE) |
| 299 | +static struct w1_gpio_platform_data w1_gpio_pdata = { |
| 300 | + .pin = W1_GPIO, |
| 301 | + .is_open_drain = 0, |
| 302 | +}; |
| 303 | + |
| 304 | +static struct platform_device w1_device = { |
| 305 | + .name = "w1-gpio", |
| 306 | + .id = -1, |
| 307 | + .dev.platform_data = &w1_gpio_pdata, |
| 308 | +}; |
| 309 | +#endif |
| 310 | + |
294 | 311 | static u64 fb_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);
|
295 | 312 |
|
296 | 313 | static struct platform_device bcm2708_fb_device = {
|
@@ -591,6 +608,9 @@ void __init bcm2708_init(void)
|
591 | 608 | bcm_register_device(&bcm2708_vcio_device);
|
592 | 609 | #ifdef CONFIG_BCM2708_GPIO
|
593 | 610 | bcm_register_device(&bcm2708_gpio_device);
|
| 611 | +#endif |
| 612 | +#if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE) |
| 613 | + platform_device_register(&w1_device); |
594 | 614 | #endif
|
595 | 615 | bcm_register_device(&bcm2708_systemtimer_device);
|
596 | 616 | #ifdef CONFIG_MMC_BCM2708
|
|
0 commit comments