• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Dockstar 1-wire GPIO support  (Read 2354 times)
petgu
Newbie
*

Karma: 0
Posts: 2


View Profile
« on: August 17, 2011, 12:48:38 AM »

As mentioned in this topic:
http://www.plugcomputer.org/plugforum/index.php?topic=163.0

there has been some success in connecting DS18B20 to the GPIO using kerneldriver.

I've been trying this for a while now but no success for me.

I've done the patches like adding the gpio pin I'm using to the GPIO pool
Registred the w1-gpio platform driver

Compiled a new kernel (2.39.1) with no errors

Loaded the w1-gpio module

Everything comes up great in the /sys/bus/w1 folder

With a oscilloscope I can see the my Dockstar polling the w1 bus but it looks like it doesn't changing the direction of the pin to input.
I see a minimal dip (0.1volt) when the slave tries to answer.
Pullup is the usual 5k that I've used with all other projects including the 18B20.

If I unload the w1-gpio module and try to use the pin manually, like setting it high, low, changing direction, reading. No problem.
The kernel seems to have full control over the pin.

Is there some one who has got it working and is willing to share their findings or maybe is there a better forum to ask this question in?

/Peter
Logged

petgu
Newbie
*

Karma: 0
Posts: 2


View Profile
« Reply #1 on: August 19, 2011, 11:26:20 PM »

I'll reply to my self as I found the solution after asking the author of the w1-gpio kmod Ville Syrjälä

Here is the changes needed to get it working on a dockstar

Should be the same on all 88F6281 based plugs .. Just find the right setup file in kernel source.


In this example I use MPP49
---------------------------------------------------------------------
/* arch/arm/mach-kirkwood/dockstar-setup.c */

#include <linux/w1-gpio.h>
 
static unsigned int dockstar_mpp_config[] __initdata = {
...
   MPP49_GPIO,   /* W1 Pin */
...
};

static struct w1_gpio_platform_data w1_gpio_pdata = {
        .pin            = 49,
};

static struct platform_device dockstar_device_w1 = {
        .name                   = "w1-gpio",
        .id                     = -1,
        .dev.platform_data      = &w1_gpio_pdata,
};

static void __init dockstar_init(void){
...
        platform_device_register(&dockstar_device_w1);
...
};
---------------------------------------------------------------------
Logged

Pages: [1]
Print
Jump to: