[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+Dvk63SwoFjBCsd@smile.fi.intel.com>
Date: Mon, 6 Feb 2023 14:16:19 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Pin-yen Lin <treapking@...omium.org>
Cc: Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Robert Foss <robert.foss@...aro.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Daniel Scally <djrscally@...il.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Prashant Malani <pmalani@...omium.org>,
Benson Leung <bleung@...omium.org>,
Guenter Roeck <groeck@...omium.org>,
linux-kernel@...r.kernel.org,
Nícolas F . R . A . Prado
<nfraprado@...labora.com>, Hsin-Yi Wang <hsinyi@...omium.org>,
devicetree@...r.kernel.org, Allen Chen <allen.chen@....com.tw>,
Lyude Paul <lyude@...hat.com>, linux-acpi@...r.kernel.org,
dri-devel@...ts.freedesktop.org, Marek Vasut <marex@...x.de>,
Xin Ji <xji@...logixsemi.com>,
Stephen Boyd <swboyd@...omium.org>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Thomas Zimmermann <tzimmermann@...e.de>,
Javier Martinez Canillas <javierm@...hat.com>,
chrome-platform@...ts.linux.dev,
José Expósito <jose.exposito89@...il.com>
Subject: Re: [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
Powered by blists - more mailing lists