ch7xxx: actually power up the chip around connection detection

This commit is contained in:
Dave Airlie 2007-01-28 19:40:12 +11:00
parent effe579e69
commit 6eb69e7378
2 changed files with 13 additions and 1 deletions

View File

@ -183,9 +183,20 @@ static xf86OutputStatus
ch7xxx_detect(I2CDevPtr d)
{
struct ch7xxx_priv *dev_priv = d->DriverPrivate.ptr;
CARD8 cdet;
CARD8 cdet, gpio, orig_pm, pm;
ch7xxx_read(dev_priv, CH7xxx_PM, &orig_pm);
pm = orig_pm;
pm &= ~CH7xxx_PM_FPD;
pm |= CH7xxx_PM_DVIL | CH7xxx_PM_DVIP;
ch7xxx_write(dev_priv, CH7xxx_PM, pm);
ch7xxx_read(dev_priv, CH7xxx_CONNECTION_DETECT, &cdet);
ch7xxx_write(dev_priv, CH7xxx_PM, orig_pm);
if (cdet & CH7xxx_CDET_DVI)
return XF86OutputStatusConnected;
return XF86OutputStatusDisconnected;

View File

@ -44,6 +44,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define CH7xxx_CM_MCP (1<<2)
#define CH7xxx_INPUT_CLOCK 0x1D
#define CH7xxx_GPIO 0x1E
#define CH7xxx_GPIO_HPIR (1<<3)
#define CH7xxx_IDF 0x1F
#define CH7xxx_IDF_HSP (1<<3)