aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/host1x.h45
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
25enum host1x_class { 25enum host1x_class {
@@ -37,6 +37,7 @@ struct host1x_client_ops {
37 37
38struct host1x_client { 38struct 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);
230int host1x_job_pin(struct host1x_job *job, struct device *dev); 231int host1x_job_pin(struct host1x_job *job, struct device *dev);
231void host1x_job_unpin(struct host1x_job *job); 232void host1x_job_unpin(struct host1x_job *job);
232 233
234/*
235 * subdevice probe infrastructure
236 */
237
238struct host1x_device;
239
240struct 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
249int host1x_driver_register(struct host1x_driver *driver);
250void host1x_driver_unregister(struct host1x_driver *driver);
251
252struct 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
265static inline struct host1x_device *to_host1x_device(struct device *dev)
266{
267 return container_of(dev, struct host1x_device, dev);
268}
269
270int host1x_device_init(struct host1x_device *device);
271int host1x_device_exit(struct host1x_device *device);
272
273int host1x_client_register(struct host1x_client *client);
274int host1x_client_unregister(struct host1x_client *client);
275
233#endif 276#endif