Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Hannes Petermaier | f04e999 | 2014-03-06 14:39:06 +0100 | [diff] [blame] | 2 | /* |
Hannes Schmelzer | 2d9a3cd | 2018-01-09 19:01:32 +0100 | [diff] [blame] | 3 | * Copyright (C) 2013-2018 Hannes Schmelzer <oe5hpm@oevsv.at> - |
| 4 | * B&R Industrial Automation GmbH - http://www.br-automation.com |
Hannes Petermaier | f04e999 | 2014-03-06 14:39:06 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef AM335X_FB_H |
| 8 | #define AM335X_FB_H |
| 9 | |
Dario Binacchi | 3d9a713 | 2020-02-22 14:05:37 +0100 | [diff] [blame^] | 10 | #define HSVS_CONTROL BIT(25) /* |
Hannes Petermaier | f04e999 | 2014-03-06 14:39:06 +0100 | [diff] [blame] | 11 | * 0 = lcd_lp and lcd_fp are driven on |
| 12 | * opposite edges of pixel clock than |
| 13 | * the lcd_pixel_o |
| 14 | * 1 = lcd_lp and lcd_fp are driven |
| 15 | * according to bit 24 Note that this |
| 16 | * bit MUST be set to '0' for Passive |
| 17 | * Matrix displays the edge timing is |
| 18 | * fixed |
| 19 | */ |
Dario Binacchi | 3d9a713 | 2020-02-22 14:05:37 +0100 | [diff] [blame^] | 20 | #define HSVS_RISEFALL BIT(24) /* |
Hannes Petermaier | f04e999 | 2014-03-06 14:39:06 +0100 | [diff] [blame] | 21 | * 0 = lcd_lp and lcd_fp are driven on |
| 22 | * the rising edge of pixel clock (bit |
| 23 | * 25 must be set to 1) |
| 24 | * 1 = lcd_lp and lcd_fp are driven on |
| 25 | * the falling edge of pixel clock (bit |
| 26 | * 25 must be set to 1) |
| 27 | */ |
Dario Binacchi | 3d9a713 | 2020-02-22 14:05:37 +0100 | [diff] [blame^] | 28 | #define DE_INVERT BIT(23) /* |
Hannes Petermaier | f04e999 | 2014-03-06 14:39:06 +0100 | [diff] [blame] | 29 | * 0 = DE is low-active |
| 30 | * 1 = DE is high-active |
| 31 | */ |
Dario Binacchi | 3d9a713 | 2020-02-22 14:05:37 +0100 | [diff] [blame^] | 32 | #define PXCLK_INVERT BIT(22) /* |
Hannes Petermaier | f04e999 | 2014-03-06 14:39:06 +0100 | [diff] [blame] | 33 | * 0 = pix-clk is high-active |
| 34 | * 1 = pic-clk is low-active |
| 35 | */ |
Dario Binacchi | 3d9a713 | 2020-02-22 14:05:37 +0100 | [diff] [blame^] | 36 | #define HSYNC_INVERT BIT(21) /* |
Hannes Petermaier | f04e999 | 2014-03-06 14:39:06 +0100 | [diff] [blame] | 37 | * 0 = HSYNC is active high |
| 38 | * 1 = HSYNC is avtive low |
| 39 | */ |
Dario Binacchi | 3d9a713 | 2020-02-22 14:05:37 +0100 | [diff] [blame^] | 40 | #define VSYNC_INVERT BIT(20) /* |
Hannes Petermaier | f04e999 | 2014-03-06 14:39:06 +0100 | [diff] [blame] | 41 | * 0 = VSYNC is active high |
| 42 | * 1 = VSYNC is active low |
| 43 | */ |
| 44 | |
| 45 | struct am335x_lcdpanel { |
| 46 | unsigned int hactive; /* Horizontal active area */ |
| 47 | unsigned int vactive; /* Vertical active area */ |
| 48 | unsigned int bpp; /* bits per pixel */ |
| 49 | unsigned int hfp; /* Horizontal front porch */ |
| 50 | unsigned int hbp; /* Horizontal back porch */ |
| 51 | unsigned int hsw; /* Horizontal Sync Pulse Width */ |
| 52 | unsigned int vfp; /* Vertical front porch */ |
| 53 | unsigned int vbp; /* Vertical back porch */ |
| 54 | unsigned int vsw; /* Vertical Sync Pulse Width */ |
Hannes Schmelzer | 6e1e428 | 2018-01-09 19:01:34 +0100 | [diff] [blame] | 55 | unsigned int pxl_clk; /* Pixel clock */ |
Hannes Petermaier | f04e999 | 2014-03-06 14:39:06 +0100 | [diff] [blame] | 56 | unsigned int pol; /* polarity of sync, clock signals */ |
Hannes Petermaier | 169aa70 | 2015-02-03 13:22:23 +0100 | [diff] [blame] | 57 | unsigned int pup_delay; /* |
| 58 | * time in ms after power on to |
| 59 | * initialization of lcd-controller |
| 60 | * (VCC ramp up time) |
| 61 | */ |
Hannes Petermaier | f04e999 | 2014-03-06 14:39:06 +0100 | [diff] [blame] | 62 | unsigned int pon_delay; /* |
Hannes Petermaier | 169aa70 | 2015-02-03 13:22:23 +0100 | [diff] [blame] | 63 | * time in ms after initialization of |
| 64 | * lcd-controller (pic stabilization) |
Hannes Petermaier | f04e999 | 2014-03-06 14:39:06 +0100 | [diff] [blame] | 65 | */ |
| 66 | void (*panel_power_ctrl)(int); /* fp for power on/off display */ |
| 67 | }; |
| 68 | |
| 69 | int am335xfb_init(struct am335x_lcdpanel *panel); |
| 70 | |
| 71 | #endif /* AM335X_FB_H */ |