Message ID | 20230820184402.102486-5-biju.das.jz@bp.renesas.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | onvert enum->pointer for data in the rt1711h match tables | expand |
On Sun, Aug 20, 2023 at 07:44:02PM +0100, Biju Das wrote: > The RT1715 has PD30 extended message compared to RT1711H. Add a feature bit > enable_pd30_extended_message to struct rt1711h_chip_info to enable this > feature only for RT1715. ... > struct rt1711h_chip_info { > u16 did; > u32 rxdz_sel; > + unsigned enable_pd30_extended_message:1; Besides pahole results, the unsigned is deprecated to use, spell it as unsigned int or u32 or... (find the best match). > }; ... > + .enable_pd30_extended_message = 1, Maybe even bool?
On Mon, Aug 21, 2023 at 04:08:15PM +0300, Andy Shevchenko wrote: > On Sun, Aug 20, 2023 at 07:44:02PM +0100, Biju Das wrote: > > The RT1715 has PD30 extended message compared to RT1711H. Add a feature bit > > enable_pd30_extended_message to struct rt1711h_chip_info to enable this > > feature only for RT1715. > > ... > > > struct rt1711h_chip_info { > > u16 did; > > u32 rxdz_sel; > > + unsigned enable_pd30_extended_message:1; > > Besides pahole results, the unsigned is deprecated to use, spell it as > unsigned int or u32 or... (find the best match). Just use bool. Guenter > > > }; > > ... > > > + .enable_pd30_extended_message = 1, > > Maybe even bool? > > -- > With Best Regards, > Andy Shevchenko > >
diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c index 1b1753895ca5..e79cbb344c14 100644 --- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c +++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c @@ -54,6 +54,7 @@ struct rt1711h_chip_info { u16 did; u32 rxdz_sel; + unsigned enable_pd30_extended_message:1; }; struct rt1711h_chip { @@ -110,7 +111,7 @@ static int rt1711h_init(struct tcpci *tcpci, struct tcpci_data *tdata) return ret; /* Enable PD30 extended message for RT1715 */ - if (chip->info->did == RT1715_DID) { + if (chip->info->enable_pd30_extended_message) { ret = regmap_update_bits(regmap, RT1711H_RTCTRL8, RT1711H_ENEXTMSG, RT1711H_ENEXTMSG); if (ret < 0) @@ -401,6 +402,7 @@ static const struct rt1711h_chip_info rt1711h = { static const struct rt1711h_chip_info rt1715 = { .did = RT1715_DID, .rxdz_sel = RT1711H_BMCIO_RXDZSEL, + .enable_pd30_extended_message = 1, }; static const struct i2c_device_id rt1711h_id[] = {
The RT1715 has PD30 extended message compared to RT1711H. Add a feature bit enable_pd30_extended_message to struct rt1711h_chip_info to enable this feature only for RT1715. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> --- drivers/usb/typec/tcpm/tcpci_rt1711h.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)