• Home
  • Help
  • Search
  • Login
  • Register
  Show Posts
Pages: [1]
1  Hardware and U-Boot firmware / Hardware / Dockstar (sheevaplug) w1-gpio on: October 26, 2010, 12:32:29 PM
Hi everyone,

I want to use a DS18B20 which is a temperature sensor with one wire bus. Because the Sheevaplug hat many useable gpios I want to try it with one of them since now without success  Embarrassed (i use a debian kernel: 2.6.36-rc6)

I added this to the /usr/src/linux-source-2.6.36-rc6/arch/arm/mach-kirkwood/sheevaplug-setup.c:

Code:
#include <linux/w1-gpio.h>
...
static struct w1_gpio_platform_data w1_gpio_pdata = {
        .pin            = MPP30_GPIO,
        .is_open_drain  = 1,
};

static struct platform_device foo_device_w1 = {
        .name                   = "w1-gpio",
        .id                     = -1,
        .dev.platform_data      = &w1_gpio_pdata,
};
...
static unsigned int sheevaplug_mpp_config[] __initdata = {
        MPP29_GPIO,     /* USB Power Enable */
        MPP46_GPIO,     /* LED green*/
        MPP47_GPIO,     /* LED orange*/
        MPP30_GPIO,     /* GPIO for w1-gpio */
        0,
};
...
static void __init sheevaplug_init(void)
{
        ...
        /* setup w1-gpio */
        platform_device_register(&foo_device_w1);
}


I also enabled one wire master gpio support in the kernel config

# modprobe w1-gpio
FATAL: Error inserting w1_gpio (/lib/modules/2.6.36-rc6/kernel/drivers/w1/masters/w1-gpio.ko): No such device

and demsg says:
# dmesg
[ 5977.291208] gpio_request: gpio-503838 (w1) status -22
[ 5977.291227] w1-gpio: probe of w1-gpio failed with error -22

I have no idea how to solve this problem.
Pages: [1]