Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * BRIEF MODULE DESCRIPTION |
| 3 | * Au1100 LCD Driver. |
| 4 | * |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 5 | * Rewritten for 2.6 by Embedded Alley Solutions |
| 6 | * <source@embeddedalley.com>, based on submissions by |
| 7 | * Karl Lessard <klessard@sunrisetelecom.com> |
| 8 | * <c.pellegrin@exadron.com> |
| 9 | * |
Rodolfo Giometti | f77f50c | 2006-06-26 00:26:49 -0700 | [diff] [blame] | 10 | * PM support added by Rodolfo Giometti <giometti@linux.it> |
Rodolfo Giometti | ca27ac4 | 2006-10-03 01:14:36 -0700 | [diff] [blame] | 11 | * Cursor enable/disable by Rodolfo Giometti <giometti@linux.it> |
Rodolfo Giometti | f77f50c | 2006-06-26 00:26:49 -0700 | [diff] [blame] | 12 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | * Copyright 2002 MontaVista Software |
| 14 | * Author: MontaVista Software, Inc. |
| 15 | * ppopov@mvista.com or source@mvista.com |
| 16 | * |
| 17 | * Copyright 2002 Alchemy Semiconductor |
| 18 | * Author: Alchemy Semiconductor |
| 19 | * |
| 20 | * Based on: |
| 21 | * linux/drivers/video/skeletonfb.c -- Skeleton for a frame buffer device |
| 22 | * Created 28 Dec 1997 by Geert Uytterhoeven |
| 23 | * |
| 24 | * This program is free software; you can redistribute it and/or modify it |
| 25 | * under the terms of the GNU General Public License as published by the |
| 26 | * Free Software Foundation; either version 2 of the License, or (at your |
| 27 | * option) any later version. |
| 28 | * |
| 29 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| 30 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 31 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN |
| 32 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 33 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 34 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
| 35 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 36 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 37 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 38 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 39 | * |
| 40 | * You should have received a copy of the GNU General Public License along |
| 41 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 42 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
| 43 | */ |
Manuel Lauss | 6b1889c | 2014-07-23 16:36:54 +0200 | [diff] [blame] | 44 | #include <linux/clk.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | #include <linux/module.h> |
| 46 | #include <linux/kernel.h> |
| 47 | #include <linux/errno.h> |
| 48 | #include <linux/string.h> |
| 49 | #include <linux/mm.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | #include <linux/fb.h> |
| 51 | #include <linux/init.h> |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 52 | #include <linux/interrupt.h> |
| 53 | #include <linux/ctype.h> |
| 54 | #include <linux/dma-mapping.h> |
Freddy Spierenburg | cacfc8c | 2006-02-24 13:04:17 -0800 | [diff] [blame] | 55 | #include <linux/platform_device.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 56 | #include <linux/slab.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 58 | #include <asm/mach-au1x00/au1000.h> |
| 59 | |
| 60 | #define DEBUG 0 |
| 61 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | #include "au1100fb.h" |
| 63 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 64 | #define DRIVER_NAME "au1100fb" |
| 65 | #define DRIVER_DESC "LCD controller driver for AU1100 processors" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 67 | #define to_au1100fb_device(_info) \ |
| 68 | (_info ? container_of(_info, struct au1100fb_device, info) : NULL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 70 | /* Bitfields format supported by the controller. Note that the order of formats |
| 71 | * SHOULD be the same as in the LCD_CONTROL_SBPPF field, so we can retrieve the |
| 72 | * right pixel format by doing rgb_bitfields[LCD_CONTROL_SBPPF_XXX >> LCD_CONTROL_SBPPF] |
| 73 | */ |
| 74 | struct fb_bitfield rgb_bitfields[][4] = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | { |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 76 | /* Red, Green, Blue, Transp */ |
| 77 | { { 10, 6, 0 }, { 5, 5, 0 }, { 0, 5, 0 }, { 0, 0, 0 } }, |
| 78 | { { 11, 5, 0 }, { 5, 6, 0 }, { 0, 5, 0 }, { 0, 0, 0 } }, |
| 79 | { { 11, 5, 0 }, { 6, 5, 0 }, { 0, 6, 0 }, { 0, 0, 0 } }, |
| 80 | { { 10, 5, 0 }, { 5, 5, 0 }, { 0, 5, 0 }, { 15, 1, 0 } }, |
| 81 | { { 11, 5, 0 }, { 6, 5, 0 }, { 1, 5, 0 }, { 0, 1, 0 } }, |
| 82 | |
| 83 | /* The last is used to describe 12bpp format */ |
| 84 | { { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } }, |
| 85 | }; |
| 86 | |
Greg Kroah-Hartman | 48c68c4 | 2012-12-21 13:07:39 -0800 | [diff] [blame] | 87 | static struct fb_fix_screeninfo au1100fb_fix = { |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 88 | .id = "AU1100 FB", |
| 89 | .xpanstep = 1, |
| 90 | .ypanstep = 1, |
| 91 | .type = FB_TYPE_PACKED_PIXELS, |
| 92 | .accel = FB_ACCEL_NONE, |
| 93 | }; |
| 94 | |
Greg Kroah-Hartman | 48c68c4 | 2012-12-21 13:07:39 -0800 | [diff] [blame] | 95 | static struct fb_var_screeninfo au1100fb_var = { |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 96 | .activate = FB_ACTIVATE_NOW, |
| 97 | .height = -1, |
| 98 | .width = -1, |
| 99 | .vmode = FB_VMODE_NONINTERLACED, |
| 100 | }; |
| 101 | |
Yoichi Yuasa | 8e92f21 | 2007-08-22 14:02:03 -0700 | [diff] [blame] | 102 | /* fb_blank |
| 103 | * Blank the screen. Depending on the mode, the screen will be |
| 104 | * activated with the backlight color, or desactivated |
| 105 | */ |
| 106 | static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi) |
| 107 | { |
| 108 | struct au1100fb_device *fbdev = to_au1100fb_device(fbi); |
| 109 | |
| 110 | print_dbg("fb_blank %d %p", blank_mode, fbi); |
| 111 | |
| 112 | switch (blank_mode) { |
| 113 | |
| 114 | case VESA_NO_BLANKING: |
Paul Bolle | 88564dd | 2013-03-25 20:27:19 +0000 | [diff] [blame] | 115 | /* Turn on panel */ |
| 116 | fbdev->regs->lcd_control |= LCD_CONTROL_GO; |
Manuel Lauss | 2f73bfb | 2014-07-23 16:36:26 +0200 | [diff] [blame] | 117 | wmb(); /* drain writebuffer */ |
Yoichi Yuasa | 8e92f21 | 2007-08-22 14:02:03 -0700 | [diff] [blame] | 118 | break; |
| 119 | |
| 120 | case VESA_VSYNC_SUSPEND: |
| 121 | case VESA_HSYNC_SUSPEND: |
| 122 | case VESA_POWERDOWN: |
Paul Bolle | 88564dd | 2013-03-25 20:27:19 +0000 | [diff] [blame] | 123 | /* Turn off panel */ |
| 124 | fbdev->regs->lcd_control &= ~LCD_CONTROL_GO; |
Manuel Lauss | 2f73bfb | 2014-07-23 16:36:26 +0200 | [diff] [blame] | 125 | wmb(); /* drain writebuffer */ |
Yoichi Yuasa | 8e92f21 | 2007-08-22 14:02:03 -0700 | [diff] [blame] | 126 | break; |
| 127 | default: |
| 128 | break; |
| 129 | |
| 130 | } |
| 131 | return 0; |
| 132 | } |
| 133 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 134 | /* |
| 135 | * Set hardware with var settings. This will enable the controller with a specific |
| 136 | * mode, normally validated with the fb_check_var method |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 137 | */ |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 138 | int au1100fb_setmode(struct au1100fb_device *fbdev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | { |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 140 | struct fb_info *info = &fbdev->info; |
| 141 | u32 words; |
| 142 | int index; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 144 | if (!fbdev) |
| 145 | return -EINVAL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 147 | /* Update var-dependent FB info */ |
| 148 | if (panel_is_active(fbdev->panel) || panel_is_color(fbdev->panel)) { |
| 149 | if (info->var.bits_per_pixel <= 8) { |
| 150 | /* palettized */ |
| 151 | info->var.red.offset = 0; |
| 152 | info->var.red.length = info->var.bits_per_pixel; |
| 153 | info->var.red.msb_right = 0; |
| 154 | |
| 155 | info->var.green.offset = 0; |
| 156 | info->var.green.length = info->var.bits_per_pixel; |
| 157 | info->var.green.msb_right = 0; |
| 158 | |
| 159 | info->var.blue.offset = 0; |
| 160 | info->var.blue.length = info->var.bits_per_pixel; |
| 161 | info->var.blue.msb_right = 0; |
| 162 | |
| 163 | info->var.transp.offset = 0; |
| 164 | info->var.transp.length = 0; |
| 165 | info->var.transp.msb_right = 0; |
| 166 | |
| 167 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
| 168 | info->fix.line_length = info->var.xres_virtual / |
| 169 | (8/info->var.bits_per_pixel); |
| 170 | } else { |
| 171 | /* non-palettized */ |
| 172 | index = (fbdev->panel->control_base & LCD_CONTROL_SBPPF_MASK) >> LCD_CONTROL_SBPPF_BIT; |
| 173 | info->var.red = rgb_bitfields[index][0]; |
| 174 | info->var.green = rgb_bitfields[index][1]; |
| 175 | info->var.blue = rgb_bitfields[index][2]; |
| 176 | info->var.transp = rgb_bitfields[index][3]; |
| 177 | |
| 178 | info->fix.visual = FB_VISUAL_TRUECOLOR; |
| 179 | info->fix.line_length = info->var.xres_virtual << 1; /* depth=16 */ |
Rodolfo Giometti | bb39e41 | 2006-08-05 12:14:22 -0700 | [diff] [blame] | 180 | } |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 181 | } else { |
| 182 | /* mono */ |
| 183 | info->fix.visual = FB_VISUAL_MONO10; |
| 184 | info->fix.line_length = info->var.xres_virtual / 8; |
| 185 | } |
| 186 | |
| 187 | info->screen_size = info->fix.line_length * info->var.yres_virtual; |
Rodolfo Giometti | fd2d543 | 2006-08-05 12:14:19 -0700 | [diff] [blame] | 188 | info->var.rotate = ((fbdev->panel->control_base&LCD_CONTROL_SM_MASK) \ |
| 189 | >> LCD_CONTROL_SM_BIT) * 90; |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 190 | |
| 191 | /* Determine BPP mode and format */ |
Rodolfo Giometti | fd2d543 | 2006-08-05 12:14:19 -0700 | [diff] [blame] | 192 | fbdev->regs->lcd_control = fbdev->panel->control_base; |
Rodolfo Giometti | bb39e41 | 2006-08-05 12:14:22 -0700 | [diff] [blame] | 193 | fbdev->regs->lcd_horztiming = fbdev->panel->horztiming; |
| 194 | fbdev->regs->lcd_verttiming = fbdev->panel->verttiming; |
| 195 | fbdev->regs->lcd_clkcontrol = fbdev->panel->clkcontrol_base; |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 196 | fbdev->regs->lcd_intenable = 0; |
| 197 | fbdev->regs->lcd_intstatus = 0; |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 198 | fbdev->regs->lcd_dmaaddr0 = LCD_DMA_SA_N(fbdev->fb_phys); |
| 199 | |
| 200 | if (panel_is_dual(fbdev->panel)) { |
| 201 | /* Second panel display seconf half of screen if possible, |
| 202 | * otherwise display the same as the first panel */ |
| 203 | if (info->var.yres_virtual >= (info->var.yres << 1)) { |
| 204 | fbdev->regs->lcd_dmaaddr1 = LCD_DMA_SA_N(fbdev->fb_phys + |
| 205 | (info->fix.line_length * |
| 206 | (info->var.yres_virtual >> 1))); |
| 207 | } else { |
| 208 | fbdev->regs->lcd_dmaaddr1 = LCD_DMA_SA_N(fbdev->fb_phys); |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | words = info->fix.line_length / sizeof(u32); |
| 213 | if (!info->var.rotate || (info->var.rotate == 180)) { |
| 214 | words *= info->var.yres_virtual; |
| 215 | if (info->var.rotate /* 180 */) { |
| 216 | words -= (words % 8); /* should be divisable by 8 */ |
| 217 | } |
| 218 | } |
| 219 | fbdev->regs->lcd_words = LCD_WRD_WRDS_N(words); |
| 220 | |
| 221 | fbdev->regs->lcd_pwmdiv = 0; |
| 222 | fbdev->regs->lcd_pwmhi = 0; |
| 223 | |
| 224 | /* Resume controller */ |
| 225 | fbdev->regs->lcd_control |= LCD_CONTROL_GO; |
Rodolfo Giometti | bb39e41 | 2006-08-05 12:14:22 -0700 | [diff] [blame] | 226 | mdelay(10); |
| 227 | au1100fb_fb_blank(VESA_NO_BLANKING, info); |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 228 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 229 | return 0; |
| 230 | } |
| 231 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 232 | /* fb_setcolreg |
| 233 | * Set color in LCD palette. |
| 234 | */ |
| 235 | int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fbi) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | { |
Rodolfo Giometti | c05b7f3 | 2006-05-30 21:26:57 -0700 | [diff] [blame] | 237 | struct au1100fb_device *fbdev; |
| 238 | u32 *palette; |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 239 | u32 value; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | |
Rodolfo Giometti | c05b7f3 | 2006-05-30 21:26:57 -0700 | [diff] [blame] | 241 | fbdev = to_au1100fb_device(fbi); |
| 242 | palette = fbdev->regs->lcd_pallettebase; |
| 243 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 244 | if (regno > (AU1100_LCD_NBR_PALETTE_ENTRIES - 1)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | return -EINVAL; |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 246 | |
| 247 | if (fbi->var.grayscale) { |
| 248 | /* Convert color to grayscale */ |
| 249 | red = green = blue = |
| 250 | (19595 * red + 38470 * green + 7471 * blue) >> 16; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | } |
| 252 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 253 | if (fbi->fix.visual == FB_VISUAL_TRUECOLOR) { |
| 254 | /* Place color in the pseudopalette */ |
| 255 | if (regno > 16) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | return -EINVAL; |
| 257 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 258 | palette = (u32*)fbi->pseudo_palette; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 260 | red >>= (16 - fbi->var.red.length); |
| 261 | green >>= (16 - fbi->var.green.length); |
| 262 | blue >>= (16 - fbi->var.blue.length); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 263 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 264 | value = (red << fbi->var.red.offset) | |
| 265 | (green << fbi->var.green.offset)| |
| 266 | (blue << fbi->var.blue.offset); |
| 267 | value &= 0xFFFF; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 268 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 269 | } else if (panel_is_active(fbdev->panel)) { |
| 270 | /* COLOR TFT PALLETTIZED (use RGB 565) */ |
| 271 | value = (red & 0xF800)|((green >> 5) & 0x07E0)|((blue >> 11) & 0x001F); |
| 272 | value &= 0xFFFF; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 273 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 274 | } else if (panel_is_color(fbdev->panel)) { |
| 275 | /* COLOR STN MODE */ |
| 276 | value = (((panel_swap_rgb(fbdev->panel) ? blue : red) >> 12) & 0x000F) | |
| 277 | ((green >> 8) & 0x00F0) | |
| 278 | (((panel_swap_rgb(fbdev->panel) ? red : blue) >> 4) & 0x0F00); |
| 279 | value &= 0xFFF; |
| 280 | } else { |
| 281 | /* MONOCHROME MODE */ |
| 282 | value = (green >> 12) & 0x000F; |
| 283 | value &= 0xF; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | } |
| 285 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 286 | palette[regno] = value; |
| 287 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 288 | return 0; |
| 289 | } |
| 290 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 291 | /* fb_pan_display |
| 292 | * Pan display in x and/or y as specified |
| 293 | */ |
| 294 | int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | { |
Rodolfo Giometti | c05b7f3 | 2006-05-30 21:26:57 -0700 | [diff] [blame] | 296 | struct au1100fb_device *fbdev; |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 297 | int dy; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 298 | |
Rodolfo Giometti | c05b7f3 | 2006-05-30 21:26:57 -0700 | [diff] [blame] | 299 | fbdev = to_au1100fb_device(fbi); |
| 300 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 301 | print_dbg("fb_pan_display %p %p", var, fbi); |
| 302 | |
| 303 | if (!var || !fbdev) { |
| 304 | return -EINVAL; |
| 305 | } |
| 306 | |
| 307 | if (var->xoffset - fbi->var.xoffset) { |
| 308 | /* No support for X panning for now! */ |
| 309 | return -EINVAL; |
| 310 | } |
| 311 | |
| 312 | print_dbg("fb_pan_display 2 %p %p", var, fbi); |
| 313 | dy = var->yoffset - fbi->var.yoffset; |
| 314 | if (dy) { |
| 315 | |
| 316 | u32 dmaaddr; |
| 317 | |
| 318 | print_dbg("Panning screen of %d lines", dy); |
| 319 | |
| 320 | dmaaddr = fbdev->regs->lcd_dmaaddr0; |
| 321 | dmaaddr += (fbi->fix.line_length * dy); |
| 322 | |
| 323 | /* TODO: Wait for current frame to finished */ |
| 324 | fbdev->regs->lcd_dmaaddr0 = LCD_DMA_SA_N(dmaaddr); |
| 325 | |
| 326 | if (panel_is_dual(fbdev->panel)) { |
| 327 | dmaaddr = fbdev->regs->lcd_dmaaddr1; |
| 328 | dmaaddr += (fbi->fix.line_length * dy); |
| 329 | fbdev->regs->lcd_dmaaddr0 = LCD_DMA_SA_N(dmaaddr); |
| 330 | } |
| 331 | } |
| 332 | print_dbg("fb_pan_display 3 %p %p", var, fbi); |
| 333 | |
| 334 | return 0; |
| 335 | } |
| 336 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 337 | /* fb_mmap |
| 338 | * Map video memory in user space. We don't use the generic fb_mmap method mainly |
| 339 | * to allow the use of the TLB streaming flag (CCA=6) |
| 340 | */ |
Christoph Hellwig | 216d526 | 2006-01-14 13:21:25 -0800 | [diff] [blame] | 341 | int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 342 | { |
Christoph Hellwig | 67f30ad | 2019-04-28 13:47:05 -0500 | [diff] [blame] | 343 | struct au1100fb_device *fbdev = to_au1100fb_device(fbi); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 344 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 345 | pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6 |
| 346 | |
Christoph Hellwig | 67f30ad | 2019-04-28 13:47:05 -0500 | [diff] [blame] | 347 | return dma_mmap_coherent(fbdev->dev, vma, fbdev->fb_mem, fbdev->fb_phys, |
| 348 | fbdev->fb_len); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 349 | } |
| 350 | |
Jani Nikula | 8a48ac33 | 2019-12-03 18:38:50 +0200 | [diff] [blame] | 351 | static const struct fb_ops au1100fb_ops = |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 352 | { |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 353 | .owner = THIS_MODULE, |
| 354 | .fb_setcolreg = au1100fb_fb_setcolreg, |
| 355 | .fb_blank = au1100fb_fb_blank, |
| 356 | .fb_pan_display = au1100fb_fb_pan_display, |
| 357 | .fb_fillrect = cfb_fillrect, |
| 358 | .fb_copyarea = cfb_copyarea, |
| 359 | .fb_imageblit = cfb_imageblit, |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 360 | .fb_mmap = au1100fb_fb_mmap, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 361 | }; |
| 362 | |
| 363 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 364 | /*-------------------------------------------------------------------------*/ |
| 365 | |
Manuel Lauss | d121c3f | 2011-09-30 20:49:43 +0200 | [diff] [blame] | 366 | static int au1100fb_setup(struct au1100fb_device *fbdev) |
| 367 | { |
| 368 | char *this_opt, *options; |
| 369 | int num_panels = ARRAY_SIZE(known_lcd_panels); |
| 370 | |
| 371 | if (num_panels <= 0) { |
| 372 | print_err("No LCD panels supported by driver!"); |
| 373 | return -ENODEV; |
| 374 | } |
| 375 | |
| 376 | if (fb_get_options(DRIVER_NAME, &options)) |
| 377 | return -ENODEV; |
| 378 | if (!options) |
| 379 | return -ENODEV; |
| 380 | |
| 381 | while ((this_opt = strsep(&options, ",")) != NULL) { |
| 382 | /* Panel option */ |
| 383 | if (!strncmp(this_opt, "panel:", 6)) { |
| 384 | int i; |
| 385 | this_opt += 6; |
| 386 | for (i = 0; i < num_panels; i++) { |
| 387 | if (!strncmp(this_opt, known_lcd_panels[i].name, |
| 388 | strlen(this_opt))) { |
| 389 | fbdev->panel = &known_lcd_panels[i]; |
| 390 | fbdev->panel_idx = i; |
| 391 | break; |
| 392 | } |
| 393 | } |
| 394 | if (i >= num_panels) { |
| 395 | print_warn("Panel '%s' not supported!", this_opt); |
| 396 | return -ENODEV; |
| 397 | } |
| 398 | } |
| 399 | /* Unsupported option */ |
| 400 | else |
| 401 | print_warn("Unsupported option \"%s\"", this_opt); |
| 402 | } |
| 403 | |
| 404 | print_info("Panel=%s", fbdev->panel->name); |
| 405 | |
| 406 | return 0; |
| 407 | } |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 408 | |
Greg Kroah-Hartman | 48c68c4 | 2012-12-21 13:07:39 -0800 | [diff] [blame] | 409 | static int au1100fb_drv_probe(struct platform_device *dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 410 | { |
Markus Elfring | 46953e6 | 2018-03-28 16:34:29 +0200 | [diff] [blame] | 411 | struct au1100fb_device *fbdev; |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 412 | struct resource *regs_res; |
Manuel Lauss | 6b1889c | 2014-07-23 16:36:54 +0200 | [diff] [blame] | 413 | struct clk *c; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 414 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 415 | /* Allocate new device private */ |
Markus Elfring | db66f02 | 2018-03-28 16:34:29 +0200 | [diff] [blame] | 416 | fbdev = devm_kzalloc(&dev->dev, sizeof(*fbdev), GFP_KERNEL); |
Markus Elfring | 29914ba | 2018-03-28 16:34:29 +0200 | [diff] [blame] | 417 | if (!fbdev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 418 | return -ENOMEM; |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 419 | |
Manuel Lauss | d121c3f | 2011-09-30 20:49:43 +0200 | [diff] [blame] | 420 | if (au1100fb_setup(fbdev)) |
| 421 | goto failed; |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 422 | |
Ming Lei | 7a192ec | 2009-02-06 23:40:12 +0800 | [diff] [blame] | 423 | platform_set_drvdata(dev, (void *)fbdev); |
Christoph Hellwig | 67f30ad | 2019-04-28 13:47:05 -0500 | [diff] [blame] | 424 | fbdev->dev = &dev->dev; |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 425 | |
| 426 | /* Allocate region for our registers and map them */ |
Manuel Lauss | d121c3f | 2011-09-30 20:49:43 +0200 | [diff] [blame] | 427 | regs_res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
| 428 | if (!regs_res) { |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 429 | print_err("fail to retrieve registers resource"); |
| 430 | return -EFAULT; |
| 431 | } |
| 432 | |
| 433 | au1100fb_fix.mmio_start = regs_res->start; |
Joe Perches | 28f65c11 | 2011-06-09 09:13:32 -0700 | [diff] [blame] | 434 | au1100fb_fix.mmio_len = resource_size(regs_res); |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 435 | |
Manuel Lauss | 9301973 | 2012-03-24 11:38:02 +0100 | [diff] [blame] | 436 | if (!devm_request_mem_region(&dev->dev, |
| 437 | au1100fb_fix.mmio_start, |
Julia Lawall | 1c16697 | 2012-01-21 16:01:58 +0100 | [diff] [blame] | 438 | au1100fb_fix.mmio_len, |
| 439 | DRIVER_NAME)) { |
Rodolfo Giometti | c05b7f3 | 2006-05-30 21:26:57 -0700 | [diff] [blame] | 440 | print_err("fail to lock memory region at 0x%08lx", |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 441 | au1100fb_fix.mmio_start); |
| 442 | return -EBUSY; |
| 443 | } |
| 444 | |
| 445 | fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(au1100fb_fix.mmio_start); |
| 446 | |
| 447 | print_dbg("Register memory map at %p", fbdev->regs); |
| 448 | print_dbg("phys=0x%08x, size=%d", fbdev->regs_phys, fbdev->regs_len); |
| 449 | |
Manuel Lauss | 6b1889c | 2014-07-23 16:36:54 +0200 | [diff] [blame] | 450 | c = clk_get(NULL, "lcd_intclk"); |
| 451 | if (!IS_ERR(c)) { |
| 452 | fbdev->lcdclk = c; |
| 453 | clk_set_rate(c, 48000000); |
| 454 | clk_prepare_enable(c); |
| 455 | } |
| 456 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 457 | /* Allocate the framebuffer to the maximum screen size * nbr of video buffers */ |
| 458 | fbdev->fb_len = fbdev->panel->xres * fbdev->panel->yres * |
| 459 | (fbdev->panel->bpp >> 3) * AU1100FB_NBR_VIDEO_BUFFERS; |
| 460 | |
Manuel Lauss | 9301973 | 2012-03-24 11:38:02 +0100 | [diff] [blame] | 461 | fbdev->fb_mem = dmam_alloc_coherent(&dev->dev, |
Julia Lawall | 1c16697 | 2012-01-21 16:01:58 +0100 | [diff] [blame] | 462 | PAGE_ALIGN(fbdev->fb_len), |
| 463 | &fbdev->fb_phys, GFP_KERNEL); |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 464 | if (!fbdev->fb_mem) { |
Colin Ian King | 3879490 | 2018-05-15 12:41:11 +0200 | [diff] [blame] | 465 | print_err("fail to allocate framebuffer (size: %dK))", |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 466 | fbdev->fb_len / 1024); |
| 467 | return -ENOMEM; |
| 468 | } |
| 469 | |
| 470 | au1100fb_fix.smem_start = fbdev->fb_phys; |
| 471 | au1100fb_fix.smem_len = fbdev->fb_len; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 472 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 473 | print_dbg("Framebuffer memory map at %p", fbdev->fb_mem); |
| 474 | print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 475 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 476 | /* load the panel info into the var struct */ |
| 477 | au1100fb_var.bits_per_pixel = fbdev->panel->bpp; |
| 478 | au1100fb_var.xres = fbdev->panel->xres; |
| 479 | au1100fb_var.xres_virtual = au1100fb_var.xres; |
| 480 | au1100fb_var.yres = fbdev->panel->yres; |
| 481 | au1100fb_var.yres_virtual = au1100fb_var.yres; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 482 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 483 | fbdev->info.screen_base = fbdev->fb_mem; |
| 484 | fbdev->info.fbops = &au1100fb_ops; |
| 485 | fbdev->info.fix = au1100fb_fix; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 486 | |
Julia Lawall | 1c16697 | 2012-01-21 16:01:58 +0100 | [diff] [blame] | 487 | fbdev->info.pseudo_palette = |
Kees Cook | a86854d | 2018-06-12 14:07:58 -0700 | [diff] [blame] | 488 | devm_kcalloc(&dev->dev, 16, sizeof(u32), GFP_KERNEL); |
Julia Lawall | 1c16697 | 2012-01-21 16:01:58 +0100 | [diff] [blame] | 489 | if (!fbdev->info.pseudo_palette) |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 490 | return -ENOMEM; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 491 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 492 | if (fb_alloc_cmap(&fbdev->info.cmap, AU1100_LCD_NBR_PALETTE_ENTRIES, 0) < 0) { |
| 493 | print_err("Fail to allocate colormap (%d entries)", |
| 494 | AU1100_LCD_NBR_PALETTE_ENTRIES); |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 495 | return -EFAULT; |
| 496 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 497 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 498 | fbdev->info.var = au1100fb_var; |
| 499 | |
| 500 | /* Set h/w registers */ |
| 501 | au1100fb_setmode(fbdev); |
| 502 | |
| 503 | /* Register new framebuffer */ |
| 504 | if (register_framebuffer(&fbdev->info) < 0) { |
| 505 | print_err("cannot register new framebuffer"); |
| 506 | goto failed; |
| 507 | } |
| 508 | |
| 509 | return 0; |
| 510 | |
| 511 | failed: |
Manuel Lauss | 6b1889c | 2014-07-23 16:36:54 +0200 | [diff] [blame] | 512 | if (fbdev->lcdclk) { |
| 513 | clk_disable_unprepare(fbdev->lcdclk); |
| 514 | clk_put(fbdev->lcdclk); |
| 515 | } |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 516 | if (fbdev->info.cmap.len != 0) { |
| 517 | fb_dealloc_cmap(&fbdev->info.cmap); |
| 518 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 519 | |
Julia Lawall | 1c16697 | 2012-01-21 16:01:58 +0100 | [diff] [blame] | 520 | return -ENODEV; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 521 | } |
| 522 | |
Ming Lei | 7a192ec | 2009-02-06 23:40:12 +0800 | [diff] [blame] | 523 | int au1100fb_drv_remove(struct platform_device *dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 524 | { |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 525 | struct au1100fb_device *fbdev = NULL; |
| 526 | |
| 527 | if (!dev) |
| 528 | return -ENODEV; |
| 529 | |
Jingoo Han | 5a7bbe8 | 2013-09-09 14:49:14 +0900 | [diff] [blame] | 530 | fbdev = platform_get_drvdata(dev); |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 531 | |
| 532 | #if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO) |
| 533 | au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info); |
| 534 | #endif |
| 535 | fbdev->regs->lcd_control &= ~LCD_CONTROL_GO; |
| 536 | |
| 537 | /* Clean up all probe data */ |
| 538 | unregister_framebuffer(&fbdev->info); |
| 539 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 540 | fb_dealloc_cmap(&fbdev->info.cmap); |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 541 | |
Manuel Lauss | 6b1889c | 2014-07-23 16:36:54 +0200 | [diff] [blame] | 542 | if (fbdev->lcdclk) { |
| 543 | clk_disable_unprepare(fbdev->lcdclk); |
| 544 | clk_put(fbdev->lcdclk); |
| 545 | } |
| 546 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 547 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 548 | } |
| 549 | |
Rodolfo Giometti | f77f50c | 2006-06-26 00:26:49 -0700 | [diff] [blame] | 550 | #ifdef CONFIG_PM |
Rodolfo Giometti | f77f50c | 2006-06-26 00:26:49 -0700 | [diff] [blame] | 551 | static struct au1100fb_regs fbregs; |
| 552 | |
Ming Lei | 7a192ec | 2009-02-06 23:40:12 +0800 | [diff] [blame] | 553 | int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state) |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 554 | { |
Ming Lei | 7a192ec | 2009-02-06 23:40:12 +0800 | [diff] [blame] | 555 | struct au1100fb_device *fbdev = platform_get_drvdata(dev); |
Rodolfo Giometti | f77f50c | 2006-06-26 00:26:49 -0700 | [diff] [blame] | 556 | |
| 557 | if (!fbdev) |
| 558 | return 0; |
| 559 | |
Rodolfo Giometti | f77f50c | 2006-06-26 00:26:49 -0700 | [diff] [blame] | 560 | /* Blank the LCD */ |
| 561 | au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info); |
| 562 | |
Manuel Lauss | 6b1889c | 2014-07-23 16:36:54 +0200 | [diff] [blame] | 563 | if (fbdev->lcdclk) |
| 564 | clk_disable(fbdev->lcdclk); |
Rodolfo Giometti | f77f50c | 2006-06-26 00:26:49 -0700 | [diff] [blame] | 565 | |
| 566 | memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs)); |
| 567 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 568 | return 0; |
| 569 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 570 | |
Ming Lei | 7a192ec | 2009-02-06 23:40:12 +0800 | [diff] [blame] | 571 | int au1100fb_drv_resume(struct platform_device *dev) |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 572 | { |
Ming Lei | 7a192ec | 2009-02-06 23:40:12 +0800 | [diff] [blame] | 573 | struct au1100fb_device *fbdev = platform_get_drvdata(dev); |
Rodolfo Giometti | f77f50c | 2006-06-26 00:26:49 -0700 | [diff] [blame] | 574 | |
| 575 | if (!fbdev) |
| 576 | return 0; |
| 577 | |
| 578 | memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs)); |
| 579 | |
Manuel Lauss | 6b1889c | 2014-07-23 16:36:54 +0200 | [diff] [blame] | 580 | if (fbdev->lcdclk) |
| 581 | clk_enable(fbdev->lcdclk); |
Rodolfo Giometti | f77f50c | 2006-06-26 00:26:49 -0700 | [diff] [blame] | 582 | |
| 583 | /* Unblank the LCD */ |
| 584 | au1100fb_fb_blank(VESA_NO_BLANKING, &fbdev->info); |
| 585 | |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 586 | return 0; |
| 587 | } |
Rodolfo Giometti | f77f50c | 2006-06-26 00:26:49 -0700 | [diff] [blame] | 588 | #else |
| 589 | #define au1100fb_drv_suspend NULL |
| 590 | #define au1100fb_drv_resume NULL |
| 591 | #endif |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 592 | |
Ming Lei | 7a192ec | 2009-02-06 23:40:12 +0800 | [diff] [blame] | 593 | static struct platform_driver au1100fb_driver = { |
| 594 | .driver = { |
| 595 | .name = "au1100-lcd", |
Ming Lei | 7a192ec | 2009-02-06 23:40:12 +0800 | [diff] [blame] | 596 | }, |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 597 | .probe = au1100fb_drv_probe, |
| 598 | .remove = au1100fb_drv_remove, |
| 599 | .suspend = au1100fb_drv_suspend, |
| 600 | .resume = au1100fb_drv_resume, |
| 601 | }; |
Hanjun Guo | 55be310 | 2013-09-29 13:32:10 +0800 | [diff] [blame] | 602 | module_platform_driver(au1100fb_driver); |
Pete Popov | 3b495f2 | 2005-04-04 01:06:19 +0000 | [diff] [blame] | 603 | |
| 604 | MODULE_DESCRIPTION(DRIVER_DESC); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 605 | MODULE_LICENSE("GPL"); |