/*
*/
/*
* Copyright (c) 2012, 2013 Intel Corporation. All rights reserved.
*/
/**************************************************************************
Copyright © 2006 Dave Airlie
All Rights Reserved.
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,
permit persons to whom the 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 NON-INFRINGEMENT.
IN NO EVENT SHALL THE AUTHOR 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.
**************************************************************************/
#include "dvo.h"
/** @file
* driver for the Chrontel 7xxx DVI chip over DVO.
*/
static struct ch7xxx_id_struct {
char *name;
} ch7xxx_ids[] = {
{ CH7011_VID, "CH7011" },
{ CH7010B_VID, "CH7010B" },
{ CH7009A_VID, "CH7009A" },
{ CH7009B_VID, "CH7009B" },
{ CH7301_VID, "CH7301" },
};
static struct ch7xxx_did_struct {
char *name;
} ch7xxx_dids[] = {
{ CH7xxx_DID, "CH7XXX" },
{ CH7010_DID, "CH7010B" },
};
struct ch7xxx_priv {
bool quiet;
};
{
int i;
for (i = 0; i < ARRAY_SIZE(ch7xxx_ids); i++) {
return ch7xxx_ids[i].name;
}
return NULL;
}
{
int i;
for (i = 0; i < ARRAY_SIZE(ch7xxx_dids); i++) {
return ch7xxx_dids[i].name;
}
return NULL;
}
/** Reads an 8 bit register */
{
{
.flags = 0,
.len = 1,
},
{
.len = 1,
}
};
out_buf[1] = 0;
return true;
};
DRM_DEBUG_KMS("Unable to read register 0x%02x from %s:%02x.\n",
}
return false;
}
/** Writes an 8 bit register */
{
.flags = 0,
.len = 2,
};
return true;
DRM_DEBUG_KMS("Unable to write register 0x%02x to %s:%d.\n",
}
return false;
}
struct i2c_adapter *adapter)
{
/* this will detect the CH7xxx chip on the specified i2c bus */
return false;
goto out;
if (!name) {
DRM_DEBUG_KMS("ch7xxx not detected; got 0x%02x from %s "
"slave %d.\n",
goto out;
}
goto out;
if (!devid) {
DRM_DEBUG_KMS("ch7xxx not detected; got 0x%02x from %s "
"slave %d.\n",
goto out;
}
DRM_DEBUG_KMS("Detected %s chipset, vendor/device ID 0x%02x/0x%02x\n",
return true;
out:
return false;
}
{
pm &= ~CH7xxx_PM_FPD;
if (cdet & CH7xxx_CDET_DVI)
return connector_status_connected;
return connector_status_disconnected;
}
/* 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)
{
tvco = 0x23;
tpcp = 0x08;
tpd = 0x16;
tlpf = 0x60;
} else {
tvco = 0x2d;
tpcp = 0x06;
tpd = 0x26;
tlpf = 0xa0;
}
idf |= CH7xxx_IDF_HSP;
idf |= CH7xxx_IDF_HSP;
}
/* set the CH7xxx power state */
{
if (enable)
else
}
{
return true;
else
return false;
}
{
int i;
for (i = 0; i < CH7xxx_NUM_REGS; i++) {
if ((i % 8) == 0 )
DRM_LOG_KMS("\n %02X: ", i);
}
}
{
if (ch7xxx) {
}
}
.init = ch7xxx_init,
.detect = ch7xxx_detect,
.dpms = ch7xxx_dpms,
};