~ubuntu-branches/ubuntu/precise/linux-linaro-u8500/precise

« back to all changes in this revision

Viewing changes to include/linux/mfd/core.h

  • Committer: Bazaar Package Importer
  • Author(s): John Rigby, Upstream Fixes, Andy Green, John Rigby
  • Date: 2011-04-14 12:16:06 UTC
  • Revision ID: james.westby@ubuntu.com-20110414121606-b77podkyqgr2oix7
Tags: 2.6.38-1002.3
[ Upstream Fixes ]

* MUSB: shutdown: Make sure block is awake before doing shutdown
  - LP: #745737
* Fixed gpio polarity of gpio USB-phy reset.
  - LP: #747639

[ Andy Green ]

* LINARO: SAUCE: disable CONFIG_OMAP_RESET_CLOCKS
  - LP: #752900

[ John Rigby ]

* Rebase to new upstreams:
  Linux v2.6.38.1
  linaro-linux-2.6.38-upstream-29Mar2011
  Ubuntu-2.6.38-7.35
* SAUCE: OMAP4: clock: wait for module to become accessible on
  a clk enable
  - LP: #745737
* Rebase to new upstreams:
  Linux v2.6.38.2
  linaro-linux-2.6.38-upstream-5Apr2011
  Ubuntu-2.6.38-8.41
  - LP: #732842
* Update configs for device tree, dvfs and lttng
* LINARO: add building of dtb's
* LINARO: SAUCE: Disable lowest operating freqs on omap34xx
  - LP: #732912

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
        const char              *name;
26
26
        int                     id;
27
27
 
 
28
        /* refcounting for multiple drivers to use a single cell */
 
29
        atomic_t                *usage_count;
28
30
        int                     (*enable)(struct platform_device *dev);
29
31
        int                     (*disable)(struct platform_device *dev);
 
32
 
30
33
        int                     (*suspend)(struct platform_device *dev);
31
34
        int                     (*resume)(struct platform_device *dev);
32
35
 
33
 
        /* driver-specific data for MFD-aware "cell" drivers */
34
 
        void                    *driver_data;
35
 
 
36
 
        /* platform_data can be used to either pass data to "generic"
37
 
           driver or as a hook to mfd_cell for the "cell" drivers */
38
 
        void                    *platform_data;
39
 
        size_t                  data_size;
 
36
        /* mfd_data can be used to pass data to client drivers */
 
37
        void                    *mfd_data;
40
38
 
41
39
        /*
42
 
         * This resources can be specified relatively to the parent device.
43
 
         * For accessing device you should use resources from device
 
40
         * These resources can be specified relative to the parent device.
 
41
         * For accessing hardware you should use resources from the platform dev
44
42
         */
45
43
        int                     num_resources;
46
44
        const struct resource   *resources;
55
53
        bool                    pm_runtime_no_callbacks;
56
54
};
57
55
 
 
56
/*
 
57
 * Convenience functions for clients using shared cells.  Refcounting
 
58
 * happens automatically, with the cell's enable/disable callbacks
 
59
 * being called only when a device is first being enabled or no other
 
60
 * clients are making use of it.
 
61
 */
 
62
extern int mfd_cell_enable(struct platform_device *pdev);
 
63
extern int mfd_cell_disable(struct platform_device *pdev);
 
64
 
 
65
/*
 
66
 * Given a platform device that's been created by mfd_add_devices(), fetch
 
67
 * the mfd_cell that created it.
 
68
 */
 
69
static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev)
 
70
{
 
71
        return pdev->dev.platform_data;
 
72
}
 
73
 
 
74
/*
 
75
 * Given a platform device that's been created by mfd_add_devices(), fetch
 
76
 * the .mfd_data entry from the mfd_cell that created it.
 
77
 */
 
78
static inline void *mfd_get_data(struct platform_device *pdev)
 
79
{
 
80
        return mfd_get_cell(pdev)->mfd_data;
 
81
}
 
82
 
58
83
extern int mfd_add_devices(struct device *parent, int id,
59
 
                           const struct mfd_cell *cells, int n_devs,
 
84
                           struct mfd_cell *cells, int n_devs,
60
85
                           struct resource *mem_base,
61
86
                           int irq_base);
62
87
 
63
88
extern void mfd_remove_devices(struct device *parent);
64
89
 
 
90
/*
 
91
 * For MFD drivers with clients sharing access to resources, these create
 
92
 * multiple platform devices per cell.  Contention handling must still be
 
93
 * handled via drivers (ie, with enable/disable hooks).
 
94
 */
 
95
extern int mfd_shared_platform_driver_register(struct platform_driver *drv,
 
96
                const char *cellname);
 
97
extern void mfd_shared_platform_driver_unregister(struct platform_driver *drv);
 
98
 
65
99
#endif