Lines Matching +full:fixed +full:- +full:clock

2  * Copyright © 2006-2009 Intel Corporation
15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
34 /* The max/min PWM frequency in BPCR[31:17] - */
36 * 15-bit field of the and then*/
37 /* shifts to the left by one bit to get the actual 16-bit
38 * value that the 15-bits correspond to.*/
50 struct drm_psb_private *dev_priv = dev->dev_private; in oaktrail_lvds_set_power()
61 dev_priv->is_lvds_on = true; in oaktrail_lvds_set_power()
62 if (dev_priv->ops->lvds_bl_power) in oaktrail_lvds_set_power()
63 dev_priv->ops->lvds_bl_power(dev, true); in oaktrail_lvds_set_power()
65 if (dev_priv->ops->lvds_bl_power) in oaktrail_lvds_set_power()
66 dev_priv->ops->lvds_bl_power(dev, false); in oaktrail_lvds_set_power()
72 dev_priv->is_lvds_on = false; in oaktrail_lvds_set_power()
73 pm_request_idle(&dev->pdev->dev); in oaktrail_lvds_set_power()
80 struct drm_device *dev = encoder->dev; in oaktrail_lvds_dpms()
96 struct drm_device *dev = encoder->dev; in oaktrail_lvds_mode_set()
97 struct drm_psb_private *dev_priv = dev->dev_private; in oaktrail_lvds_mode_set()
98 struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; in oaktrail_lvds_mode_set()
99 struct drm_mode_config *mode_config = &dev->mode_config; in oaktrail_lvds_mode_set()
101 struct drm_crtc *crtc = encoder->crtc; in oaktrail_lvds_mode_set()
120 if (mode_dev->panel_wants_dither || dev_priv->lvds_dither) in oaktrail_lvds_mode_set()
126 list_for_each_entry(connector, &mode_config->connector_list, head) { in oaktrail_lvds_mode_set()
127 if (!connector->encoder || connector->encoder->crtc != crtc) in oaktrail_lvds_mode_set()
138 dev->mode_config.scaling_mode_property, in oaktrail_lvds_mode_set()
144 if ((mode->vdisplay != adjusted_mode->crtc_vdisplay) || in oaktrail_lvds_mode_set()
145 (mode->hdisplay != adjusted_mode->crtc_hdisplay)) { in oaktrail_lvds_mode_set()
146 if ((adjusted_mode->crtc_hdisplay * mode->vdisplay) == in oaktrail_lvds_mode_set()
147 (mode->hdisplay * adjusted_mode->crtc_vdisplay)) in oaktrail_lvds_mode_set()
149 else if ((adjusted_mode->crtc_hdisplay * in oaktrail_lvds_mode_set()
150 mode->vdisplay) > (mode->hdisplay * in oaktrail_lvds_mode_set()
151 adjusted_mode->crtc_vdisplay)) in oaktrail_lvds_mode_set()
167 struct drm_device *dev = encoder->dev; in oaktrail_lvds_prepare()
168 struct drm_psb_private *dev_priv = dev->dev_private; in oaktrail_lvds_prepare()
171 struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; in oaktrail_lvds_prepare()
176 mode_dev->saveBLC_PWM_CTL = REG_READ(BLC_PWM_CTL); in oaktrail_lvds_prepare()
177 mode_dev->backlight_duty_cycle = (mode_dev->saveBLC_PWM_CTL & in oaktrail_lvds_prepare()
185 struct drm_psb_private *dev_priv = dev->dev_private; in oaktrail_lvds_get_max_backlight()
195 ret = ((dev_priv->saveBLC_PWM_CTL & in oaktrail_lvds_get_max_backlight()
204 struct drm_device *dev = encoder->dev; in oaktrail_lvds_commit()
205 struct drm_psb_private *dev_priv = dev->dev_private; in oaktrail_lvds_commit()
208 struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; in oaktrail_lvds_commit()
210 if (mode_dev->backlight_duty_cycle == 0) in oaktrail_lvds_commit()
211 mode_dev->backlight_duty_cycle = in oaktrail_lvds_commit()
225 /* hard coded fixed mode for TPO LTPS LPJ040K001A */
228 /* hard coded fixed mode for LVDS 800x480 */
231 /* hard coded fixed mode for Samsung 480wsvga LVDS 1024x600@75 */
234 /* hard coded fixed mode for Samsung 480wsvga LVDS 1024x600@75 */
237 /* hard coded fixed mode for Sharp wsvga LVDS 1024x600 */
240 /* hard coded fixed mode for LVDS 1024x768 */
243 /* hard coded fixed mode for LVDS 1366x768 */
248 /* Returns the panel fixed mode from configuration. */
254 struct drm_psb_private *dev_priv = dev->dev_private; in oaktrail_lvds_get_configuration_mode()
255 struct oaktrail_timing_info *ti = &dev_priv->gct_data.DTD; in oaktrail_lvds_get_configuration_mode()
257 mode_dev->panel_fixed_mode = NULL; in oaktrail_lvds_get_configuration_mode()
260 if (dev_priv->vbt_data.size != 0x00) { /*if non-zero, then use vbt*/ in oaktrail_lvds_get_configuration_mode()
265 mode->hdisplay = (ti->hactive_hi << 8) | ti->hactive_lo; in oaktrail_lvds_get_configuration_mode()
266 mode->vdisplay = (ti->vactive_hi << 8) | ti->vactive_lo; in oaktrail_lvds_get_configuration_mode()
267 mode->hsync_start = mode->hdisplay + \ in oaktrail_lvds_get_configuration_mode()
268 ((ti->hsync_offset_hi << 8) | \ in oaktrail_lvds_get_configuration_mode()
269 ti->hsync_offset_lo); in oaktrail_lvds_get_configuration_mode()
270 mode->hsync_end = mode->hsync_start + \ in oaktrail_lvds_get_configuration_mode()
271 ((ti->hsync_pulse_width_hi << 8) | \ in oaktrail_lvds_get_configuration_mode()
272 ti->hsync_pulse_width_lo); in oaktrail_lvds_get_configuration_mode()
273 mode->htotal = mode->hdisplay + ((ti->hblank_hi << 8) | \ in oaktrail_lvds_get_configuration_mode()
274 ti->hblank_lo); in oaktrail_lvds_get_configuration_mode()
275 mode->vsync_start = \ in oaktrail_lvds_get_configuration_mode()
276 mode->vdisplay + ((ti->vsync_offset_hi << 4) | \ in oaktrail_lvds_get_configuration_mode()
277 ti->vsync_offset_lo); in oaktrail_lvds_get_configuration_mode()
278 mode->vsync_end = \ in oaktrail_lvds_get_configuration_mode()
279 mode->vsync_start + ((ti->vsync_pulse_width_hi << 4) | \ in oaktrail_lvds_get_configuration_mode()
280 ti->vsync_pulse_width_lo); in oaktrail_lvds_get_configuration_mode()
281 mode->vtotal = mode->vdisplay + \ in oaktrail_lvds_get_configuration_mode()
282 ((ti->vblank_hi << 8) | ti->vblank_lo); in oaktrail_lvds_get_configuration_mode()
283 mode->clock = ti->pixel_clock * 10; in oaktrail_lvds_get_configuration_mode()
285 printk(KERN_INFO "hdisplay is %d\n", mode->hdisplay); in oaktrail_lvds_get_configuration_mode()
286 printk(KERN_INFO "vdisplay is %d\n", mode->vdisplay); in oaktrail_lvds_get_configuration_mode()
287 printk(KERN_INFO "HSS is %d\n", mode->hsync_start); in oaktrail_lvds_get_configuration_mode()
288 printk(KERN_INFO "HSE is %d\n", mode->hsync_end); in oaktrail_lvds_get_configuration_mode()
289 printk(KERN_INFO "htotal is %d\n", mode->htotal); in oaktrail_lvds_get_configuration_mode()
290 printk(KERN_INFO "VSS is %d\n", mode->vsync_start); in oaktrail_lvds_get_configuration_mode()
291 printk(KERN_INFO "VSE is %d\n", mode->vsync_end); in oaktrail_lvds_get_configuration_mode()
292 printk(KERN_INFO "vtotal is %d\n", mode->vtotal); in oaktrail_lvds_get_configuration_mode()
293 printk(KERN_INFO "clock is %d\n", mode->clock); in oaktrail_lvds_get_configuration_mode()
295 mode_dev->panel_fixed_mode = mode; in oaktrail_lvds_get_configuration_mode()
299 if (mode_dev->panel_fixed_mode == NULL && mode_dev->vbt_mode) in oaktrail_lvds_get_configuration_mode()
300 mode_dev->panel_fixed_mode = drm_mode_duplicate(dev, in oaktrail_lvds_get_configuration_mode()
301 mode_dev->vbt_mode); in oaktrail_lvds_get_configuration_mode()
304 if (mode_dev->panel_fixed_mode == NULL) in oaktrail_lvds_get_configuration_mode()
305 if (dev_priv->lfp_lvds_vbt_mode) in oaktrail_lvds_get_configuration_mode()
306 mode_dev->panel_fixed_mode = in oaktrail_lvds_get_configuration_mode()
308 dev_priv->lfp_lvds_vbt_mode); in oaktrail_lvds_get_configuration_mode()
310 if (mode_dev->panel_fixed_mode == NULL) in oaktrail_lvds_get_configuration_mode()
311 mode_dev->panel_fixed_mode in oaktrail_lvds_get_configuration_mode()
314 drm_mode_set_name(mode_dev->panel_fixed_mode); in oaktrail_lvds_get_configuration_mode()
315 drm_mode_set_crtcinfo(mode_dev->panel_fixed_mode, 0); in oaktrail_lvds_get_configuration_mode()
319 * oaktrail_lvds_init - setup LVDS connectors on this device
332 struct drm_psb_private *dev_priv = dev->dev_private; in oaktrail_lvds_init()
346 connector = &psb_intel_connector->base; in oaktrail_lvds_init()
347 encoder = &psb_intel_encoder->base; in oaktrail_lvds_init()
348 dev_priv->is_lvds_on = true; in oaktrail_lvds_init()
358 psb_intel_encoder->type = INTEL_OUTPUT_LVDS; in oaktrail_lvds_init()
363 connector->display_info.subpixel_order = SubPixelHorizontalRGB; in oaktrail_lvds_init()
364 connector->interlace_allowed = false; in oaktrail_lvds_init()
365 connector->doublescan_allowed = false; in oaktrail_lvds_init()
368 dev->mode_config.scaling_mode_property, in oaktrail_lvds_init()
371 dev_priv->backlight_property, in oaktrail_lvds_init()
374 mode_dev->panel_wants_dither = false; in oaktrail_lvds_init()
375 if (dev_priv->vbt_data.size != 0x00) in oaktrail_lvds_init()
376 mode_dev->panel_wants_dither = (dev_priv->gct_data. in oaktrail_lvds_init()
378 if (dev_priv->lvds_dither) in oaktrail_lvds_init()
379 mode_dev->panel_wants_dither = 1; in oaktrail_lvds_init()
391 i2c_adap = i2c_get_adapter(dev_priv->ops->i2c_bus); in oaktrail_lvds_init()
393 dev_err(dev->dev, "No ddc adapter available!\n"); in oaktrail_lvds_init()
395 * Attempt to get the fixed panel mode from DDC. Assume that the in oaktrail_lvds_init()
407 list_for_each_entry(scan, &connector->probed_modes, head) { in oaktrail_lvds_init()
408 if (scan->type & DRM_MODE_TYPE_PREFERRED) { in oaktrail_lvds_init()
409 mode_dev->panel_fixed_mode = in oaktrail_lvds_init()
421 if (mode_dev->panel_fixed_mode) { in oaktrail_lvds_init()
422 mode_dev->panel_fixed_mode->type |= DRM_MODE_TYPE_PREFERRED; in oaktrail_lvds_init()
427 if (!mode_dev->panel_fixed_mode) { in oaktrail_lvds_init()
428 dev_err(dev->dev, "Found no modes on the lvds, ignoring the LVDS\n"); in oaktrail_lvds_init()
437 dev_dbg(dev->dev, "No LVDS modes found, disabling.\n"); in oaktrail_lvds_init()
438 if (psb_intel_encoder->ddc_bus) in oaktrail_lvds_init()
439 psb_intel_i2c_destroy(psb_intel_encoder->ddc_bus); in oaktrail_lvds_init()