dvo_sil164.c revision 1450
/*
*/
/*
* 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"
#define SIL164_VID 0x0001
#define SIL164_DID 0x0006
#define SIL164_VID_LO 0x00
#define SIL164_VID_HI 0x01
#define SIL164_DID_LO 0x02
#define SIL164_DID_HI 0x03
#define SIL164_REV 0x04
#define SIL164_RSVD 0x05
#define SIL164_FREQ_LO 0x06
#define SIL164_FREQ_HI 0x07
#define SIL164_REG8 0x08
#define SIL164_8_PD (1<<0)
#define SIL164_REG9 0x09
#define SIL164_9_MDI (1<<0)
#define SIL164_REGC 0x0c
struct sil164_priv {
//I2CDevRec d;
bool quiet;
};
{
{
.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;
}
{
.flags = 0,
.len = 2,
};
return true;
DRM_DEBUG_KMS("Unable to write register 0x%02x to %s:%d.\n",
}
return false;
}
/* Silicon Image 164 driver for chip on i2c bus */
struct i2c_adapter *adapter)
{
/* this will detect the SIL164 chip on the specified i2c bus */
struct sil164_priv *sil;
unsigned char ch;
return false;
goto out;
DRM_DEBUG_KMS("sil164 not detected got %d: from %s Slave %d.\n",
goto out;
}
goto out;
DRM_DEBUG_KMS("sil164 not detected got %d: from %s Slave %d.\n",
goto out;
}
DRM_DEBUG_KMS("init sil164 dvo controller successfully!\n");
return true;
out:
return false;
}
{
if (reg9 & SIL164_9_HTPLG)
return connector_status_connected;
else
return connector_status_disconnected;
}
/* LINTED */
/* LINTED */
struct drm_display_mode *mode)
{
return MODE_OK;
}
/* LINTED */
/* LINTED */
struct drm_display_mode *mode,
/* LINTED */
struct drm_display_mode *adjusted_mode)
{
/* As long as the basics are set up, since we don't have clock
* dependencies in the mode setup, we can just leave the
* registers alone and everything will work fine.
*/
/* recommended programming sequence from doc */
/*sil164_writeb(sil, 0x08, 0x30);
sil164_writeb(sil, 0x09, 0x00);
sil164_writeb(sil, 0x0a, 0x90);
sil164_writeb(sil, 0x0c, 0x89);
sil164_writeb(sil, 0x08, 0x31);*/
/* don't do much */
return;
}
/* set the SIL164 power state */
{
int ret;
unsigned char ch;
if (ret == false)
return;
if (enable)
ch |= SIL164_8_PD;
else
ch &= ~SIL164_8_PD;
return;
}
{
int ret;
unsigned char ch;
if (ret == false)
return false;
if (ch & SIL164_8_PD)
return true;
else
return false;
}
{
}
{
if (sil) {
}
}
struct intel_dvo_dev_ops sil164_ops = {
.init = sil164_init,
.detect = sil164_detect,
.dpms = sil164_dpms,
};