Thread (21 messages) flat view 21 messages, 2 authors, 2023-02-22

Re: [PATCH v12 10/10] drm/bridge: it6505: Register Type C mode switches

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2023-02-21 11:55:40
Also in: chrome-platform, dri-devel, linux-acpi, lkml

On Tue, Feb 21, 2023 at 05:50:54PM +0800, Pin-yen Lin wrote:
Register USB Type-C mode switches when the "mode-switch" property and
relevant port are available in Device Tree. Configure the "lane_swap"
state based on the entered alternate mode for a specific Type-C
connector, which ends up updating the lane swap registers of the it6505
chip.
...
+static void it6505_typec_ports_update(struct it6505 *it6505)
+{
+	int i;
unsigned?

(and just note that here you have already blank line which is good)
+	/* Check if both ports available and do nothing to retain the current one */
+	if (it6505->port_data[0].dp_connected && it6505->port_data[1].dp_connected)
+		return;
+
+	for (i = 0; i < 2; i++) {
+		if (it6505->port_data[i].dp_connected)
+			it6505->lane_swap = it6505->port_data[i].lane_swap;
+	}
+}

,,,
+	it6505->port_data[port->port_num].dp_connected =
+		state->alt && state->alt->svid == USB_TYPEC_DP_SID &&
+		state->alt->mode == USB_TYPEC_DP_MODE;
Split first parameter?

...
+	it6505->port_data = devm_kcalloc(
+		dev, switch_desc->num_typec_switches,
Strange indentation.
+		sizeof(struct it6505_typec_port_data), GFP_KERNEL);
+
Redundant blank line.
+	if (!it6505->port_data) {
+		ret = -ENOMEM;
+		goto unregister_mux;
+	}
...
+		num_lanes = fwnode_property_count_u32(fwnode, "data-lanes");
+
+		if (num_lanes < 0) {
+			dev_err(dev,
+				"Error on getting data lanes count from %pfwP: %d\n",
+				fwnode, num_lanes);
+			ret = num_lanes;
+			goto unregister_mux;
+		}
Same two comments as per previous patch of similar semantics.

-- 
With Best Regards,
Andy Shevchenko

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help