blob: a761b5b2fba79e5b1797b99e9c13e4dd6fec68e7 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef _PLATFORM_DEVICE_H_
13#define _PLATFORM_DEVICE_H_
Ben Cheng4b29af02012-03-07 16:14:53 -080014
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080015#include <linux/device.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080016
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080017struct platform_device {
18 const char * name;
19 u32 id;
20 struct device dev;
21 u32 num_resources;
22 struct resource * resource;
23};
Ben Cheng4b29af02012-03-07 16:14:53 -080024
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080025#define to_platform_device(x) container_of((x), struct platform_device, dev)
Ben Cheng4b29af02012-03-07 16:14:53 -080026
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080027struct platform_driver {
28 int (*probe)(struct platform_device *);
29 int (*remove)(struct platform_device *);
30 void (*shutdown)(struct platform_device *);
31 int (*suspend)(struct platform_device *, pm_message_t state);
32 int (*resume)(struct platform_device *);
33 struct device_driver driver;
34};
Ben Cheng4b29af02012-03-07 16:14:53 -080035
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080036#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)
37#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data))
Ben Cheng4b29af02012-03-07 16:14:53 -080038
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080039#endif