~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to include/linux/platform_device.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#include <linux/device.h>
15
15
#include <linux/mod_devicetable.h>
16
16
 
 
17
struct mfd_cell;
 
18
 
17
19
struct platform_device {
18
20
        const char      * name;
19
21
        int             id;
23
25
 
24
26
        const struct platform_device_id *id_entry;
25
27
 
 
28
        /* MFD cell pointer */
 
29
        struct mfd_cell *mfd_cell;
 
30
 
26
31
        /* arch specific additions */
27
32
        struct pdev_archdata    archdata;
28
33
};
130
135
extern int platform_driver_probe(struct platform_driver *driver,
131
136
                int (*probe)(struct platform_device *));
132
137
 
133
 
#define platform_get_drvdata(_dev)      dev_get_drvdata(&(_dev)->dev)
134
 
#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data))
 
138
static inline void *platform_get_drvdata(const struct platform_device *pdev)
 
139
{
 
140
        return dev_get_drvdata(&pdev->dev);
 
141
}
 
142
 
 
143
static inline void platform_set_drvdata(struct platform_device *pdev, void *data)
 
144
{
 
145
        dev_set_drvdata(&pdev->dev, data);
 
146
}
135
147
 
136
148
extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
137
149
                                        int (*probe)(struct platform_device *),
138
150
                                        struct resource *res, unsigned int n_res,
139
151
                                        const void *data, size_t size);
140
152
 
141
 
extern const struct dev_pm_ops * platform_bus_get_pm_ops(void);
142
 
extern void platform_bus_set_pm_ops(const struct dev_pm_ops *pm);
143
 
 
144
153
/* early platform driver interface */
145
154
struct early_platform_driver {
146
155
        const char *class_str;
193
202
}
194
203
#endif /* MODULE */
195
204
 
 
205
#ifdef CONFIG_PM_SLEEP
 
206
extern int platform_pm_prepare(struct device *dev);
 
207
extern void platform_pm_complete(struct device *dev);
 
208
#else
 
209
#define platform_pm_prepare     NULL
 
210
#define platform_pm_complete    NULL
 
211
#endif
 
212
 
 
213
#ifdef CONFIG_SUSPEND
 
214
extern int platform_pm_suspend(struct device *dev);
 
215
extern int platform_pm_suspend_noirq(struct device *dev);
 
216
extern int platform_pm_resume(struct device *dev);
 
217
extern int platform_pm_resume_noirq(struct device *dev);
 
218
#else
 
219
#define platform_pm_suspend             NULL
 
220
#define platform_pm_resume              NULL
 
221
#define platform_pm_suspend_noirq       NULL
 
222
#define platform_pm_resume_noirq        NULL
 
223
#endif
 
224
 
 
225
#ifdef CONFIG_HIBERNATE_CALLBACKS
 
226
extern int platform_pm_freeze(struct device *dev);
 
227
extern int platform_pm_freeze_noirq(struct device *dev);
 
228
extern int platform_pm_thaw(struct device *dev);
 
229
extern int platform_pm_thaw_noirq(struct device *dev);
 
230
extern int platform_pm_poweroff(struct device *dev);
 
231
extern int platform_pm_poweroff_noirq(struct device *dev);
 
232
extern int platform_pm_restore(struct device *dev);
 
233
extern int platform_pm_restore_noirq(struct device *dev);
 
234
#else
 
235
#define platform_pm_freeze              NULL
 
236
#define platform_pm_thaw                NULL
 
237
#define platform_pm_poweroff            NULL
 
238
#define platform_pm_restore             NULL
 
239
#define platform_pm_freeze_noirq        NULL
 
240
#define platform_pm_thaw_noirq          NULL
 
241
#define platform_pm_poweroff_noirq      NULL
 
242
#define platform_pm_restore_noirq       NULL
 
243
#endif
 
244
 
 
245
#ifdef CONFIG_PM_SLEEP
 
246
#define USE_PLATFORM_PM_SLEEP_OPS \
 
247
        .prepare = platform_pm_prepare, \
 
248
        .complete = platform_pm_complete, \
 
249
        .suspend = platform_pm_suspend, \
 
250
        .resume = platform_pm_resume, \
 
251
        .freeze = platform_pm_freeze, \
 
252
        .thaw = platform_pm_thaw, \
 
253
        .poweroff = platform_pm_poweroff, \
 
254
        .restore = platform_pm_restore, \
 
255
        .suspend_noirq = platform_pm_suspend_noirq, \
 
256
        .resume_noirq = platform_pm_resume_noirq, \
 
257
        .freeze_noirq = platform_pm_freeze_noirq, \
 
258
        .thaw_noirq = platform_pm_thaw_noirq, \
 
259
        .poweroff_noirq = platform_pm_poweroff_noirq, \
 
260
        .restore_noirq = platform_pm_restore_noirq,
 
261
#else
 
262
#define USE_PLATFORM_PM_SLEEP_OPS
 
263
#endif
 
264
 
196
265
#endif /* _PLATFORM_DEVICE_H_ */