diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/host1x.h | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/include/linux/host1x.h b/include/linux/host1x.h index 7442f2a57039..e62c61a4afa9 100644 --- a/include/linux/host1x.h +++ b/include/linux/host1x.h | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | #ifndef __LINUX_HOST1X_H | 19 | #ifndef __LINUX_HOST1X_H |
| 20 | #define __LINUX_HOST1X_H | 20 | #define __LINUX_HOST1X_H |
| 21 | 21 | ||
| 22 | #include <linux/kref.h> | 22 | #include <linux/device.h> |
| 23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
| 24 | 24 | ||
| 25 | enum host1x_class { | 25 | enum host1x_class { |
| @@ -37,6 +37,7 @@ struct host1x_client_ops { | |||
| 37 | 37 | ||
| 38 | struct host1x_client { | 38 | struct host1x_client { |
| 39 | struct list_head list; | 39 | struct list_head list; |
| 40 | struct device *parent; | ||
| 40 | struct device *dev; | 41 | struct device *dev; |
| 41 | 42 | ||
| 42 | const struct host1x_client_ops *ops; | 43 | const struct host1x_client_ops *ops; |
| @@ -230,4 +231,46 @@ void host1x_job_put(struct host1x_job *job); | |||
| 230 | int host1x_job_pin(struct host1x_job *job, struct device *dev); | 231 | int host1x_job_pin(struct host1x_job *job, struct device *dev); |
| 231 | void host1x_job_unpin(struct host1x_job *job); | 232 | void host1x_job_unpin(struct host1x_job *job); |
| 232 | 233 | ||
| 234 | /* | ||
| 235 | * subdevice probe infrastructure | ||
| 236 | */ | ||
| 237 | |||
| 238 | struct host1x_device; | ||
| 239 | |||
| 240 | struct host1x_driver { | ||
| 241 | const struct of_device_id *subdevs; | ||
| 242 | struct list_head list; | ||
| 243 | const char *name; | ||
| 244 | |||
| 245 | int (*probe)(struct host1x_device *device); | ||
| 246 | int (*remove)(struct host1x_device *device); | ||
| 247 | }; | ||
| 248 | |||
| 249 | int host1x_driver_register(struct host1x_driver *driver); | ||
| 250 | void host1x_driver_unregister(struct host1x_driver *driver); | ||
| 251 | |||
| 252 | struct host1x_device { | ||
| 253 | struct host1x_driver *driver; | ||
| 254 | struct list_head list; | ||
| 255 | struct device dev; | ||
| 256 | |||
| 257 | struct mutex subdevs_lock; | ||
| 258 | struct list_head subdevs; | ||
| 259 | struct list_head active; | ||
| 260 | |||
| 261 | struct mutex clients_lock; | ||
| 262 | struct list_head clients; | ||
| 263 | }; | ||
| 264 | |||
| 265 | static inline struct host1x_device *to_host1x_device(struct device *dev) | ||
| 266 | { | ||
| 267 | return container_of(dev, struct host1x_device, dev); | ||
| 268 | } | ||
| 269 | |||
| 270 | int host1x_device_init(struct host1x_device *device); | ||
| 271 | int host1x_device_exit(struct host1x_device *device); | ||
| 272 | |||
| 273 | int host1x_client_register(struct host1x_client *client); | ||
| 274 | int host1x_client_unregister(struct host1x_client *client); | ||
| 275 | |||
| 233 | #endif | 276 | #endif |
