usb: typec: tcpci_rt1711h: Convert enum->pointer for data in the match tables
authorBiju Das <biju.das.jz@bp.renesas.com>
Wed, 6 Sep 2023 08:06:16 +0000 (09:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Oct 2023 11:56:08 +0000 (13:56 +0200)
commite2d514dffcb583977150a6bee9d39aeb393ee8d9
tree3fd2156a54eb65b9e99c789efaa30b11e5cbf1b7
parent343a9d34a74359dba67c10e394dbd68c621fa657
usb: typec: tcpci_rt1711h: Convert enum->pointer for data in the match tables

Currently did varaible is used for HW differences between the devices which
complicates the code by adding checks.

Therefore it is better to convert enum->pointer for data match and extend
match support for both ID and OF tables by using i2c_get_match_data().

Add struct rt1711h_chip_info with did variable and replace did->info in
struct rt1711h_chip. Later patch will add more hw differences to
struct rt1711h_chip_info and avoid checking did for HW differences.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20230906080619.36930-3-biju.das.jz@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpci_rt1711h.c