conststruct platform_device_id *id_entry; /* * Driver name to force a match. Do not set directly, because core * frees it. Use driver_set_override() to set or clear it.
*/ constchar *driver_override;
/* MFD cell pointer */ struct mfd_cell *mfd_cell;
/* arch specific additions */ struct pdev_archdata archdata;
};
/** * platform_device_register_resndata - add a platform-level device with * resources and platform-specific data * * @parent: parent device for the device we're adding * @name: base name of the device we're adding * @id: instance id * @res: set of resources that needs to be allocated for the device * @num: number of resources * @data: platform specific data for this platform device * @size: size of platform specific data * * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
*/ staticinlinestruct platform_device *platform_device_register_resndata( struct device *parent, constchar *name, int id, conststruct resource *res, unsignedint num, constvoid *data, size_t size) {
/** * platform_device_register_simple - add a platform-level device and its resources * @name: base name of the device we're adding * @id: instance id * @res: set of resources that needs to be allocated for the device * @num: number of resources * * This function creates a simple platform device that requires minimal * resource and memory management. Canned release function freeing memory * allocated for the device allows drivers using such devices to be * unloaded without waiting for the last reference to the device to be * dropped. * * This interface is primarily intended for use with legacy drivers which * probe hardware directly. Because such drivers create sysfs device nodes * themselves, rather than letting system infrastructure handle such device * enumeration tasks, they don't fully conform to the Linux driver model. * In particular, when such drivers are built as modules, they can't be * "hotplugged". * * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
*/ staticinlinestruct platform_device *platform_device_register_simple( constchar *name, int id, conststruct resource *res, unsignedint num)
{ return platform_device_register_resndata(NULL, name, id,
res, num, NULL, 0);
}
/** * platform_device_register_data - add a platform-level device with platform-specific data * @parent: parent device for the device we're adding * @name: base name of the device we're adding * @id: instance id * @data: platform specific data for this platform device * @size: size of platform specific data * * This function creates a simple platform device that requires minimal * resource and memory management. Canned release function freeing memory * allocated for the device allows drivers using such devices to be * unloaded without waiting for the last reference to the device to be * dropped. * * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
*/ staticinlinestruct platform_device *platform_device_register_data( struct device *parent, constchar *name, int id, constvoid *data, size_t size)
{ return platform_device_register_resndata(parent, name, id,
NULL, 0, data, size);
}
struct platform_driver { int (*probe)(struct platform_device *); void (*remove)(struct platform_device *); void (*shutdown)(struct platform_device *); int (*suspend)(struct platform_device *, pm_message_t state); int (*resume)(struct platform_device *); struct device_driver driver; conststruct platform_device_id *id_table; bool prevent_deferred_probe; /* * For most device drivers, no need to care about this flag as long as * all DMAs are handled through the kernel DMA API. For some special * ones, for example VFIO drivers, they know how to manage the DMA * themselves and set this flag so that the IOMMU layer will allow them * to setup and manage their own I/O address space.
*/ bool driver_managed_dma;
};
/* * use a macro to avoid include chaining to get THIS_MODULE
*/ #define platform_driver_register(drv) \
__platform_driver_register(drv, THIS_MODULE) externint __platform_driver_register(struct platform_driver *, struct module *); externvoid platform_driver_unregister(struct platform_driver *);
/* non-hotpluggable platform devices may use this so that probe() and * its support may live in __init sections, conserving runtime memory.
*/ #define platform_driver_probe(drv, probe) \
__platform_driver_probe(drv, probe, THIS_MODULE) externint __platform_driver_probe(struct platform_driver *driver, int (*probe)(struct platform_device *), struct module *module);
/* module_platform_driver() - Helper macro for drivers that don't do * anything special in module init/exit. This eliminates a lot of * boilerplate. Each module may only use this macro once, and * calling it replaces module_init() and module_exit()
*/ #define module_platform_driver(__platform_driver) \
module_driver(__platform_driver, platform_driver_register, \
platform_driver_unregister)
/* builtin_platform_driver() - Helper macro for builtin drivers that * don't do anything special in driver init. This eliminates some * boilerplate. Each driver may only use this macro once, and * calling it replaces device_initcall(). Note this is meant to be * a parallel of module_platform_driver() above, but w/o _exit stuff.
*/ #define builtin_platform_driver(__platform_driver) \
builtin_driver(__platform_driver, platform_driver_register)
/* module_platform_driver_probe() - Helper macro for drivers that don't do * anything special in module init/exit. This eliminates a lot of * boilerplate. Each module may only use this macro once, and * calling it replaces module_init() and module_exit()
*/ #define module_platform_driver_probe(__platform_driver, __platform_probe) \ staticint __init __platform_driver##_init(void) \
{ \ return platform_driver_probe(&(__platform_driver), \
__platform_probe); \
} \
module_init(__platform_driver##_init); \ staticvoid __exit __platform_driver##_exit(void) \
{ \
platform_driver_unregister(&(__platform_driver)); \
} \
module_exit(__platform_driver##_exit);
/* builtin_platform_driver_probe() - Helper macro for drivers that don't do * anything special in device init. This eliminates some boilerplate. Each * driver may only use this macro once, and using it replaces device_initcall. * This is meant to be a parallel of module_platform_driver_probe above, but * without the __exit parts.
*/ #define builtin_platform_driver_probe(__platform_driver, __platform_probe) \ staticint __init __platform_driver##_init(void) \
{ \ return platform_driver_probe(&(__platform_driver), \
__platform_probe); \
} \
device_initcall(__platform_driver##_init); \
#ifndef CONFIG_SUPERH /* * REVISIT: This stub is needed for all non-SuperH users of early platform * drivers. It should go away once we introduce the new platform_device-based * early driver framework.
*/ staticinlineint is_sh_early_platform_device(struct platform_device *pdev)
{ return 0;
} #endif/* CONFIG_SUPERH */
/* For now only SuperH uses it */ void early_platform_cleanup(void);
#endif/* _PLATFORM_DEVICE_H_ */
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.