linux/drivers/video/fbdev/pxa168fb.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PXA168FB_H__
#define __PXA168FB_H__

/* ------------< LCD register >------------ */
/* Video Frame 0&1 start address registers */
#define LCD_SPU_DMA_START_ADDR_Y0
#define LCD_SPU_DMA_START_ADDR_U0
#define LCD_SPU_DMA_START_ADDR_V0
#define LCD_CFG_DMA_START_ADDR_0
#define LCD_SPU_DMA_START_ADDR_Y1
#define LCD_SPU_DMA_START_ADDR_U1
#define LCD_SPU_DMA_START_ADDR_V1
#define LCD_CFG_DMA_START_ADDR_1

/* YC & UV Pitch */
#define LCD_SPU_DMA_PITCH_YC
#define SPU_DMA_PITCH_C(c)
#define SPU_DMA_PITCH_Y(y)
#define LCD_SPU_DMA_PITCH_UV
#define SPU_DMA_PITCH_V(v)
#define SPU_DMA_PITCH_U(u)

/* Video Starting Point on Screen Register */
#define LCD_SPUT_DMA_OVSA_HPXL_VLN
#define CFG_DMA_OVSA_VLN(y)
#define CFG_DMA_OVSA_HPXL(x)

/* Video Size Register */
#define LCD_SPU_DMA_HPXL_VLN
#define CFG_DMA_VLN(y)
#define CFG_DMA_HPXL(x)

/* Video Size After zooming Register */
#define LCD_SPU_DZM_HPXL_VLN
#define CFG_DZM_VLN(y)
#define CFG_DZM_HPXL(x)

/* Graphic Frame 0&1 Starting Address Register */
#define LCD_CFG_GRA_START_ADDR0
#define LCD_CFG_GRA_START_ADDR1

/* Graphic Frame Pitch */
#define LCD_CFG_GRA_PITCH

/* Graphic Starting Point on Screen Register */
#define LCD_SPU_GRA_OVSA_HPXL_VLN
#define CFG_GRA_OVSA_VLN(y)
#define CFG_GRA_OVSA_HPXL(x)

/* Graphic Size Register */
#define LCD_SPU_GRA_HPXL_VLN
#define CFG_GRA_VLN(y)
#define CFG_GRA_HPXL(x)

/* Graphic Size after Zooming Register */
#define LCD_SPU_GZM_HPXL_VLN
#define CFG_GZM_VLN(y)
#define CFG_GZM_HPXL(x)

/* HW Cursor Starting Point on Screen Register */
#define LCD_SPU_HWC_OVSA_HPXL_VLN
#define CFG_HWC_OVSA_VLN(y)
#define CFG_HWC_OVSA_HPXL(x)

/* HW Cursor Size */
#define LCD_SPU_HWC_HPXL_VLN
#define CFG_HWC_VLN(y)
#define CFG_HWC_HPXL(x)

/* Total Screen Size Register */
#define LCD_SPUT_V_H_TOTAL
#define CFG_V_TOTAL(y)
#define CFG_H_TOTAL(x)

/* Total Screen Active Size Register */
#define LCD_SPU_V_H_ACTIVE
#define CFG_V_ACTIVE(y)
#define CFG_H_ACTIVE(x)

/* Screen H&V Porch Register */
#define LCD_SPU_H_PORCH
#define CFG_H_BACK_PORCH(b)
#define CFG_H_FRONT_PORCH(f)
#define LCD_SPU_V_PORCH
#define CFG_V_BACK_PORCH(b)
#define CFG_V_FRONT_PORCH(f)

/* Screen Blank Color Register */
#define LCD_SPU_BLANKCOLOR
#define CFG_BLANKCOLOR_MASK
#define CFG_BLANKCOLOR_R_MASK
#define CFG_BLANKCOLOR_G_MASK
#define CFG_BLANKCOLOR_B_MASK

/* HW Cursor Color 1&2 Register */
#define LCD_SPU_ALPHA_COLOR1
#define CFG_HWC_COLOR1
#define CFG_HWC_COLOR1_R(red)
#define CFG_HWC_COLOR1_G(green)
#define CFG_HWC_COLOR1_B(blue)
#define CFG_HWC_COLOR1_R_MASK
#define CFG_HWC_COLOR1_G_MASK
#define CFG_HWC_COLOR1_B_MASK
#define LCD_SPU_ALPHA_COLOR2
#define CFG_HWC_COLOR2
#define CFG_HWC_COLOR2_R_MASK
#define CFG_HWC_COLOR2_G_MASK
#define CFG_HWC_COLOR2_B_MASK

/* Video YUV Color Key Control */
#define LCD_SPU_COLORKEY_Y
#define CFG_CKEY_Y2(y2)
#define CFG_CKEY_Y2_MASK
#define CFG_CKEY_Y1(y1)
#define CFG_CKEY_Y1_MASK
#define CFG_CKEY_Y(y)
#define CFG_CKEY_Y_MASK
#define CFG_ALPHA_Y(y)
#define CFG_ALPHA_Y_MASK
#define LCD_SPU_COLORKEY_U
#define CFG_CKEY_U2(u2)
#define CFG_CKEY_U2_MASK
#define CFG_CKEY_U1(u1)
#define CFG_CKEY_U1_MASK
#define CFG_CKEY_U(u)
#define CFG_CKEY_U_MASK
#define CFG_ALPHA_U(u)
#define CFG_ALPHA_U_MASK
#define LCD_SPU_COLORKEY_V
#define CFG_CKEY_V2(v2)
#define CFG_CKEY_V2_MASK
#define CFG_CKEY_V1(v1)
#define CFG_CKEY_V1_MASK
#define CFG_CKEY_V(v)
#define CFG_CKEY_V_MASK
#define CFG_ALPHA_V(v)
#define CFG_ALPHA_V_MASK

/* SPI Read Data Register */
#define LCD_SPU_SPI_RXDATA

/* Smart Panel Read Data Register */
#define LCD_SPU_ISA_RSDATA
#define ISA_RXDATA_16BIT_1_DATA_MASK
#define ISA_RXDATA_16BIT_2_DATA_MASK
#define ISA_RXDATA_16BIT_3_DATA_MASK
#define ISA_RXDATA_16BIT_4_DATA_MASK
#define ISA_RXDATA_32BIT_1_DATA_MASK

/* HWC SRAM Read Data Register */
#define LCD_SPU_HWC_RDDAT

/* Gamma Table SRAM Read Data Register */
#define LCD_SPU_GAMMA_RDDAT
#define CFG_GAMMA_RDDAT_MASK

/* Palette Table SRAM Read Data Register */
#define LCD_SPU_PALETTE_RDDAT
#define CFG_PALETTE_RDDAT_MASK

/* I/O Pads Input Read Only Register */
#define LCD_SPU_IOPAD_IN
#define CFG_IOPAD_IN_MASK

/* Reserved Read Only Registers */
#define LCD_CFG_RDREG5F
#define IRE_FRAME_CNT_MASK
#define IPE_FRAME_CNT_MASK
#define GRA_FRAME_CNT_MASK
#define DMA_FRAME_CNT_MASK

/* SPI Control Register. */
#define LCD_SPU_SPI_CTRL
#define CFG_SCLKCNT(div)
#define CFG_SCLKCNT_MASK
#define CFG_RXBITS(rx)
#define CFG_RXBITS_MASK
#define CFG_TXBITS(tx)
#define CFG_TXBITS_MASK
#define CFG_CLKINV(clk)
#define CFG_CLKINV_MASK
#define CFG_KEEPXFER(transfer)
#define CFG_KEEPXFER_MASK
#define CFG_RXBITSTO0(rx)
#define CFG_RXBITSTO0_MASK
#define CFG_TXBITSTO0(tx)
#define CFG_TXBITSTO0_MASK
#define CFG_SPI_ENA(spi)
#define CFG_SPI_ENA_MASK
#define CFG_SPI_SEL(spi)
#define CFG_SPI_SEL_MASK
#define CFG_SPI_3W4WB(wire)
#define CFG_SPI_3W4WB_MASK
#define CFG_SPI_START(start)
#define CFG_SPI_START_MASK

/* SPI Tx Data Register */
#define LCD_SPU_SPI_TXDATA

/*
   1. Smart Pannel 8-bit Bus Control Register.
   2. AHB Slave Path Data Port Register
*/
#define LCD_SPU_SMPN_CTRL

/* DMA Control 0 Register */
#define LCD_SPU_DMA_CTRL0
#define CFG_NOBLENDING(nb)
#define CFG_NOBLENDING_MASK
#define CFG_GAMMA_ENA(gn)
#define CFG_GAMMA_ENA_MASK
#define CFG_CBSH_ENA(cn)
#define CFG_CBSH_ENA_MASK
#define CFG_PALETTE_ENA(pn)
#define CFG_PALETTE_ENA_MASK
#define CFG_ARBFAST_ENA(an)
#define CFG_ARBFAST_ENA_MASK
#define CFG_HWC_1BITMOD(mode)
#define CFG_HWC_1BITMOD_MASK
#define CFG_HWC_1BITENA(mn)
#define CFG_HWC_1BITENA_MASK
#define CFG_HWC_ENA(cn)
#define CFG_HWC_ENA_MASK
#define CFG_DMAFORMAT(dmaformat)
#define CFG_DMAFORMAT_MASK
#define CFG_GRAFORMAT(graformat)
#define CFG_GRAFORMAT_MASK
/* for graphic part */
#define CFG_GRA_FTOGGLE(toggle)
#define CFG_GRA_FTOGGLE_MASK
#define CFG_GRA_HSMOOTH(smooth)
#define CFG_GRA_HSMOOTH_MASK
#define CFG_GRA_TSTMODE(test)
#define CFG_GRA_TSTMODE_MASK
#define CFG_GRA_SWAPRB(swap)
#define CFG_GRA_SWAPRB_MASK
#define CFG_GRA_SWAPUV(swap)
#define CFG_GRA_SWAPUV_MASK
#define CFG_GRA_SWAPYU(swap)
#define CFG_GRA_SWAPYU_MASK
#define CFG_YUV2RGB_GRA(cvrt)
#define CFG_YUV2RGB_GRA_MASK
#define CFG_GRA_ENA(gra)
#define CFG_GRA_ENA_MASK
/* for video part */
#define CFG_DMA_FTOGGLE(toggle)
#define CFG_DMA_FTOGGLE_MASK
#define CFG_DMA_HSMOOTH(smooth)
#define CFG_DMA_HSMOOTH_MASK
#define CFG_DMA_TSTMODE(test)
#define CFG_DMA_TSTMODE_MASK
#define CFG_DMA_SWAPRB(swap)
#define CFG_DMA_SWAPRB_MASK
#define CFG_DMA_SWAPUV(swap)
#define CFG_DMA_SWAPUV_MASK
#define CFG_DMA_SWAPYU(swap)
#define CFG_DMA_SWAPYU_MASK
#define CFG_DMA_SWAP_MASK
#define CFG_YUV2RGB_DMA(cvrt)
#define CFG_YUV2RGB_DMA_MASK
#define CFG_DMA_ENA(video)
#define CFG_DMA_ENA_MASK

/* DMA Control 1 Register */
#define LCD_SPU_DMA_CTRL1
#define CFG_FRAME_TRIG(trig)
#define CFG_FRAME_TRIG_MASK
#define CFG_VSYNC_TRIG(trig)
#define CFG_VSYNC_TRIG_MASK
#define CFG_VSYNC_INV(inv)
#define CFG_VSYNC_INV_MASK
#define CFG_COLOR_KEY_MODE(cmode)
#define CFG_COLOR_KEY_MASK
#define CFG_CARRY(carry)
#define CFG_CARRY_MASK
#define CFG_LNBUF_ENA(lnbuf)
#define CFG_LNBUF_ENA_MASK
#define CFG_GATED_ENA(gated)
#define CFG_GATED_ENA_MASK
#define CFG_PWRDN_ENA(power)
#define CFG_PWRDN_ENA_MASK
#define CFG_DSCALE(dscale)
#define CFG_DSCALE_MASK
#define CFG_ALPHA_MODE(amode)
#define CFG_ALPHA_MODE_MASK
#define CFG_ALPHA(alpha)
#define CFG_ALPHA_MASK
#define CFG_PXLCMD(pxlcmd)
#define CFG_PXLCMD_MASK

/* SRAM Control Register */
#define LCD_SPU_SRAM_CTRL
#define CFG_SRAM_INIT_WR_RD(mode)
#define CFG_SRAM_INIT_WR_RD_MASK
#define CFG_SRAM_ADDR_LCDID(id)
#define CFG_SRAM_ADDR_LCDID_MASK
#define CFG_SRAM_ADDR(addr)
#define CFG_SRAM_ADDR_MASK

/* SRAM Write Data Register */
#define LCD_SPU_SRAM_WRDAT

/* SRAM RTC/WTC Control Register */
#define LCD_SPU_SRAM_PARA0

/* SRAM Power Down Control Register */
#define LCD_SPU_SRAM_PARA1
#define CFG_CSB_256x32(hwc)
#define CFG_CSB_256x32_MASK
#define CFG_CSB_256x24(palette)
#define CFG_CSB_256x24_MASK
#define CFG_CSB_256x8(gamma)
#define CFG_CSB_256x8_MASK
#define CFG_PDWN256x32(pdwn)
#define CFG_PDWN256x32_MASK
#define CFG_PDWN256x24(pdwn)
#define CFG_PDWN256x24_MASK
#define CFG_PDWN256x8(pdwn)
#define CFG_PDWN256x8_MASK
#define CFG_PDWN32x32(pdwn)
#define CFG_PDWN32x32_MASK
#define CFG_PDWN16x66(pdwn)
#define CFG_PDWN16x66_MASK
#define CFG_PDWN32x66(pdwn)
#define CFG_PDWN32x66_MASK
#define CFG_PDWN64x66(pdwn)
#define CFG_PDWN64x66_MASK

/* Smart or Dumb Panel Clock Divider */
#define LCD_CFG_SCLK_DIV
#define SCLK_SOURCE_SELECT(src)
#define SCLK_SOURCE_SELECT_MASK
#define CLK_FRACDIV(frac)
#define CLK_FRACDIV_MASK
#define CLK_INT_DIV(div)
#define CLK_INT_DIV_MASK

/* Video Contrast Register */
#define LCD_SPU_CONTRAST
#define CFG_BRIGHTNESS(bright)
#define CFG_BRIGHTNESS_MASK
#define CFG_CONTRAST(contrast)
#define CFG_CONTRAST_MASK

/* Video Saturation Register */
#define LCD_SPU_SATURATION
#define CFG_C_MULTS(mult)
#define CFG_C_MULTS_MASK
#define CFG_SATURATION(sat)
#define CFG_SATURATION_MASK

/* Video Hue Adjust Register */
#define LCD_SPU_CBSH_HUE
#define CFG_SIN0(sin0)
#define CFG_SIN0_MASK
#define CFG_COS0(con0)
#define CFG_COS0_MASK

/* Dump LCD Panel Control Register */
#define LCD_SPU_DUMB_CTRL
#define CFG_DUMBMODE(mode)
#define CFG_DUMBMODE_MASK
#define CFG_LCDGPIO_O(data)
#define CFG_LCDGPIO_O_MASK
#define CFG_LCDGPIO_ENA(gpio)
#define CFG_LCDGPIO_ENA_MASK
#define CFG_BIAS_OUT(bias)
#define CFG_BIAS_OUT_MASK
#define CFG_REVERSE_RGB(rRGB)
#define CFG_REVERSE_RGB_MASK
#define CFG_INV_COMPBLANK(blank)
#define CFG_INV_COMPBLANK_MASK
#define CFG_INV_COMPSYNC(sync)
#define CFG_INV_COMPSYNC_MASK
#define CFG_INV_HENA(hena)
#define CFG_INV_HENA_MASK
#define CFG_INV_VSYNC(vsync)
#define CFG_INV_VSYNC_MASK
#define CFG_INV_HSYNC(hsync)
#define CFG_INV_HSYNC_MASK
#define CFG_INV_PCLK(pclk)
#define CFG_INV_PCLK_MASK
#define CFG_DUMB_ENA(dumb)
#define CFG_DUMB_ENA_MASK

/* LCD I/O Pads Control Register */
#define SPU_IOPAD_CONTROL
#define CFG_GRA_VM_ENA(vm)
#define CFG_GRA_VM_ENA_MASK
#define CFG_DMA_VM_ENA(vm)
#define CFG_DMA_VM_ENA_MASK
#define CFG_CMD_VM_ENA(vm)
#define CFG_CMD_VM_ENA_MASK
#define CFG_CSC(csc)
#define CFG_CSC_MASK
#define CFG_AXICTRL(axi)
#define CFG_AXICTRL_MASK
#define CFG_IOPADMODE(iopad)
#define CFG_IOPADMODE_MASK

/* LCD Interrupt Control Register */
#define SPU_IRQ_ENA
#define DMA_FRAME_IRQ0_ENA(irq)
#define DMA_FRAME_IRQ0_ENA_MASK
#define DMA_FRAME_IRQ1_ENA(irq)
#define DMA_FRAME_IRQ1_ENA_MASK
#define DMA_FF_UNDERFLOW_ENA(ff)
#define DMA_FF_UNDERFLOW_ENA_MASK
#define GRA_FRAME_IRQ0_ENA(irq)
#define GRA_FRAME_IRQ0_ENA_MASK
#define GRA_FRAME_IRQ1_ENA(irq)
#define GRA_FRAME_IRQ1_ENA_MASK
#define GRA_FF_UNDERFLOW_ENA(ff)
#define GRA_FF_UNDERFLOW_ENA_MASK
#define VSYNC_IRQ_ENA(vsync_irq)
#define VSYNC_IRQ_ENA_MASK
#define DUMB_FRAMEDONE_ENA(fdone)
#define DUMB_FRAMEDONE_ENA_MASK
#define TWC_FRAMEDONE_ENA(fdone)
#define TWC_FRAMEDONE_ENA_MASK
#define HWC_FRAMEDONE_ENA(fdone)
#define HWC_FRAMEDONE_ENA_MASK
#define SLV_IRQ_ENA(irq)
#define SLV_IRQ_ENA_MASK
#define SPI_IRQ_ENA(irq)
#define SPI_IRQ_ENA_MASK
#define PWRDN_IRQ_ENA(irq)
#define PWRDN_IRQ_ENA_MASK
#define ERR_IRQ_ENA(irq)
#define ERR_IRQ_ENA_MASK
#define CLEAN_SPU_IRQ_ISR(irq)
#define CLEAN_SPU_IRQ_ISR_MASK

/* LCD Interrupt Status Register */
#define SPU_IRQ_ISR
#define DMA_FRAME_IRQ0(irq)
#define DMA_FRAME_IRQ0_MASK
#define DMA_FRAME_IRQ1(irq)
#define DMA_FRAME_IRQ1_MASK
#define DMA_FF_UNDERFLOW(ff)
#define DMA_FF_UNDERFLOW_MASK
#define GRA_FRAME_IRQ0(irq)
#define GRA_FRAME_IRQ0_MASK
#define GRA_FRAME_IRQ1(irq)
#define GRA_FRAME_IRQ1_MASK
#define GRA_FF_UNDERFLOW(ff)
#define GRA_FF_UNDERFLOW_MASK
#define VSYNC_IRQ(vsync_irq)
#define VSYNC_IRQ_MASK
#define DUMB_FRAMEDONE(fdone)
#define DUMB_FRAMEDONE_MASK
#define TWC_FRAMEDONE(fdone)
#define TWC_FRAMEDONE_MASK
#define HWC_FRAMEDONE(fdone)
#define HWC_FRAMEDONE_MASK
#define SLV_IRQ(irq)
#define SLV_IRQ_MASK
#define SPI_IRQ(irq)
#define SPI_IRQ_MASK
#define PWRDN_IRQ(irq)
#define PWRDN_IRQ_MASK
#define ERR_IRQ(irq)
#define ERR_IRQ_MASK
/* read-only */
#define DMA_FRAME_IRQ0_LEVEL_MASK
#define DMA_FRAME_IRQ1_LEVEL_MASK
#define DMA_FRAME_CNT_ISR_MASK
#define GRA_FRAME_IRQ0_LEVEL_MASK
#define GRA_FRAME_IRQ1_LEVEL_MASK
#define GRA_FRAME_CNT_ISR_MASK
#define VSYNC_IRQ_LEVEL_MASK
#define DUMB_FRAMEDONE_LEVEL_MASK
#define TWC_FRAMEDONE_LEVEL_MASK
#define HWC_FRAMEDONE_LEVEL_MASK
#define SLV_FF_EMPTY_MASK
#define DMA_FF_ALLEMPTY_MASK
#define GRA_FF_ALLEMPTY_MASK
#define PWRDN_IRQ_LEVEL_MASK


/*
 * defined Video Memory Color format for DMA control 0 register
 * DMA0 bit[23:20]
 */
#define VMODE_RGB565
#define VMODE_RGB1555
#define VMODE_RGB888PACKED
#define VMODE_RGB888UNPACKED
#define VMODE_RGBA888
#define VMODE_YUV422PACKED
#define VMODE_YUV422PLANAR
#define VMODE_YUV420PLANAR
#define VMODE_SMPNCMD
#define VMODE_PALETTE4BIT
#define VMODE_PALETTE8BIT
#define VMODE_RESERVED

/*
 * defined Graphic Memory Color format for DMA control 0 register
 * DMA0 bit[19:16]
 */
#define GMODE_RGB565
#define GMODE_RGB1555
#define GMODE_RGB888PACKED
#define GMODE_RGB888UNPACKED
#define GMODE_RGBA888
#define GMODE_YUV422PACKED
#define GMODE_YUV422PLANAR
#define GMODE_YUV420PLANAR
#define GMODE_SMPNCMD
#define GMODE_PALETTE4BIT
#define GMODE_PALETTE8BIT
#define GMODE_RESERVED

/*
 * define for DMA control 1 register
 */
#define DMA1_FRAME_TRIG
#define DMA1_VSYNC_MODE
#define DMA1_VSYNC_INV
#define DMA1_CKEY
#define DMA1_CARRY
#define DMA1_LNBUF_ENA
#define DMA1_GATED_ENA
#define DMA1_PWRDN_ENA
#define DMA1_DSCALE
#define DMA1_ALPHA_MODE
#define DMA1_ALPHA
#define DMA1_PXLCMD

/*
 * defined for Configure Dumb Mode
 * DUMB LCD Panel bit[31:28]
 */
#define DUMB16_RGB565_0
#define DUMB16_RGB565_1
#define DUMB18_RGB666_0
#define DUMB18_RGB666_1
#define DUMB12_RGB444_0
#define DUMB12_RGB444_1
#define DUMB24_RGB888_0
#define DUMB_BLANK

/*
 * defined for Configure I/O Pin Allocation Mode
 * LCD LCD I/O Pads control register bit[3:0]
 */
#define IOPAD_DUMB24
#define IOPAD_DUMB18SPI
#define IOPAD_DUMB18GPIO
#define IOPAD_DUMB16SPI
#define IOPAD_DUMB16GPIO
#define IOPAD_DUMB12
#define IOPAD_SMART18SPI
#define IOPAD_SMART16SPI
#define IOPAD_SMART8BOTH

#endif /* __PXA168FB_H__ */