1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Freescale DIU Frame Buffer device driver
7 * Authors: Hongjun Chen <hong-jun.chen@freescale.com>
8 * Paul Widmer <paul.widmer@freescale.com>
9 * Srikanth Srinivasan <srikanth.srinivasan@freescale.com>
10 * York Sun <yorksun@freescale.com>
12 * Based on imxfb.c Copyright (C) 2004 S.Hauer, Pengutronix
15 #ifndef __FSL_DIU_FB_H__
16 #define __FSL_DIU_FB_H__
18 #include <linux/types.h>
20 struct mfb_chroma_key {
30 struct aoi_display_offset {
35 #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key)
36 #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8)
37 #define MFB_SET_ALPHA _IOW('M', 0, __u8)
38 #define MFB_GET_ALPHA _IOR('M', 0, __u8)
39 #define MFB_SET_AOID _IOW('M', 4, struct aoi_display_offset)
40 #define MFB_GET_AOID _IOR('M', 4, struct aoi_display_offset)
41 #define MFB_SET_PIXFMT _IOW('M', 8, __u32)
42 #define MFB_GET_PIXFMT _IOR('M', 8, __u32)
45 * The MPC5121 BSP comes with a gamma_set utility that initializes the
46 * gamma table. Unfortunately, it uses bad values for the IOCTL commands,
47 * but there's nothing we can do about it now. These ioctls are only
48 * supported on the MPC5121.
50 #define MFB_SET_GAMMA _IOW('M', 1, __u8)
51 #define MFB_GET_GAMMA _IOR('M', 1, __u8)
54 * The original definitions of MFB_SET_PIXFMT and MFB_GET_PIXFMT used the
55 * wrong value for 'size' field of the ioctl. The current macros above use the
56 * right size, but we still need to provide backwards compatibility, at least
59 #define MFB_SET_PIXFMT_OLD 0x80014d08
60 #define MFB_GET_PIXFMT_OLD 0x40014d08
65 * These are the fields of area descriptor(in DDR memory) for every plane
68 /* Word 0(32-bit) in DDR memory */
70 /* __u16 pixel_s:2; */
71 /* __u16 palette:1; */
73 /* __u16 green_c:2; */
75 /* __u16 alpha_c:3; */
79 __be32 pix_fmt; /* hard coding pixel format */
81 /* Word 1(32-bit) in DDR memory */
84 /* Word 2(32-bit) in DDR memory */
85 /* __u32 delta_xs:11; */
87 /* __u32 delta_ys:11; */
89 /* __u32 g_alpha:8; */
90 __le32 src_size_g_alpha;
92 /* Word 3(32-bit) in DDR memory */
93 /* __u32 delta_xi:11; */
95 /* __u32 delta_yi:11; */
100 /* Word 4(32-bit) in DDR memory */
101 /*__u32 offset_xi:11;
108 /* Word 5(32-bit) in DDR memory */
109 /*__u32 offset_xd:11;
116 /* Word 6(32-bit) in DDR memory */
122 /* Word 7(32-bit) in DDR memory */
129 /* Word 8(32-bit) in DDR memory */
132 /* Word 9(32-bit) in DDR memory, just for 64-bit aligned */
134 } __attribute__ ((packed));
136 /* DIU register map */
158 } __attribute__ ((packed));
161 * Modes of operation of DIU. The DIU supports five different modes, but
162 * the driver only supports modes 0 and 1.
164 #define MFB_MODE0 0 /* DIU off */
165 #define MFB_MODE1 1 /* All three planes output to display */
167 #endif /* __KERNEL__ */
168 #endif /* __FSL_DIU_FB_H__ */