atyfb: Rage LT LCD register access.
PATCH 1/1 atyfb: Rage LT LCD register access.
This patch is an attempt to make the LCD code work for Rage LT chips.
I don't actually own a Rage LT (only LT Pro) so the code is completely untested in that regards...
I also got rid of the two different power management functions. I changed the timeouts so that the bigger of the previosuly used values is now used in every step. Also untested...
The mach64_ct.c changes actually affect all chips since before it was trying to write to the LCD registers using aty_{ld,st}_le32(). This almost gets rid of the visual garble I see when atyfb takes over my LT Pro but not quite. Apparently the LCD would need to be turned off even earlier to fix this.
Signature · 3 lines
Ville Syrjälä [email protected] http://www.sci.fi/~syrjala/
drivers/video/aty/atyfb.h +6 -1
@@ -192,7 +192,7 @@#define M64F_G3_PB_1_1 0x00008000#define M64F_G3_PB_1024x768 0x00010000#define M64F_EXTRA_BRIGHT 0x00020000 -#define M64F_LT_SLEEP 0x00040000 +#define M64F_LT_LCD_REGS 0x00040000#define M64F_XL_DLL 0x00080000#define M64F_MFB_FORCE_4 0x00100000#define M64F_HW_TRIPLE 0x00200000
@@ -252,6 +252,11 @@#endif } +#if defined(CONFIG_PM ) || defined(CONFIG_PMAC_BACKLIGHT ) || defined (CONFIG_FB_ATY_GENERIC_LCD ) +extern void aty_st_lcd (int index,u32 val,const struct atyfb_par *par); +extern u32 aty_ld_lcd (int index,const struct atyfb_par *par); +#endif +/* * DAC operations */
drivers/video/aty/atyfb_base.c +67 -93
244 lines not on this page · raw message
drivers/video/aty/mach64_ct.c +3 -3
@@ -281,8 +281,8 @@#ifdef CONFIG_FB_ATY_GENERIC_LCD if (par->lcd_table !=0 ) {/* turn off LCD */ - lcd_gen_cntrl =aty_ld_le32 (LCD_GEN_CNTL , par); -aty_st_le32 (LCD_GEN_CNTL , lcd_gen_cntrl & ~LCD_ON , par); + lcd_gen_cntrl =aty_ld_lcd (LCD_GEN_CNTL , par); +aty_st_lcd (LCD_GEN_CNTL , lcd_gen_cntrl & ~LCD_ON , par); }#endif aty_st_8 (CLOCK_CNTL , par->clk_wr_offset |CLOCK_STROBE , par);
@@ -351,7 +351,7 @@#ifdef CONFIG_FB_ATY_GENERIC_LCD if (par->lcd_table !=0 ) {/* restore LCD */ -aty_st_le32 (LCD_GEN_CNTL , lcd_gen_cntrl, par); +aty_st_lcd (LCD_GEN_CNTL , lcd_gen_cntrl, par); }#endif }
include/video/mach64.h +11 -3
@@ -68,6 +68,8 @@#define I2C_CNTL_0 0x003C/* Dword offset 0_0F */ +#define DSTN_CONTROL_LG 0x003C/* Dword offset 0_0F (LG) */ +/* Overscan */ #define OVR_CLR 0x0040/* Dword offset 0_10 */ #define OVR2_CLR 0x0040/* Dword offset 0_10 */
@@ -101,7 +103,7 @@#define CUR_HORZ_VERT_OFF 0x0070/* Dword offset 0_1C */ #define CUR2_HORZ_VERT_OFF 0x0070/* Dword offset 0_1C */ -#define CONFIG_PANEL_LG 0x0074/* Dword offset 0_1D */ +#define CONFIG_PANEL_LG 0x0074/* Dword offset 0_1D (LG) */ /* General I/O Control */ #define GP_IO 0x0078/* Dword offset 0_1E */
@@ -153,6 +155,8 @@#define LCD_INDEX 0x00A4/* Dword offset 0_29 */ #define LCD_DATA 0x00A8/* Dword offset 0_2A */ +#define HFB_PITCH_ADDR_LG 0x00A8/* Dword offset 0_2A (LG) */ +/* Memory Control */ #define EXT_MEM_CNTL 0x00AC/* Dword offset 0_2B */ #define MEM_CNTL 0x00B0/* Dword offset 0_2C */
@@ -161,6 +165,8 @@#define I2C_CNTL_1 0x00BC/* Dword offset 0_2F */ +#define LT_GIO_LG 0x00BC/* Dword offset 0_2F (LG) */ +/* DAC Control */ #define DAC_REGS 0x00C0/* Dword offset 0_30 */ #define DAC_W_INDEX 0x00C0/* Dword offset 0_30 */
@@ -171,14 +177,16 @@#define EXT_DAC_REGS 0x00C8/* Dword offset 0_32 */ +#define HORZ_STRETCHING_LG 0x00C8/* Dword offset 0_32 (LG) */ +#define VERT_STRETCHING_LG 0x00CC/* Dword offset 0_33 (LG) */ +/* Test and Debug */ #define GEN_TEST_CNTL 0x00D0/* Dword offset 0_34 */ /* Custom Macros */ #define CUSTOM_MACRO_CNTL 0x00D4/* Dword offset 0_35 */ -#define LCD_GEN_CNTL_LG 0x00D4/* Dword offset 0_35 */ - +#define LCD_GEN_CNTL_LG 0x00D4/* Dword offset 0_35 (LG) */ #define POWER_MANAGEMENT_LG 0x00D8/* Dword offset 0_36 (LG) */ /* Configuration */