summaryrefslogtreecommitdiff
path: root/src/ch7xxx
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-01-28 19:40:12 +1100
committerDave Airlie <airlied@linux.ie>2007-01-29 20:27:20 +1100
commit6eb69e737864d06dc6d4fbb4cd85a027cbb7643a (patch)
tree8f43b82d2cb04b0fde8f507dc2ee867f27c087b9 /src/ch7xxx
parenteffe579e691b044e3ce59b41b5c0eaaac4368dda (diff)
ch7xxx: actually power up the chip around connection detection
Diffstat (limited to 'src/ch7xxx')
-rw-r--r--src/ch7xxx/ch7xxx.c13
-rw-r--r--src/ch7xxx/ch7xxx_reg.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/src/ch7xxx/ch7xxx.c b/src/ch7xxx/ch7xxx.c
index 9e2a0055..161aebf4 100644
--- a/src/ch7xxx/ch7xxx.c
+++ b/src/ch7xxx/ch7xxx.c
@@ -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;
diff --git a/src/ch7xxx/ch7xxx_reg.h b/src/ch7xxx/ch7xxx_reg.h
index 0ec84ea9..328b6533 100644
--- a/src/ch7xxx/ch7xxx_reg.h
+++ b/src/ch7xxx/ch7xxx_reg.h
@@ -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)