lkml.org 
[lkml]   [2023]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v11 6/9] drm/bridge: anx7625: Register Type C mode switches
On Sat, Feb 04, 2023 at 09:30:37PM +0800, Pin-yen Lin wrote:
> Register USB Type-C mode switches when the "mode-switch" property and
> relevant ports are available in Device Tree. Configure the crosspoint
> switch based on the entered alternate mode for a specific Type-C
> connector.
>
> Crosspoint switch can also be used for switching the output signal for
> different orientations of a single USB Type-C connector, but the
> orientation switch is not implemented yet. A TODO is added for this.

...

> + for (i = 0; i < 2; i++) {
> + if (ctx->port_data[i].dp_connected)
> + anx7625_set_crosspoint_switch(
> + ctx, ctx->port_data[i].orientation);

It's more than enough room to place ctx on the previous line.

> + }

...

> + struct anx7625_data *ctx = (struct anx7625_data *) port->data;

Redundant explicit casting.

...

> + struct device *dev = &ctx->client->dev;

Do you really need to keep client in that struct and not simply dev?

...

> + /* dp on, power on first */

DP ?

...

> + /* dp off, power off last */

Ditto.

...

> + num_lanes = fwnode_property_read_u32_array(fwnode, "data-lanes",
> + NULL, 0);

Read the kernel doc for this API and amend your code accordingly.

...

> + if (num_lanes <= 0 || num_lanes > 2) {
> + dev_err(dev,
> + "Error on getting data lanes count from %pfwP: %d\n",
> + fwnode, num_lanes);
> + ret = num_lanes;

ret == 0?! Carefully consider all cases.

> + goto unregister_mux;
> + }

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2023-03-27 00:11    [W:0.155 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site