]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/staging/sm750fb/ddk750_chip.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef DDK750_CHIP_H__
3 #define DDK750_CHIP_H__
4 #define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
5 #ifndef SM750LE_REVISION_ID
6 #define SM750LE_REVISION_ID ((unsigned char)0xfe)
10 #include <linux/ioport.h>
11 #include <linux/uaccess.h>
13 extern void __iomem
*mmio750
;
15 /* software control endianness */
16 static inline u32
peek32(u32 addr
)
18 return readl(addr
+ mmio750
);
21 static inline void poke32(u32 data
, u32 addr
)
23 writel(data
, addr
+ mmio750
);
26 /* This is all the chips recognized by this library */
27 typedef enum _logical_chip_type_t
{
35 typedef enum _clock_type_t
{
45 clock_type_t clockType
;
46 unsigned long inputFreq
; /* Input clock frequency to the PLL */
48 /* Use this when clockType = PANEL_PLL */
55 /* input struct to initChipParam() function */
56 struct initchip_param
{
57 /* Use power mode 0 or 1 */
58 unsigned short powerMode
;
61 * Speed of main chip clock in MHz unit
62 * 0 = keep the current clock setting
63 * Others = the new main chip clock
65 unsigned short chipClock
;
68 * Speed of memory clock in MHz unit
69 * 0 = keep the current clock setting
70 * Others = the new memory clock
72 unsigned short memClock
;
75 * Speed of master clock in MHz unit
76 * 0 = keep the current clock setting
77 * Others = the new master clock
79 unsigned short masterClock
;
82 * 0 = leave all engine state untouched.
83 * 1 = make sure they are off: 2D, Overlay,
84 * video alpha, alpha, hardware cursors
86 unsigned short setAllEngOff
;
89 * 0 = Do not reset the memory controller
90 * 1 = Reset the memory controller
92 unsigned char resetMemory
;
94 /* More initialization parameter can be added if needed */
97 logical_chip_type_t
sm750_get_chip_type(void);
98 void sm750_set_chip_type(unsigned short devId
, u8 revId
);
99 unsigned int sm750_calc_pll_value(unsigned int request
, struct pll_value
*pll
);
100 unsigned int sm750_format_pll_reg(struct pll_value
*pPLL
);
101 unsigned int ddk750_get_vm_size(void);
102 int ddk750_init_hw(struct initchip_param
*pinit_param
);