Hi all, Can any tell me what is the point of "struct platform_device", what does it represent and what it is used for ? thanks
- posted
18 years ago
Hi all, Can any tell me what is the point of "struct platform_device", what does it represent and what it is used for ? thanks
/* * platform_device.h - generic, centralized driver model * * Copyright (c) 2001-2003 Patrick Mochel * * This file is released under the GPLv2 * * See Documentation/driver-model/ for more information. */
#ifndef _PLATFORM_DEVICE_H_ #define _PLATFORM_DEVICE_H_
#include
struct platform_device { const char * name; u32 id; struct device dev; u32 num_resources; struct resource * resource; }; ...
I read the documentation, but it was not very clear.
Its used for devices which cannot be autodetected (in contrast to devices on the PCI bus). You must *know* they are in the system. And you must know which resources these devices allocate. So you create a list of platform devices in your board support package. See arch/arm/mach-pxa/generic.c (or mainstone.c) for some examples how to use them.
Hope it helps JB
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.