/* Return: 0 if setting the lane count was successful, -ve on error  */
static int set_lane_count(struct udevice *dev, u8 lane_count)
/* Return: 0 if setting the lane count was successful, -ve on error  */
static int set_lane_count(struct udevice *dev, u8 lane_count)
{
	struct dp_tx *dp_tx = dev_get_priv(dev);
	int status;
	u8 val;
	if (!is_connected(dev))
		return -ENODEV;
	printf("       set lane count to %u\n", lane_count);
	dp_tx->link_config.lane_count = lane_count;
	set_reg(dev, REG_LANE_COUNT_SET, dp_tx->link_config.lane_count);
	status = aux_read(dev, DPCD_LANE_COUNT_SET, 0x1, &val);
	if (status)
		return -EIO;
	val &= ~DPCD_LANE_COUNT_SET_MASK;
	val |= dp_tx->link_config.lane_count;
	status = aux_write(dev, DPCD_LANE_COUNT_SET, 0x1, &val);
	if (status)
		return -EIO;
	return 0;
}