Lines Matching +full:ast2500 +full:- +full:i2c +full:- +full:bus

3  * Parts based on xf86-video-ast
16 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
51 static void ast_i2c_destroy(struct ast_i2c_chan *i2c);
72 if (!crtc->enabled) in ast_crtc_load_lut()
75 r = crtc->gamma_store; in ast_crtc_load_lut()
76 g = r + crtc->gamma_size; in ast_crtc_load_lut()
77 b = g + crtc->gamma_size; in ast_crtc_load_lut()
93 switch (format->cpp[0] * 8) { in ast_get_vbios_mode_info()
95 vbios_mode->std_table = &vbios_stdtable[VGAModeIndex]; in ast_get_vbios_mode_info()
98 vbios_mode->std_table = &vbios_stdtable[HiCModeIndex]; in ast_get_vbios_mode_info()
102 vbios_mode->std_table = &vbios_stdtable[TrueCModeIndex]; in ast_get_vbios_mode_info()
108 switch (mode->crtc_hdisplay) { in ast_get_vbios_mode_info()
110 vbios_mode->enh_table = &res_640x480[refresh_rate_index]; in ast_get_vbios_mode_info()
113 vbios_mode->enh_table = &res_800x600[refresh_rate_index]; in ast_get_vbios_mode_info()
116 vbios_mode->enh_table = &res_1024x768[refresh_rate_index]; in ast_get_vbios_mode_info()
119 if (mode->crtc_vdisplay == 800) in ast_get_vbios_mode_info()
120 vbios_mode->enh_table = &res_1280x800[refresh_rate_index]; in ast_get_vbios_mode_info()
122 vbios_mode->enh_table = &res_1280x1024[refresh_rate_index]; in ast_get_vbios_mode_info()
125 vbios_mode->enh_table = &res_1360x768[refresh_rate_index]; in ast_get_vbios_mode_info()
128 vbios_mode->enh_table = &res_1440x900[refresh_rate_index]; in ast_get_vbios_mode_info()
131 if (mode->crtc_vdisplay == 900) in ast_get_vbios_mode_info()
132 vbios_mode->enh_table = &res_1600x900[refresh_rate_index]; in ast_get_vbios_mode_info()
134 vbios_mode->enh_table = &res_1600x1200[refresh_rate_index]; in ast_get_vbios_mode_info()
137 vbios_mode->enh_table = &res_1680x1050[refresh_rate_index]; in ast_get_vbios_mode_info()
140 if (mode->crtc_vdisplay == 1080) in ast_get_vbios_mode_info()
141 vbios_mode->enh_table = &res_1920x1080[refresh_rate_index]; in ast_get_vbios_mode_info()
143 vbios_mode->enh_table = &res_1920x1200[refresh_rate_index]; in ast_get_vbios_mode_info()
150 check_sync = vbios_mode->enh_table->flags & WideScreenMode; in ast_get_vbios_mode_info()
153 const struct ast_vbios_enhtable *loop = vbios_mode->enh_table; in ast_get_vbios_mode_info()
155 while (loop->refresh_rate != 0xff) { in ast_get_vbios_mode_info()
157 (((mode->flags & DRM_MODE_FLAG_NVSYNC) && in ast_get_vbios_mode_info()
158 (loop->flags & PVSync)) || in ast_get_vbios_mode_info()
159 ((mode->flags & DRM_MODE_FLAG_PVSYNC) && in ast_get_vbios_mode_info()
160 (loop->flags & NVSync)) || in ast_get_vbios_mode_info()
161 ((mode->flags & DRM_MODE_FLAG_NHSYNC) && in ast_get_vbios_mode_info()
162 (loop->flags & PHSync)) || in ast_get_vbios_mode_info()
163 ((mode->flags & DRM_MODE_FLAG_PHSYNC) && in ast_get_vbios_mode_info()
164 (loop->flags & NHSync)))) { in ast_get_vbios_mode_info()
168 if (loop->refresh_rate <= refresh_rate in ast_get_vbios_mode_info()
169 && (!best || loop->refresh_rate > best->refresh_rate)) in ast_get_vbios_mode_info()
179 vbios_mode->enh_table = best; in ast_get_vbios_mode_info()
181 hborder = (vbios_mode->enh_table->flags & HBorder) ? 8 : 0; in ast_get_vbios_mode_info()
182 vborder = (vbios_mode->enh_table->flags & VBorder) ? 8 : 0; in ast_get_vbios_mode_info()
184 adjusted_mode->crtc_htotal = vbios_mode->enh_table->ht; in ast_get_vbios_mode_info()
185 adjusted_mode->crtc_hblank_start = vbios_mode->enh_table->hde + hborder; in ast_get_vbios_mode_info()
186 adjusted_mode->crtc_hblank_end = vbios_mode->enh_table->ht - hborder; in ast_get_vbios_mode_info()
187 adjusted_mode->crtc_hsync_start = vbios_mode->enh_table->hde + hborder + in ast_get_vbios_mode_info()
188 vbios_mode->enh_table->hfp; in ast_get_vbios_mode_info()
189 adjusted_mode->crtc_hsync_end = (vbios_mode->enh_table->hde + hborder + in ast_get_vbios_mode_info()
190 vbios_mode->enh_table->hfp + in ast_get_vbios_mode_info()
191 vbios_mode->enh_table->hsync); in ast_get_vbios_mode_info()
193 adjusted_mode->crtc_vtotal = vbios_mode->enh_table->vt; in ast_get_vbios_mode_info()
194 adjusted_mode->crtc_vblank_start = vbios_mode->enh_table->vde + vborder; in ast_get_vbios_mode_info()
195 adjusted_mode->crtc_vblank_end = vbios_mode->enh_table->vt - vborder; in ast_get_vbios_mode_info()
196 adjusted_mode->crtc_vsync_start = vbios_mode->enh_table->vde + vborder + in ast_get_vbios_mode_info()
197 vbios_mode->enh_table->vfp; in ast_get_vbios_mode_info()
198 adjusted_mode->crtc_vsync_end = (vbios_mode->enh_table->vde + vborder + in ast_get_vbios_mode_info()
199 vbios_mode->enh_table->vfp + in ast_get_vbios_mode_info()
200 vbios_mode->enh_table->vsync); in ast_get_vbios_mode_info()
211 switch (format->cpp[0]) { in ast_set_vbios_color_reg()
213 color_index = VGAModeIndex - 1; in ast_set_vbios_color_reg()
230 if (vbios_mode->enh_table->flags & NewModeInfo) { in ast_set_vbios_color_reg()
232 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x92, format->cpp[0] * 8); in ast_set_vbios_color_reg()
242 refresh_rate_index = vbios_mode->enh_table->refresh_rate_index; in ast_set_vbios_mode_reg()
243 mode_id = vbios_mode->enh_table->mode_id; in ast_set_vbios_mode_reg()
250 if (vbios_mode->enh_table->flags & NewModeInfo) { in ast_set_vbios_mode_reg()
252 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x93, adjusted_mode->clock / 1000); in ast_set_vbios_mode_reg()
253 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x94, adjusted_mode->crtc_hdisplay); in ast_set_vbios_mode_reg()
254 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x95, adjusted_mode->crtc_hdisplay >> 8); in ast_set_vbios_mode_reg()
255 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x96, adjusted_mode->crtc_vdisplay); in ast_set_vbios_mode_reg()
256 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x97, adjusted_mode->crtc_vdisplay >> 8); in ast_set_vbios_mode_reg()
268 stdtable = vbios_mode->std_table; in ast_set_std_reg()
270 jreg = stdtable->misc; in ast_set_std_reg()
275 ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x01, 0xdf, stdtable->seq[0]); in ast_set_std_reg()
277 jreg = stdtable->seq[i]; in ast_set_std_reg()
284 ast_set_index_reg(ast, AST_IO_CRTC_PORT, i, stdtable->crtc[i]); in ast_set_std_reg()
286 ast_set_index_reg(ast, AST_IO_CRTC_PORT, i, stdtable->crtc[i]); in ast_set_std_reg()
288 ast_set_index_reg(ast, AST_IO_CRTC_PORT, i, stdtable->crtc[i]); in ast_set_std_reg()
293 jreg = stdtable->ar[i]; in ast_set_std_reg()
305 ast_set_index_reg(ast, AST_IO_GR_PORT, i, stdtable->gr[i]); in ast_set_std_reg()
315 if ((ast->chip == AST2500) && in ast_set_crtc_reg()
316 (vbios_mode->enh_table->flags & AST2500PreCatchCRT)) in ast_set_crtc_reg()
321 temp = (mode->crtc_htotal >> 3) - 5; in ast_set_crtc_reg()
326 temp = (mode->crtc_hdisplay >> 3) - 1; in ast_set_crtc_reg()
331 temp = (mode->crtc_hblank_start >> 3) - 1; in ast_set_crtc_reg()
336 temp = ((mode->crtc_hblank_end >> 3) - 1) & 0x7f; in ast_set_crtc_reg()
343 temp = ((mode->crtc_hsync_start-precache) >> 3) - 1; in ast_set_crtc_reg()
348 temp = (((mode->crtc_hsync_end-precache) >> 3) - 1) & 0x3f; in ast_set_crtc_reg()
357 temp = (mode->crtc_vtotal) - 2; in ast_set_crtc_reg()
366 temp = (mode->crtc_vsync_start) - 1; in ast_set_crtc_reg()
375 temp = (mode->crtc_vsync_end - 1) & 0x3f; in ast_set_crtc_reg()
382 temp = mode->crtc_vdisplay - 1; in ast_set_crtc_reg()
391 temp = mode->crtc_vblank_start - 1; in ast_set_crtc_reg()
400 temp = mode->crtc_vblank_end - 1; in ast_set_crtc_reg()
422 offset = fb->pitches[0] >> 3; in ast_set_offset_reg()
433 if (ast->chip == AST2500) in ast_set_dclk_reg()
434 clk_info = &dclk_table_ast2500[vbios_mode->enh_table->dclk_index]; in ast_set_dclk_reg()
436 clk_info = &dclk_table[vbios_mode->enh_table->dclk_index]; in ast_set_dclk_reg()
438 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xc0, 0x00, clk_info->param1); in ast_set_dclk_reg()
439 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xc1, 0x00, clk_info->param2); in ast_set_dclk_reg()
441 (clk_info->param3 & 0xc0) | in ast_set_dclk_reg()
442 ((clk_info->param3 & 0x3) << 4)); in ast_set_dclk_reg()
450 switch (format->cpp[0] * 8) { in ast_set_color_reg()
477 if (ast->chip == AST2300 || ast->chip == AST2400 || in ast_set_crtthd_reg()
478 ast->chip == AST2500) { in ast_set_crtthd_reg()
481 } else if (ast->chip == AST2100 || in ast_set_crtthd_reg()
482 ast->chip == AST1100 || in ast_set_crtthd_reg()
483 ast->chip == AST2200 || in ast_set_crtthd_reg()
484 ast->chip == AST2150) { in ast_set_crtthd_reg()
501 if (vbios_mode->enh_table->flags & NVSync) in ast_set_sync_reg()
503 if (vbios_mode->enh_table->flags & NHSync) in ast_set_sync_reg()
549 if (!new_plane_state->crtc) in ast_primary_plane_helper_atomic_check()
553 new_plane_state->crtc); in ast_primary_plane_helper_atomic_check()
562 if (!new_plane_state->visible) in ast_primary_plane_helper_atomic_check()
567 ast_crtc_state->format = new_plane_state->fb->format; in ast_primary_plane_helper_atomic_check()
578 struct drm_device *dev = plane->dev; in ast_primary_plane_helper_atomic_update()
584 struct drm_framebuffer *fb = new_state->fb; in ast_primary_plane_helper_atomic_update()
585 struct drm_framebuffer *old_fb = old_state->fb; in ast_primary_plane_helper_atomic_update()
587 if (!old_fb || (fb->format != old_fb->format)) { in ast_primary_plane_helper_atomic_update()
588 struct drm_crtc_state *crtc_state = new_state->crtc->state; in ast_primary_plane_helper_atomic_update()
590 struct ast_vbios_mode_info *vbios_mode_info = &ast_crtc_state->vbios_mode_info; in ast_primary_plane_helper_atomic_update()
592 ast_set_color_reg(ast, fb->format); in ast_primary_plane_helper_atomic_update()
593 ast_set_vbios_color_reg(ast, fb->format, vbios_mode_info); in ast_primary_plane_helper_atomic_update()
596 gbo = drm_gem_vram_of_gem(fb->obj[0]); in ast_primary_plane_helper_atomic_update()
611 struct ast_private *ast = to_ast_private(plane->dev); in ast_primary_plane_helper_atomic_disable()
634 struct drm_device *dev = &ast->base; in ast_primary_plane_init()
635 struct drm_plane *primary_plane = &ast->primary_plane; in ast_primary_plane_init()
674 last_alpha_dst_delta = alpha_dst_delta - (width << 1); in ast_update_cursor_image()
677 dstxor = (u8 *)dst + last_alpha_dst_delta + (AST_MAX_HWC_HEIGHT - height) * alpha_dst_delta; in ast_update_cursor_image()
769 struct drm_framebuffer *fb = new_plane_state->fb; in ast_cursor_plane_helper_atomic_check()
773 if (!new_plane_state->crtc) in ast_cursor_plane_helper_atomic_check()
777 new_plane_state->crtc); in ast_cursor_plane_helper_atomic_check()
786 if (!new_plane_state->visible) in ast_cursor_plane_helper_atomic_check()
789 if (fb->width > AST_MAX_HWC_WIDTH || fb->height > AST_MAX_HWC_HEIGHT) in ast_cursor_plane_helper_atomic_check()
790 return -EINVAL; in ast_cursor_plane_helper_atomic_check()
805 struct drm_framebuffer *fb = new_state->fb; in ast_cursor_plane_helper_atomic_update()
806 struct ast_private *ast = to_ast_private(plane->dev); in ast_cursor_plane_helper_atomic_update()
808 ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].map; in ast_cursor_plane_helper_atomic_update()
810 ast_cursor_plane->hwc[ast_cursor_plane->next_hwc_index].off; in ast_cursor_plane_helper_atomic_update()
811 struct dma_buf_map src_map = shadow_plane_state->data[0]; in ast_cursor_plane_helper_atomic_update()
825 * point the scanout engine to dst_gbo's offset and page-flip the HWC buffers. in ast_cursor_plane_helper_atomic_update()
828 ast_update_cursor_image(dst, src, fb->width, fb->height); in ast_cursor_plane_helper_atomic_update()
830 if (new_state->fb != old_state->fb) { in ast_cursor_plane_helper_atomic_update()
833 ++ast_cursor_plane->next_hwc_index; in ast_cursor_plane_helper_atomic_update()
834 ast_cursor_plane->next_hwc_index %= ARRAY_SIZE(ast_cursor_plane->hwc); in ast_cursor_plane_helper_atomic_update()
841 writel(new_state->crtc_x, sig + AST_HWC_SIGNATURE_X); in ast_cursor_plane_helper_atomic_update()
842 writel(new_state->crtc_y, sig + AST_HWC_SIGNATURE_Y); in ast_cursor_plane_helper_atomic_update()
844 offset_x = AST_MAX_HWC_WIDTH - fb->width; in ast_cursor_plane_helper_atomic_update()
845 offset_y = AST_MAX_HWC_HEIGHT - fb->height; in ast_cursor_plane_helper_atomic_update()
847 if (new_state->crtc_x < 0) { in ast_cursor_plane_helper_atomic_update()
848 x_offset = (-new_state->crtc_x) + offset_x; in ast_cursor_plane_helper_atomic_update()
852 x = new_state->crtc_x; in ast_cursor_plane_helper_atomic_update()
854 if (new_state->crtc_y < 0) { in ast_cursor_plane_helper_atomic_update()
855 y_offset = (-new_state->crtc_y) + offset_y; in ast_cursor_plane_helper_atomic_update()
859 y = new_state->crtc_y; in ast_cursor_plane_helper_atomic_update()
864 /* Dummy write to enable HWC and make the HW pick-up the changes. */ in ast_cursor_plane_helper_atomic_update()
872 struct ast_private *ast = to_ast_private(plane->dev); in ast_cursor_plane_helper_atomic_disable()
891 for (i = 0; i < ARRAY_SIZE(ast_cursor_plane->hwc); ++i) { in ast_cursor_plane_destroy()
892 gbo = ast_cursor_plane->hwc[i].gbo; in ast_cursor_plane_destroy()
893 map = ast_cursor_plane->hwc[i].map; in ast_cursor_plane_destroy()
911 struct drm_device *dev = &ast->base; in ast_cursor_plane_init()
912 struct ast_cursor_plane *ast_cursor_plane = &ast->cursor_plane; in ast_cursor_plane_init()
913 struct drm_plane *cursor_plane = &ast_cursor_plane->base; in ast_cursor_plane_init()
927 for (i = 0; i < ARRAY_SIZE(ast_cursor_plane->hwc); ++i) { in ast_cursor_plane_init()
945 ast_cursor_plane->hwc[i].gbo = gbo; in ast_cursor_plane_init()
946 ast_cursor_plane->hwc[i].map = map; in ast_cursor_plane_init()
947 ast_cursor_plane->hwc[i].off = off; in ast_cursor_plane_init()
970 --i; in ast_cursor_plane_init()
971 gbo = ast_cursor_plane->hwc[i].gbo; in ast_cursor_plane_init()
972 map = ast_cursor_plane->hwc[i].map; in ast_cursor_plane_init()
989 struct ast_private *ast = to_ast_private(crtc->dev); in ast_crtc_dpms()
998 if (ast->tx_chip_type == AST_TX_DP501) in ast_crtc_dpms()
999 ast_set_dp501_video_output(crtc->dev, 1); in ast_crtc_dpms()
1002 if (ast->tx_chip_type == AST_TX_DP501) in ast_crtc_dpms()
1003 ast_set_dp501_video_output(crtc->dev, 0); in ast_crtc_dpms()
1013 struct drm_device *dev = crtc->dev; in ast_crtc_helper_atomic_check()
1018 if (!crtc_state->enable) in ast_crtc_helper_atomic_check()
1023 format = ast_state->format; in ast_crtc_helper_atomic_check()
1025 return -EINVAL; /* BUG: We didn't set format in primary check(). */ in ast_crtc_helper_atomic_check()
1027 succ = ast_get_vbios_mode_info(format, &crtc_state->mode, in ast_crtc_helper_atomic_check()
1028 &crtc_state->adjusted_mode, in ast_crtc_helper_atomic_check()
1029 &ast_state->vbios_mode_info); in ast_crtc_helper_atomic_check()
1031 return -EINVAL; in ast_crtc_helper_atomic_check()
1044 struct ast_private *ast = to_ast_private(crtc->dev); in ast_crtc_helper_atomic_flush()
1052 if (old_ast_crtc_state->format != ast_crtc_state->format) in ast_crtc_helper_atomic_flush()
1060 struct drm_device *dev = crtc->dev; in ast_crtc_helper_atomic_enable()
1062 struct drm_crtc_state *crtc_state = crtc->state; in ast_crtc_helper_atomic_enable()
1065 &ast_crtc_state->vbios_mode_info; in ast_crtc_helper_atomic_enable()
1066 struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; in ast_crtc_helper_atomic_enable()
1085 struct drm_device *dev = crtc->dev; in ast_crtc_helper_atomic_disable()
1095 * helper will re-enable it if necessary. in ast_crtc_helper_atomic_disable()
1121 if (crtc->state) in ast_crtc_reset()
1122 crtc->funcs->atomic_destroy_state(crtc, crtc->state); in ast_crtc_reset()
1124 __drm_atomic_helper_crtc_reset(crtc, &ast_state->base); in ast_crtc_reset()
1131 struct drm_device *dev = crtc->dev; in ast_crtc_atomic_duplicate_state()
1133 if (drm_WARN_ON(dev, !crtc->state)) in ast_crtc_atomic_duplicate_state()
1139 __drm_atomic_helper_crtc_duplicate_state(crtc, &new_ast_state->base); in ast_crtc_atomic_duplicate_state()
1141 ast_state = to_ast_crtc_state(crtc->state); in ast_crtc_atomic_duplicate_state()
1143 new_ast_state->format = ast_state->format; in ast_crtc_atomic_duplicate_state()
1144 memcpy(&new_ast_state->vbios_mode_info, &ast_state->vbios_mode_info, in ast_crtc_atomic_duplicate_state()
1145 sizeof(new_ast_state->vbios_mode_info)); in ast_crtc_atomic_duplicate_state()
1147 return &new_ast_state->base; in ast_crtc_atomic_duplicate_state()
1155 __drm_atomic_helper_crtc_destroy_state(&ast_state->base); in ast_crtc_atomic_destroy_state()
1171 struct drm_crtc *crtc = &ast->crtc; in ast_crtc_init()
1174 ret = drm_crtc_init_with_planes(dev, crtc, &ast->primary_plane, in ast_crtc_init()
1175 &ast->cursor_plane.base, &ast_crtc_funcs, in ast_crtc_init()
1193 struct drm_encoder *encoder = &ast->encoder; in ast_encoder_init()
1200 encoder->possible_crtcs = 1; in ast_encoder_init()
1212 struct ast_private *ast = to_ast_private(connector->dev); in ast_get_modes()
1217 if (ast->tx_chip_type == AST_TX_DP501) { in ast_get_modes()
1218 ast->dp501_maxclk = 0xff; in ast_get_modes()
1221 return -ENOMEM; in ast_get_modes()
1223 flags = ast_dp501_read_edid(connector->dev, (u8 *)edid); in ast_get_modes()
1225 ast->dp501_maxclk = ast_get_dp501_max_clk(connector->dev); in ast_get_modes()
1230 edid = drm_get_edid(connector, &ast_connector->i2c->adapter); in ast_get_modes()
1232 drm_connector_update_edid_property(&ast_connector->base, edid); in ast_get_modes()
1237 drm_connector_update_edid_property(&ast_connector->base, NULL); in ast_get_modes()
1244 struct ast_private *ast = to_ast_private(connector->dev); in ast_mode_valid()
1248 if (ast->support_wide_screen) { in ast_mode_valid()
1249 if ((mode->hdisplay == 1680) && (mode->vdisplay == 1050)) in ast_mode_valid()
1251 if ((mode->hdisplay == 1280) && (mode->vdisplay == 800)) in ast_mode_valid()
1253 if ((mode->hdisplay == 1440) && (mode->vdisplay == 900)) in ast_mode_valid()
1255 if ((mode->hdisplay == 1360) && (mode->vdisplay == 768)) in ast_mode_valid()
1257 if ((mode->hdisplay == 1600) && (mode->vdisplay == 900)) in ast_mode_valid()
1260 if ((ast->chip == AST2100) || (ast->chip == AST2200) || in ast_mode_valid()
1261 (ast->chip == AST2300) || (ast->chip == AST2400) || in ast_mode_valid()
1262 (ast->chip == AST2500)) { in ast_mode_valid()
1263 if ((mode->hdisplay == 1920) && (mode->vdisplay == 1080)) in ast_mode_valid()
1266 if ((mode->hdisplay == 1920) && (mode->vdisplay == 1200)) { in ast_mode_valid()
1275 switch (mode->hdisplay) { in ast_mode_valid()
1277 if (mode->vdisplay == 480) in ast_mode_valid()
1281 if (mode->vdisplay == 600) in ast_mode_valid()
1285 if (mode->vdisplay == 768) in ast_mode_valid()
1289 if (mode->vdisplay == 1024) in ast_mode_valid()
1293 if (mode->vdisplay == 1200) in ast_mode_valid()
1307 ast_i2c_destroy(ast_connector->i2c); in ast_connector_destroy()
1327 struct ast_connector *ast_connector = &ast->connector; in ast_connector_init()
1328 struct drm_connector *connector = &ast_connector->base; in ast_connector_init()
1329 struct drm_encoder *encoder = &ast->encoder; in ast_connector_init()
1331 ast_connector->i2c = ast_i2c_create(dev); in ast_connector_init()
1332 if (!ast_connector->i2c) in ast_connector_init()
1333 drm_err(dev, "failed to add ddc bus for connector\n"); in ast_connector_init()
1338 &ast_connector->i2c->adapter); in ast_connector_init()
1342 connector->interlace_allowed = 0; in ast_connector_init()
1343 connector->doublescan_allowed = 0; in ast_connector_init()
1345 connector->polled = DRM_CONNECTOR_POLL_CONNECT; in ast_connector_init()
1370 struct drm_device *dev = &ast->base; in ast_mode_config_init()
1371 struct pci_dev *pdev = to_pci_dev(dev->dev); in ast_mode_config_init()
1378 dev->mode_config.funcs = &ast_mode_config_funcs; in ast_mode_config_init()
1379 dev->mode_config.min_width = 0; in ast_mode_config_init()
1380 dev->mode_config.min_height = 0; in ast_mode_config_init()
1381 dev->mode_config.preferred_depth = 24; in ast_mode_config_init()
1382 dev->mode_config.prefer_shadow = 1; in ast_mode_config_init()
1383 dev->mode_config.fb_base = pci_resource_start(pdev, 0); in ast_mode_config_init()
1385 if (ast->chip == AST2100 || in ast_mode_config_init()
1386 ast->chip == AST2200 || in ast_mode_config_init()
1387 ast->chip == AST2300 || in ast_mode_config_init()
1388 ast->chip == AST2400 || in ast_mode_config_init()
1389 ast->chip == AST2500) { in ast_mode_config_init()
1390 dev->mode_config.max_width = 1920; in ast_mode_config_init()
1391 dev->mode_config.max_height = 2048; in ast_mode_config_init()
1393 dev->mode_config.max_width = 1600; in ast_mode_config_init()
1394 dev->mode_config.max_height = 1200; in ast_mode_config_init()
1397 dev->mode_config.helper_private = &ast_mode_config_helper_funcs; in ast_mode_config_init()
1419 struct ast_i2c_chan *i2c = i2c_priv; in get_clock() local
1420 struct ast_private *ast = to_ast_private(i2c->dev); in get_clock()
1441 struct ast_i2c_chan *i2c = i2c_priv; in get_data() local
1442 struct ast_private *ast = to_ast_private(i2c->dev); in get_data()
1463 struct ast_i2c_chan *i2c = i2c_priv; in set_clock() local
1464 struct ast_private *ast = to_ast_private(i2c->dev); in set_clock()
1479 struct ast_i2c_chan *i2c = i2c_priv; in set_data() local
1480 struct ast_private *ast = to_ast_private(i2c->dev); in set_data()
1495 struct ast_i2c_chan *i2c; in ast_i2c_create() local
1498 i2c = kzalloc(sizeof(struct ast_i2c_chan), GFP_KERNEL); in ast_i2c_create()
1499 if (!i2c) in ast_i2c_create()
1502 i2c->adapter.owner = THIS_MODULE; in ast_i2c_create()
1503 i2c->adapter.class = I2C_CLASS_DDC; in ast_i2c_create()
1504 i2c->adapter.dev.parent = dev->dev; in ast_i2c_create()
1505 i2c->dev = dev; in ast_i2c_create()
1506 i2c_set_adapdata(&i2c->adapter, i2c); in ast_i2c_create()
1507 snprintf(i2c->adapter.name, sizeof(i2c->adapter.name), in ast_i2c_create()
1508 "AST i2c bit bus"); in ast_i2c_create()
1509 i2c->adapter.algo_data = &i2c->bit; in ast_i2c_create()
1511 i2c->bit.udelay = 20; in ast_i2c_create()
1512 i2c->bit.timeout = 2; in ast_i2c_create()
1513 i2c->bit.data = i2c; in ast_i2c_create()
1514 i2c->bit.setsda = set_data; in ast_i2c_create()
1515 i2c->bit.setscl = set_clock; in ast_i2c_create()
1516 i2c->bit.getsda = get_data; in ast_i2c_create()
1517 i2c->bit.getscl = get_clock; in ast_i2c_create()
1518 ret = i2c_bit_add_bus(&i2c->adapter); in ast_i2c_create()
1520 drm_err(dev, "Failed to register bit i2c\n"); in ast_i2c_create()
1524 return i2c; in ast_i2c_create()
1526 kfree(i2c); in ast_i2c_create()
1530 static void ast_i2c_destroy(struct ast_i2c_chan *i2c) in ast_i2c_destroy() argument
1532 if (!i2c) in ast_i2c_destroy()
1534 i2c_del_adapter(&i2c->adapter); in ast_i2c_destroy()
1535 kfree(i2c); in ast_i2c_destroy()