ts-7000
[Top] [All Lists]

[ts-7000] Help - confused by platform driver code.

To:
Subject: [ts-7000] Help - confused by platform driver code.
From: "Dom Storey" <>
Date: Sun, 28 Feb 2010 07:08:38 -0000
Hi 

I'm developing a kernel driver for the relay8 board based on kernel 2.6.33 - 
I'm quite new to this and I am finding some of the calls in drivers hard to 
understand. 

I need to do i/o on 3 registers - offset at {0, 1, 2} from base (after I have 
located the base of the board 0x11e00000 + {0x140,0x150,0x160,0x170} depending 
on board jumper).

This location should be done in the probe routine of the driver. Yet on all the 
other drivers I have examined, I can't see how they locate specific locations 
in memory.

Most drivers seem to have

static __devinit int mydrv_probe(struct platform_device *pdev)
{
      ...
    r_data = platform_get_resource(pdev, IORESOURCE_MEM, 0);

followed by something like 

    ioport = ioremap(r_data->start, r_data->end - r_data->start + 1);
      ...

so I am getting the feeling that something in the kernel which is calling 
mydrv_probe with the pdev structure filled out magically with the right address 
mappings. Yet I can't seem to find any configuration file anywhere else that 
would indicate this. 

Google searches on platform driver development don't seem to return anything 
useful. Anyone got a source of enlightening information?

thanks Dominic



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU