The IT66122 is a drop in replacement for the IT66122. The part is register compatible with what we use of the IT66121. The only relevant change being the PID is now 0x0622 vs 0x0612. Add this extra PID so probe does not fail during the PID check with these new parts.
Since production flow can result in multiple devices as the part gets replaced, prepare for a match list that allows introducing additional vid/pid matches for the same device profile. Signed-off-by: Nishanth Menon <n...@ti.com> --- New Patch - This sets up the stage for introducing it66122 support drivers/gpu/drm/bridge/ite-it66121.c | 29 ++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c index aa7b1dcc5d70..208e118df0e2 100644 --- a/drivers/gpu/drm/bridge/ite-it66121.c +++ b/drivers/gpu/drm/bridge/ite-it66121.c @@ -289,9 +289,13 @@ enum chip_id { ID_IT66121, }; +struct it66121_device_id { + u16 vid, pid; +}; + struct it66121_chip_info { enum chip_id id; - u16 vid, pid; + struct it66121_device_id device_id[]; /* NULL terminated List */ }; struct it66121_ctx { @@ -1511,6 +1515,7 @@ static int it66121_probe(struct i2c_client *client) int ret; struct it66121_ctx *ctx; struct device *dev = &client->dev; + const struct it66121_device_id *device_id; if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { dev_err(dev, "I2C check functionality failed.\n"); @@ -1574,11 +1579,15 @@ static int it66121_probe(struct i2c_client *client) revision_id = FIELD_GET(IT66121_REVISION_MASK, device_ids[1]); device_ids[1] &= IT66121_DEVICE_ID1_MASK; - if ((vendor_ids[1] << 8 | vendor_ids[0]) != ctx->info->vid || - (device_ids[1] << 8 | device_ids[0]) != ctx->info->pid) { - return -ENODEV; + for (device_id = ctx->info->device_id; device_id->vid; device_id++) { + if ((vendor_ids[1] << 8 | vendor_ids[0]) == device_id->vid && + (device_ids[1] << 8 | device_ids[0]) == device_id->pid) + break; } + if (!device_id->vid) + return -ENODEV; + ctx->bridge.of_node = dev->of_node; ctx->bridge.type = DRM_MODE_CONNECTOR_HDMIA; ctx->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID; @@ -1614,14 +1623,18 @@ static void it66121_remove(struct i2c_client *client) static const struct it66121_chip_info it66121_chip_info = { .id = ID_IT66121, - .vid = 0x4954, - .pid = 0x0612, + .device_id = { + {.vid = 0x4954, .pid = 0x0612 }, + { } + }, }; static const struct it66121_chip_info it6610_chip_info = { .id = ID_IT6610, - .vid = 0xca00, - .pid = 0x0611, + .device_id = { + { .vid = 0xca00, .pid = 0x0611}, + { } + }, }; static const struct of_device_id it66121_dt_match[] = { -- 2.47.0