18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2009-2013, NVIDIA Corporation. All rights reserved.
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef __LINUX_HOST1X_H
78c2ecf20Sopenharmony_ci#define __LINUX_HOST1X_H
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <linux/device.h>
108c2ecf20Sopenharmony_ci#include <linux/types.h>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cienum host1x_class {
138c2ecf20Sopenharmony_ci	HOST1X_CLASS_HOST1X = 0x1,
148c2ecf20Sopenharmony_ci	HOST1X_CLASS_GR2D = 0x51,
158c2ecf20Sopenharmony_ci	HOST1X_CLASS_GR2D_SB = 0x52,
168c2ecf20Sopenharmony_ci	HOST1X_CLASS_VIC = 0x5D,
178c2ecf20Sopenharmony_ci	HOST1X_CLASS_GR3D = 0x60,
188c2ecf20Sopenharmony_ci};
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cistruct host1x;
218c2ecf20Sopenharmony_cistruct host1x_client;
228c2ecf20Sopenharmony_cistruct iommu_group;
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciu64 host1x_get_dma_mask(struct host1x *host1x);
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci/**
278c2ecf20Sopenharmony_ci * struct host1x_client_ops - host1x client operations
288c2ecf20Sopenharmony_ci * @init: host1x client initialization code
298c2ecf20Sopenharmony_ci * @exit: host1x client tear down code
308c2ecf20Sopenharmony_ci * @suspend: host1x client suspend code
318c2ecf20Sopenharmony_ci * @resume: host1x client resume code
328c2ecf20Sopenharmony_ci */
338c2ecf20Sopenharmony_cistruct host1x_client_ops {
348c2ecf20Sopenharmony_ci	int (*init)(struct host1x_client *client);
358c2ecf20Sopenharmony_ci	int (*exit)(struct host1x_client *client);
368c2ecf20Sopenharmony_ci	int (*suspend)(struct host1x_client *client);
378c2ecf20Sopenharmony_ci	int (*resume)(struct host1x_client *client);
388c2ecf20Sopenharmony_ci};
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci/**
418c2ecf20Sopenharmony_ci * struct host1x_client - host1x client structure
428c2ecf20Sopenharmony_ci * @list: list node for the host1x client
438c2ecf20Sopenharmony_ci * @host: pointer to struct device representing the host1x controller
448c2ecf20Sopenharmony_ci * @dev: pointer to struct device backing this host1x client
458c2ecf20Sopenharmony_ci * @group: IOMMU group that this client is a member of
468c2ecf20Sopenharmony_ci * @ops: host1x client operations
478c2ecf20Sopenharmony_ci * @class: host1x class represented by this client
488c2ecf20Sopenharmony_ci * @channel: host1x channel associated with this client
498c2ecf20Sopenharmony_ci * @syncpts: array of syncpoints requested for this client
508c2ecf20Sopenharmony_ci * @num_syncpts: number of syncpoints requested for this client
518c2ecf20Sopenharmony_ci * @parent: pointer to parent structure
528c2ecf20Sopenharmony_ci * @usecount: reference count for this structure
538c2ecf20Sopenharmony_ci * @lock: mutex for mutually exclusive concurrency
548c2ecf20Sopenharmony_ci */
558c2ecf20Sopenharmony_cistruct host1x_client {
568c2ecf20Sopenharmony_ci	struct list_head list;
578c2ecf20Sopenharmony_ci	struct device *host;
588c2ecf20Sopenharmony_ci	struct device *dev;
598c2ecf20Sopenharmony_ci	struct iommu_group *group;
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci	const struct host1x_client_ops *ops;
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci	enum host1x_class class;
648c2ecf20Sopenharmony_ci	struct host1x_channel *channel;
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci	struct host1x_syncpt **syncpts;
678c2ecf20Sopenharmony_ci	unsigned int num_syncpts;
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci	struct host1x_client *parent;
708c2ecf20Sopenharmony_ci	unsigned int usecount;
718c2ecf20Sopenharmony_ci	struct mutex lock;
728c2ecf20Sopenharmony_ci};
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci/*
758c2ecf20Sopenharmony_ci * host1x buffer objects
768c2ecf20Sopenharmony_ci */
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_cistruct host1x_bo;
798c2ecf20Sopenharmony_cistruct sg_table;
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_cistruct host1x_bo_ops {
828c2ecf20Sopenharmony_ci	struct host1x_bo *(*get)(struct host1x_bo *bo);
838c2ecf20Sopenharmony_ci	void (*put)(struct host1x_bo *bo);
848c2ecf20Sopenharmony_ci	struct sg_table *(*pin)(struct device *dev, struct host1x_bo *bo,
858c2ecf20Sopenharmony_ci				dma_addr_t *phys);
868c2ecf20Sopenharmony_ci	void (*unpin)(struct device *dev, struct sg_table *sgt);
878c2ecf20Sopenharmony_ci	void *(*mmap)(struct host1x_bo *bo);
888c2ecf20Sopenharmony_ci	void (*munmap)(struct host1x_bo *bo, void *addr);
898c2ecf20Sopenharmony_ci};
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_cistruct host1x_bo {
928c2ecf20Sopenharmony_ci	const struct host1x_bo_ops *ops;
938c2ecf20Sopenharmony_ci};
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_cistatic inline void host1x_bo_init(struct host1x_bo *bo,
968c2ecf20Sopenharmony_ci				  const struct host1x_bo_ops *ops)
978c2ecf20Sopenharmony_ci{
988c2ecf20Sopenharmony_ci	bo->ops = ops;
998c2ecf20Sopenharmony_ci}
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_cistatic inline struct host1x_bo *host1x_bo_get(struct host1x_bo *bo)
1028c2ecf20Sopenharmony_ci{
1038c2ecf20Sopenharmony_ci	return bo->ops->get(bo);
1048c2ecf20Sopenharmony_ci}
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_cistatic inline void host1x_bo_put(struct host1x_bo *bo)
1078c2ecf20Sopenharmony_ci{
1088c2ecf20Sopenharmony_ci	bo->ops->put(bo);
1098c2ecf20Sopenharmony_ci}
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_cistatic inline struct sg_table *host1x_bo_pin(struct device *dev,
1128c2ecf20Sopenharmony_ci					     struct host1x_bo *bo,
1138c2ecf20Sopenharmony_ci					     dma_addr_t *phys)
1148c2ecf20Sopenharmony_ci{
1158c2ecf20Sopenharmony_ci	return bo->ops->pin(dev, bo, phys);
1168c2ecf20Sopenharmony_ci}
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_cistatic inline void host1x_bo_unpin(struct device *dev, struct host1x_bo *bo,
1198c2ecf20Sopenharmony_ci				   struct sg_table *sgt)
1208c2ecf20Sopenharmony_ci{
1218c2ecf20Sopenharmony_ci	bo->ops->unpin(dev, sgt);
1228c2ecf20Sopenharmony_ci}
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_cistatic inline void *host1x_bo_mmap(struct host1x_bo *bo)
1258c2ecf20Sopenharmony_ci{
1268c2ecf20Sopenharmony_ci	return bo->ops->mmap(bo);
1278c2ecf20Sopenharmony_ci}
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_cistatic inline void host1x_bo_munmap(struct host1x_bo *bo, void *addr)
1308c2ecf20Sopenharmony_ci{
1318c2ecf20Sopenharmony_ci	bo->ops->munmap(bo, addr);
1328c2ecf20Sopenharmony_ci}
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci/*
1358c2ecf20Sopenharmony_ci * host1x syncpoints
1368c2ecf20Sopenharmony_ci */
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci#define HOST1X_SYNCPT_CLIENT_MANAGED	(1 << 0)
1398c2ecf20Sopenharmony_ci#define HOST1X_SYNCPT_HAS_BASE		(1 << 1)
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_cistruct host1x_syncpt_base;
1428c2ecf20Sopenharmony_cistruct host1x_syncpt;
1438c2ecf20Sopenharmony_cistruct host1x;
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_cistruct host1x_syncpt *host1x_syncpt_get(struct host1x *host, u32 id);
1468c2ecf20Sopenharmony_ciu32 host1x_syncpt_id(struct host1x_syncpt *sp);
1478c2ecf20Sopenharmony_ciu32 host1x_syncpt_read_min(struct host1x_syncpt *sp);
1488c2ecf20Sopenharmony_ciu32 host1x_syncpt_read_max(struct host1x_syncpt *sp);
1498c2ecf20Sopenharmony_ciu32 host1x_syncpt_read(struct host1x_syncpt *sp);
1508c2ecf20Sopenharmony_ciint host1x_syncpt_incr(struct host1x_syncpt *sp);
1518c2ecf20Sopenharmony_ciu32 host1x_syncpt_incr_max(struct host1x_syncpt *sp, u32 incrs);
1528c2ecf20Sopenharmony_ciint host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout,
1538c2ecf20Sopenharmony_ci		       u32 *value);
1548c2ecf20Sopenharmony_cistruct host1x_syncpt *host1x_syncpt_request(struct host1x_client *client,
1558c2ecf20Sopenharmony_ci					    unsigned long flags);
1568c2ecf20Sopenharmony_civoid host1x_syncpt_free(struct host1x_syncpt *sp);
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_cistruct host1x_syncpt_base *host1x_syncpt_get_base(struct host1x_syncpt *sp);
1598c2ecf20Sopenharmony_ciu32 host1x_syncpt_base_id(struct host1x_syncpt_base *base);
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci/*
1628c2ecf20Sopenharmony_ci * host1x channel
1638c2ecf20Sopenharmony_ci */
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_cistruct host1x_channel;
1668c2ecf20Sopenharmony_cistruct host1x_job;
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_cistruct host1x_channel *host1x_channel_request(struct host1x_client *client);
1698c2ecf20Sopenharmony_cistruct host1x_channel *host1x_channel_get(struct host1x_channel *channel);
1708c2ecf20Sopenharmony_civoid host1x_channel_put(struct host1x_channel *channel);
1718c2ecf20Sopenharmony_ciint host1x_job_submit(struct host1x_job *job);
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci/*
1748c2ecf20Sopenharmony_ci * host1x job
1758c2ecf20Sopenharmony_ci */
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci#define HOST1X_RELOC_READ	(1 << 0)
1788c2ecf20Sopenharmony_ci#define HOST1X_RELOC_WRITE	(1 << 1)
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_cistruct host1x_reloc {
1818c2ecf20Sopenharmony_ci	struct {
1828c2ecf20Sopenharmony_ci		struct host1x_bo *bo;
1838c2ecf20Sopenharmony_ci		unsigned long offset;
1848c2ecf20Sopenharmony_ci	} cmdbuf;
1858c2ecf20Sopenharmony_ci	struct {
1868c2ecf20Sopenharmony_ci		struct host1x_bo *bo;
1878c2ecf20Sopenharmony_ci		unsigned long offset;
1888c2ecf20Sopenharmony_ci	} target;
1898c2ecf20Sopenharmony_ci	unsigned long shift;
1908c2ecf20Sopenharmony_ci	unsigned long flags;
1918c2ecf20Sopenharmony_ci};
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_cistruct host1x_job {
1948c2ecf20Sopenharmony_ci	/* When refcount goes to zero, job can be freed */
1958c2ecf20Sopenharmony_ci	struct kref ref;
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci	/* List entry */
1988c2ecf20Sopenharmony_ci	struct list_head list;
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci	/* Channel where job is submitted to */
2018c2ecf20Sopenharmony_ci	struct host1x_channel *channel;
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci	/* client where the job originated */
2048c2ecf20Sopenharmony_ci	struct host1x_client *client;
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci	/* Gathers and their memory */
2078c2ecf20Sopenharmony_ci	struct host1x_job_gather *gathers;
2088c2ecf20Sopenharmony_ci	unsigned int num_gathers;
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_ci	/* Array of handles to be pinned & unpinned */
2118c2ecf20Sopenharmony_ci	struct host1x_reloc *relocs;
2128c2ecf20Sopenharmony_ci	unsigned int num_relocs;
2138c2ecf20Sopenharmony_ci	struct host1x_job_unpin_data *unpins;
2148c2ecf20Sopenharmony_ci	unsigned int num_unpins;
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci	dma_addr_t *addr_phys;
2178c2ecf20Sopenharmony_ci	dma_addr_t *gather_addr_phys;
2188c2ecf20Sopenharmony_ci	dma_addr_t *reloc_addr_phys;
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_ci	/* Sync point id, number of increments and end related to the submit */
2218c2ecf20Sopenharmony_ci	u32 syncpt_id;
2228c2ecf20Sopenharmony_ci	u32 syncpt_incrs;
2238c2ecf20Sopenharmony_ci	u32 syncpt_end;
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci	/* Maximum time to wait for this job */
2268c2ecf20Sopenharmony_ci	unsigned int timeout;
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_ci	/* Index and number of slots used in the push buffer */
2298c2ecf20Sopenharmony_ci	unsigned int first_get;
2308c2ecf20Sopenharmony_ci	unsigned int num_slots;
2318c2ecf20Sopenharmony_ci
2328c2ecf20Sopenharmony_ci	/* Copy of gathers */
2338c2ecf20Sopenharmony_ci	size_t gather_copy_size;
2348c2ecf20Sopenharmony_ci	dma_addr_t gather_copy;
2358c2ecf20Sopenharmony_ci	u8 *gather_copy_mapped;
2368c2ecf20Sopenharmony_ci
2378c2ecf20Sopenharmony_ci	/* Check if register is marked as an address reg */
2388c2ecf20Sopenharmony_ci	int (*is_addr_reg)(struct device *dev, u32 class, u32 reg);
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_ci	/* Check if class belongs to the unit */
2418c2ecf20Sopenharmony_ci	int (*is_valid_class)(u32 class);
2428c2ecf20Sopenharmony_ci
2438c2ecf20Sopenharmony_ci	/* Request a SETCLASS to this class */
2448c2ecf20Sopenharmony_ci	u32 class;
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci	/* Add a channel wait for previous ops to complete */
2478c2ecf20Sopenharmony_ci	bool serialize;
2488c2ecf20Sopenharmony_ci};
2498c2ecf20Sopenharmony_ci
2508c2ecf20Sopenharmony_cistruct host1x_job *host1x_job_alloc(struct host1x_channel *ch,
2518c2ecf20Sopenharmony_ci				    u32 num_cmdbufs, u32 num_relocs);
2528c2ecf20Sopenharmony_civoid host1x_job_add_gather(struct host1x_job *job, struct host1x_bo *bo,
2538c2ecf20Sopenharmony_ci			   unsigned int words, unsigned int offset);
2548c2ecf20Sopenharmony_cistruct host1x_job *host1x_job_get(struct host1x_job *job);
2558c2ecf20Sopenharmony_civoid host1x_job_put(struct host1x_job *job);
2568c2ecf20Sopenharmony_ciint host1x_job_pin(struct host1x_job *job, struct device *dev);
2578c2ecf20Sopenharmony_civoid host1x_job_unpin(struct host1x_job *job);
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ci/*
2608c2ecf20Sopenharmony_ci * subdevice probe infrastructure
2618c2ecf20Sopenharmony_ci */
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_cistruct host1x_device;
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_ci/**
2668c2ecf20Sopenharmony_ci * struct host1x_driver - host1x logical device driver
2678c2ecf20Sopenharmony_ci * @driver: core driver
2688c2ecf20Sopenharmony_ci * @subdevs: table of OF device IDs matching subdevices for this driver
2698c2ecf20Sopenharmony_ci * @list: list node for the driver
2708c2ecf20Sopenharmony_ci * @probe: called when the host1x logical device is probed
2718c2ecf20Sopenharmony_ci * @remove: called when the host1x logical device is removed
2728c2ecf20Sopenharmony_ci * @shutdown: called when the host1x logical device is shut down
2738c2ecf20Sopenharmony_ci */
2748c2ecf20Sopenharmony_cistruct host1x_driver {
2758c2ecf20Sopenharmony_ci	struct device_driver driver;
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ci	const struct of_device_id *subdevs;
2788c2ecf20Sopenharmony_ci	struct list_head list;
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ci	int (*probe)(struct host1x_device *device);
2818c2ecf20Sopenharmony_ci	int (*remove)(struct host1x_device *device);
2828c2ecf20Sopenharmony_ci	void (*shutdown)(struct host1x_device *device);
2838c2ecf20Sopenharmony_ci};
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_cistatic inline struct host1x_driver *
2868c2ecf20Sopenharmony_cito_host1x_driver(struct device_driver *driver)
2878c2ecf20Sopenharmony_ci{
2888c2ecf20Sopenharmony_ci	return container_of(driver, struct host1x_driver, driver);
2898c2ecf20Sopenharmony_ci}
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_ciint host1x_driver_register_full(struct host1x_driver *driver,
2928c2ecf20Sopenharmony_ci				struct module *owner);
2938c2ecf20Sopenharmony_civoid host1x_driver_unregister(struct host1x_driver *driver);
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_ci#define host1x_driver_register(driver) \
2968c2ecf20Sopenharmony_ci	host1x_driver_register_full(driver, THIS_MODULE)
2978c2ecf20Sopenharmony_ci
2988c2ecf20Sopenharmony_cistruct host1x_device {
2998c2ecf20Sopenharmony_ci	struct host1x_driver *driver;
3008c2ecf20Sopenharmony_ci	struct list_head list;
3018c2ecf20Sopenharmony_ci	struct device dev;
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ci	struct mutex subdevs_lock;
3048c2ecf20Sopenharmony_ci	struct list_head subdevs;
3058c2ecf20Sopenharmony_ci	struct list_head active;
3068c2ecf20Sopenharmony_ci
3078c2ecf20Sopenharmony_ci	struct mutex clients_lock;
3088c2ecf20Sopenharmony_ci	struct list_head clients;
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_ci	bool registered;
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci	struct device_dma_parameters dma_parms;
3138c2ecf20Sopenharmony_ci};
3148c2ecf20Sopenharmony_ci
3158c2ecf20Sopenharmony_cistatic inline struct host1x_device *to_host1x_device(struct device *dev)
3168c2ecf20Sopenharmony_ci{
3178c2ecf20Sopenharmony_ci	return container_of(dev, struct host1x_device, dev);
3188c2ecf20Sopenharmony_ci}
3198c2ecf20Sopenharmony_ci
3208c2ecf20Sopenharmony_ciint host1x_device_init(struct host1x_device *device);
3218c2ecf20Sopenharmony_ciint host1x_device_exit(struct host1x_device *device);
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_civoid __host1x_client_init(struct host1x_client *client, struct lock_class_key *key);
3248c2ecf20Sopenharmony_civoid host1x_client_exit(struct host1x_client *client);
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci#define host1x_client_init(client)			\
3278c2ecf20Sopenharmony_ci	({						\
3288c2ecf20Sopenharmony_ci		static struct lock_class_key __key;	\
3298c2ecf20Sopenharmony_ci		__host1x_client_init(client, &__key);	\
3308c2ecf20Sopenharmony_ci	})
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_ciint __host1x_client_register(struct host1x_client *client);
3338c2ecf20Sopenharmony_ci
3348c2ecf20Sopenharmony_ci/*
3358c2ecf20Sopenharmony_ci * Note that this wrapper calls __host1x_client_init() for compatibility
3368c2ecf20Sopenharmony_ci * with existing callers. Callers that want to separately initialize and
3378c2ecf20Sopenharmony_ci * register a host1x client must first initialize using either of the
3388c2ecf20Sopenharmony_ci * __host1x_client_init() or host1x_client_init() functions and then use
3398c2ecf20Sopenharmony_ci * the low-level __host1x_client_register() function to avoid the client
3408c2ecf20Sopenharmony_ci * getting reinitialized.
3418c2ecf20Sopenharmony_ci */
3428c2ecf20Sopenharmony_ci#define host1x_client_register(client)			\
3438c2ecf20Sopenharmony_ci	({						\
3448c2ecf20Sopenharmony_ci		static struct lock_class_key __key;	\
3458c2ecf20Sopenharmony_ci		__host1x_client_init(client, &__key);	\
3468c2ecf20Sopenharmony_ci		__host1x_client_register(client);	\
3478c2ecf20Sopenharmony_ci	})
3488c2ecf20Sopenharmony_ci
3498c2ecf20Sopenharmony_ciint host1x_client_unregister(struct host1x_client *client);
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_ciint host1x_client_suspend(struct host1x_client *client);
3528c2ecf20Sopenharmony_ciint host1x_client_resume(struct host1x_client *client);
3538c2ecf20Sopenharmony_ci
3548c2ecf20Sopenharmony_cistruct tegra_mipi_device;
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_cistruct tegra_mipi_device *tegra_mipi_request(struct device *device,
3578c2ecf20Sopenharmony_ci					     struct device_node *np);
3588c2ecf20Sopenharmony_civoid tegra_mipi_free(struct tegra_mipi_device *device);
3598c2ecf20Sopenharmony_ciint tegra_mipi_enable(struct tegra_mipi_device *device);
3608c2ecf20Sopenharmony_ciint tegra_mipi_disable(struct tegra_mipi_device *device);
3618c2ecf20Sopenharmony_ciint tegra_mipi_start_calibration(struct tegra_mipi_device *device);
3628c2ecf20Sopenharmony_ciint tegra_mipi_finish_calibration(struct tegra_mipi_device *device);
3638c2ecf20Sopenharmony_ci
3648c2ecf20Sopenharmony_ci#endif
365