blob: d586c24a3d310d39d2cf154b0501cc7a1c81df12 [file] [log] [blame]
Chunming Zhoud03846a2015-07-28 14:20:03 -04001/*
2 * Copyright 2015 Advanced Micro Devices, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 *
23 */
24#ifndef _CGS_COMMON_H
25#define _CGS_COMMON_H
26
Jammy Zhoubf3911b02015-05-13 18:58:05 +080027
Chunming Zhoud03846a2015-07-28 14:20:03 -040028/**
29 * enum cgs_gpu_mem_type - GPU memory types
30 */
31enum cgs_gpu_mem_type {
32 CGS_GPU_MEM_TYPE__VISIBLE_FB,
33 CGS_GPU_MEM_TYPE__INVISIBLE_FB,
34 CGS_GPU_MEM_TYPE__VISIBLE_CONTIG_FB,
35 CGS_GPU_MEM_TYPE__INVISIBLE_CONTIG_FB,
36 CGS_GPU_MEM_TYPE__GART_CACHEABLE,
37 CGS_GPU_MEM_TYPE__GART_WRITECOMBINE
38};
39
40/**
41 * enum cgs_ind_reg - Indirect register spaces
42 */
43enum cgs_ind_reg {
44 CGS_IND_REG__MMIO,
45 CGS_IND_REG__PCIE,
46 CGS_IND_REG__SMC,
47 CGS_IND_REG__UVD_CTX,
48 CGS_IND_REG__DIDT,
49 CGS_IND_REG__AUDIO_ENDPT
50};
51
52/**
53 * enum cgs_clock - Clocks controlled by the SMU
54 */
55enum cgs_clock {
56 CGS_CLOCK__SCLK,
57 CGS_CLOCK__MCLK,
58 CGS_CLOCK__VCLK,
59 CGS_CLOCK__DCLK,
60 CGS_CLOCK__ECLK,
61 CGS_CLOCK__ACLK,
62 CGS_CLOCK__ICLK,
63 /* ... */
64};
65
66/**
67 * enum cgs_engine - Engines that can be statically power-gated
68 */
69enum cgs_engine {
70 CGS_ENGINE__UVD,
71 CGS_ENGINE__VCE,
72 CGS_ENGINE__VP8,
73 CGS_ENGINE__ACP_DMA,
74 CGS_ENGINE__ACP_DSP0,
75 CGS_ENGINE__ACP_DSP1,
76 CGS_ENGINE__ISP,
77 /* ... */
78};
79
80/**
81 * enum cgs_voltage_planes - Voltage planes for external camera HW
82 */
83enum cgs_voltage_planes {
84 CGS_VOLTAGE_PLANE__SENSOR0,
85 CGS_VOLTAGE_PLANE__SENSOR1,
86 /* ... */
87};
88
Jammy Zhoubf3911b02015-05-13 18:58:05 +080089/*
90 * enum cgs_ucode_id - Firmware types for different IPs
91 */
92enum cgs_ucode_id {
93 CGS_UCODE_ID_SMU = 0,
94 CGS_UCODE_ID_SDMA0,
95 CGS_UCODE_ID_SDMA1,
96 CGS_UCODE_ID_CP_CE,
97 CGS_UCODE_ID_CP_PFP,
98 CGS_UCODE_ID_CP_ME,
99 CGS_UCODE_ID_CP_MEC,
100 CGS_UCODE_ID_CP_MEC_JT1,
101 CGS_UCODE_ID_CP_MEC_JT2,
102 CGS_UCODE_ID_GMCON_RENG,
103 CGS_UCODE_ID_RLC_G,
104 CGS_UCODE_ID_MAXIMUM,
105};
106
Chunming Zhoud03846a2015-07-28 14:20:03 -0400107/**
108 * struct cgs_clock_limits - Clock limits
109 *
110 * Clocks are specified in 10KHz units.
111 */
112struct cgs_clock_limits {
113 unsigned min; /**< Minimum supported frequency */
114 unsigned max; /**< Maxumim supported frequency */
115 unsigned sustainable; /**< Thermally sustainable frequency */
116};
117
Jammy Zhoubf3911b02015-05-13 18:58:05 +0800118/**
119 * struct cgs_firmware_info - Firmware information
120 */
121struct cgs_firmware_info {
122 uint16_t version;
123 uint16_t feature_version;
124 uint32_t image_size;
125 uint64_t mc_addr;
126 void *kptr;
127};
128
Chunming Zhoud03846a2015-07-28 14:20:03 -0400129typedef unsigned long cgs_handle_t;
130
131/**
132 * cgs_gpu_mem_info() - Return information about memory heaps
133 * @cgs_device: opaque device handle
134 * @type: memory type
135 * @mc_start: Start MC address of the heap (output)
136 * @mc_size: MC address space size (output)
137 * @mem_size: maximum amount of memory available for allocation (output)
138 *
139 * This function returns information about memory heaps. The type
140 * parameter is used to select the memory heap. The mc_start and
141 * mc_size for GART heaps may be bigger than the memory available for
142 * allocation.
143 *
144 * mc_start and mc_size are undefined for non-contiguous FB memory
145 * types, since buffers allocated with these types may or may not be
146 * GART mapped.
147 *
148 * Return: 0 on success, -errno otherwise
149 */
150typedef int (*cgs_gpu_mem_info_t)(void *cgs_device, enum cgs_gpu_mem_type type,
151 uint64_t *mc_start, uint64_t *mc_size,
152 uint64_t *mem_size);
153
154/**
155 * cgs_gmap_kmem() - map kernel memory to GART aperture
156 * @cgs_device: opaque device handle
157 * @kmem: pointer to kernel memory
158 * @size: size to map
159 * @min_offset: minimum offset from start of GART aperture
160 * @max_offset: maximum offset from start of GART aperture
161 * @kmem_handle: kernel memory handle (output)
162 * @mcaddr: MC address (output)
163 *
164 * Return: 0 on success, -errno otherwise
165 */
166typedef int (*cgs_gmap_kmem_t)(void *cgs_device, void *kmem, uint64_t size,
167 uint64_t min_offset, uint64_t max_offset,
168 cgs_handle_t *kmem_handle, uint64_t *mcaddr);
169
170/**
171 * cgs_gunmap_kmem() - unmap kernel memory
172 * @cgs_device: opaque device handle
173 * @kmem_handle: kernel memory handle returned by gmap_kmem
174 *
175 * Return: 0 on success, -errno otherwise
176 */
177typedef int (*cgs_gunmap_kmem_t)(void *cgs_device, cgs_handle_t kmem_handle);
178
179/**
180 * cgs_alloc_gpu_mem() - Allocate GPU memory
181 * @cgs_device: opaque device handle
182 * @type: memory type
183 * @size: size in bytes
184 * @align: alignment in bytes
185 * @min_offset: minimum offset from start of heap
186 * @max_offset: maximum offset from start of heap
187 * @handle: memory handle (output)
188 *
189 * The memory types CGS_GPU_MEM_TYPE_*_CONTIG_FB force contiguous
190 * memory allocation. This guarantees that the MC address returned by
191 * cgs_gmap_gpu_mem is not mapped through the GART. The non-contiguous
192 * FB memory types may be GART mapped depending on memory
193 * fragmentation and memory allocator policies.
194 *
195 * If min/max_offset are non-0, the allocation will be forced to
196 * reside between these offsets in its respective memory heap. The
197 * base address that the offset relates to, depends on the memory
198 * type.
199 *
200 * - CGS_GPU_MEM_TYPE__*_CONTIG_FB: FB MC base address
201 * - CGS_GPU_MEM_TYPE__GART_*: GART aperture base address
202 * - others: undefined, don't use with max_offset
203 *
204 * Return: 0 on success, -errno otherwise
205 */
206typedef int (*cgs_alloc_gpu_mem_t)(void *cgs_device, enum cgs_gpu_mem_type type,
207 uint64_t size, uint64_t align,
208 uint64_t min_offset, uint64_t max_offset,
209 cgs_handle_t *handle);
210
211/**
212 * cgs_free_gpu_mem() - Free GPU memory
213 * @cgs_device: opaque device handle
214 * @handle: memory handle returned by alloc or import
215 *
216 * Return: 0 on success, -errno otherwise
217 */
218typedef int (*cgs_free_gpu_mem_t)(void *cgs_device, cgs_handle_t handle);
219
220/**
221 * cgs_gmap_gpu_mem() - GPU-map GPU memory
222 * @cgs_device: opaque device handle
223 * @handle: memory handle returned by alloc or import
224 * @mcaddr: MC address (output)
225 *
226 * Ensures that a buffer is GPU accessible and returns its MC address.
227 *
228 * Return: 0 on success, -errno otherwise
229 */
230typedef int (*cgs_gmap_gpu_mem_t)(void *cgs_device, cgs_handle_t handle,
231 uint64_t *mcaddr);
232
233/**
234 * cgs_gunmap_gpu_mem() - GPU-unmap GPU memory
235 * @cgs_device: opaque device handle
236 * @handle: memory handle returned by alloc or import
237 *
238 * Allows the buffer to be migrated while it's not used by the GPU.
239 *
240 * Return: 0 on success, -errno otherwise
241 */
242typedef int (*cgs_gunmap_gpu_mem_t)(void *cgs_device, cgs_handle_t handle);
243
244/**
245 * cgs_kmap_gpu_mem() - Kernel-map GPU memory
246 *
247 * @cgs_device: opaque device handle
248 * @handle: memory handle returned by alloc or import
249 * @map: Kernel virtual address the memory was mapped to (output)
250 *
251 * Return: 0 on success, -errno otherwise
252 */
253typedef int (*cgs_kmap_gpu_mem_t)(void *cgs_device, cgs_handle_t handle,
254 void **map);
255
256/**
257 * cgs_kunmap_gpu_mem() - Kernel-unmap GPU memory
258 * @cgs_device: opaque device handle
259 * @handle: memory handle returned by alloc or import
260 *
261 * Return: 0 on success, -errno otherwise
262 */
263typedef int (*cgs_kunmap_gpu_mem_t)(void *cgs_device, cgs_handle_t handle);
264
265/**
266 * cgs_read_register() - Read an MMIO register
267 * @cgs_device: opaque device handle
268 * @offset: register offset
269 *
270 * Return: register value
271 */
272typedef uint32_t (*cgs_read_register_t)(void *cgs_device, unsigned offset);
273
274/**
275 * cgs_write_register() - Write an MMIO register
276 * @cgs_device: opaque device handle
277 * @offset: register offset
278 * @value: register value
279 */
280typedef void (*cgs_write_register_t)(void *cgs_device, unsigned offset,
281 uint32_t value);
282
283/**
284 * cgs_read_ind_register() - Read an indirect register
285 * @cgs_device: opaque device handle
286 * @offset: register offset
287 *
288 * Return: register value
289 */
290typedef uint32_t (*cgs_read_ind_register_t)(void *cgs_device, enum cgs_ind_reg space,
291 unsigned index);
292
293/**
294 * cgs_write_ind_register() - Write an indirect register
295 * @cgs_device: opaque device handle
296 * @offset: register offset
297 * @value: register value
298 */
299typedef void (*cgs_write_ind_register_t)(void *cgs_device, enum cgs_ind_reg space,
300 unsigned index, uint32_t value);
301
302/**
303 * cgs_read_pci_config_byte() - Read byte from PCI configuration space
304 * @cgs_device: opaque device handle
305 * @addr: address
306 *
307 * Return: Value read
308 */
309typedef uint8_t (*cgs_read_pci_config_byte_t)(void *cgs_device, unsigned addr);
310
311/**
312 * cgs_read_pci_config_word() - Read word from PCI configuration space
313 * @cgs_device: opaque device handle
314 * @addr: address, must be word-aligned
315 *
316 * Return: Value read
317 */
318typedef uint16_t (*cgs_read_pci_config_word_t)(void *cgs_device, unsigned addr);
319
320/**
321 * cgs_read_pci_config_dword() - Read dword from PCI configuration space
322 * @cgs_device: opaque device handle
323 * @addr: address, must be dword-aligned
324 *
325 * Return: Value read
326 */
327typedef uint32_t (*cgs_read_pci_config_dword_t)(void *cgs_device,
328 unsigned addr);
329
330/**
331 * cgs_write_pci_config_byte() - Write byte to PCI configuration space
332 * @cgs_device: opaque device handle
333 * @addr: address
334 * @value: value to write
335 */
336typedef void (*cgs_write_pci_config_byte_t)(void *cgs_device, unsigned addr,
337 uint8_t value);
338
339/**
340 * cgs_write_pci_config_word() - Write byte to PCI configuration space
341 * @cgs_device: opaque device handle
342 * @addr: address, must be word-aligned
343 * @value: value to write
344 */
345typedef void (*cgs_write_pci_config_word_t)(void *cgs_device, unsigned addr,
346 uint16_t value);
347
348/**
349 * cgs_write_pci_config_dword() - Write byte to PCI configuration space
350 * @cgs_device: opaque device handle
351 * @addr: address, must be dword-aligned
352 * @value: value to write
353 */
354typedef void (*cgs_write_pci_config_dword_t)(void *cgs_device, unsigned addr,
355 uint32_t value);
356
357/**
358 * cgs_atom_get_data_table() - Get a pointer to an ATOM BIOS data table
359 * @cgs_device: opaque device handle
360 * @table: data table index
361 * @size: size of the table (output, may be NULL)
362 * @frev: table format revision (output, may be NULL)
363 * @crev: table content revision (output, may be NULL)
364 *
365 * Return: Pointer to start of the table, or NULL on failure
366 */
367typedef const void *(*cgs_atom_get_data_table_t)(
368 void *cgs_device, unsigned table,
369 uint16_t *size, uint8_t *frev, uint8_t *crev);
370
371/**
372 * cgs_atom_get_cmd_table_revs() - Get ATOM BIOS command table revisions
373 * @cgs_device: opaque device handle
374 * @table: data table index
375 * @frev: table format revision (output, may be NULL)
376 * @crev: table content revision (output, may be NULL)
377 *
378 * Return: 0 on success, -errno otherwise
379 */
380typedef int (*cgs_atom_get_cmd_table_revs_t)(void *cgs_device, unsigned table,
381 uint8_t *frev, uint8_t *crev);
382
383/**
384 * cgs_atom_exec_cmd_table() - Execute an ATOM BIOS command table
385 * @cgs_device: opaque device handle
386 * @table: command table index
387 * @args: arguments
388 *
389 * Return: 0 on success, -errno otherwise
390 */
391typedef int (*cgs_atom_exec_cmd_table_t)(void *cgs_device,
392 unsigned table, void *args);
393
394/**
395 * cgs_create_pm_request() - Create a power management request
396 * @cgs_device: opaque device handle
397 * @request: handle of created PM request (output)
398 *
399 * Return: 0 on success, -errno otherwise
400 */
401typedef int (*cgs_create_pm_request_t)(void *cgs_device, cgs_handle_t *request);
402
403/**
404 * cgs_destroy_pm_request() - Destroy a power management request
405 * @cgs_device: opaque device handle
406 * @request: handle of created PM request
407 *
408 * Return: 0 on success, -errno otherwise
409 */
410typedef int (*cgs_destroy_pm_request_t)(void *cgs_device, cgs_handle_t request);
411
412/**
413 * cgs_set_pm_request() - Activate or deactiveate a PM request
414 * @cgs_device: opaque device handle
415 * @request: PM request handle
416 * @active: 0 = deactivate, non-0 = activate
417 *
418 * While a PM request is active, its minimum clock requests are taken
419 * into account as the requested engines are powered up. When the
420 * request is inactive, the engines may be powered down and clocks may
421 * be lower, depending on other PM requests by other driver
422 * components.
423 *
424 * Return: 0 on success, -errno otherwise
425 */
426typedef int (*cgs_set_pm_request_t)(void *cgs_device, cgs_handle_t request,
427 int active);
428
429/**
430 * cgs_pm_request_clock() - Request a minimum frequency for a specific clock
431 * @cgs_device: opaque device handle
432 * @request: PM request handle
433 * @clock: which clock?
434 * @freq: requested min. frequency in 10KHz units (0 to clear request)
435 *
436 * Return: 0 on success, -errno otherwise
437 */
438typedef int (*cgs_pm_request_clock_t)(void *cgs_device, cgs_handle_t request,
439 enum cgs_clock clock, unsigned freq);
440
441/**
442 * cgs_pm_request_engine() - Request an engine to be powered up
443 * @cgs_device: opaque device handle
444 * @request: PM request handle
445 * @engine: which engine?
446 * @powered: 0 = powered down, non-0 = powered up
447 *
448 * Return: 0 on success, -errno otherwise
449 */
450typedef int (*cgs_pm_request_engine_t)(void *cgs_device, cgs_handle_t request,
451 enum cgs_engine engine, int powered);
452
453/**
454 * cgs_pm_query_clock_limits() - Query clock frequency limits
455 * @cgs_device: opaque device handle
456 * @clock: which clock?
457 * @limits: clock limits
458 *
459 * Return: 0 on success, -errno otherwise
460 */
461typedef int (*cgs_pm_query_clock_limits_t)(void *cgs_device,
462 enum cgs_clock clock,
463 struct cgs_clock_limits *limits);
464
465/**
466 * cgs_set_camera_voltages() - Apply specific voltages to PMIC voltage planes
467 * @cgs_device: opaque device handle
468 * @mask: bitmask of voltages to change (1<<CGS_VOLTAGE_PLANE__xyz|...)
469 * @voltages: pointer to array of voltage values in 1mV units
470 *
471 * Return: 0 on success, -errno otherwise
472 */
473typedef int (*cgs_set_camera_voltages_t)(void *cgs_device, uint32_t mask,
474 const uint32_t *voltages);
Jammy Zhoubf3911b02015-05-13 18:58:05 +0800475/**
476 * cgs_get_firmware_info - Get the firmware information from core driver
477 * @cgs_device: opaque device handle
478 * @type: the firmware type
479 * @info: returend firmware information
480 *
481 * Return: 0 on success, -errno otherwise
482 */
483typedef int (*cgs_get_firmware_info)(void *cgs_device,
484 enum cgs_ucode_id type,
485 struct cgs_firmware_info *info);
486
Chunming Zhoud03846a2015-07-28 14:20:03 -0400487
488struct cgs_ops {
489 /* memory management calls (similar to KFD interface) */
490 cgs_gpu_mem_info_t gpu_mem_info;
491 cgs_gmap_kmem_t gmap_kmem;
492 cgs_gunmap_kmem_t gunmap_kmem;
493 cgs_alloc_gpu_mem_t alloc_gpu_mem;
494 cgs_free_gpu_mem_t free_gpu_mem;
495 cgs_gmap_gpu_mem_t gmap_gpu_mem;
496 cgs_gunmap_gpu_mem_t gunmap_gpu_mem;
497 cgs_kmap_gpu_mem_t kmap_gpu_mem;
498 cgs_kunmap_gpu_mem_t kunmap_gpu_mem;
499 /* MMIO access */
500 cgs_read_register_t read_register;
501 cgs_write_register_t write_register;
502 cgs_read_ind_register_t read_ind_register;
503 cgs_write_ind_register_t write_ind_register;
504 /* PCI configuration space access */
505 cgs_read_pci_config_byte_t read_pci_config_byte;
506 cgs_read_pci_config_word_t read_pci_config_word;
507 cgs_read_pci_config_dword_t read_pci_config_dword;
508 cgs_write_pci_config_byte_t write_pci_config_byte;
509 cgs_write_pci_config_word_t write_pci_config_word;
510 cgs_write_pci_config_dword_t write_pci_config_dword;
511 /* ATOM BIOS */
512 cgs_atom_get_data_table_t atom_get_data_table;
513 cgs_atom_get_cmd_table_revs_t atom_get_cmd_table_revs;
514 cgs_atom_exec_cmd_table_t atom_exec_cmd_table;
515 /* Power management */
516 cgs_create_pm_request_t create_pm_request;
517 cgs_destroy_pm_request_t destroy_pm_request;
518 cgs_set_pm_request_t set_pm_request;
519 cgs_pm_request_clock_t pm_request_clock;
520 cgs_pm_request_engine_t pm_request_engine;
521 cgs_pm_query_clock_limits_t pm_query_clock_limits;
522 cgs_set_camera_voltages_t set_camera_voltages;
Jammy Zhoubf3911b02015-05-13 18:58:05 +0800523 /* Firmware Info */
524 cgs_get_firmware_info get_firmware_info;
Chunming Zhoud03846a2015-07-28 14:20:03 -0400525 /* ACPI (TODO) */
526};
527
528struct cgs_os_ops; /* To be define in OS-specific CGS header */
529
530struct cgs_device
531{
532 const struct cgs_ops *ops;
533 const struct cgs_os_ops *os_ops;
534 /* to be embedded at the start of driver private structure */
535};
536
537/* Convenience macros that make CGS indirect function calls look like
538 * normal function calls */
539#define CGS_CALL(func,dev,...) \
540 (((struct cgs_device *)dev)->ops->func(dev, ##__VA_ARGS__))
541#define CGS_OS_CALL(func,dev,...) \
542 (((struct cgs_device *)dev)->os_ops->func(dev, ##__VA_ARGS__))
543
544#define cgs_gpu_mem_info(dev,type,mc_start,mc_size,mem_size) \
545 CGS_CALL(gpu_mem_info,dev,type,mc_start,mc_size,mem_size)
546#define cgs_gmap_kmem(dev,kmem,size,min_off,max_off,kmem_handle,mcaddr) \
547 CGS_CALL(gmap_kmem,dev,kmem,size,min_off,max_off,kmem_handle,mcaddr)
548#define cgs_gummap_kmem(dev,kmem_handle) \
549 CGS_CALL(gunmap_kmem,dev,keme_handle)
550#define cgs_alloc_gpu_mem(dev,type,size,align,min_off,max_off,handle) \
551 CGS_CALL(alloc_gpu_mem,dev,type,size,align,min_off,max_off,handle)
552#define cgs_free_gpu_mem(dev,handle) \
553 CGS_CALL(free_gpu_mem,dev,handle)
554#define cgs_gmap_gpu_mem(dev,handle,mcaddr) \
555 CGS_CALL(gmap_gpu_mem,dev,handle,mcaddr)
556#define cgs_gummap_gpu_mem(dev,handle) \
557 CGS_CALL(gunmap_gpu_mem,dev,handle)
558#define cgs_kmap_gpu_mem(dev,handle,map) \
559 CGS_CALL(kmap_gpu_mem,dev,handle,map)
560#define cgs_kunmap_gpu_mem(dev,handle) \
561 CGS_CALL(kunmap_gpu_mem,dev,handle)
562
563#define cgs_read_register(dev,offset) \
564 CGS_CALL(read_register,dev,offset)
565#define cgs_write_register(dev,offset,value) \
566 CGS_CALL(write_register,dev,offset,value)
567#define cgs_read_ind_register(dev,space,index) \
568 CGS_CALL(read_ind_register,dev,space,index)
569#define cgs_write_ind_register(dev,space,index,value) \
570 CGS_CALL(write_ind_register,dev,space,index,value)
571
572#define cgs_read_pci_config_byte(dev,addr) \
573 CGS_CALL(read_pci_config_byte,dev,addr)
574#define cgs_read_pci_config_word(dev,addr) \
575 CGS_CALL(read_pci_config_word,dev,addr)
576#define cgs_read_pci_config_dword(dev,addr) \
577 CGS_CALL(read_pci_config_dword,dev,addr)
578#define cgs_write_pci_config_byte(dev,addr,value) \
579 CGS_CALL(write_pci_config_byte,dev,addr,value)
580#define cgs_write_pci_config_word(dev,addr,value) \
581 CGS_CALL(write_pci_config_word,dev,addr,value)
582#define cgs_write_pci_config_dword(dev,addr,value) \
583 CGS_CALL(write_pci_config_dword,dev,addr,value)
584
585#define cgs_atom_get_data_table(dev,table,size,frev,crev) \
586 CGS_CALL(atom_get_data_table,dev,table,size,frev,crev)
587#define cgs_atom_get_cmd_table_revs(dev,table,frev,crev) \
588 CGS_CALL(atom_get_cmd_table_revs,dev,table,frev,crev)
589#define cgs_atom_exec_cmd_table(dev,table,args) \
590 CGS_CALL(atom_exec_cmd_table,dev,table,args)
591
592#define cgs_create_pm_request(dev,request) \
593 CGS_CALL(create_pm_request,dev,request)
594#define cgs_destroy_pm_request(dev,request) \
595 CGS_CALL(destroy_pm_request,dev,request)
596#define cgs_set_pm_request(dev,request,active) \
597 CGS_CALL(set_pm_request,dev,request,active)
598#define cgs_pm_request_clock(dev,request,clock,freq) \
599 CGS_CALL(pm_request_clock,dev,request,clock,freq)
600#define cgs_pm_request_engine(dev,request,engine,powered) \
601 CGS_CALL(pm_request_engine,dev,request,engine,powered)
602#define cgs_pm_query_clock_limits(dev,clock,limits) \
603 CGS_CALL(pm_query_clock_limits,dev,clock,limits)
604#define cgs_set_camera_voltages(dev,mask,voltages) \
605 CGS_CALL(set_camera_voltages,dev,mask,voltages)
Jammy Zhoubf3911b02015-05-13 18:58:05 +0800606#define cgs_get_firmware_info(dev, type, info) \
607 CGS_CALL(get_firmware_info, dev, type, info)
Chunming Zhoud03846a2015-07-28 14:20:03 -0400608
609#endif /* _CGS_COMMON_H */