ts-7000
[Top] [All Lists]

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

To:
Subject: Re: [ts-7000] Help - confused by platform driver code.
From: Petr Štetiar <>
Date: Sun, 28 Feb 2010 13:31:07 +0100
Dom Storey <> [2010-02-28 07:08:38]:

> 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.

Take a look at Matthieu's patches[1], for example at his 
0006-ts72xx_ts_ser1.patch.

> Most drivers seem to have
> 
> r_data = platform_get_resource(pdev, IORESOURCE_MEM, 0);

but to use this, you would need to define resource first:

        static struct resource ts72xx_mydrv_resources[] = {
        {
                .start = TS72XX_PC104_8BIT_IO_PHYS_BASE,
                .end   = TS72XX_PC104_8BIT_IO_PHYS_BASE + 
TS72XX_PC104_8BIT_IO_SIZE,
                .flags = IORESOURCE_MEM,
        }

then assign the resource to your platform_device:

        static struct platform_device ts72xx_mydrv_device = {
                .resource       = ts72xx_mydrv_resources,
                .num_resources  = ARRAY_SIZE(ts72xx_mydrv_resources),
        }

then register it:

        platform_device_register(&ts72xx_mydrv_device);

and now you can do:

        mem_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);

But I think, that you can do it easily using ioremap, __raw{read, write}b as
Matthieu is doing in his ts_ser1 driver.

1. http://mcrapet.free.fr/

-- ynezz


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

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