Lines Matching refs:ast
49 static inline void ast_load_palette_index(struct ast_private *ast, in ast_load_palette_index() argument
53 ast_io_write8(ast, AST_IO_DAC_INDEX_WRITE, index); in ast_load_palette_index()
54 ast_io_read8(ast, AST_IO_SEQ_PORT); in ast_load_palette_index()
55 ast_io_write8(ast, AST_IO_DAC_DATA, red); in ast_load_palette_index()
56 ast_io_read8(ast, AST_IO_SEQ_PORT); in ast_load_palette_index()
57 ast_io_write8(ast, AST_IO_DAC_DATA, green); in ast_load_palette_index()
58 ast_io_read8(ast, AST_IO_SEQ_PORT); in ast_load_palette_index()
59 ast_io_write8(ast, AST_IO_DAC_DATA, blue); in ast_load_palette_index()
60 ast_io_read8(ast, AST_IO_SEQ_PORT); in ast_load_palette_index()
65 struct ast_private *ast = crtc->dev->dev_private; in ast_crtc_load_lut() local
73 ast_load_palette_index(ast, i, ast_crtc->lut_r[i], in ast_crtc_load_lut()
81 struct ast_private *ast = crtc->dev->dev_private; in ast_get_vbios_mode_info() local
200 if (ast->chip == AST1180) { in ast_get_vbios_mode_info()
203 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x8c, (u8)((color_index & 0xf) << 4)); in ast_get_vbios_mode_info()
204 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x8d, refresh_rate_index & 0xff); in ast_get_vbios_mode_info()
205 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x8e, mode_id & 0xff); in ast_get_vbios_mode_info()
207 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x91, 0x00); in ast_get_vbios_mode_info()
209 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x91, 0xa8); in ast_get_vbios_mode_info()
210 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x92, crtc->primary->fb->bits_per_pixel); in ast_get_vbios_mode_info()
211 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x93, adjusted_mode->clock / 1000); in ast_get_vbios_mode_info()
212 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x94, adjusted_mode->crtc_hdisplay); in ast_get_vbios_mode_info()
213 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x95, adjusted_mode->crtc_hdisplay >> 8); in ast_get_vbios_mode_info()
215 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x96, adjusted_mode->crtc_vdisplay); in ast_get_vbios_mode_info()
216 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x97, adjusted_mode->crtc_vdisplay >> 8); in ast_get_vbios_mode_info()
227 struct ast_private *ast = crtc->dev->dev_private; in ast_set_std_reg() local
235 ast_io_write8(ast, AST_IO_MISC_PORT_WRITE, jreg); in ast_set_std_reg()
238 ast_set_index_reg(ast, AST_IO_SEQ_PORT, 0x00, 0x03); in ast_set_std_reg()
243 ast_set_index_reg(ast, AST_IO_SEQ_PORT, (i + 1) , jreg); in ast_set_std_reg()
247 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x11, 0x7f, 0x00); in ast_set_std_reg()
249 ast_set_index_reg(ast, AST_IO_CRTC_PORT, i, stdtable->crtc[i]); in ast_set_std_reg()
252 jreg = ast_io_read8(ast, AST_IO_INPUT_STATUS1_READ); in ast_set_std_reg()
255 ast_io_write8(ast, AST_IO_AR_PORT_WRITE, (u8)i); in ast_set_std_reg()
256 ast_io_write8(ast, AST_IO_AR_PORT_WRITE, jreg); in ast_set_std_reg()
258 ast_io_write8(ast, AST_IO_AR_PORT_WRITE, 0x14); in ast_set_std_reg()
259 ast_io_write8(ast, AST_IO_AR_PORT_WRITE, 0x00); in ast_set_std_reg()
261 jreg = ast_io_read8(ast, AST_IO_INPUT_STATUS1_READ); in ast_set_std_reg()
262 ast_io_write8(ast, AST_IO_AR_PORT_WRITE, 0x20); in ast_set_std_reg()
266 ast_set_index_reg(ast, AST_IO_GR_PORT, i, stdtable->gr[i]); in ast_set_std_reg()
272 struct ast_private *ast = crtc->dev->dev_private; in ast_set_crtc_reg() local
276 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x11, 0x7f, 0x00); in ast_set_crtc_reg()
281 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x00, 0x00, temp); in ast_set_crtc_reg()
286 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x01, 0x00, temp); in ast_set_crtc_reg()
291 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x02, 0x00, temp); in ast_set_crtc_reg()
298 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x03, 0xE0, (temp & 0x1f)); in ast_set_crtc_reg()
303 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x04, 0x00, temp); in ast_set_crtc_reg()
308 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x05, 0x60, (u8)((temp & 0x1f) | jreg05)); in ast_set_crtc_reg()
310 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAC, 0x00, jregAC); in ast_set_crtc_reg()
311 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAD, 0x00, jregAD); in ast_set_crtc_reg()
321 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x06, 0x00, temp); in ast_set_crtc_reg()
330 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x10, 0x00, temp); in ast_set_crtc_reg()
337 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x11, 0x70, temp & 0xf); in ast_set_crtc_reg()
346 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x12, 0x00, temp); in ast_set_crtc_reg()
355 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x15, 0x00, temp); in ast_set_crtc_reg()
360 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x16, 0x00, temp); in ast_set_crtc_reg()
362 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x07, 0x00, jreg07); in ast_set_crtc_reg()
363 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x09, 0xdf, jreg09); in ast_set_crtc_reg()
364 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAE, 0x00, (jregAE | 0x80)); in ast_set_crtc_reg()
366 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x11, 0x7f, 0x80); in ast_set_crtc_reg()
371 struct ast_private *ast = crtc->dev->dev_private; in ast_set_offset_reg() local
376 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x13, (offset & 0xff)); in ast_set_offset_reg()
377 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xb0, (offset >> 8) & 0x3f); in ast_set_offset_reg()
383 struct ast_private *ast = dev->dev_private; in ast_set_dclk_reg() local
388 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xc0, 0x00, clk_info->param1); in ast_set_dclk_reg()
389 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xc1, 0x00, clk_info->param2); in ast_set_dclk_reg()
390 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xbb, 0x0f, in ast_set_dclk_reg()
397 struct ast_private *ast = crtc->dev->dev_private; in ast_set_ext_reg() local
419 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa0, 0x8f, jregA0); in ast_set_ext_reg()
420 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa3, 0xf0, jregA3); in ast_set_ext_reg()
421 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa8, 0xfd, jregA8); in ast_set_ext_reg()
424 if (ast->chip == AST2300 || ast->chip == AST2400) { in ast_set_ext_reg()
425 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa7, 0x78); in ast_set_ext_reg()
426 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa6, 0x60); in ast_set_ext_reg()
427 } else if (ast->chip == AST2100 || in ast_set_ext_reg()
428 ast->chip == AST1100 || in ast_set_ext_reg()
429 ast->chip == AST2200 || in ast_set_ext_reg()
430 ast->chip == AST2150) { in ast_set_ext_reg()
431 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa7, 0x3f); in ast_set_ext_reg()
432 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa6, 0x2f); in ast_set_ext_reg()
434 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa7, 0x2f); in ast_set_ext_reg()
435 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa6, 0x1f); in ast_set_ext_reg()
442 struct ast_private *ast = dev->dev_private; in ast_set_sync_reg() local
445 jreg = ast_io_read8(ast, AST_IO_MISC_PORT_READ); in ast_set_sync_reg()
449 ast_io_write8(ast, AST_IO_MISC_PORT_WRITE, jreg); in ast_set_sync_reg()
466 struct ast_private *ast = crtc->dev->dev_private; in ast_set_start_address_crt1() local
470 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x0d, (u8)(addr & 0xff)); in ast_set_start_address_crt1()
471 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x0c, (u8)((addr >> 8) & 0xff)); in ast_set_start_address_crt1()
472 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xaf, (u8)((addr >> 16) & 0xff)); in ast_set_start_address_crt1()
478 struct ast_private *ast = crtc->dev->dev_private; in ast_crtc_dpms() local
480 if (ast->chip == AST1180) in ast_crtc_dpms()
487 ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x1, 0xdf, 0); in ast_crtc_dpms()
488 if (ast->tx_chip_type == AST_TX_DP501) in ast_crtc_dpms()
493 if (ast->tx_chip_type == AST_TX_DP501) in ast_crtc_dpms()
495 ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x1, 0xdf, 0x20); in ast_crtc_dpms()
512 struct ast_private *ast = crtc->dev->dev_private; in ast_crtc_do_set_base() local
545 if (&ast->fbdev->afb == ast_fb) { in ast_crtc_do_set_base()
551 ast_fbdev_set_base(ast, gpu_addr); in ast_crtc_do_set_base()
574 struct ast_private *ast = crtc->dev->dev_private; in ast_crtc_mode_set() local
577 if (ast->chip == AST1180) { in ast_crtc_mode_set()
585 ast_open_key(ast); in ast_crtc_mode_set()
587 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04); in ast_crtc_mode_set()
614 struct ast_private *ast = crtc->dev->dev_private; in ast_crtc_commit() local
615 ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x1, 0xdf, 0); in ast_crtc_commit()
765 struct ast_private *ast = connector->dev->dev_private; in ast_get_modes() local
769 if (ast->tx_chip_type == AST_TX_DP501) { in ast_get_modes()
770 ast->dp501_maxclk = 0xff; in ast_get_modes()
777 ast->dp501_maxclk = ast_get_dp501_max_clk(connector->dev); in ast_get_modes()
796 struct ast_private *ast = connector->dev->dev_private; in ast_mode_valid() local
800 if (ast->support_wide_screen) { in ast_mode_valid()
812 …if ((ast->chip == AST2100) || (ast->chip == AST2200) || (ast->chip == AST2300) || (ast->chip == AS… in ast_mode_valid()
817 jtemp = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd1, 0xff); in ast_mode_valid()
911 struct ast_private *ast = dev->dev_private; in ast_cursor_init() local
934 ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &ast->cache_kmap); in ast_cursor_init()
938 ast->cursor_cache = obj; in ast_cursor_init()
939 ast->cursor_cache_gpu_addr = gpu_addr; in ast_cursor_init()
940 DRM_DEBUG_KMS("pinned cursor cache at %llx\n", ast->cursor_cache_gpu_addr); in ast_cursor_init()
948 struct ast_private *ast = dev->dev_private; in ast_cursor_fini() local
949 ttm_bo_kunmap(&ast->cache_kmap); in ast_cursor_fini()
950 drm_gem_object_unreference_unlocked(ast->cursor_cache); in ast_cursor_fini()
970 struct ast_private *ast = i2c->dev->dev_private; in get_clock() local
975 val = (ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb7, 0x10) >> 4) & 0x01; in get_clock()
977 val2 = (ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb7, 0x10) >> 4) & 0x01; in get_clock()
982 val = (ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb7, 0x10) >> 4) & 0x01; in get_clock()
992 struct ast_private *ast = i2c->dev->dev_private; in get_data() local
997 val = (ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb7, 0x20) >> 5) & 0x01; in get_data()
999 val2 = (ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb7, 0x20) >> 5) & 0x01; in get_data()
1004 val = (ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb7, 0x20) >> 5) & 0x01; in get_data()
1014 struct ast_private *ast = i2c->dev->dev_private; in set_clock() local
1020 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb7, 0xf4, ujcrb7); in set_clock()
1021 jtemp = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb7, 0x01); in set_clock()
1030 struct ast_private *ast = i2c->dev->dev_private; in set_data() local
1036 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb7, 0xf1, ujcrb7); in set_data()
1037 jtemp = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb7, 0x04); in set_data()
1090 struct ast_private *ast = crtc->dev->dev_private; in ast_show_cursor() local
1096 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xcb, 0xfc, jreg); in ast_show_cursor()
1101 struct ast_private *ast = crtc->dev->dev_private; in ast_hide_cursor() local
1102 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xcb, 0xfc, 0x00); in ast_hide_cursor()
1167 struct ast_private *ast = crtc->dev->dev_private; in ast_cursor_set() local
1199 dst = ttm_kmap_obj_virtual(&ast->cache_kmap, &dst_isiomem); in ast_cursor_set()
1206 dst += (AST_HWC_SIZE + AST_HWC_SIGNATURE_SIZE)*ast->next_cursor; in ast_cursor_set()
1215 …u8 *dst = (u8 *)ast->cache_kmap.virtual + (AST_HWC_SIZE + AST_HWC_SIGNATURE_SIZE)*ast->next_cursor… in ast_cursor_set()
1223 gpu_addr = ast->cursor_cache_gpu_addr; in ast_cursor_set()
1224 gpu_addr += (AST_HWC_SIZE + AST_HWC_SIGNATURE_SIZE)*ast->next_cursor; in ast_cursor_set()
1226 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc8, gpu_addr & 0xff); in ast_cursor_set()
1227 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc9, (gpu_addr >> 8) & 0xff); in ast_cursor_set()
1228 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xca, (gpu_addr >> 16) & 0xff); in ast_cursor_set()
1235 ast->next_cursor = (ast->next_cursor + 1) % AST_DEFAULT_HWC_NUM; in ast_cursor_set()
1250 struct ast_private *ast = crtc->dev->dev_private; in ast_cursor_move() local
1254 …sig = (u8 *)ast->cache_kmap.virtual + (AST_HWC_SIZE + AST_HWC_SIGNATURE_SIZE)*ast->next_cursor + A… in ast_cursor_move()
1269 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc2, x_offset); in ast_cursor_move()
1270 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc3, y_offset); in ast_cursor_move()
1271 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc4, (x & 0xff)); in ast_cursor_move()
1272 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc5, ((x >> 8) & 0x0f)); in ast_cursor_move()
1273 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc6, (y & 0xff)); in ast_cursor_move()
1274 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xc7, ((y >> 8) & 0x07)); in ast_cursor_move()