diff options
Diffstat (limited to 'include/linux/host1x.h')
-rw-r--r-- | include/linux/host1x.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/linux/host1x.h b/include/linux/host1x.h index bb9840fd1e18..464f33814a94 100644 --- a/include/linux/host1x.h +++ b/include/linux/host1x.h | |||
@@ -250,17 +250,29 @@ void host1x_job_unpin(struct host1x_job *job); | |||
250 | struct host1x_device; | 250 | struct host1x_device; |
251 | 251 | ||
252 | struct host1x_driver { | 252 | struct host1x_driver { |
253 | struct device_driver driver; | ||
254 | |||
253 | const struct of_device_id *subdevs; | 255 | const struct of_device_id *subdevs; |
254 | struct list_head list; | 256 | struct list_head list; |
255 | const char *name; | ||
256 | 257 | ||
257 | int (*probe)(struct host1x_device *device); | 258 | int (*probe)(struct host1x_device *device); |
258 | int (*remove)(struct host1x_device *device); | 259 | int (*remove)(struct host1x_device *device); |
260 | void (*shutdown)(struct host1x_device *device); | ||
259 | }; | 261 | }; |
260 | 262 | ||
261 | int host1x_driver_register(struct host1x_driver *driver); | 263 | static inline struct host1x_driver * |
264 | to_host1x_driver(struct device_driver *driver) | ||
265 | { | ||
266 | return container_of(driver, struct host1x_driver, driver); | ||
267 | } | ||
268 | |||
269 | int host1x_driver_register_full(struct host1x_driver *driver, | ||
270 | struct module *owner); | ||
262 | void host1x_driver_unregister(struct host1x_driver *driver); | 271 | void host1x_driver_unregister(struct host1x_driver *driver); |
263 | 272 | ||
273 | #define host1x_driver_register(driver) \ | ||
274 | host1x_driver_register_full(driver, THIS_MODULE) | ||
275 | |||
264 | struct host1x_device { | 276 | struct host1x_device { |
265 | struct host1x_driver *driver; | 277 | struct host1x_driver *driver; |
266 | struct list_head list; | 278 | struct list_head list; |
@@ -272,6 +284,8 @@ struct host1x_device { | |||
272 | 284 | ||
273 | struct mutex clients_lock; | 285 | struct mutex clients_lock; |
274 | struct list_head clients; | 286 | struct list_head clients; |
287 | |||
288 | bool registered; | ||
275 | }; | 289 | }; |
276 | 290 | ||
277 | static inline struct host1x_device *to_host1x_device(struct device *dev) | 291 | static inline struct host1x_device *to_host1x_device(struct device *dev) |