18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  arch/arm/mach-omap1/include/mach/lcd_dma.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Extracted from arch/arm/plat-omap/include/plat/dma.h
68c2ecf20Sopenharmony_ci *  Copyright (C) 2003 Nokia Corporation
78c2ecf20Sopenharmony_ci *  Author: Juha Yrjölä <juha.yrjola@nokia.com>
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci#ifndef __MACH_OMAP1_LCD_DMA_H__
108c2ecf20Sopenharmony_ci#define __MACH_OMAP1_LCD_DMA_H__
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci/* Hardware registers for LCD DMA */
138c2ecf20Sopenharmony_ci#define OMAP1510_DMA_LCD_BASE		(0xfffedb00)
148c2ecf20Sopenharmony_ci#define OMAP1510_DMA_LCD_CTRL		(OMAP1510_DMA_LCD_BASE + 0x00)
158c2ecf20Sopenharmony_ci#define OMAP1510_DMA_LCD_TOP_F1_L	(OMAP1510_DMA_LCD_BASE + 0x02)
168c2ecf20Sopenharmony_ci#define OMAP1510_DMA_LCD_TOP_F1_U	(OMAP1510_DMA_LCD_BASE + 0x04)
178c2ecf20Sopenharmony_ci#define OMAP1510_DMA_LCD_BOT_F1_L	(OMAP1510_DMA_LCD_BASE + 0x06)
188c2ecf20Sopenharmony_ci#define OMAP1510_DMA_LCD_BOT_F1_U	(OMAP1510_DMA_LCD_BASE + 0x08)
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_BASE		(0xfffee300)
218c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_CSDP		(OMAP1610_DMA_LCD_BASE + 0xc0)
228c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_CCR		(OMAP1610_DMA_LCD_BASE + 0xc2)
238c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_CTRL		(OMAP1610_DMA_LCD_BASE + 0xc4)
248c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_TOP_B1_L	(OMAP1610_DMA_LCD_BASE + 0xc8)
258c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_TOP_B1_U	(OMAP1610_DMA_LCD_BASE + 0xca)
268c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_BOT_B1_L	(OMAP1610_DMA_LCD_BASE + 0xcc)
278c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_BOT_B1_U	(OMAP1610_DMA_LCD_BASE + 0xce)
288c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_TOP_B2_L	(OMAP1610_DMA_LCD_BASE + 0xd0)
298c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_TOP_B2_U	(OMAP1610_DMA_LCD_BASE + 0xd2)
308c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_BOT_B2_L	(OMAP1610_DMA_LCD_BASE + 0xd4)
318c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_BOT_B2_U	(OMAP1610_DMA_LCD_BASE + 0xd6)
328c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_SRC_EI_B1	(OMAP1610_DMA_LCD_BASE + 0xd8)
338c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_SRC_FI_B1_L	(OMAP1610_DMA_LCD_BASE + 0xda)
348c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_SRC_EN_B1	(OMAP1610_DMA_LCD_BASE + 0xe0)
358c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_SRC_FN_B1	(OMAP1610_DMA_LCD_BASE + 0xe4)
368c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_LCH_CTRL	(OMAP1610_DMA_LCD_BASE + 0xea)
378c2ecf20Sopenharmony_ci#define OMAP1610_DMA_LCD_SRC_FI_B1_U	(OMAP1610_DMA_LCD_BASE + 0xf4)
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci/* LCD DMA block numbers */
408c2ecf20Sopenharmony_cienum {
418c2ecf20Sopenharmony_ci	OMAP_LCD_DMA_B1_TOP,
428c2ecf20Sopenharmony_ci	OMAP_LCD_DMA_B1_BOTTOM,
438c2ecf20Sopenharmony_ci	OMAP_LCD_DMA_B2_TOP,
448c2ecf20Sopenharmony_ci	OMAP_LCD_DMA_B2_BOTTOM
458c2ecf20Sopenharmony_ci};
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci/* LCD DMA functions */
488c2ecf20Sopenharmony_ciextern int omap_request_lcd_dma(void (*callback)(u16 status, void *data),
498c2ecf20Sopenharmony_ci				void *data);
508c2ecf20Sopenharmony_ciextern void omap_free_lcd_dma(void);
518c2ecf20Sopenharmony_ciextern void omap_setup_lcd_dma(void);
528c2ecf20Sopenharmony_ciextern void omap_enable_lcd_dma(void);
538c2ecf20Sopenharmony_ciextern void omap_stop_lcd_dma(void);
548c2ecf20Sopenharmony_ciextern void omap_set_lcd_dma_ext_controller(int external);
558c2ecf20Sopenharmony_ciextern void omap_set_lcd_dma_single_transfer(int single);
568c2ecf20Sopenharmony_ciextern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
578c2ecf20Sopenharmony_ci				int data_type);
588c2ecf20Sopenharmony_ciextern void omap_set_lcd_dma_b1_rotation(int rotate);
598c2ecf20Sopenharmony_ciextern void omap_set_lcd_dma_b1_vxres(unsigned long vxres);
608c2ecf20Sopenharmony_ciextern void omap_set_lcd_dma_b1_mirror(int mirror);
618c2ecf20Sopenharmony_ciextern void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale);
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ciextern int omap_lcd_dma_running(void);
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#endif /* __MACH_OMAP1_LCD_DMA_H__ */
66