32,6 → 32,7 |
#define CH7xxx_REG_DID 0x4b |
|
#define CH7011_VID 0x83 /* 7010 as well */ |
#define CH7010B_VID 0x05 |
#define CH7009A_VID 0x84 |
#define CH7009B_VID 0x85 |
#define CH7301_VID 0x95 |
38,6 → 39,7 |
|
#define CH7xxx_VID 0x84 |
#define CH7xxx_DID 0x17 |
#define CH7010_DID 0x16 |
|
#define CH7xxx_NUM_REGS 0x4c |
|
87,11 → 89,20 |
char *name; |
} ch7xxx_ids[] = { |
{ CH7011_VID, "CH7011" }, |
{ CH7010B_VID, "CH7010B" }, |
{ CH7009A_VID, "CH7009A" }, |
{ CH7009B_VID, "CH7009B" }, |
{ CH7301_VID, "CH7301" }, |
}; |
|
static struct ch7xxx_did_struct { |
uint8_t did; |
char *name; |
} ch7xxx_dids[] = { |
{ CH7xxx_DID, "CH7XXX" }, |
{ CH7010_DID, "CH7010B" }, |
}; |
|
struct ch7xxx_priv { |
bool quiet; |
}; |
108,6 → 119,18 |
return NULL; |
} |
|
static char *ch7xxx_get_did(uint8_t did) |
{ |
int i; |
|
for (i = 0; i < ARRAY_SIZE(ch7xxx_dids); i++) { |
if (ch7xxx_dids[i].did == did) |
return ch7xxx_dids[i].name; |
} |
|
return NULL; |
} |
|
/** Reads an 8 bit register */ |
static bool ch7xxx_readb(struct intel_dvo_device *dvo, int addr, uint8_t *ch) |
{ |
179,7 → 202,7 |
/* this will detect the CH7xxx chip on the specified i2c bus */ |
struct ch7xxx_priv *ch7xxx; |
uint8_t vendor, device; |
char *name; |
char *name, *devid; |
|
ch7xxx = kzalloc(sizeof(struct ch7xxx_priv), GFP_KERNEL); |
if (ch7xxx == NULL) |
204,7 → 227,8 |
if (!ch7xxx_readb(dvo, CH7xxx_REG_DID, &device)) |
goto out; |
|
if (device != CH7xxx_DID) { |
devid = ch7xxx_get_did(device); |
if (!devid) { |
DRM_DEBUG_KMS("ch7xxx not detected; got 0x%02x from %s " |
"slave %d.\n", |
vendor, adapter->name, dvo->slave_addr); |
283,7 → 307,7 |
idf |= CH7xxx_IDF_HSP; |
|
if (mode->flags & DRM_MODE_FLAG_PVSYNC) |
idf |= CH7xxx_IDF_HSP; |
idf |= CH7xxx_IDF_VSP; |
|
ch7xxx_writeb(dvo, CH7xxx_IDF, idf); |
} |