aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_i2c.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_i2c.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c
index 84614858728b..fdd7e3de79c8 100644
--- a/drivers/gpu/drm/nouveau/nouveau_i2c.c
+++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c
@@ -299,7 +299,10 @@ nouveau_probe_i2c_addr(struct nouveau_i2c_chan *i2c, int addr)
299 299
300int 300int
301nouveau_i2c_identify(struct drm_device *dev, const char *what, 301nouveau_i2c_identify(struct drm_device *dev, const char *what,
302 struct i2c_board_info *info, int index) 302 struct i2c_board_info *info,
303 bool (*match)(struct nouveau_i2c_chan *,
304 struct i2c_board_info *),
305 int index)
303{ 306{
304 struct nouveau_i2c_chan *i2c = nouveau_i2c_find(dev, index); 307 struct nouveau_i2c_chan *i2c = nouveau_i2c_find(dev, index);
305 int i; 308 int i;
@@ -307,7 +310,8 @@ nouveau_i2c_identify(struct drm_device *dev, const char *what,
307 NV_DEBUG(dev, "Probing %ss on I2C bus: %d\n", what, index); 310 NV_DEBUG(dev, "Probing %ss on I2C bus: %d\n", what, index);
308 311
309 for (i = 0; info[i].addr; i++) { 312 for (i = 0; info[i].addr; i++) {
310 if (nouveau_probe_i2c_addr(i2c, info[i].addr)) { 313 if (nouveau_probe_i2c_addr(i2c, info[i].addr) &&
314 (!match || match(i2c, &info[i]))) {
311 NV_INFO(dev, "Detected %s: %s\n", what, info[i].type); 315 NV_INFO(dev, "Detected %s: %s\n", what, info[i].type);
312 return i; 316 return i;
313 } 317 }