Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/bridge: it66121: Add minimal it66122 support

The IT66122 is a pin compatible replacement for the IT66122. Based on
empirical testing, the new device looks to be compatible with IT66121.
However due to a lack of public data sheet at this time beyond overall
feature list[1] (which seems to add additional features vs ITT66121),
it is hard to determine that additional register operations required
to enable additional features.

So, introduce the device as a new compatible that we will detect based
on vid/pid match, with explicit id that can be used to extend the
driver capability as information becomes available later on.

[1] https://www.ite.com.tw/en/product/cate1/IT66122

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20251029150636.3118628-6-nm@ti.com

authored by

Nishanth Menon and committed by
Neil Armstrong
715cbb21 a8811c0b

+9 -5
+9 -5
drivers/gpu/drm/bridge/ite-it66121.c
··· 287 287 enum chip_id { 288 288 ID_IT6610, 289 289 ID_IT66121, 290 + ID_IT66122, 290 291 }; 291 292 292 293 struct it66121_chip_info { ··· 403 402 if (ret) 404 403 return ret; 405 404 406 - if (ctx->id == ID_IT66121) { 405 + if (ctx->id == ID_IT66121 || ctx->id == ID_IT66122) { 407 406 ret = regmap_write_bits(ctx->regmap, IT66121_AFE_IP_REG, 408 407 IT66121_AFE_IP_EC1, 0); 409 408 if (ret) ··· 429 428 if (ret) 430 429 return ret; 431 430 432 - if (ctx->id == ID_IT66121) { 431 + if (ctx->id == ID_IT66121 || ctx->id == ID_IT66122) { 433 432 ret = regmap_write_bits(ctx->regmap, IT66121_AFE_IP_REG, 434 433 IT66121_AFE_IP_EC1, 435 434 IT66121_AFE_IP_EC1); ··· 600 599 if (ret) 601 600 return ret; 602 601 603 - if (ctx->id == ID_IT66121) { 602 + if (ctx->id == ID_IT66121 || ctx->id == ID_IT66122) { 604 603 ret = regmap_write_bits(ctx->regmap, IT66121_CLK_BANK_REG, 605 604 IT66121_CLK_BANK_PWROFF_RCLK, 0); 606 605 if (ret) ··· 803 802 if (regmap_write(ctx->regmap, IT66121_HDMI_MODE_REG, IT66121_HDMI_MODE_HDMI)) 804 803 goto unlock; 805 804 806 - if (ctx->id == ID_IT66121 && 805 + if ((ctx->id == ID_IT66121 || ctx->id == ID_IT66122) && 807 806 regmap_write_bits(ctx->regmap, IT66121_CLK_BANK_REG, 808 807 IT66121_CLK_BANK_PWROFF_TXCLK, 809 808 IT66121_CLK_BANK_PWROFF_TXCLK)) { ··· 816 815 if (it66121_configure_afe(ctx, adjusted_mode)) 817 816 goto unlock; 818 817 819 - if (ctx->id == ID_IT66121 && 818 + if ((ctx->id == ID_IT66121 || ctx->id == ID_IT66122) && 820 819 regmap_write_bits(ctx->regmap, IT66121_CLK_BANK_REG, 821 820 IT66121_CLK_BANK_PWROFF_TXCLK, 0)) { 822 821 goto unlock; ··· 1502 1501 static const struct it66121_chip_info it66xx_chip_info[] = { 1503 1502 {.id = ID_IT6610, .vid = 0xca00, .pid = 0x0611 }, 1504 1503 {.id = ID_IT66121, .vid = 0x4954, .pid = 0x0612 }, 1504 + {.id = ID_IT66122, .vid = 0x4954, .pid = 0x0622 }, 1505 1505 }; 1506 1506 1507 1507 static int it66121_probe(struct i2c_client *client) ··· 1623 1621 static const struct of_device_id it66121_dt_match[] = { 1624 1622 { .compatible = "ite,it6610" }, 1625 1623 { .compatible = "ite,it66121" }, 1624 + { .compatible = "ite,it66122" }, 1626 1625 { } 1627 1626 }; 1628 1627 MODULE_DEVICE_TABLE(of, it66121_dt_match); ··· 1631 1628 static const struct i2c_device_id it66121_id[] = { 1632 1629 { .name = "it6610" }, 1633 1630 { .name = "it66121" }, 1631 + { .name = "it66122" }, 1634 1632 { } 1635 1633 }; 1636 1634 MODULE_DEVICE_TABLE(i2c, it66121_id);