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: "Sandesh Ghimire" <>
Date: Sun, 28 Feb 2010 11:30:39 -0500


 

 

From: [ On Behalf Of Petr Štetiar
Sent: Sunday, February 28, 2010 7:31 AM
To:
Subject: Re: [ts-7000] Help - confused by platform driver code.

 

 

Dom Storey <dstorey%40barossafarm.com> [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



__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<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