/*
*/
/*
* Copyright (c) 2006, 2013, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Eric Anholt <eric@anholt.net>
*
*/
#include "dvo.h"
/** Enables the TV output path. */
/** Powers down the TV out block, and DAC0-3 */
/**< Low bits of horizontal active pixel input */
/** High bits of horizontal active pixel input */
/** High bits of vertical active line output */
/**< Low bits of vertical active line output */
/**< Low bits of horizontal active pixel output */
/** High bits of horizontal active pixel output */
/** Enables the LVDS power down state transition */
/** Enables the LVDS upscaler */
/** Enables the LVDS panel output path */
/** Enables the LVDS panel backlight */
# define CH7017_LVDS_PLL_FEED_FORWARD_DIVIDER_SHIFT 0
# define CH7017_LVDS_PLL_POST_SCALE_DIV_SHIFT 0
# define CH7017_PHASE_DETECTOR_SHIFT 0
struct ch7017_priv {
};
{
{
.flags = 0,
.len = 1,
},
{
.len = 1,
}
};
}
{
.flags = 0,
.len = 2,
};
}
/** Probes for a CH7017 on the given bus and slave address. */
struct i2c_adapter *adapter)
{
const char *str;
return false;
goto fail;
switch (val) {
case CH7017_DEVICE_ID_VALUE:
str = "ch7017";
break;
case CH7018_DEVICE_ID_VALUE:
str = "ch7018";
break;
case CH7019_DEVICE_ID_VALUE:
str = "ch7019";
break;
default:
DRM_DEBUG_KMS("ch701x not detected, got %d: from %s "
"slave %d.\n",
goto fail;
}
DRM_DEBUG_KMS("%s detected on %s, addr %d\n",
return true;
fail:
return false;
}
/* LINTED */
{
return connector_status_connected;
}
/* LINTED */
struct drm_display_mode *mode)
{
return MODE_CLOCK_HIGH;
return MODE_OK;
}
struct drm_display_mode *mode,
/* LINTED */
struct drm_display_mode *adjusted_mode)
{
DRM_DEBUG_KMS("Registers before mode setting\n");
/* LVDS PLL settings from page 75 of 7017-7017ds.pdf*/
(2 << CH7017_LVDS_PLL_VCO_SHIFT) |
(0 << CH7017_PHASE_DETECTOR_SHIFT);
} else {
lvds_pll_feedback_div = 35;
(0 << CH7017_PHASE_DETECTOR_SHIFT);
/* LINTED */
if (1) { /* XXX: dual channel panel detection. Assume yes for now. */
(2 << CH7017_LVDS_PLL_VCO_SHIFT) |
(13 << CH7017_LVDS_PLL_POST_SCALE_DIV_SHIFT);
} else {
(1 << CH7017_LVDS_PLL_VCO_SHIFT) |
(13 << CH7017_LVDS_PLL_POST_SCALE_DIV_SHIFT);
}
}
ch7017_dpms(dvo, false);
/* Turn the LVDS back on with new settings. */
DRM_DEBUG_KMS("Registers after mode setting\n");
}
/* set the CH7017 power state */
{
if (enable) {
/* Turn on the LVDS */
} else {
/* Turn off the LVDS */
}
/* XXX: Should actually wait for update power status somehow */
msleep(20);
}
{
if (val & CH7017_LVDS_POWER_DOWN_EN)
return false;
else
return true;
}
{
do { \
} while (*"\0")
}
{
if (priv) {
}
}
.init = ch7017_init,
.detect = ch7017_detect,
.dpms = ch7017_dpms,
};